diff -Nru zorba-2.7.0-0/CMakeLists.txt zorba-2.8.0-0/CMakeLists.txt --- zorba-2.7.0-0/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -76,25 +76,28 @@ ############################################################################### # Check for system include files, features, etc. ############################################################################### -INCLUDE(CheckIncludeFiles) -INCLUDE(CheckSymbolExists) +INCLUDE(CheckCXXSourceCompiles) INCLUDE(CheckFunctionExists) -INCLUDE(CheckLibraryExists) -INCLUDE(CheckVariableExists) INCLUDE(CheckIncludeFileCXX) +INCLUDE(CheckIncludeFiles) +INCLUDE(CheckLibraryExists) +INCLUDE(CheckStructHasMember) +INCLUDE(CheckSymbolExists) INCLUDE(CheckTypeSize) -INCLUDE(CheckCXXSourceCompiles) +INCLUDE(CheckVariableExists) -CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" ZORBA_HAVE_SYS_MOUNT_H) -CHECK_INCLUDE_FILES ("unicode/utypes.h" ZORBA_HAVE_UTYPES_H) CHECK_INCLUDE_FILES ("unicode/coll.h" ZORBA_HAVE_COLL_H) -CHECK_INCLUDE_FILES ("unicode/ustring.h" ZORBA_HAVE_USTRING_H) +CHECK_INCLUDE_FILES ("iconv.h" ZORBA_HAVE_ICONV_H) CHECK_INCLUDE_FILES ("inttypes.h" ZORBA_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILES ("limits.h" ZORBA_HAVE_LIMITS_H) CHECK_INCLUDE_FILES ("stdint.h" ZORBA_HAVE_STDINT_H) CHECK_INCLUDE_FILES ("stdlib.h" ZORBA_HAVE_STDLIB_H) -CHECK_INCLUDE_FILES ("limits.h" ZORBA_HAVE_LIMITS_H) +CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" ZORBA_HAVE_SYS_MOUNT_H) CHECK_INCLUDE_FILES ("sys/types.h" ZORBA_HAVE_SYS_TYPES_H) -CHECK_INCLUDE_FILES ("iconv.h" ZORBA_HAVE_ICONV_H) +CHECK_INCLUDE_FILES ("tzfile.h" ZORBA_HAVE_TZFILE_H) +CHECK_INCLUDE_FILES ("unicode/ustring.h" ZORBA_HAVE_USTRING_H) +CHECK_INCLUDE_FILES ("unicode/utypes.h" ZORBA_HAVE_UTYPES_H) + IF (NOT APPLE OR ${CMAKE_SYSTEM_VERSION} VERSION_GREATER "10.4") # execinfo is found by this macro when cross compiling for Mac OS X 10.4 # although it shouldn't be found for this platform @@ -124,6 +127,9 @@ CHECK_TYPE_SIZE("__int32" ZORBA_HAVE_MS_INT32) CHECK_TYPE_SIZE("int64_t" ZORBA_HAVE_INT64_T) +CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff time.h ZORBA_HAVE_STRUCT_TM_TM_GMTOFF) +CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff time.h ZORBA_HAVE_STRUCT_TM___TM_GMTOFF) + # C++ built-in type sizes CHECK_TYPE_SIZE("double" ZORBA_SIZEOF_DOUBLE BUILTIN_TYPES_ONLY) CHECK_TYPE_SIZE("float" ZORBA_SIZEOF_FLOAT BUILTIN_TYPES_ONLY) @@ -472,7 +478,7 @@ # zorba versioning SET(ZORBA_MAJOR_NUMBER "2") -SET(ZORBA_MINOR_NUMBER "7") +SET(ZORBA_MINOR_NUMBER "8") SET(ZORBA_PATCH_NUMBER "0") SET(ZORBA_VERSION ${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}) MESSAGE(STATUS "Zorba version number: ${ZORBA_VERSION}") @@ -550,12 +556,16 @@ ADD_SUBDIRECTORY(scripts) ADD_SUBDIRECTORY(cmake_modules) -# Subdirectory ordering: We need to include "test" before "config" so -# ZorbaConfig knows about testdriver. We need to include "config" -# before "modules" so external modules will be able to find -# ZorbaConfig.cmake. We need to include "modules" before "include" so -# config.h can know eg. whether we found CURL. We need to include "modules" -# before "doc" so xqdoc can know what non-core modules are available. +# Subdirectory ordering: We need to include "bin" before "test" so +# that test/fots can add zorbacmd-based tests. We need to include +# "test" before "config" so ZorbaConfig knows about testdriver. We +# need to include "config" before "modules" so external modules will +# be able to find ZorbaConfig.cmake. We need to include "modules" +# before "include" so config.h can know eg. whether we found CURL. We +# need to include "modules" before "doc" so xqdoc can know what +# non-core modules are available. + +ADD_SUBDIRECTORY(bin) ADD_SUBDIRECTORY(test) ADD_SUBDIRECTORY(config) @@ -572,8 +582,6 @@ ADD_SUBDIRECTORY (swig) ENDIF (SWIG_FOUND) -ADD_SUBDIRECTORY(bin) - # add the uninstall support # QQQ move to config/ CONFIGURE_FILE( diff -Nru zorba-2.7.0-0/ChangeLog zorba-2.8.0-0/ChangeLog --- zorba-2.7.0-0/ChangeLog 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/ChangeLog 2013-01-16 18:28:18.000000000 +0000 @@ -1,5 +1,64 @@ Zorba - The XQuery Processor + +version 2.8 + +New Features: + * New external module for interfacing with Couchbase Server. + * New external module for interfacing with SQLite Database. + * New external module for interfacing with Oracle NoSQL Database. + * New external module for interfacing with relational databases via JDBC. + * New external info-extraction module for querying concepts and entities in + natural language text. + * New built-in module to (de)reference XML nodes or JSON objects and + arrays that are stored in a collection + * Implemented JSONiq's json-doc() function. + * http-uri-resolution feature to disable HTTP when resolving URIs. + * Option to specify that parse-json() strips the top-level array. + * Extended cast and castable expression to allow any simple target type + (as specified by XQuery 3.0). + * The XQXQ (XQuery-for-XQuery) module became part of the Zorba core. + * The datetime module became part of the Zorba core. + * In the datetime module, added parse-date(), parse-dateTime(), parse-time(), + and utc-offset(). + * Includes test driver for W3C XQuery 3.0 Test Suite (aka FOTS). + +Optimizations: + * Various optimizations in the implementation of the optimizer rules. + * Better computation of the static type for global variables. + * Optimization of comparison operators when untypedAtomic items are involved. + * Improved computation of static type for fn:data function. + * Fixed iteration over the components of a window clause; this improves static + type computation of expressions referencing window vars. + * No need to cast xs:untypedAtomic to xs:string in order-by expression. + * Convert LET variables whose domain sequence has exactly one item to FOR vars. + +Bug Fixes/Other Changes: + * Fixed bug #949064 (faulty QName should be printed in the error message) + * Fixed bug #1072644 (broken parser error location) + * Fixed bug #868640 (Node lifetime is shorter than expected due to let + variable inlining) + * Fixed bugs #1081626 (Segmentation fault in a side-effecting FLWOR), + #1079488 (streaming segfault) + * Fixed bug #1062093 (bug in var reference iterators with an associated + position that is negative) + * Fixed bug #1073978 (FOTS: option default ns not supported) + * Fixed bug #1061222 (bad message for errors in index key type declaration) + * Fixed bug #1065175 (preceding::node()[1] returns wrong results) + * Fixed bug #1065321 (following:text() doesn't return results in doc order) + * Fixed bug #1067706 (wrong const folding in mutually recursive udfs) + * Fixed bug #1021492 (while computing the "sources" of a prolog var, skip + any var-setting exprs that appear in non-used (and non-optimized) functions). + * Fixed bug #1070551 (zerr:ZOSE0003 stream read failure) + * Fixed bug #992304 (Compiling library modules could load data from wrong + source) + * Fixed bug #1043294 (XQST0036 not used in XQuery 3.0). + * Fixed bug in castable expr when the target type is xs:QName. + * Fixed bug in testing if a sequence type is subtype of node(xs:untyped) + * Fixed mustCopyInputNodes() method of no-copy, and jsoniq functions. + * Fixed bugs related to casting to user-defined types. + + version 2.7 New Features: @@ -14,7 +73,7 @@ * Roundtripping of JSON items has been moved from the serializer to encoding functions. * Added uuid to public API. * Best-effort serialization of atomic values in JSON items. - * Positional pagination support for index probes + * Positional pagination support for index probes * Recognize the {http://www.zorba-xquery.com/extensions}no-copy pragma to avoid copying nodes before insertion into a collection. * Added createUntypedAtomic to API's ItemFactory. @@ -180,7 +239,7 @@ * Fixed bug #967864 (var substitution did not update theFreeVars property) * Fixed bug #891650 (context size var not always declared within path expr) * Fixed bug #948879 (--uri-path doesn't work with fetch:content()) - * Fixed bug in MarkNodeCopyProps rule (static cast to replace_expr without chaing the expr kind first) + * Fixed bug in MarkNodeCopyProps rule (static cast to replace_expr without chaing the expr kind first) * Fixed bug in window iterator (binding the end vars in the output tuple stream) * Fixed bug #866547 (protect index-join rule from general flwor) * Fixed bug #867253 (cdml:delete-nodes should only remove root nodes) @@ -206,10 +265,10 @@ New Features: * Add --compile-plan (-c) and --execute-plan (-e) options to zorba command line. - * Add XQuery 3.0 concat operator (http://www.w3.org/TR/xquery-30/#id-string-concat-expr) + * Add XQuery 3.0 concat operator (http://www.w3.org/TR/xquery-30/#id-string-concat-expr) * New URI module providing percent-decoding functions. * The core parse-xml module is now able to parse input files in a streaming mode. A number of new options have also been added. - * LibXml2 version 2.7.0 or higher is now required in order to build Zorba. + * LibXml2 version 2.7.0 or higher is now required in order to build Zorba. * Added index management function to the C++ api's StaticCollectionManager. * Added createDayTimeDuration, createYearMonthDuration, createDocumentNode, createCommentNode, createPiNode to api's ItemFactory. * Fixed bug #905050 (setting and getting the context item type via the c++ api). @@ -228,7 +287,7 @@ Optimization: * No-copy optimization: avoids copying nodes during node-constructor expressions. - * Added external function annotations %ann:propagates-input-nodes and + * Added external function annotations %ann:propagates-input-nodes and %ann:must-copy-input-nodes to be used by the no-copy optimization. * Caching of results for recursive functions with atomic parameter and return types. * Added %ann:cache and %ann:no-cache to enable or disable caching of results of functions with atomic parameter and return types. @@ -264,7 +323,7 @@ * Fixed bug #907872 (segfault when returning an input ItemSequence from an external function). * Fixed bug in codegen: do not create a materialize clause if one exists already support. - * Fixed bug involving positional var and groupby + * Fixed bug involving positional var and groupby * Fixed bug #867266 (do not hoist updating expressions) * Fixed bug #867022 (added location and params to some XPTY0004 errors) * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors @@ -281,17 +340,17 @@ * Fixed bug #951772 (Comment node crashes serialization) * Fixed bug #945241 (StaticCollectionManager::declaredIndexes() and temporary indexes) - + version 2.1 New Features: * New node-position module. This module allows to obtain a representation of a node position, which can be used to assess structural relationships with other nodes. * New node-reference module. References can be obtained for any node, and - different nodes cannot have the same identifier. + different nodes cannot have the same identifier. * Custom Full-text thesaurus using Zorba URI resolver mechanism. - * Modified C++ API to add isSequential, getExternalVariables, isBoundContextItem and - isBoundExternalVariable Functions + * Modified C++ API to add isSequential, getExternalVariables, + isBoundContextItem and isBoundExternalVariable Functions * Collection allows to retrieve information about the type and the annotations of a static collection. * Implemented the probe-index-range-value for general indexes @@ -326,7 +385,7 @@ corruption will occur) * Fixed bug # (Should not destroy the parent of a node that is being detached before the detach is done). - * Added const qualifier to StaticContext::getAuditEvent() + * Added const qualifier to StaticContext::getAuditEvent() * Fixed bug #3408181 (available-collection() returns undeclared collections) * Fixed bug #859465 (Fatal error if a PUL contains two deactivate IC primitives) * Fixed bug #859467 (Fatal error if a PUL contains two activate Foreign Key primitives) @@ -346,7 +405,7 @@ * Fixed bug #869024 (segmentation fault with node-reference) * Fixed bug #869025 (segmentation fault with node-reference) * New node-reference module. References can be obtained for any node, and - different nodes cannot have the same identifier. + different nodes cannot have the same identifier. * Fixed bug #872697 (segmentation fault with validation of NMTOKENS) * General index cannot be declared as unique if the type of its key is xs:anyAtomicType or xs:untypedAtomic. @@ -369,7 +428,7 @@ * Fixed bug #862089 (Split binary/xq install directories for modules) by splitting "module path" into separate URI and Library paths * New node-position module. This module allows to obtain a representation of a node position, which - can be used to assess structural relationships with other nodes. + can be used to assess structural relationships with other nodes. * Fixed bug #872502 (validation of the JSON module xqdoc fails) * Fixed bug #897619 (testdriver_mt can not run the XQueryX tests) * Fixed bug #867107 (xqdoc dependency to zorba is wrong) diff -Nru zorba-2.7.0-0/NOTICE.txt zorba-2.8.0-0/NOTICE.txt --- zorba-2.7.0-0/NOTICE.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/NOTICE.txt 2013-01-16 18:28:18.000000000 +0000 @@ -1,5 +1,5 @@ ----------- -Zorba 2.7.0 +Zorba 2.8.0 ----------- (Note: This file is generated automatically from NOTICE.xml. diff -Nru zorba-2.7.0-0/bin/CMakeLists.txt zorba-2.8.0-0/bin/CMakeLists.txt --- zorba-2.7.0-0/bin/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -15,6 +15,8 @@ INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/src/) INCLUDE_DIRECTORIES(AFTER ${CMAKE_CURRENT_SOURCE_DIR}) +INCLUDE("${CMAKE_SOURCE_DIR}/cmake_modules/ZorbaGenerateExe.cmake") + IF (ZORBA_WITH_DEBUGGER) IF (NOT WIN32) FIND_PACKAGE (Libedit) @@ -49,7 +51,6 @@ path_util.cpp ) -INCLUDE("${CMAKE_SOURCE_DIR}/cmake_modules/ZorbaGenerateExe.cmake") ZORBA_GENERATE_EXE("zorbacmd" "${SRCS}" "" "zorba" "bin") @@ -93,30 +94,42 @@ # test the --uri-path, --lib-path, and --module-path args. # Use the versioning tests as they utilize test modules already. SET (_testdir - "${CMAKE_CURRENT_SOURCE_DIR}/../test/rbkt/Queries/zorba/versioning") + "${CMAKE_CURRENT_SOURCE_DIR}/../test/rbkt/Queries/zorba") SET (_uridir "${CMAKE_BINARY_DIR}/TEST_URI_PATH") SET (_libdir "${CMAKE_BINARY_DIR}/TEST_LIB_PATH") -ZORBA_ADD_TEST(bin/zorba_uri_path_1 zorbacmd -f -q "${_testdir}/import1.xq" +ZORBA_ADD_TEST(bin/zorba_uri_path_1 zorbacmd + -f -q "${_testdir}/versioning/import1.xq" --uri-path "${_uridir}") ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_1 PASS_REGULAR_EXPRESSION "hello, v2") -ZORBA_ADD_TEST(bin/zorba_uri_path_2 zorbacmd -f -q "${_testdir}/external1.xq" +ZORBA_ADD_TEST(bin/zorba_uri_path_2 zorbacmd + -f -q "${_testdir}/versioning/external1.xq" --uri-path "${_uridir}") ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_2 PASS_REGULAR_EXPRESSION "ZXQP0008") -ZORBA_ADD_TEST(bin/zorba_uri_path_3 zorbacmd -f -q "${_testdir}/external1.xq" +ZORBA_ADD_TEST(bin/zorba_uri_path_3 zorbacmd + -f -q "${_testdir}/versioning/external1.xq" --uri-path "${_uridir}" --lib-path "${_libdir}") ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_3 PASS_REGULAR_EXPRESSION "hello, v2") +# test the --disable-http-resolution flag, using the corresponding test query +# from rbkt/zorba/uris/disable-http and a timeout. +ZORBA_ADD_TEST(bin/zorba_disable_http_download zorbacmd + -f -q "${_testdir}/uris/disable-http.xq" --disable-http-resolution) +ZORBA_SET_TEST_PROPERTY(bin/zorba_disable_http_download + PASS_REGULAR_EXPRESSION "XQST0059") +ZORBA_SET_TEST_PROPERTY(bin/zorba_disable_http_download TIMEOUT 5) + IF(WIN32) SET(PATH_SEP ";") ELSE(WIN32) SET(PATH_SEP ":") ENDIF(WIN32) -ZORBA_ADD_TEST(bin/zorba_module_path_1 zorbacmd -f -q "${_testdir}/external1.xq" +ZORBA_ADD_TEST(bin/zorba_module_path_1 zorbacmd + -f -q "${_testdir}/versioning/external1.xq" --module-path "${_libdir}${PATH_SEP}${_uridir}") ZORBA_SET_TEST_PROPERTY(bin/zorba_module_path_1 PASS_REGULAR_EXPRESSION "hello, v2") diff -Nru zorba-2.7.0-0/bin/path_util.cpp zorba-2.8.0-0/bin/path_util.cpp --- zorba-2.7.0-0/bin/path_util.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/path_util.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -28,27 +28,6 @@ namespace PathUtil { -static std::string -getPathFromEnvironment(std::string const& aEnvVar) -{ -#ifdef WIN32 - char* lBuffer; - size_t lLen=0; - errno_t lErr = getenv_s(&lLen, NULL, 0, aEnvVar.c_str()); - if (lErr || !lLen) return ""; - lBuffer = (char*)malloc(lLen * sizeof(char)); - if (!lBuffer) return ""; - getenv_s(&lLen, lBuffer, lLen, aEnvVar.c_str()); - std::string lRes(lBuffer); - free(lBuffer); - return lRes; -#else - const char* lEnvValue = getenv(aEnvVar.c_str()); - return lEnvValue != 0 ? lEnvValue : ""; -#endif -} - - void tokenizePath( const std::string& aPathStr, @@ -66,42 +45,22 @@ } } - -String -concatenatePaths( const std::vector& aPathList) -{ - String delimiter(filesystem_path::get_path_separator()); - - String lResult; - for (std::vector::const_iterator lIter = aPathList.begin(); - lIter != aPathList.end(); ++lIter) - { - lResult += delimiter + *lIter; - } - - return lResult; -} - - void setPathsOnContext( const ZorbaCMDProperties& aProperties, StaticContext_t& aStaticCtx) { std::vector lPath; - std::string lPathStr, lEnvStr; + std::string lPathStr; // Compute the current working directory to append to all paths. filesystem_path lCWD; // setModulePaths() *overwrites* the URI path and lib path, so there's no - // sense in calling both. So if either --module-path or ZORBA_MODULE_PATH - // exists, just use those. + // sense in calling both. So if --module-path exists, just use it. aProperties.getModulePath(lPathStr); - lEnvStr = getPathFromEnvironment("ZORBA_MODULE_PATH"); - if (lPathStr.length() > 0 || lEnvStr.length() > 0) { + if (lPathStr.length() > 0) { tokenizePath(lPathStr, lPath); - tokenizePath(lEnvStr, lPath); lPath.push_back(lCWD.get_path()); aStaticCtx->setModulePaths(lPath); } @@ -109,8 +68,6 @@ // Compute and set URI path aProperties.getURIPath(lPathStr); tokenizePath(lPathStr, lPath); - lEnvStr = getPathFromEnvironment("ZORBA_URI_PATH"); - tokenizePath(lEnvStr, lPath); lPath.push_back(lCWD.get_path()); aStaticCtx->setURIPath(lPath); lPath.clear(); @@ -119,8 +76,6 @@ aProperties.getLibPath(lPathStr); tokenizePath(lPathStr, lPath); lPath.push_back(lCWD.get_path()); - lEnvStr = getPathFromEnvironment("ZORBA_LIB_PATH"); - tokenizePath(lEnvStr, lPath); aStaticCtx->setLibPath(lPath); } } diff -Nru zorba-2.7.0-0/bin/path_util.h zorba-2.8.0-0/bin/path_util.h --- zorba-2.7.0-0/bin/path_util.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/path_util.h 2013-01-16 18:28:18.000000000 +0000 @@ -35,10 +35,6 @@ void tokenizePath(const std::string& aPathStr, std::vector& aResult); - - String - concatenatePaths( const std::vector& aPathList); - } } /* namespace zorba */ diff -Nru zorba-2.7.0-0/bin/test/mymod.xq zorba-2.8.0-0/bin/test/mymod.xq --- zorba-2.7.0-0/bin/test/mymod.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/test/mymod.xq 2013-01-16 18:28:18.000000000 +0000 @@ -14,7 +14,7 @@ : limitations under the License. :) -module namespace foo = "http://www.zorba-xquery.com/foo"; +module namespace foo = "http://www.28msec.com/foo"; declare function foo:test() { if (fn:true()) diff -Nru zorba-2.7.0-0/bin/zorbacmd.cpp zorba-2.8.0-0/bin/zorbacmd.cpp --- zorba-2.7.0-0/bin/zorbacmd.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/zorbacmd.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -178,10 +178,10 @@ Item lQName = zorba->getItemFactory()->createQName(lIter->clark_qname); sctx->declareOption(lQName, lIter->value); } - catch (zorba::ZorbaException const& /* e */) + catch (zorba::ZorbaException const& e) { std::cerr << "unable to set static context option with qname " - << lIter->clark_qname << std::endl; + << lIter->clark_qname << ": " << e.what() << std::endl; return false; } } @@ -251,7 +251,8 @@ sctx->registerURIMapper(&theThesaurusMapper); } } -#endif +#endif /* ZORBA_NO_FULL_TEXT */ + return true; } @@ -888,14 +889,23 @@ timing.startTimer(TimingInfo::UNLOAD_TIMER, i); - DocumentManager* lMgr = store->getDocumentManager(); - ItemSequence_t lSeq = lMgr->availableDocuments(); - Iterator_t lIter = lSeq->getIterator(); + DocumentManager* docMgr = store->getDocumentManager(); + ItemSequence_t docsSeq = docMgr->availableDocuments(); + Iterator_t lIter = docsSeq->getIterator(); lIter->open(); - Item lURI; - while (lIter->next(lURI)) + Item uri; + std::vector docURIs; + while (lIter->next(uri)) + { + docURIs.push_back(uri); + } + lIter->close(); + + size_t numDocs = docURIs.size(); + + for (size_t k = 0; k < numDocs; ++k) { - lMgr->remove(lURI.getStringValue()); + docMgr->remove(docURIs[k].getStringValue()); } timing.stopTimer(TimingInfo::UNLOAD_TIMER, i); diff -Nru zorba-2.7.0-0/bin/zorbacmdproperties.cpp zorba-2.8.0-0/bin/zorbacmdproperties.cpp --- zorba-2.7.0-0/bin/zorbacmdproperties.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/zorbacmdproperties.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -68,7 +68,8 @@ std::string lVarName = lStr.substr(0, lPos); std::string lValue = lStr.substr(lPos + 1); bool lInlineFile = true; - if (lVarName.at(lVarName.size()-1) == ':') { + if (lVarName.at(lVarName.size()-1) == ':') + { lInlineFile = false; lVarName.resize(lVarName.size()-1); // remove the : } @@ -80,7 +81,8 @@ } for (std::vector::const_iterator lIter = theOption.begin(); - lIter != theOption.end(); ++lIter) { + lIter != theOption.end(); ++lIter) + { size_t lEQual = lIter->find_last_of("="); if (lEQual == std::string::npos) return "option must be of the form {namespace}localname=value"; @@ -93,8 +95,10 @@ lOption.value = lValue; theStaticContextOptions.push_back(lOption); } + for (std::vector::const_iterator lIter = theStopWords.begin(); - lIter != theStopWords.end(); ++lIter) { + lIter != theStopWords.end(); ++lIter) + { size_t lEQual = lIter->find(":="); if (lEQual == std::string::npos) return "Stop-words mapping must be of the form URI:=value"; @@ -107,8 +111,10 @@ lMapping.value = lValue; theStopWordsMapping.push_back(lMapping); } + for (std::vector::const_iterator lIter = theThesaurus.begin(); - lIter != theThesaurus.end(); ++lIter) { + lIter != theThesaurus.end(); ++lIter) + { size_t lEQual = lIter->find(":="); if (lEQual == std::string::npos) return "Thesaurus mapping must be of the form URI:=value"; diff -Nru zorba-2.7.0-0/bin/zorbacmdproperties.h zorba-2.8.0-0/bin/zorbacmdproperties.h --- zorba-2.7.0-0/bin/zorbacmdproperties.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/zorbacmdproperties.h 2013-01-16 18:28:18.000000000 +0000 @@ -21,24 +21,33 @@ #include "zorbacmdproperties_base.h" -class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase { +class ZorbaCMDProperties : public zorbacmd::ZorbaCMDPropertiesBase +{ public: - struct ExternalVariable { + struct ExternalVariable + { std::string var_name; std::string var_value; bool inline_file; }; + typedef std::vector ExternalVars_t; - struct StaticContextOption { + + + struct StaticContextOption + { std::string clark_qname; std::string value; }; + typedef std::vector Options_t; - struct FullTextMapping { + struct FullTextMapping + { std::string uri; std::string value; }; + typedef std::vector FullText_t; typedef std::vector QueriesOrFiles_t; diff -Nru zorba-2.7.0-0/bin/zorbacmdproperties_base.h zorba-2.8.0-0/bin/zorbacmdproperties_base.h --- zorba-2.7.0-0/bin/zorbacmdproperties_base.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/bin/zorbacmdproperties_base.h 2013-01-16 18:28:18.000000000 +0000 @@ -42,7 +42,8 @@ "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo", "--timeout", "--uri-path", "--lib-path", "--module-path", "--classpath", "--option", "--trailing-nl", "--stop-words", "--thesaurus", - "--compile-plan", "--execute-plan --serialize-plan", NULL }; + "--compile-plan", "--execute-plan", "--serialize-plan", + "--disable-http-resolution", NULL }; return result; } @@ -426,6 +427,11 @@ { theLoadPlan = true; } + else if (strcmp (*argv, "--disable-http-resolution") == 0) + { + init_val ("{http://www.zorba-xquery.com/options/features}disable=http-uri-resolution", + theOption, 0); + } else if (strcmp (*argv, "--") == 0) { copy_args (++argv); @@ -489,6 +495,7 @@ "--serialize-plan, -s\nSerialize and then load the query execution plan.\n\n" "--compile-plan,\nDo not execute the query; just compile it and save the execution plan in the file specified with the -o option.\n\n" "--execute-plan\nDo not compile the query; instead load the execution plan from the file specified by the -f -q options, and execute the loaded plan.\n\n" + "--disable-http-resolution\nDo not use HTTP to resolve URIs\n\n" ; } diff -Nru zorba-2.7.0-0/cmake_modules/FindPHP5.cmake zorba-2.8.0-0/cmake_modules/FindPHP5.cmake --- zorba-2.7.0-0/cmake_modules/FindPHP5.cmake 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/cmake_modules/FindPHP5.cmake 2013-01-16 18:28:18.000000000 +0000 @@ -58,6 +58,17 @@ ) MESSAGE(STATUS "Executable: " ${PHP5_EXECUTABLE}) + +FIND_LIBRARY(PHP5_LIBRARY + NAMES php5ts php5 + PATHS + /usr/bin + /usr/local/bin + ${PHP5_BINARY_DIR} + ) + +MESSAGE(STATUS "Library: " ${PHP5_LIBRARY}) + MARK_AS_ADVANCED( PHP5_EXECUTABLE PHP5_FOUND_INCLUDE_PATH @@ -146,16 +157,18 @@ ENDIF(PHP5_VERSION LESS 5) ELSE (NOT WIN32 OR CYGWIN) -MESSAGE(STATUS "Windows Environment Configuration...") -#On Windows, set PHP5_INCLUDE_DIR with -D -MESSAGE(STATUS "Path to source: " ${PHP5_INCLUDE_DIR}) -SET(PHP5_INCLUDES ${PHP5_INCLUDE_DIR}) -#SET(PHP5_EXTENSION_DIR "" CACHE PATH "Path to the ext subdir in binary PHP5") -ENDIF (NOT WIN32 OR CYGWIN) - + +################ WINDOWS CONFIG + IF(NOT PHP5_INCLUDE_DIR ) SET (PHP5_INCLUDE_DIR ${CMAKE_PREFIX_PATH}) ENDIF(NOT PHP5_INCLUDE_DIR ) + +MESSAGE(STATUS "Windows Environment Configuration.") +MESSAGE(STATUS "PHP Path: " ${PHP5_INCLUDE_DIR}) +SET(PHP5_INCLUDES ${PHP5_INCLUDE_DIR}) + +ENDIF (NOT WIN32 OR CYGWIN) set(PHP5_MAIN_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/main) set(PHP5_TSRM_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/TSRM) @@ -165,8 +178,6 @@ set(PHP5_DATE_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/date/lib) set(PHP5_STANDARD_INCLUDE_DIR ${PHP5_INCLUDE_DIR}/ext/standard) -MESSAGE(STATUS ${PHP5_MAIN_INCLUDE_DIR}) - IF(PHP5_EXECUTABLE AND PHP5_INCLUDES) SET(PHP5_FOUND "yes") MESSAGE(STATUS "Found PHP5-Version ${PHP5_VERSION}") diff -Nru zorba-2.7.0-0/cmake_modules/Windows/ProxyFindModule.cmake zorba-2.8.0-0/cmake_modules/Windows/ProxyFindModule.cmake --- zorba-2.7.0-0/cmake_modules/Windows/ProxyFindModule.cmake 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/cmake_modules/Windows/ProxyFindModule.cmake 2013-01-16 18:28:18.000000000 +0000 @@ -265,13 +265,15 @@ IF (NOT WIN32) MESSAGE (FATAL_ERROR "This macro is intended only for Windows platforms.") ENDIF (NOT WIN32) - + + PARSE_ARGUMENTS(ARG "" "" "SKIP_INSTALL" ${ARGN}) + # get the current DLLs and their paths SET (dlls "${ZORBA_REQUIRED_DLLS}") SET (paths "${ZORBA_REQUIRED_DLL_PATHS}") - - FOREACH (NAME ${ARGN}) - + + FOREACH (NAME ${ARG_DEFAULT_ARGS}) + # first delete the cache entry used during FIND_FILE to make sure the correct file is chosen UNSET (TMP_DLL_VAR CACHE) @@ -291,8 +293,13 @@ FILE (TO_NATIVE_PATH ${PATH} NATIVE_PATH) LIST (APPEND paths "${NATIVE_PATH}") MESSAGE (STATUS "Added dll to ZORBA_REQUIRED_DLLS cache variable: ${TMP_DLL_VAR}") - INSTALL_DLL (${TMP_DLL_VAR}) - + + IF(ARG_SKIP_INSTALL) + MESSAGE(STATUS "Skip installation of ${NAME}.dll") + ELSE (ARG_SKIP_INSTALL) + INSTALL_DLL (${TMP_DLL_VAR}) + ENDIF(ARG_SKIP_INSTALL) + # we break the loop if we found one DLL BREAK () @@ -302,7 +309,7 @@ # we report a warning if the DLL could not be found IF (NOT TMP_DLL_VAR) - MESSAGE (WARNING "None of the names provided (${ARGN}) points to a DLL in: ${LIBRARY_LOCATION}. Zorba will not run properly unless you have it in the path.") + MESSAGE (WARNING "None of the names provided (${ARG_DEFAULT_ARGS}) points to a DLL in: ${LIBRARY_LOCATION}. Zorba will not run properly unless you have it in the path.") ENDIF (NOT TMP_DLL_VAR) # make sure we don't leave garbage in the cache and don't influence other logic with this diff -Nru zorba-2.7.0-0/cmake_modules/ZorbaModule.cmake zorba-2.8.0-0/cmake_modules/ZorbaModule.cmake --- zorba-2.7.0-0/cmake_modules/ZorbaModule.cmake 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/cmake_modules/ZorbaModule.cmake 2013-01-16 18:28:18.000000000 +0000 @@ -118,6 +118,9 @@ # information; see below # TEST_ONLY - (optional) Module is for testcases only and should not # be installed +# LIBRARY_DEPENDS - (optional) List of targets that the external +# function library will depend on (only works if the module +# contains C++ external functions) # # CONFIG_FILES - any files specific here will be copied to # CMAKE_CURRENT_BINARY_DIR using CONFIGURE_FILE(). They may contain @@ -136,7 +139,7 @@ # file enough to deduce the URI and version? MACRO (DECLARE_ZORBA_MODULE) # Parse and validate arguments - PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES" + PARSE_ARGUMENTS(MODULE "LINK_LIBRARIES;EXTRA_SOURCES;CONFIG_FILES;LIBRARY_DEPENDS" "URI;FILE;VERSION" "TEST_ONLY" ${ARGN}) IF (NOT MODULE_FILE) MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_MODULE()") @@ -268,6 +271,9 @@ # the module *URI*'s final component. SET(module_lib_target "modlib${num_zorba_modules}_${module_name}") ADD_LIBRARY(${module_lib_target} SHARED ${SRC_FILES}) + IF (MODULE_LIBRARY_DEPENDS) + ADD_DEPENDENCIES(${module_lib_target} ${MODULE_LIBRARY_DEPENDS}) + ENDIF() GET_FILENAME_COMPONENT(module_filewe "${module_filename}" NAME_WE) IF (MODULE_VERSION) # If there's a version, insert it into the module library name diff -Nru zorba-2.7.0-0/debian/bzr-builder.manifest zorba-2.8.0-0/debian/bzr-builder.manifest --- zorba-2.7.0-0/debian/bzr-builder.manifest 2012-10-03 22:34:58.000000000 +0000 +++ zorba-2.8.0-0/debian/bzr-builder.manifest 2013-01-16 18:28:33.000000000 +0000 @@ -1,3 +1,3 @@ -# bzr-builder format 0.3 deb-version {debupstream}-0-11086 -lp:zorba revid:chillery+buildbot@lambda.nu-20121003222006-oy63fbueeh02plsc -nest-part debian_rules lp:~zorba-coders/zorba/debian_control_files debian_files/zorba_debian_rules/debian debian revid:juan457@gmail.com-20121001221930-ezwl97pru5b4r3ok +# bzr-builder format 0.3 deb-version {debupstream}-0-11187 +lp:zorba revid:chillery+buildbot@lambda.nu-20130116163411-nhz1hfp1qe3omhqe +nest-part debian_rules lp:~zorba-coders/zorba/debian_control_files debian_files/zorba_debian_rules/debian debian revid:juan457@gmail.com-20130116181440-3e9lvyabkqbwv861 diff -Nru zorba-2.7.0-0/debian/changelog zorba-2.8.0-0/debian/changelog --- zorba-2.7.0-0/debian/changelog 2012-10-03 22:34:58.000000000 +0000 +++ zorba-2.8.0-0/debian/changelog 2013-01-16 18:28:33.000000000 +0000 @@ -1,12 +1,12 @@ -zorba (2.7.0-0-11086~lucid1) lucid; urgency=low +zorba (2.8.0-0-11187~lucid1) lucid; urgency=low * Auto build. - -- Juan Zacarias Wed, 03 Oct 2012 22:34:58 +0000 + -- Juan Zacarias Wed, 16 Jan 2013 18:28:33 +0000 -zorba (2.7.0) unstable; urgency=low +zorba (2.8.0) unstable; urgency=low *Updated to current Version - -- The FLWOR Fundation Mon, 01 Oct 2012 17:19:15 -0500 + -- The FLWOR Fundation Wed, 16 Jan 2013 12:13:22 -0600 diff -Nru zorba-2.7.0-0/debian/copyright zorba-2.8.0-0/debian/copyright --- zorba-2.7.0-0/debian/copyright 2012-10-03 22:34:55.000000000 +0000 +++ zorba-2.8.0-0/debian/copyright 2013-01-16 18:28:29.000000000 +0000 @@ -1,5 +1,5 @@ This package was debianized by The FLWOR Fundation on -Mon, 01 Oct 2012 17:19:15 -0500 +Wed, 16 Jan 2013 12:13:22 -0600 It was downloaded from http://www.zorba-xquery.com diff -Nru zorba-2.7.0-0/doc/zorba/build_prerequisites.dox zorba-2.8.0-0/doc/zorba/build_prerequisites.dox --- zorba-2.7.0-0/doc/zorba/build_prerequisites.dox 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/doc/zorba/build_prerequisites.dox 2013-01-16 18:28:18.000000000 +0000 @@ -95,6 +95,19 @@ at least Swig 1.3.40 or later (http://www.swig.org/download.html). All bindings are generated using Swig. +\note There is a known bug in many versions of Swig + (http://sourceforge.net/tracker/index.php?func=detail&aid=3479190&group_id=1645&atid=101645) + that affects a small number of platforms, including at least + FreeBSD. If you get compilation errors that look similar to this: + +\code + build/swig/php/zorba_apiPHP5_wrap.cxx:953: error: invalid conversion from 'const char*' to 'char*' +\endcode + + then you may have run into this bug. Our experience is that Swig + version at least 2.0.7 has corrected this bug, so please try upgrading + to that version. + For a particular language binding, you need the corresponding language tools and development headers. CMake will automatically enable the language bindings for any language that is detected. diff -Nru zorba-2.7.0-0/doc/zorba/indexpage.dox.in zorba-2.8.0-0/doc/zorba/indexpage.dox.in --- zorba-2.7.0-0/doc/zorba/indexpage.dox.in 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/doc/zorba/indexpage.dox.in 2013-01-16 18:28:18.000000000 +0000 @@ -11,10 +11,12 @@ \section apis APIs - C++ API - C API + - XQJ API - Java API + - PHP API - Python API + - C# API - Ruby API - - PHP API \section generalarchitecture General Architecture - \ref data_lifecycle diff -Nru zorba-2.7.0-0/doc/zorba/options.dox zorba-2.8.0-0/doc/zorba/options.dox --- zorba-2.7.0-0/doc/zorba/options.dox 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/doc/zorba/options.dox 2013-01-16 18:28:18.000000000 +0000 @@ -67,8 +67,9 @@
  • scripting: This local name can be used to enable or disable the Zorba Scripting Extension. Per default, the feature is enabled.
  • -
  • xqddf: The xqddf local name refers to the Zorba specific -XQuery Data Definition Facility. The feature is enabled by default. +
  • ddl: The ddl local name refers to the static +(language-level) Data Description Language portion of the \ref xqddf. +The feature is enabled by default.
  • trace: The fn:trace @@ -86,6 +87,18 @@ fn:doc. DTD validation is disabled by default.
  • +
  • http-uri-resolution: When resolving URIs for schema and module +import statements, Zorba always first attempts to map the URI to a local +filesystem location (see \ref builtin_uri_resolver). As a fallback, Zorba +will then by default attempt to use HTTP, HTTPS, or FTP (depending on the +URI scheme) to download the resource from the internet. The local name +http-uri-resolution can be used to enable or disable this network +fallback. By default it is enabled. +\note Because XQuery options must appear in queries after import statements, +unfortunately the http-uri-resolution option can have no effect if +it is specified inside query text. It must be specified using the C++ API +or a Zorba command-line option. An error will be raised if this option is +specified inside query text to avoid confusion. diff -Nru zorba-2.7.0-0/doc/zorba/uriresolvers.dox zorba-2.8.0-0/doc/zorba/uriresolvers.dox --- zorba-2.7.0-0/doc/zorba/uriresolvers.dox 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/doc/zorba/uriresolvers.dox 2013-01-16 18:28:18.000000000 +0000 @@ -20,7 +20,7 @@ which will allow you to resolve URIs from queries in almost any way imaginable to handle application-specific problems. -\section builtin Zorba's Built-in URI Resolver +\section builtin_uri_resolver Zorba's Built-in URI Resolver XQuery itself offers an approach to locating resources via the "at" clause in import module and import schema @@ -143,8 +143,9 @@ If, after searching all URI path directories, no match is found for a given URI, Zorba will by default fall back to interpretting the URI -as a URL and loading the resource via HTTP (assuming the URI -has the http: scheme). +as a URL and loading the resource via HTTP / HTTPS / FTP (depending on +the URI scheme). This behaviour can be defeated by disabling the +http-uri-resolution Zorba option (see \ref options_features). \section libpath Zorba's Library Path diff -Nru zorba-2.7.0-0/include/zorba/config.h.cmake zorba-2.8.0-0/include/zorba/config.h.cmake --- zorba-2.7.0-0/include/zorba/config.h.cmake 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/config.h.cmake 2013-01-16 18:28:18.000000000 +0000 @@ -50,6 +50,7 @@ #cmakedefine ZORBA_HAVE_STDLIB_H #cmakedefine ZORBA_HAVE_SYS_MOUNT_H #cmakedefine ZORBA_HAVE_SYS_TYPES_H +#cmakedefine ZORBA_HAVE_TZFILE_H #cmakedefine ZORBA_HAVE_USTRING_H #cmakedefine ZORBA_HAVE_UTYPES_H #cmakedefine ZORBA_HAVE_UUID_H @@ -69,6 +70,10 @@ #cmakedefine ZORBA_HAVE_MS_INT32 #cmakedefine ZORBA_HAVE_MS_UINT32 #cmakedefine ZORBA_HAVE_UINT32_T +#cmakedefine ZORBA_HAVE_STRUCT_TM_TM_GMTOFF +#cmakedefine ZORBA_HAVE_STRUCT_TM___TM_GMTOFF + +// Platform type sizes #cmakedefine ZORBA_SIZEOF_DOUBLE @ZORBA_SIZEOF_DOUBLE@ #cmakedefine ZORBA_SIZEOF_FLOAT @ZORBA_SIZEOF_FLOAT@ #cmakedefine ZORBA_SIZEOF_INT @ZORBA_SIZEOF_INT@ @@ -160,6 +165,8 @@ ////////// Zorba ////////////////////////////////////////////////////////////// +#cmakedefine ZORBA_STORE_NAME "zorba_${ZORBA_STORE_NAME}" + // Version #define ZORBA_VERSION "${ZORBA_VERSION}" #define ZORBA_MAJOR_NUMBER ${ZORBA_MAJOR_NUMBER} diff -Nru zorba-2.7.0-0/include/zorba/diagnostic.h zorba-2.8.0-0/include/zorba/diagnostic.h --- zorba-2.7.0-0/include/zorba/diagnostic.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/diagnostic.h 2013-01-16 18:28:18.000000000 +0000 @@ -246,8 +246,10 @@ # ifdef ZORBA_WITH_JSON JSONIQ_CORE, - JSONIQ_UPDATE -# endif + JSONIQ_UPDATE, +# endif /* ZORBA_WITH_JSON */ + + ZORBA_CORE_MODULE // Zorba Core Module }; /** diff -Nru zorba-2.7.0-0/include/zorba/dynamic_context.h zorba-2.8.0-0/include/zorba/dynamic_context.h --- zorba-2.7.0-0/include/zorba/dynamic_context.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/dynamic_context.h 2013-01-16 18:28:18.000000000 +0000 @@ -284,7 +284,7 @@ * false otherwise. */ virtual bool - addExternalFunctionParameter ( const String& aName, ExternalFunctionParameter* aParam ) = 0; + addExternalFunctionParameter ( const String& aName, ExternalFunctionParameter* aParam ) const = 0; /** \brief Get the value of a pair that was registered using * the addExternalFunctionParam method. This can diff -Nru zorba-2.7.0-0/include/zorba/internal/diagnostic.h zorba-2.8.0-0/include/zorba/internal/diagnostic.h --- zorba-2.7.0-0/include/zorba/internal/diagnostic.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/internal/diagnostic.h 2013-01-16 18:28:18.000000000 +0000 @@ -45,6 +45,7 @@ * A %location holds the file location of an error. */ class ZORBA_DLL_PUBLIC location { + typedef ztd::explicit_bool explicit_bool; public: /** * The line-number type. @@ -70,15 +71,16 @@ /** * Constructs a %location. * - * @param file The name of the file where the error occurred. - * @param line The line number of the file where the expression that raises - * the error begins. + * @param file The name of the file where the expression causing the error + * occurred. + * @param line The line number of the file where the expression causing the + * error begins. * @param column The column number, if any, of the file where the expression - * that raises the error begins. + * causing the error begins. * @param line_end The end line number, if any, of the file where the * expression causing the error ends. * @param column_end The end column number, if any, of the file where the - * xpression causing the error ends. + * expression causing the error ends. */ location( char const *file, line_type line, column_type column = 0, line_type line_end = 0, column_type column_end = 0 ) : @@ -158,8 +160,8 @@ * * @return Returns \c true only if this %location has been set. */ - operator bool() const { - return !!line_; + operator explicit_bool::type() const { + return explicit_bool::value_of( line_ ); } /** diff -Nru zorba-2.7.0-0/include/zorba/internal/streambuf.h zorba-2.8.0-0/include/zorba/internal/streambuf.h --- zorba-2.7.0-0/include/zorba/internal/streambuf.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/internal/streambuf.h 2013-01-16 18:28:18.000000000 +0000 @@ -20,12 +20,15 @@ #include #include +#include namespace zorba { namespace internal { /////////////////////////////////////////////////////////////////////////////// +typedef ztd::proxy proxy_streambuf; + ZORBA_DLL_PUBLIC void dealloc_streambuf( std::streambuf* ); diff -Nru zorba-2.7.0-0/include/zorba/internal/unique_ptr.h zorba-2.8.0-0/include/zorba/internal/unique_ptr.h --- zorba-2.7.0-0/include/zorba/internal/unique_ptr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/internal/unique_ptr.h 2013-01-16 18:28:18.000000000 +0000 @@ -455,8 +455,7 @@ typedef typename ZORBA_TR1_NS::add_reference::type deleter_const_reference; - struct pointer_conversion { int valid; }; - typedef int pointer_conversion::*explicit_bool; + typedef zorba::internal::ztd::explicit_bool explicit_bool; public: typedef T element_type; @@ -512,8 +511,8 @@ std::swap( storage_, p.storage_ ); } - operator explicit_bool() const throw() { - return get() ? &pointer_conversion::valid : 0; + operator explicit_bool::type() const throw() { + return explicit_bool::value_of( get() ); } private: diff -Nru zorba-2.7.0-0/include/zorba/internal/ztd.h zorba-2.8.0-0/include/zorba/internal/ztd.h --- zorba-2.7.0-0/include/zorba/internal/ztd.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/internal/ztd.h 2013-01-16 18:28:18.000000000 +0000 @@ -84,7 +84,7 @@ * \internal * This namespace is used only to bundle the implementation details for * implementing \c has_insertion_operator. - * This implementation is based on http://stackoverflow.com/questions/4434569/ + * This implementation is based on http://stackoverflow.com/q/4434569/ */ namespace has_insertion_operator_impl { typedef char no; @@ -410,12 +410,20 @@ } /** - * Converts the the built-in \c bool value to an explicit \c bool value. + * Converts the given value to an explicit \c bool value. * - * @param value The \c bool value to convert. + * @tparam T The type of the value to convert. + * @param value The value to convert. * @return Return said value. */ - static type value_of( bool value ) { + template static + typename std::enable_if::value, + type>::type + value_of( T const &value ) { + // + // Using a template here eliminates a MSVC++ 4800 warning: + // "forcing value to 'true' or 'false' (performance warning)" + // return value ? true_value() : false_value(); } }; diff -Nru zorba-2.7.0-0/include/zorba/pregenerated/diagnostic_list.h zorba-2.8.0-0/include/zorba/pregenerated/diagnostic_list.h --- zorba-2.7.0-0/include/zorba/pregenerated/diagnostic_list.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/pregenerated/diagnostic_list.h 2013-01-16 18:28:18.000000000 +0000 @@ -56,6 +56,8 @@ extern ZORBA_DLL_PUBLIC XQueryErrorCode XPTY0020; +extern ZORBA_DLL_PUBLIC XQueryErrorCode XPTY0117; + extern ZORBA_DLL_PUBLIC XQueryErrorCode XQTY0024; extern ZORBA_DLL_PUBLIC XQueryErrorCode XQTY0030; @@ -98,6 +100,8 @@ extern ZORBA_DLL_PUBLIC XQueryErrorCode XQST0049; +extern ZORBA_DLL_PUBLIC XQueryErrorCode XQST0052; + extern ZORBA_DLL_PUBLIC XQueryErrorCode XQST0054; extern ZORBA_DLL_PUBLIC XQueryErrorCode XQST0055; @@ -410,6 +414,10 @@ extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0010_FUNCTION_NOT_SEQUENTIAL; +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0011_INVALID_LOCALE; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0012_UNKNOWN_LOCALE; + extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0013_FXCHARHEAP_EXCEPTION; extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0016_RESERVED_MODULE_TARGET_NAMESPACE; @@ -450,6 +458,8 @@ extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0060_OPTION_NOT_KNOWN; +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP0061_DISABLE_HTTP_OPTION_IN_QUERY; + #if !defined(ZORBA_NO_FULL_TEXT) extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZXQP8401_THESAURUS_VERSION_MISMATCH; @@ -486,7 +496,7 @@ extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0009_XQUERY_NOT_COMPILED_IN_DEBUG_MODE; -extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0011_ELEMENT_NOT_DECLARED; +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0011_VARIABLE_NOT_DECLARED; extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0014_INVALID_ARGUMENT; @@ -528,7 +538,7 @@ extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0070_INVALID_SERIALIZATION_METHOD_FOR_SAX; -extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_NODE_REFERENCE; +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_REFERENCE; extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZAPI0090_CANNOT_VALIDATE_NON_ROOT; @@ -638,6 +648,14 @@ extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0036_NON_ROOT_NODE_DELETION; +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0037_COLLECTION_APPEND_BAD_EDIT; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0038_COLLECTION_QUEUE_BAD_EDIT; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0039_NON_ROOT_NODE_EDIT; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDDY0040_INCONSISTENT_EDIT; + extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED; extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDST0002_COLLECTION_ALREADY_IMPORTED; @@ -714,6 +732,8 @@ extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZOSE0006_TRANSCODING_ERROR; +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZOSE0007_UNSUPPORTED_LOCALE; + extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0001_INDEX_ALREADY_EXISTS; extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZSTR0002_INDEX_DOES_NOT_EXIST; @@ -782,6 +802,16 @@ extern ZORBA_DLL_PUBLIC ZorbaErrorCode XSST0010; +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDTP0001_INVALID_SPECIFICATION; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDTP0002_INSUFFICIENT_BUFFER; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDTP0003_INVALID_VALUE; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDTP0004_LITERAL_MISMATCH; + +extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZDTP0005_INCOMPLETE_DATE_OR_TIME; + extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0001_ILLEGAL_CHARACTER; extern ZORBA_DLL_PUBLIC ZorbaErrorCode ZJPE0002_ILLEGAL_CODEPOINT; @@ -845,6 +875,8 @@ extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0012; +extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0013; + extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0014; extern ZORBA_DLL_PUBLIC JSONiqErrorCode JNSE0022; diff -Nru zorba-2.7.0-0/include/zorba/store_consts.h zorba-2.8.0-0/include/zorba/store_consts.h --- zorba-2.7.0-0/include/zorba/store_consts.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/store_consts.h 2013-01-16 18:28:18.000000000 +0000 @@ -16,6 +16,7 @@ #ifndef ZORBA_STORE_STORE_CONSTS_H #define ZORBA_STORE_STORE_CONSTS_H +#include #include #include @@ -89,6 +90,8 @@ XS_LAST }; +std::ostream& operator<<( std::ostream&, SchemaTypeCode ); + class ZORBA_DLL_PUBLIC StoreConsts { diff -Nru zorba-2.7.0-0/include/zorba/transcode_stream.h zorba-2.8.0-0/include/zorba/transcode_stream.h --- zorba-2.7.0-0/include/zorba/transcode_stream.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/transcode_stream.h 2013-01-16 18:28:18.000000000 +0000 @@ -17,18 +17,11 @@ #ifndef ZORBA_TRANSCODE_STREAM_API_H #define ZORBA_TRANSCODE_STREAM_API_H -#include -#include - #include -#include #include #include namespace zorba { - -typedef internal::ztd::proxy proxy_streambuf; - namespace transcode { /////////////////////////////////////////////////////////////////////////////// @@ -108,7 +101,7 @@ std::streamsize xsputn( char_type const*, std::streamsize ); private: - std::unique_ptr proxy_buf_; + std::unique_ptr proxy_buf_; // forbid streambuf( streambuf const& ); diff -Nru zorba-2.7.0-0/include/zorba/xquery_exception.h zorba-2.8.0-0/include/zorba/xquery_exception.h --- zorba-2.7.0-0/include/zorba/xquery_exception.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/include/zorba/xquery_exception.h 2013-01-16 18:28:18.000000000 +0000 @@ -58,6 +58,17 @@ */ XQueryException& operator=( XQueryException const &from ); + ////////// source file/line location //////////////////////////////////////// + + /** + * Checks whether the XQuery source-code location has been set. + * + * @return Returns \c true only if said has been set. + */ + bool has_source() const throw() { + return source_loc_; + } + /** * Sets the XQuery source-code URI name, line, and column numbers. * @@ -67,24 +78,14 @@ * @param line_end The source-code URI end line number. * @param column_end The source-code URI end column number. */ - void set_source( - char const *uri, - line_type line, - column_type column = 0, - line_type line_end = 0, - column_type column_end = 0 ); - - /** - * Checks whether the XQuery source location has been set. - * - * @return Returns \c true only if the source location has been set. - */ - bool has_source() const throw() { - return source_loc_; - } + void set_source( char const *uri, + line_type line, + column_type column = 0, + line_type line_end = 0, + column_type column_end = 0 ); /** - * Gets the XQuery source URI containing the error. + * Gets the XQuery source-code URI containing the error. * * @return Returns said URI or the empty string if unset. */ @@ -128,6 +129,84 @@ return source_loc_.column_end(); } + ////////// "applied at" file/line location ////////////////////////////////// + + /** + * Checks whether the XQuery "applied at" location has been set. + * + * @return Returns \c true only if the "applied at" location has been set. + */ + bool has_applied() const throw() { + return applied_loc_; + } + + /** + * Sets the XQuery source-code "applied at" URI name, line, and column + * numbers. + * + * @param uri The source-code "applied at" URI name. If either the null + * pointer or the empty string, \c source_uri() is used. + * @param line The source-code "applied at" URI line number. + * @param column The source-code "applied at" URI column number. + * @param line_end The source-code "applied at" URI end line number. + * @param column_end The source-code "applied at" URI end column number. + */ + void set_applied( char const *uri, + line_type line, + column_type column = 0, + line_type line_end = 0, + column_type column_end = 0 ); + + /** + * Gets the XQuery source-code "applied at" URI containing the error. + * + * @return Returns said URI or the empty string if unset. + */ + char const* applied_uri() const throw() { + return applied_loc_.file(); + } + + /** + * Gets the XQuery source-code "applied at" line number containing the error. + * + * @return Returns said line number or 0 if unset. + */ + line_type applied_line() const throw() { + return applied_loc_.line(); + } + + /** + * Gets the XQuery source-code "applied at" column number containing the + * error. + * + * @return Returns said column number or 0 if unset. + */ + column_type applied_column() const throw() { + return applied_loc_.column(); + } + + /** + * Gets the XQuery source-code "applied at" end line number containing the + * error. + * + * @return Returns said line number or 0 if unset. + */ + line_type applied_line_end() const throw() { + return applied_loc_.line_end(); + } + + /** + * Gets the XQuery source-code "applied at" end column number containing the + * error. + * + * @return Returns said column number or 0 if unset. + */ + column_type applied_column_end() const throw() { + return applied_loc_.column_end(); + } + + ////////// XQuery stack trace /////////////////////////////////////////////// + /** * Gets the XQuery stack trace, if any. * @@ -155,6 +234,9 @@ std::ostream& print( std::ostream &o ) const; private: + typedef internal::diagnostic::location location; + typedef internal::diagnostic::parameters parameters; + /** * Constructs an %XQueryException. * @@ -168,21 +250,23 @@ XQueryException( Diagnostic const &diagnostic, char const *raise_file, line_type raise_line, char const *message ); - internal::diagnostic::location source_loc_; + location source_loc_; + location applied_loc_; XQueryStackTrace query_trace_; friend XQueryException make_xquery_exception( char const*, ZorbaException::line_type, Diagnostic const&, - internal::diagnostic::parameters const&, - internal::diagnostic::location const& + parameters const&, location const& ); friend XQueryException* new_xquery_exception( char const*, ZorbaException::line_type, Diagnostic const&, - internal::diagnostic::parameters const&, - internal::diagnostic::location const& + parameters const&, location const& ); + friend void set_applied( ZorbaException&, char const*, line_type, column_type, + line_type, column_type, bool ); + friend void set_source( ZorbaException&, char const*, line_type, column_type, line_type, column_type, bool ); diff -Nru zorba-2.7.0-0/modules/CMakeLists.txt zorba-2.8.0-0/modules/CMakeLists.txt --- zorba-2.7.0-0/modules/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -15,6 +15,7 @@ ADD_SUBDIRECTORY(com) ADD_SUBDIRECTORY(org) ADD_SUBDIRECTORY(functx) +ADD_SUBDIRECTORY(xqxq) ADD_SUBDIRECTORY(w3c) # Add external module projects - any subdirectories of a directory diff -Nru zorba-2.7.0-0/modules/DownloadModules.cmake zorba-2.8.0-0/modules/DownloadModules.cmake --- zorba-2.7.0-0/modules/DownloadModules.cmake 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/DownloadModules.cmake 2013-01-16 18:28:18.000000000 +0000 @@ -24,7 +24,9 @@ # modules into (will be created if necessary) # notags = if true: ignore tags, check out HEAD revision of module(s) # (bzr only - svn uses different URLs for tags) - +# overwrite = if true: if module(s) is already in directory, +# then erases first to create a new copy of module(s) +# # Figure out what directory we're running in - ExternalModules.txt is here too get_filename_component (cwd ${CMAKE_CURRENT_LIST_FILE} PATH) @@ -32,8 +34,7 @@ FIND_PROGRAM(svn svn DOC "subversion command line client") # Find BZR -FIND_PROGRAM(bzr bzr DOC "bazaar command line client") - +FIND_PROGRAM(bzr bzr DOC "bazaar command line client" PATH ${BZR_PATH}) # Check parameters if (NOT outdir) message (FATAL_ERROR "Please pass -Doutdir.") @@ -78,10 +79,22 @@ if ("${_getmod}" EQUAL 1) message ("Downloading module '${_modname}'...") # We try three times, to account for network weirdnesses - foreach (i 1 2 3) - # First delete the output directory, in case there's a partial - # download from a previous attempt - file (REMOVE_RECURSE "${outdir}/${_modname}") + foreach (attempt 1 2 3) + + #Initial directory status + if (${attempt} EQUAL 1) + if (NOT EXISTS "${outdir}/${_modname}" OR overwrite) + MESSAGE (STATUS "Creating module..." ) + set(overwrite TRUE) + else (NOT EXISTS "${outdir}/${_modname}" OR overwrite) + MESSAGE (STATUS "Updating module..." ) + endif (NOT EXISTS "${outdir}/${_modname}" OR overwrite) + endif (${attempt} EQUAL 1) + + # Deleting the output directory if indicated + if (overwrite) + file (REMOVE_RECURSE "${outdir}/${_modname}") + endif (overwrite) set (_status) @@ -90,8 +103,13 @@ message (FATAL_ERROR "Subversion client not found - required for ${_modname} module!") endif (NOT svn) - execute_process (COMMAND "${svn}" checkout "${_modurl}" "${_modname}" - WORKING_DIRECTORY "${outdir}" TIMEOUT 60 RESULT_VARIABLE _status) + if (overwrite) + execute_process (COMMAND "${svn}" checkout "${_modurl}" "${_modname}" + WORKING_DIRECTORY "${outdir}" TIMEOUT 120 RESULT_VARIABLE _status) + else (overwrite) + execute_process (COMMAND "${svn}" update "${_modurl}" "${_modname}" + WORKING_DIRECTORY "${outdir}" TIMEOUT 120 RESULT_VARIABLE _status) + endif (overwrite) elseif (${_modvc} STREQUAL "bzr") if (NOT bzr) @@ -103,9 +121,16 @@ if (_modtag AND NOT notags) set (_modtagargs "-r" "${_modtag}") endif (_modtag AND NOT notags) - execute_process (COMMAND "${bzr}" branch "${_modurl}" "${_modname}" - ${_modtagargs} WORKING_DIRECTORY "${outdir}" TIMEOUT 60 - RESULT_VARIABLE _status) + if (overwrite) + execute_process (COMMAND "${bzr}" branch "${_modurl}" "${_modname}" + ${_modtagargs} WORKING_DIRECTORY "${outdir}" TIMEOUT 120 + RESULT_VARIABLE _status) + else (overwrite) + execute_process (COMMAND "${bzr}" pull + ${_modtagargs} WORKING_DIRECTORY "${outdir}/${_modname}" TIMEOUT 120 + RESULT_VARIABLE _status) + endif (overwrite) + else (${_modvc} STREQUAL "svn") message (FATAL_ERROR "Unknown vc-type '${_modvc}' for module " @@ -117,10 +142,10 @@ # Success break () else ("${_status}" EQUAL 0) - message (WARNING "Attempt ${i}: Failed to download '${_modname}' (${_status})") + message (WARNING "Attempt ${attempt}: Failed to download '${_modname}' (${_status})") endif ("${_status}" EQUAL 0) - endforeach (i) + endforeach (attempt) # Ensure we successfully downloaded something good if (NOT EXISTS "${outdir}/${_modname}/CMakeLists.txt") diff -Nru zorba-2.7.0-0/modules/ExternalModules.conf zorba-2.8.0-0/modules/ExternalModules.conf --- zorba-2.7.0-0/modules/ExternalModules.conf 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/ExternalModules.conf 2013-01-16 18:28:18.000000000 +0000 @@ -26,26 +26,31 @@ # "tag" is the VCS tag to check out (optional - defaults to HEAD; # currently only works for bzr, since svn tags are just different URLS) -archive bzr lp:zorba/archive-module zorba-2.7 -csv bzr lp:zorba/csv-module zorba-2.7 -data-cleaning bzr lp:zorba/data-cleaning-module zorba-2.7 -data-formatting bzr lp:zorba/data-formatting-module zorba-2.7 -excel bzr lp:zorba/excel-module zorba-2.7 -geo bzr lp:zorba/geo-module zorba-2.7 -graphviz bzr lp:zorba/graphviz-module zorba-2.7 -html bzr lp:zorba/html-module zorba-2.7 -http-client bzr lp:zorba/http-client-module zorba-2.7 -image bzr lp:zorba/image-module zorba-2.7 -languages bzr lp:zorba/languages-module zorba-2.7 -oauth bzr lp:zorba/oauth-module zorba-2.7 -process bzr lp:zorba/process-module zorba-2.7 -read-pdf bzr lp:zorba/read-pdf-module zorba-2.7 -security bzr lp:zorba/security-module zorba-2.7 -system bzr lp:zorba/system-module zorba-2.7 -xqxq bzr lp:zorba/xqxq-module zorba-2.7 -email bzr lp:zorba/email-module zorba-2.7 -util-jvm bzr lp:zorba/util-jvm-module zorba-2.7 -schema-tools bzr lp:zorba/schema-tools-module zorba-2.7 -stack bzr lp:zorba/stack-module zorba-2.7 -queue bzr lp:zorba/queue-module zorba-2.7 +archive bzr lp:zorba/archive-module zorba-2.8 +csv bzr lp:zorba/csv-module zorba-2.8 +data-cleaning bzr lp:zorba/data-cleaning-module zorba-2.8 +data-formatting bzr lp:zorba/data-formatting-module zorba-2.8 +excel bzr lp:zorba/excel-module zorba-2.8 +info-extraction bzr lp:zorba/info-extraction-module zorba-2.8 +geo bzr lp:zorba/geo-module zorba-2.8 +geoproj bzr lp:zorba/geoproj-module zorba-2.8 +graphviz bzr lp:zorba/graphviz-module zorba-2.8 +html bzr lp:zorba/html-module zorba-2.8 +http-client bzr lp:zorba/http-client-module zorba-2.8 +image bzr lp:zorba/image-module zorba-2.8 +jdbc bzr lp:zorba/jdbc-module zorba-2.8 +languages bzr lp:zorba/languages-module zorba-2.8 +oracle-nosql-db bzr lp:zorba/oracle-nosql-db-module zorba-2.8 +oauth bzr lp:zorba/oauth-module zorba-2.8 +process bzr lp:zorba/process-module zorba-2.8 +read-pdf bzr lp:zorba/read-pdf-module zorba-2.8 +security bzr lp:zorba/security-module zorba-2.8 +system bzr lp:zorba/system-module zorba-2.8 +email bzr lp:zorba/email-module zorba-2.8 +util-jvm bzr lp:zorba/util-jvm-module zorba-2.8 +schema-tools bzr lp:zorba/schema-tools-module zorba-2.8 +stack bzr lp:zorba/stack-module zorba-2.8 +queue bzr lp:zorba/queue-module zorba-2.8 +couchbase bzr lp:zorba/couchbase-module zorba-2.8 +sqlite bzr lp:zorba/sqlite-module zorba-2.8 diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/CMakeLists.txt zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/CMakeLists.txt --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -60,6 +60,8 @@ URI "http://www.zorba-xquery.com/modules/math") DECLARE_ZORBA_MODULE(FILE node-reference.xq VERSION 2.0 URI "http://www.zorba-xquery.com/modules/node-reference") +DECLARE_ZORBA_MODULE(FILE reference.xq VERSION 1.0 + URI "http://www.zorba-xquery.com/modules/reference") DECLARE_ZORBA_MODULE(FILE node-position.xq VERSION 2.0 URI "http://www.zorba-xquery.com/modules/node-position") DECLARE_ZORBA_MODULE(FILE node.xq VERSION 2.0 diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/datetime.xq zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/datetime.xq --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/datetime.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/datetime.xq 2013-01-16 18:28:18.000000000 +0000 @@ -17,51 +17,252 @@ :) (:~ - : This module provides functions to retrieve the current dateTime. + : This module provides functions to retrieve the current dateTime and to + : parse dates and times. + : : In contrast to the current-dateTime functions specified in - : "XQuery Functions and Operators" the functions in this module are nondeterministic. - : That is, they do not return the current-dateTime from the dynamic context but return the actual value. + : XQuery Functions and + : Operators, the functions in this module are nondeterministic, that is, + : they do not return the current dateTime from the dynamic context, but return + : the actual value. + : + : Dates and times are parsed according to the format given by + : strptime. + : However, date and time values must be "complete." + : For a date, the year and either month and day or day of the year must have + : been parsed. + : For a time, the hour must have been parsed. + : (If either the minute, second, or timezone has not been parsed, they default + : to 0.) + : For a dateTime, the parsing requirements of both date and time must be met. + : + : When a locale is given, + : it must be of the form {lang}[{sep}{country}[{encoding}]] where + : {lang} is an ISO 639-1 2-letter or 639-2 3-letter language code, + : {sep} is either '-' or '_', + : {country} is an ISO 3166-1 2-letter country code, + : and {encoding} is any string that begins with a '.'. + : The {sep}, {country}, and {encoding} are optional; + : {encoding} is always ignored. + : Examples include: de, en-US, fr_CA, ru_RU.UTF-8. : : @author Matthias Brantner + : @author Paul J. Lucas : @see http://www.w3.org/TR/xpath-functions/#context : @project XDM/atomic : :) module namespace datetime = "http://www.zorba-xquery.com/modules/datetime"; + declare namespace an = "http://www.zorba-xquery.com/annotations"; +declare namespace zerr = "http://www.zorba-xquery.com/errors"; + declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; declare option ver:module-version "2.0"; (:~ - : Return the current dateTime value. - : Please note, that this function is not stable. It returns the - : dateTime value of the date and time the function has actually been invoked. + : Gets the current date value in Universal time. + : Note that this function is not stable: it returns the value of the date when + : the function is invoked. + : + : @return the non-stable date value + :) +declare %an:nondeterministic function datetime:current-date() + as xs:date external; + +(:~ + : Gets the current dateTime value in Universal time. + : Note that this function is not stable: it returns the value of the date and + : time when the function is invoked. : : @return the non-stable datetime value :) -declare %an:nondeterministic function datetime:current-dateTime ( ) as xs:dateTime external; +declare %an:nondeterministic function datetime:current-dateTime() + as xs:dateTime external; (:~ - : Return the current time value. - : Please note, that this function is not stable. It returns the - : time value of the date and time the function has actually been invoked. + : Return the current time value in Universal time. + : Note that this function is not stable: it returns the value of the time when + : the function is invoked. : : @return the non-stable time value :) -declare %an:nondeterministic function datetime:current-time ( ) as xs:time external; +declare %an:nondeterministic function datetime:current-time() + as xs:time external; (:~ - : Return the current date value. - : Please note, that this function is not stable. It returns the - : dat value of the date the function has been actually invoked. + : Parses a date from a string in the current locale. : - : @return the non-stable date value + : @param $input The string to parse. + : @param $format The format string containing zero or more conversion + : specifications and ordinary characters. All ordinary characters are matched + : exactly with the buffer; all whitespace characters match any amount of + : whitespace in the buffer. + : @return Returns an xs:date. + : @error zerr:ZDTP0001 if $format contains an invalid conversion specification. + : @error zerr:ZDTP0002 if $input is insufficient for $format. + : @error zerr:ZDTP0003 if $input contains an invalid value for a conversion + : specification. + : @error zerr:ZDTP0004 if there is a literal characer mismatch between $input + : and $format. + : @error zerr:ZDTP0005 if the date is incomplete. + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-1.xq + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-date-uF-1.xq + :) +declare function datetime:parse-date( + $input as xs:string, + $format as xs:string +) as xs:date external; + +(:~ + : Parses a date from a string in the given locale. + : + : @param $input The string to parse. + : @param $format The format string containing zero or more conversion + : specifications and ordinary characters. All ordinary characters are matched + : exactly with the buffer; all whitespace characters match any amount of + : whitespace in the buffer. + : @param $locale The locale to use. + : @return Returns an xs:date. + : @error zerr:ZDTP0001 if $format contains an invalid conversion specification. + : @error zerr:ZDTP0002 if $input is insufficient for $format. + : @error zerr:ZDTP0003 if $input contains an invalid value for a conversion + : specification. + : @error zerr:ZDTP0004 if there is a literal characer mismatch between $input + : and $format. + : @error zerr:ZDTP0005 if the date is incomplete. + : @error zerr:ZXQP0011 if $locale is in an invalid format. + : @error zerr:ZXQP0012 if $locale is unknown. + : @error zerr:ZOSE0007 if $locale is unsupported by the operating system. + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.xq + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.xq + :) +declare function datetime:parse-date( + $input as xs:string, + $format as xs:string, + $locale as xs:string +) as xs:date external; + +(:~ + : Parses a dateTime from a string in the current locale. + : + : @param $input The string to parse. + : @param $format The format string containing zero or more conversion + : specifications and ordinary characters. All ordinary characters are matched + : exactly with the buffer; all whitespace characters match any amount of + : whitespace in the buffer. + : @return Returns an xs:dateTime. + : @error zerr:ZDTP0001 if $format contains an invalid conversion specification. + : @error zerr:ZDTP0002 if $input is insufficient for $format. + : @error zerr:ZDTP0003 if $input contains an invalid value for a conversion + : specification. + : @error zerr:ZDTP0004 if there is a literal characer mismatch between $input + : and $format. + : @error zerr:ZDTP0005 if either the date or time is incomplete. + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xq :) -declare %an:nondeterministic function datetime:current-date ( ) as xs:date external; +declare function datetime:parse-dateTime( + $input as xs:string, + $format as xs:string +) as xs:dateTime external; (:~ - : Return the the number of milliseconds since the Epoch. + : Parses a dateTime from a string in the given locale. + : + : @param $input The string to parse. + : @param $format The format string containing zero or more conversion + : specifications and ordinary characters. All ordinary characters are matched + : exactly with the buffer; all whitespace characters match any amount of + : whitespace in the buffer. + : @param $locale The locale to use. + : @return Returns an xs:dateTime. + : @error zerr:ZDTP0001 if $format contains an invalid conversion specification. + : @error zerr:ZDTP0002 if $input is insufficient for $format. + : @error zerr:ZDTP0003 if $input contains an invalid value for a conversion + : specification. + : @error zerr:ZDTP0004 if there is a literal characer mismatch between $input + : and $format. + : @error zerr:ZDTP0005 if either the date or time is incomplete. + : @error zerr:ZXQP0011 if $locale is in an invalid format. + : @error zerr:ZXQP0012 if $locale is unknown. + : @error zerr:ZOSE0007 if $locale is unsupported by the operating system. + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xq + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xq + :) +declare function datetime:parse-dateTime( + $input as xs:string, + $format as xs:string, + $locale as xs:string +) as xs:dateTime external; + +(:~ + : Parses a time from a string in the current locale. + : + : @param $input The string to parse. + : @param $format The format string containing zero or more conversion + : specifications and ordinary characters. All ordinary characters are matched + : exactly with the buffer; all whitespace characters match any amount of + : whitespace in the buffer. + : @return Returns an xs:time. + : @error zerr:ZDTP0001 if $format contains an invalid conversion specification. + : @error zerr:ZDTP0002 if $input is insufficient for $format. + : @error zerr:ZDTP0003 if $input contains an invalid value for a conversion + : specification. + : @error zerr:ZDTP0004 if there is a literal characer mismatch between $input + : and $format. + : @error zerr:ZDTP0005 if the hour has not been parsed. + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-1.xq + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-time-uIMS-1.xq + :) +declare function datetime:parse-time( + $input as xs:string, + $format as xs:string +) as xs:time external; + +(:~ + : Parses a time from a string in the given locale. + : + : @param $input The string to parse. + : @param $format The format string containing zero or more conversion + : specifications and ordinary characters. All ordinary characters are matched + : exactly with the buffer; all whitespace characters match any amount of + : whitespace in the buffer. + : @param $locale The locale to use. + : @return Returns an xs:time. + : @error zerr:ZDTP0001 if $format contains an invalid conversion specification. + : @error zerr:ZDTP0002 if $input is insufficient for $format. + : @error zerr:ZDTP0003 if $input contains an invalid value for a conversion + : specification. + : @error zerr:ZDTP0004 if there is a literal characer mismatch between $input + : and $format. + : @error zerr:ZDTP0005 if the hour has not been parsed. + : @error zerr:ZXQP0011 if $locale is in an invalid format. + : @error zerr:ZXQP0012 if $locale is unknown. + : @error zerr:ZOSE0007 if $locale is unsupported by the operating system. + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.xq + : @example test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.xq + :) +declare function datetime:parse-time( + $input as xs:string, + $format as xs:string, + $locale as xs:string +) as xs:time external; + +(:~ + : Gets the the number of milliseconds since epoch. : : @return the said number of milliseconds. :) -declare %an:nondeterministic function datetime:timestamp ( ) as xs:long external; +declare %an:nondeterministic function datetime:timestamp() + as xs:long external; + +(:~ + : Gets the offset of the current timezone from Universal time. + : + : @return the offset in seconds with positive values being east of the prime + : meridian. + :) +declare %an:nondeterministic function datetime:utc-offset() + as xs:long external; + +(: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.cpp zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.cpp --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,209 +0,0 @@ -/* - * Copyright 2006-2010 The FLWOR Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "datetime.h" - -#include -#include - -#include -#include -#ifdef UNIX -#include -#endif - -namespace zorba { namespace datetimemodule { - -void -compute_date_time( - struct ::tm& gmtm, - long& timezone, - unsigned short& millitm) -{ - int lSummerTimeShift = 0; -#if defined (WIN32) - struct _timeb timebuffer; - _ftime_s( &timebuffer ); - localtime_s(&gmtm, &timebuffer.time); //thread safe localtime on Windows - lSummerTimeShift = -timebuffer.timezone * 60; - if (gmtm.tm_isdst != 0) - lSummerTimeShift += 3600; -#else - struct timeb timebuffer; - ftime( &timebuffer ); - localtime_r(&timebuffer.time, &gmtm); //thread safe localtime on Linux - localtime_r(&timebuffer.time, &gmtm); //thread safe localtime on Linux - lSummerTimeShift = gmtm.tm_gmtoff; -#endif - - timezone = lSummerTimeShift; // in seconds - millitm = timebuffer.millitm; -} - -/****************************************************************************** - *****************************************************************************/ -zorba::ItemSequence_t -CurrentDateTimeFunction::evaluate( - const Arguments_t& aArgs, - const zorba::StaticContext* aSctx, - const zorba::DynamicContext* aDctx) const -{ - struct ::tm gmtm; - long lTimezone; - unsigned short lMilliTm; - - compute_date_time(gmtm, lTimezone, lMilliTm); - - zorba::Item lDateTime = - Zorba::getInstance(0)->getItemFactory()->createDateTime( - static_cast(gmtm.tm_year + 1900), - static_cast(gmtm.tm_mon + 1), - static_cast(gmtm.tm_mday), - static_cast(gmtm.tm_hour), - static_cast(gmtm.tm_min), - gmtm.tm_sec + lMilliTm/1000.0, - static_cast(lTimezone/3600) - ); - - return zorba::ItemSequence_t(new zorba::SingletonItemSequence(lDateTime)); -} - -/****************************************************************************** - *****************************************************************************/ -zorba::ItemSequence_t -CurrentDateFunction::evaluate( - const Arguments_t& aArgs, - const zorba::StaticContext* aSctx, - const zorba::DynamicContext* aDctx) const -{ - struct ::tm gmtm; - long lTimezone; - unsigned short lMilliTm; - - compute_date_time(gmtm, lTimezone, lMilliTm); - - zorba::Item lDateTime = - Zorba::getInstance(0)->getItemFactory()->createDate( - static_cast(gmtm.tm_year + 1900), - static_cast(gmtm.tm_mon + 1), - static_cast(gmtm.tm_mday) - ); - - return zorba::ItemSequence_t(new zorba::SingletonItemSequence(lDateTime)); -} - -/****************************************************************************** - *****************************************************************************/ -zorba::ItemSequence_t -CurrentTimeFunction::evaluate( - const Arguments_t& aArgs, - const zorba::StaticContext* aSctx, - const zorba::DynamicContext* aDctx) const -{ - struct ::tm gmtm; - long lTimezone; - unsigned short lMilliTm; - - compute_date_time(gmtm, lTimezone, lMilliTm); - - zorba::Item lDateTime = - Zorba::getInstance(0)->getItemFactory()->createTime( - static_cast(gmtm.tm_hour), - static_cast(gmtm.tm_min), - gmtm.tm_sec + lMilliTm/1000.0, - static_cast(lTimezone/3600) - ); - - return zorba::ItemSequence_t(new zorba::SingletonItemSequence(lDateTime)); -} - -/****************************************************************************** - *****************************************************************************/ - -zorba::ItemSequence_t -TimestampFunction::evaluate( - const Arguments_t& aArgs, - const zorba::StaticContext* aSctx, - const zorba::DynamicContext* aDctx) const -{ - zorba::Item lMillis; -#if WIN32 - time_t t0; - time(&t0); - lMillis = Zorba::getInstance(0)->getItemFactory()->createLong(t0*1000); -#else - timeval tv; - gettimeofday(&tv, 0); - long long millis = tv.tv_sec; - millis = millis * 1000 + tv.tv_usec/1000; - lMillis = Zorba::getInstance(0)->getItemFactory()->createLong(millis); -#endif - - return zorba::ItemSequence_t(new zorba::SingletonItemSequence(lMillis)); -} - -/****************************************************************************** - *****************************************************************************/ -zorba::ExternalFunction* -DateTimeModule::getExternalFunction(const zorba::String& aLocalname) -{ - zorba::ExternalFunction*& lFunc = theFunctions[aLocalname]; - if (!lFunc) { - if (aLocalname == "current-dateTime") { - lFunc = new CurrentDateTimeFunction(this); - } else if (aLocalname == "current-date") { - lFunc = new CurrentDateFunction(this); - } else if (aLocalname == "current-time") { - lFunc = new CurrentTimeFunction(this); - } else if (aLocalname == "timestamp") { - lFunc = new TimestampFunction(this); - } - } - return lFunc; -} - -/****************************************************************************** - *****************************************************************************/ -DateTimeModule::~DateTimeModule() -{ - for (FuncMap_t::const_iterator lIter = theFunctions.begin(); - lIter != theFunctions.end(); ++lIter) { - delete lIter->second; - } - theFunctions.clear(); -} - -/****************************************************************************** - *****************************************************************************/ -void -DateTimeModule::destroy() -{ - if (!dynamic_cast(this)) { - return; - } - delete this; -} - -} /* namespace datetimemodule */ } /* namespace zorba */ - -#ifdef WIN32 -# define DLL_EXPORT __declspec(dllexport) -#else -# define DLL_EXPORT __attribute__ ((visibility("default"))) -#endif - -extern "C" DLL_EXPORT zorba::ExternalModule* createModule() { - return new zorba::datetimemodule::DateTimeModule(); -} diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.h zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.h --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/datetime.xq.src/datetime.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -/* - * Copyright 2006-2010 The FLWOR Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef ZORBA_FILEMODULE_FILE_H -#define ZORBA_FILEMODULE_FILE_H - -#include -#include -#include -#include - -namespace zorba { namespace datetimemodule { - -/****************************************************************************** - *****************************************************************************/ -class DateTimeModule : public ExternalModule -{ -protected: - class ltstr - { - public: - bool operator()(const String& s1, const String& s2) const - { - return s1.compare(s2) < 0; - } - }; - - typedef std::map FuncMap_t; - - FuncMap_t theFunctions; - -public: - virtual zorba::String - getURI() const { return "http://www.zorba-xquery.com/modules/datetime"; } - - virtual zorba::ExternalFunction* - getExternalFunction(const zorba::String& aLocalname); - - virtual void - destroy(); - - virtual - ~DateTimeModule(); -}; - - -/****************************************************************************** - *****************************************************************************/ -class CurrentDateTimeFunction : public ContextualExternalFunction -{ -public: - CurrentDateTimeFunction(const DateTimeModule* aModule) - : theModule(aModule) {} - - virtual ~CurrentDateTimeFunction() {} - - virtual zorba::String - getLocalName() const { return "current-dateTime"; } - - virtual zorba::ItemSequence_t - evaluate(const Arguments_t&, - const zorba::StaticContext*, - const zorba::DynamicContext*) const; - - virtual String - getURI() const { return theModule->getURI(); } - -protected: - const DateTimeModule* theModule; -}; - -/****************************************************************************** - *****************************************************************************/ -class CurrentDateFunction : public ContextualExternalFunction -{ -public: - CurrentDateFunction(const DateTimeModule* aModule) - : theModule(aModule) {} - - virtual ~CurrentDateFunction() {} - - virtual zorba::String - getLocalName() const { return "current-date"; } - - virtual zorba::ItemSequence_t - evaluate(const Arguments_t&, - const zorba::StaticContext*, - const zorba::DynamicContext*) const; - - virtual String - getURI() const { return theModule->getURI(); } - -protected: - const DateTimeModule* theModule; -}; - -/****************************************************************************** - *****************************************************************************/ -class CurrentTimeFunction : public ContextualExternalFunction -{ -public: - CurrentTimeFunction(const DateTimeModule* aModule) - : theModule(aModule) {} - - virtual ~CurrentTimeFunction() {} - - virtual zorba::String - getLocalName() const { return "current-time"; } - - virtual zorba::ItemSequence_t - evaluate(const Arguments_t&, - const zorba::StaticContext*, - const zorba::DynamicContext*) const; - - virtual String - getURI() const { return theModule->getURI(); } - -protected: - const DateTimeModule* theModule; -}; - -/****************************************************************************** - *****************************************************************************/ -class TimestampFunction : public ContextualExternalFunction -{ -public: - TimestampFunction(const DateTimeModule* aModule) - : theModule(aModule) {} - - virtual ~TimestampFunction() {} - - virtual zorba::String - getLocalName() const { return "timestamp"; } - - virtual zorba::ItemSequence_t - evaluate(const Arguments_t&, - const zorba::StaticContext*, - const zorba::DynamicContext*) const; - - virtual String - getURI() const { return theModule->getURI(); } - -protected: - const DateTimeModule* theModule; -}; - -} /* namespace datetimemodule */ } /* namespace zorba */ - -#endif diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -13,11 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#include #include -#include -#include -#include #include +#include +#include +#include #include #include diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/pregenerated/errors.xq zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/pregenerated/errors.xq --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/pregenerated/errors.xq 2013-01-16 18:28:18.000000000 +0000 @@ -101,6 +101,14 @@ (:~ :) +declare variable $zerr:ZXQP0011 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0011"); + +(:~ +:) +declare variable $zerr:ZXQP0012 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0012"); + +(:~ +:) declare variable $zerr:ZXQP0013 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0013"); (:~ @@ -180,6 +188,10 @@ declare variable $zerr:ZXQP0060 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0060"); (:~ +:) +declare variable $zerr:ZXQP0061 as xs:QName := fn:QName($zerr:NS, "zerr:ZXQP0061"); + +(:~ : : The version of the thesaurus is not the expected version. : @@ -562,6 +574,22 @@ (:~ :) +declare variable $zerr:ZDDY0037 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0037"); + +(:~ +:) +declare variable $zerr:ZDDY0038 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0038"); + +(:~ +:) +declare variable $zerr:ZDDY0039 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0039"); + +(:~ +:) +declare variable $zerr:ZDDY0040 as xs:QName := fn:QName($zerr:NS, "zerr:ZDDY0040"); + +(:~ +:) declare variable $zerr:ZDST0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZDST0001"); (:~ @@ -709,6 +737,10 @@ (:~ :) +declare variable $zerr:ZOSE0007 as xs:QName := fn:QName($zerr:NS, "zerr:ZOSE0007"); + +(:~ +:) declare variable $zerr:ZSTR0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZSTR0001"); (:~ @@ -845,6 +877,26 @@ (:~ :) +declare variable $zerr:ZDTP0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZDTP0001"); + +(:~ +:) +declare variable $zerr:ZDTP0002 as xs:QName := fn:QName($zerr:NS, "zerr:ZDTP0002"); + +(:~ +:) +declare variable $zerr:ZDTP0003 as xs:QName := fn:QName($zerr:NS, "zerr:ZDTP0003"); + +(:~ +:) +declare variable $zerr:ZDTP0004 as xs:QName := fn:QName($zerr:NS, "zerr:ZDTP0004"); + +(:~ +:) +declare variable $zerr:ZDTP0005 as xs:QName := fn:QName($zerr:NS, "zerr:ZDTP0005"); + +(:~ +:) declare variable $zerr:ZJPE0001 as xs:QName := fn:QName($zerr:NS, "zerr:ZJPE0001"); (:~ diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/reference.xq zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/reference.xq --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/reference.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/reference.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,87 @@ +xquery version "1.0"; + +(: + : Copyright 2006-2012 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. +:) + +(:~ + : The module provides functions to compute an immutable and opaque reference + : for nodes, objects, or arrays and to retrieve such items given their + : identifier, respectively. + : The identifiers are immutable, i.e. a identifier does not change + : during the items lifetime and cannot be reused for another item after the + : original item gets deleted. + : Identifiers are unique, in that, two different items will never have the same + : identifier. A item, at any time during its lifetime, can be retrieved by its + : identifier. + : + :

    Please see the data lifecycle + : documentation about details on storing items.

    + : + : @see Data Lifecycle + : + : @author Matthias Brantner + : + :) +module namespace ref = "http://www.zorba-xquery.com/modules/reference"; + +declare namespace zerr = "http://www.zorba-xquery.com/errors"; + +declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; + +declare option ver:module-version "1.0"; + +(:~ + : Returns an immutable and opaque reference (with type xs:anyURI) for + : a given node, object, or array. + : + :

    The generated identifier is immutable, i.e. a identifier does not + : change during the item's lifetime and cannot be reused for another node after + : the original item gets deleted.

    + : + :

    Identifiers are also unique, in that, two different items will never + : have the same identifier.

    + : + : A item, at any time during its lifetime, can be retrieved by its + : identifier, using the ref:dereference function. + : + : Please note that a reference can only be retrieved for a JSON object or JSON + : array if the item is a member of a collection. + : + : @param $arg the node, object, or array for which the URI should be computed + : + : @return the opaque URI of the item. + : + : @error zerr::ZAPI0080 is raised if the object or array passed as argument + : is not a member of a collection. + :) +declare function ref:reference( + $arg as item() +) as xs:string external; + +(:~ + : Returns the node, object, or array identified by the given reference. + : + :

    The function returns the empty sequence if the item + : that is referenced does not exist.

    + : + : @param $arg the URI of the item to retrieve. + : + : @return the item identified by the URI passed as parameter + : or the empty-sequence if no item with that URI is found. + :) +declare function ref:dereference( + $arg as xs:string +) as item()? external; diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/store/dynamic/collections/dml.xq 2013-01-16 18:28:18.000000000 +0000 @@ -586,6 +586,32 @@ (:~ + : The edit function is an updating function that edits the first supplied + : item so as to make it look exactly like a copy of the second supplied item, + : while retaining its original identity. + : + : @param $target The target item ,that must be edited. + : @param $content The content item, that serves as an edit goal. + : + : @return The result of the function is an empty XDM instance and a pending update list + : which, once applied, performs the replacement. + : + : @error zerr:ZDDY0003 if the collection to which $target belongs is not available. + : @error zerr:ZDDY0006 if the modifier property of the collection to which $target + : belongs is append-only, const, or queue. + : @error zerr:ZDDY0017 if the $target item is not a member of a collection. + : @error zerr:ZDDY0037 if the collection is append-only. + : @error zerr:ZDDY0038 if the collection is a queue. + : @error zerr:ZDDY0039 if the $target item is not a root. + : @error zerr:ZDDY0040 if the target cannot be updated to match the content (for + : example because the target is a node and the content is an object). + : + :) +declare updating function +dml:edit($target as item(), $content as item()) external; + + +(:~ : The truncate function is an updating function that deletes the : entire contents of collection. : diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/store/static/collections/dml.xq 2013-01-16 18:28:18.000000000 +0000 @@ -831,6 +831,35 @@ (:~ + : The edit function is an updating function that edits the first supplied + : item so as to make it look exactly like a copy of the second supplied item, + : while retaining its original identity. + : + : @param $target The target item ,that must be edited. + : @param $content The content item, that serves as an edit goal. + : + : @return The result of the function is an empty XDM instance and a pending update list + : which, once applied, performs the edit. + : + : @error zerr:ZDDY0001 if the collection to which $target belongs is not declared. + : @error zerr:ZDDY0003 if the collection to which $target belongs is not available. + : @error zerr:ZDDY0006 if the modifier property of the collection to which $target + : belongs is append-only, const, or queue. + : @error zerr:ZDDY0017 if the $target item is not a member of a collection. + : @error zerr:ZDDY0037 if the collection is append-only. + : @error zerr:ZDDY0038 if the collection is a queue. + : @error zerr:ZDDY0039 if the $target item is not a root. + : @error zerr:ZDDY0040 if the target cannot be updated to match the content (for + : example because the target is a node and the content is an object). + : @error zerr:ZDTY0001 if $content does not match the expected type (as specified + : in the collection declaration) according to the rules for SequenceType Matching. + : + :) +declare updating function +cdml:edit($target as item(), $content as item()) external; + + +(:~ : The truncate function is an updating function that deletes the : entire contents of collection. : diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/xqdoc.xq zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/xqdoc.xq --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/xqdoc.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/xqdoc.xq 2013-01-16 18:28:18.000000000 +0000 @@ -139,6 +139,7 @@ $filename as xs:string ) as element() external; + (:~ : Generated the an XQDoc XML document for the module provided : as parameter to this function. @@ -157,6 +158,7 @@ xqd:xqdoc-content-impl($module, "") }; + (:~ : Generated the an XQDoc XML document for the module provided : as parameter to this function. diff -Nru zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq --- zorba-2.7.0-0/modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq 2013-01-16 18:28:18.000000000 +0000 @@ -278,6 +278,8 @@ xqdoc2html:copy-files($xhtmlRequisitesPath, $cssPath ,"css"); file:create-directory($schemasPath); + + () } }; @@ -693,11 +695,11 @@ fn:not(fn:matches($exampleSource, $search-queries))) then file:write( $exampleDestination, xqdoc2html:create-xhtml-wrapper($exampleContent,"xquery"), - $xqdoc2html:serParamXhtml) + $xqdoc2html:serParamXhtml); else if (fn:matches($exampleContent, "output", "i")) then file:write( $exampleDestination, xqdoc2html:create-xhtml-wrapper($exampleContent,"xquery"), - $xqdoc2html:serParamXhtml) + $xqdoc2html:serParamXhtml); else let $specSource := fn:replace($exampleSource, "[.]xq$", ".spec") return @@ -708,7 +710,7 @@ variable $specContent2 := fn:replace($specContent, "\$RBKT_SRC_DIR", - fn:concat($examplePath,"/rbkt")); + fn:concat($examplePath,"/test/rbkt")); variable $specLines := fn:tokenize($specContent2, "[\n\r]+"); diff -Nru zorba-2.7.0-0/modules/org/expath/ns/file.xq.src/file.cpp zorba-2.8.0-0/modules/org/expath/ns/file.xq.src/file.cpp --- zorba-2.7.0-0/modules/org/expath/ns/file.xq.src/file.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/org/expath/ns/file.xq.src/file.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -16,9 +16,10 @@ #include "file.h" -#include #include +#include #include +#include #include #include diff -Nru zorba-2.7.0-0/modules/org/jsoniq/www/functions.xq zorba-2.8.0-0/modules/org/jsoniq/www/functions.xq --- zorba-2.7.0-0/modules/org/jsoniq/www/functions.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/org/jsoniq/www/functions.xq 2013-01-16 18:28:18.000000000 +0000 @@ -170,6 +170,7 @@ : Allowed options are :
      :
    • jsoniq-multiple-top-level-items: allow parsing of sequences of JSON Objects and Arrays (boolean; default: true)
    • + :
    • jsoniq-strip-top-level-array: if the top-level JSON item is an array, strip it and return its elements as multiple top-level items (boolean; default: false)
    • :
    : : @error jerr:JNDY0021 if the given string is not valid JSON or diff -Nru zorba-2.7.0-0/modules/org/jsoniq/www/pregenerated/errors.xq zorba-2.8.0-0/modules/org/jsoniq/www/pregenerated/errors.xq --- zorba-2.7.0-0/modules/org/jsoniq/www/pregenerated/errors.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/org/jsoniq/www/pregenerated/errors.xq 2013-01-16 18:28:18.000000000 +0000 @@ -100,6 +100,14 @@ declare variable $jerr:JNSE0012 as xs:QName := fn:QName($jerr:NS, "jerr:JNSE0012"); (:~ + :It is a dynamic error to serialize an atomic value not + : supported by JSON or a node with the JSON output method and with + : the jsoniq-serialization-extensions serialization parameter + : set to false. +:) +declare variable $jerr:JNSE0013 as xs:QName := fn:QName($jerr:NS, "jerr:JNSE0013"); + +(:~ :It is a dynamic error to serialize a function or a node with the : JSON output method. :) @@ -133,7 +141,7 @@ declare variable $jerr:JNUP0019 as xs:QName := fn:QName($jerr:NS, "jerr:JNUP0019"); (:~ - :It is a type error if the prefix is not a string or if the + :It is a type error if the prefix is not a string or if the : serialization parameters are not an element. :) declare variable $jerr:JNTY0023 as xs:QName := fn:QName($jerr:NS, "jerr:JNTY0023"); diff -Nru zorba-2.7.0-0/modules/w3c/pregenerated/xqt-errors.xq zorba-2.8.0-0/modules/w3c/pregenerated/xqt-errors.xq --- zorba-2.7.0-0/modules/w3c/pregenerated/xqt-errors.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/modules/w3c/pregenerated/xqt-errors.xq 2013-01-16 18:28:18.000000000 +0000 @@ -166,6 +166,15 @@ (:~ : + : Attempt to cast to a namespace-sensitive type failed because the namespace + : bindings for the result can not be determined. + : + : @see http://www.w3.org/2005/xqt-errors +:) +declare variable $err:XPTY0117 as xs:QName := fn:QName($err:NS, "err:XPTY0117"); + +(:~ + : : It is a type error if the content sequence in an element constructor : contains an attribute node following a node that is not an attribute node. : @@ -385,6 +394,15 @@ (:~ : + : The type must be the name of a type defined in the in-scope schema types, + : and the {variety} of the type must be simple. + : + : @see http://www.w3.org/2005/xqt-errors +:) +declare variable $err:XQST0052 as xs:QName := fn:QName($err:NS, "err:XQST0052"); + +(:~ + : : It is a static error if a variable depends on itself. : : @see http://www.w3.org/2005/xqt-errors @@ -1264,8 +1282,8 @@ (:~ : - : Retrieved resource contains octets that cannot be decoded into Unicode - : using the specified encoding, the resulting characters are not + : Retrieved resource contains octets that cannot be decoded into Unicode + : using the specified encoding, the resulting characters are not : permitted XML characters or requested encoding not supported : : @see http://www.w3.org/2005/xqt-errors diff -Nru zorba-2.7.0-0/modules/xqxq/CMakeLists.txt zorba-2.8.0-0/modules/xqxq/CMakeLists.txt --- zorba-2.7.0-0/modules/xqxq/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/modules/xqxq/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,15 @@ +# Copyright 2006-2012 The FLWOR Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +DECLARE_ZORBA_MODULE (URI "http://www.zorba-xquery.com/modules/xqxq" VERSION 1.0 FILE "xqxq.xq") \ No newline at end of file diff -Nru zorba-2.7.0-0/modules/xqxq/xqxq.xq zorba-2.8.0-0/modules/xqxq/xqxq.xq --- zorba-2.7.0-0/modules/xqxq/xqxq.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/modules/xqxq/xqxq.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,381 @@ +xquery version "3.0"; +(: + : Copyright 2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. +:) + +(:~ + : This module contains functions to compile and evaluate XQuery + : programs. Also, it contains function that allow to parameterize + : the static or dynamic evaluation phase. + : + : @author Juan Zacarias + : @project Zorba/Programming Languages/XQuery + :) +module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; +declare namespace ver = "http://www.zorba-xquery.com/options/versioning"; +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare namespace f = "http://www.zorba-xquery.com/features"; + +declare option ver:module-version "1.0"; +declare option op:enable "f:hof"; + +(:~ + : The function prepares a given XQuery program for execution. + : If the program was successfully compiled, the function returns an + : identifier as xs:anyURI. This URI can be passed to other functions + : of this module (e.g. to actually evaluate the program). The URI + : is opaque and its lilfetime is bound by the lifetime of the XQuery + : program that invoked this function. Further reference or uses + : of the identifier lead to unexpected results. + : + : Successfully prepared queries need to be deleted by passing the resulting + : identifier to the xqxq:delete-query function of this module. + : + : @param $main-module-text the XQuery program that should be prepared. + : The program needs to be a XQuery main module. + : + : @return an identifier for the compiled program that can be passed + : as arguments to other functions of this module. + : + : @error any (static or type) error that may be raised during the compilation + : of the query. For example, err:XPST0003 if the given XQuery program could + : not be parsed. + :) +declare %an:sequential function xqxq:prepare-main-module($main-module-text as xs:string) as + xs:anyURI external; + +(:~ + : The function prepares a given XQuery program for execution. + : If the program was successfully compiled, the function returns an + : identifier as xs:anyURI. This URI can be passed to other functions + : of this module (e.g. to actually evaluate the program). The URI + : is opaque and its lilfetime is bound by the lifetime of the XQuery + : program that invoked this function. Further reference or uses + : of the identifier lead to unexpected results. + : + : Important notes regarding the second and third parameters of the function: + : -------------------------------------------------------------------------- + : + : These parameters allow you to specify a URL resolver and a URI mapper + : for Zorba to use when executing this query. See + : http://www.zorba-xquery.com/html/documentation/2.7.0/zorba/uriresolvers + : + : The second parameter is a function item for a URL + : resolver. The URL resolver function must recive 2 parameters: + : A $namespace as xs:string that will contain the url to be resolved. + : A $entity as xs:string that will contain the type of resolving needed; + : this can be 2 values "module" and "schema". + : The function must return an empty sequence when the specified $namespace + : or $entity are not the ones to be resolved. + : + : Example: + : + : declare function mymod:url-resolver($namespace as xs:string, $entity as xs:string) + : { + : if($namespace = 'http://test.xq') + : then "module namespace test = 'http://test'; declare function test:foo(){'foo'};" + : else () + : }; + : + : The URL resolver function's namespace, name, and parameter naming are + : not restricted by XQXQ. + : + : The URL resolver function's return type is not restricted, it could be a string, a sequence, + : a node, etc. All the outputs types are to be serialized as a string. + : + : The third parameter is a function item for a URI mapper. + : The URI mapper function, just like the URL resolver, receives 2 parameters: + : A $namespace as xs:string that will contain the URI to be mapped. + : A $entity as xs:string that will contain the type of resolving needed; + : this can be 2 values "module" and "schema". + : The URI mapper must return an empty sequence when the specified $namesapce or $entity + : are not to be mapped. Unlike the URL resolver this function must return a sequence of strings. + : + : Example: + : + : declare function mymod:uri-mapper($namespace as xs:string, $entity as xs:string) + : { + : if($namespace = 'http://test') + : then ("http://www.zorba-xquery.com/test", "http://foo.com/schema/test") + : else () + : }; + : + : The URI mapper function's namespace, name, and parameter naming are + : not restricted by XQXQ. + : + : In order to pass the above URL resolver and URI mapper to this function, + : use the following syntax: + : + : variable $queryID := xqxq:prepare-main-module("..query text..", + : mymod:url-resolver#2, mymod:uri-mapper#2); + : + : That is, the QName of the function followed by "#2". This is XQuery + : "higher-order function" syntax, meaning the function with the specified + : QName which takes two arguments. Since URL resolvers and URI mappers + : must take two arguments, both will always be specified with "#2". + : + : Note that parameters 2 and 3 should be declared as follows: + : as function($url as xs:string, $entity as xs:string) as item() + : as function($uri as xs:string, $entity as xs:string) as xs:string* + : However Zorba's implementation of higher-order functions (HOF) is not + : yet complete enough to allow for this. When Zorba's HOF implementation + : is complete this function signature will be changed. + : + : Both the URL resolver and URI mapper functions are optional, meaning you + : may pass the empty-sequence () for either. + : + : Successfully prepared queries need to be deleted by passing the resulting + : identifier to the xqxq:delete-query function of this module. + : + : @param $main-module-text the XQuery program that should be prepared. + : The program needs to be a XQuery main module. + : + : @param $resolver the URL resolver function. + : + : @param $mapper the URI mapper function. + : + : @return an identifier for the compiled program that can be passed + : as arguments to other functions of this module. + : + : @error any (static or type) error that may be raised during the compilation + : of the query. For example, err:XPST0003 if the given XQuery program could + : not be parsed. + :) +declare %an:sequential function xqxq:prepare-main-module($main-module-text as xs:string, $resolver as item()?, $mapper as item()?) as + xs:anyURI external; + +(:~ + : This function compiles a given XQuery library module. It can be used + : to compile-check a module. + : + : @param $library-module-text the XQuery library module that should + : be prepared. + : + : @return the function is declared as sequential.It returns the + : empty-sequence. + : + : @error any (static or type) error that may be raised during the compilation + : of the library module. For example, err:XPST0003 if the given XQuery library + : module could not be parsed. + :) +declare %an:sequential function xqxq:prepare-library-module($library-module-text as xs:string) as + empty-sequence() external ; + +(:~ + : The function tests if the context-item is bound for the + : execution of the query referred to by the given query identifier. + : + : @param $query-key the identifier for a compiled query + : + : @return true if the context-item is bound, false otherwise. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + :) +declare function xqxq:is-bound-context-item($query-key as xs:anyURI) + as xs:boolean external; + + +(:~ + : The function tests if the given variable is bound for the + : execution of the query referred to by the given query identifier. + : + : @param $query-key the identifier for a compiled query + : @param $var-name the name of the variable + : + : @return true if the variable is bound, false otherwise. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + : @error xqxq:UndeclaredVariable if the given variable is not declared + : in the query. + :) +declare function xqxq:is-bound-variable($query-key as xs:anyURI, $var-name as + xs:QName) as xs:boolean external; + +(:~ + : The function returns the names of the external variables that + : are declared in the given query (either in the main module or + : in any of the imported library modules). + : + : @param $query-key the identifier for a compiled query + : + : @return the sequence of names of the said external variables. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + :) +declare function xqxq:external-variables($query-key as xs:anyURI) as + xs:QName* external ; + +(:~ + : The function tests if the query identified by the given key + : is an updating query. + : + : @param $query-key the identifier for a compiled query + : + : @return true if the query is an updating query, false otherwise. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + :) +declare function xqxq:is-updating($query-key as xs:anyURI) as + xs:boolean external; + +(:~ + : The function tests if the query identified by the given key + : is sequential query. + : + : @param $query-key the identifier for a compiled query + : + : @return true if the query is a sequential, false otherwise. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + :) +declare function xqxq:is-sequential($query-key as xs:anyURI) as + xs:boolean external; + +(:~ + : This function binds the context-item of the prepared query + : identified by the given key to the $dot argument. + : + : @param $query-key the identifier for a compiled query + : @param $dot the context item to bind + : + : @return the function has side effects and returns the empty + : sequence. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + :) +declare %an:sequential function xqxq:bind-context-item($query-key as xs:anyURI, + $dot as item()) as empty-sequence() external ; + +(:~ + : This function binds the variable with name $name of + : the prepared query identified by $query-key to the given sequence. + : + : @param $query-key the identifier for a compiled query + : @param $name the name of the external variable to bind + : @param $value the sequence to which the external variable $name + : should be bound + : + : @return the function has side effects and returns the empty + : sequence. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + : @error xqxq:UndeclaredVariable if the given variable is not declared + : in the query. + :) +declare %an:sequential function xqxq:bind-variable($query-key as xs:anyURI, + $var as xs:QName, $value as item()*) as empty-sequence() external ; + + +(:~ + : Evaluates the given prepared query and returns the result + : of the evaluation. The query must not be sequential or + : updating. + : + : @param $query-key the identifier for a compiled query + : + : @return the result of evaluating the given query + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + : + : @error xqxq:QueryIsUpdating if the query is an updating query. + : + : @error xqxq:QueryIsSequential if the query is sequential. + : + : @error any dynamic error that is raised by evaluating the + : given query. + : + :) +declare function xqxq:evaluate($query-key as xs:anyURI) as item()* external; + +(:~ + : Evaluates the given prepared query and applies the updates + : computed by this query. The query must be an updating query. + : + : @param $query-key the identifier for a compiled query + : + : @return the function has side effects because it applies + : the updates of the query. It returns the empty sequence. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + : + : @error xqxq:QueryNotUpdating if the query is not an updating query. + : + : @error xqxq:QueryIsSequential if the query is sequential. + : + : @error any dynamic error that is raised by evaluating the + : given query or applying its updates. + : + :) +declare updating function xqxq:evaluate-updating($query-key as xs:anyURI) external; + +(:~ + : Evaluates the given prepared query and returns the result + : of the evaluation. The query must be sequential. + : + : @param $query-key the identifier for a compiled query + : + : @return the result of evaluating the query. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + : + : @error xqxq:QueryNotSequential if the query is not sequential. + : + : @error xqxq:QueryIsUpdating if the query is an updating query. + : + : @error any dynamic error that is raised by evaluating the + : given query. + : + :) +declare %an:sequential function xqxq:evaluate-sequential($query-key as + xs:string) as item()* external; + +(:~ + : Deletes the prepared query associated with the given identifier. + : After the query is deleted, the corresponding identifier should + : not be used as argument to any of the functions of this module. + : + : @param $query-key the identifier for a compiled query + : + : @return the function has side effects and returns the empty sequence. + : + : @error xqxq:NoQueryMatch if no query with the given identifier + : was prepared. + : + :) +declare %an:sequential function xqxq:delete-query($query-key as xs:anyURI) as + empty-sequence() external; + + +(:~ + : Internal helper function. Only necessary because of incomplete HOF + : support in Zorba. + :) +declare %private function xqxq:hof-invoker($hof as item(), + $ns as xs:string, $entity as xs:string) as item()* +{ + $hof($ns, $entity) +}; diff -Nru zorba-2.7.0-0/modules/xqxq/xqxq.xq.src/xqxq.cpp zorba-2.8.0-0/modules/xqxq/xqxq.xq.src/xqxq.cpp --- zorba-2.7.0-0/modules/xqxq/xqxq.xq.src/xqxq.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/modules/xqxq/xqxq.xq.src/xqxq.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,911 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "xqxq.h" + +namespace zorba { namespace xqxq { + +/******************************************************************************* + +********************************************************************************/ +zorba::ExternalFunction* +XQXQModule::getExternalFunction(const zorba::String& localName) +{ + FuncMap_t::iterator lIte = theFunctions.find(localName); + + ExternalFunction*& lFunc = theFunctions[localName]; + + if (lIte == theFunctions.end()) + { + if (localName == "prepare-main-module") + { + lFunc = new PrepareMainModuleFunction(this); + } + if (localName == "prepare-library-module") + { + lFunc = new PrepareLibraryModuleFunction(this); + } + else if (localName == "is-bound-context-item") + { + lFunc = new IsBoundContextItemFunction(this); + } + else if (localName == "is-bound-variable") + { + lFunc = new IsBoundVariableFunction(this); + } + else if (localName == "external-variables") + { + lFunc = new GetExternalVariablesFunction(this); + } + else if (localName == "is-updating") + { + lFunc = new IsUpdatingFunction(this); + } + else if (localName == "is-sequential") + { + lFunc = new IsSequentialFunction(this); + } + else if (localName == "bind-context-item") + { + lFunc = new BindContextItemFunction(this); + } + else if (localName == "bind-variable") + { + lFunc = new BindVariableFunction(this); + } + else if (localName == "evaluate") + { + lFunc = new EvaluateFunction(this); + } + else if (localName == "evaluate-updating") + { + lFunc = new EvaluateUpdatingFunction(this); + } + else if (localName == "evaluate-sequential") + { + lFunc = new EvaluateSequentialFunction(this); + } + else if (localName == "delete-query") + { + lFunc = new DeleteQueryFunction(this); + } + } + + return lFunc; +} + + +/******************************************************************************* + +********************************************************************************/ +void XQXQModule::destroy() +{ + delete this; +} + + +/******************************************************************************* + +********************************************************************************/ +XQXQModule::~XQXQModule() +{ + for (FuncMap_t::const_iterator lIter = theFunctions.begin(); + lIter != theFunctions.end(); ++lIter) + { + delete lIter->second; + } + theFunctions.clear(); +} + + +/******************************************************************************* + +********************************************************************************/ +XQXQFunction::XQXQFunction(const XQXQModule* aModule) + : + theModule(aModule) +{ + srand(time(NULL)); +} + + +/******************************************************************************* + +********************************************************************************/ +XQXQFunction::~XQXQFunction() +{ +} + + +/******************************************************************************* + +********************************************************************************/ +String XQXQFunction::getURI() const +{ + return theModule->getURI(); +} + + +/******************************************************************************* + +********************************************************************************/ +String XQXQFunction::getOneStringArgument(const Arguments_t& aArgs, int aPos) const +{ + Item lItem; + Iterator_t args_iter = aArgs[aPos]->getIterator(); + args_iter->open(); + args_iter->next(lItem); + String lTmpString = lItem.getStringValue(); + args_iter->close(); + return lTmpString; +} + + +/******************************************************************************* + +********************************************************************************/ +Item XQXQFunction::getItemArgument(const Arguments_t& aArgs, int aPos) const +{ + Item lItem; + Iterator_t args_iter = aArgs[aPos]->getIterator(); + args_iter->open(); + args_iter->next(lItem); + args_iter->close(); + + return lItem; +} + + +/******************************************************************************* + +********************************************************************************/ +Iterator_t XQXQFunction::getIterArgument(const Arguments_t& aArgs, int aPos) const +{ + Iterator_t args_iter = aArgs[aPos]->getIterator(); + return args_iter; +} + + +/******************************************************************************* + +********************************************************************************/ +XQuery_t XQXQFunction::getQuery( + const zorba::DynamicContext* aDctx, + const zorba::String& aIdent) const +{ + QueryMap* lQueryMap; + if (!(lQueryMap= dynamic_cast(aDctx->getExternalFunctionParameter("xqxqQueryMap")))) + { + throwError("NoQueryMatch", "No query with the given identifier was found"); + } + + XQuery_t lQuery; + if (!(lQuery = lQueryMap->getQuery(aIdent))) + throwError("NoQueryMatch", "No query with the given identifier was found"); + + return lQuery; +} + + +/******************************************************************************* + +********************************************************************************/ +void XQXQFunction::throwError(const char *err_localname, const std::string aErrorMessage) +{ + String errNS(XQXQ_MODULE_NAMESPACE); + String errName(err_localname); + Item errQName = XQXQModule::getItemFactory()->createQName(errNS, errName); + String errDescription(aErrorMessage); + throw USER_EXCEPTION(errQName, errDescription); +} + + +/******************************************************************************* + +********************************************************************************/ +QueryData::QueryData(XQuery_t aQuery, URIMapper *aMapper, URLResolver *aResolver) + : + theQuery(aQuery), + theURIMapper(aMapper), + theURLResolver(aResolver) +{ +} + + +/******************************************************************************* + +********************************************************************************/ +QueryData::~QueryData() +{ + theQuery->close(); + delete theURIMapper; + delete theURLResolver; +} + + +/******************************************************************************* + +********************************************************************************/ +QueryMap::QueryMap() +{ + QueryMap::queryMap = new QueryMap_t(); +} + + +/******************************************************************************* + +********************************************************************************/ +bool QueryMap::storeQuery(const String& aKeyName, XQuery_t aQuery, + URIMapper* aMapper, URLResolver* aResolver) +{ + QueryData_t lQueryData(new QueryData(aQuery, aMapper, aResolver)); + std::pair ret; + ret = queryMap->insert(std::pair(aKeyName, lQueryData)); + return ret.second; +} + + +/******************************************************************************* + +********************************************************************************/ +XQuery_t QueryMap::getQuery(const String& aKeyName) +{ + QueryMap::QueryMap_t::iterator lIter = queryMap->find(aKeyName); + + if(lIter == queryMap->end()) + return NULL; + + XQuery_t lQuery = lIter->second->getQuery(); + + return lQuery; +} + + +/******************************************************************************* + +********************************************************************************/ +bool QueryMap::deleteQuery(const String& aKeyName) +{ + QueryMap::QueryMap_t::iterator lIter = queryMap->find(aKeyName); + + if(lIter == queryMap->end()) + return false; + + queryMap->erase(lIter); + return true; +} + + +/******************************************************************************* + +********************************************************************************/ +void QueryMap::destroy() throw() +{ + if(queryMap) + { + for (QueryMap_t::const_iterator lIter = queryMap->begin(); + lIter != queryMap->end(); ++lIter) + { + deleteQuery(lIter->first); + } + queryMap->clear(); + delete queryMap; + } + delete this; +} + + +/******************************************************************************* + +********************************************************************************/ +static void streamReleaser(std::istream* aStream) +{ + delete aStream; +} + + +/******************************************************************************* + +********************************************************************************/ +void PrepareMainModuleFunction::XQXQURIMapper::mapURI( + String aUri, + EntityData const* aEntityData, + std::vector& oUris) +{ + //Create entityData string to send to the new url resolver + String lDataKind; + switch (aEntityData->getKind()) + { + case EntityData::SCHEMA: + lDataKind = "schema"; + break; + case EntityData::MODULE: + lDataKind = "module"; + break; + default: + break; + } + + //construct the arguments for the url resolver + std::vector lArgs; + ItemSequence_t lSeq0 = new SingletonItemSequence(theFunction); + ItemSequence_t lSeq1 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(aUri)); + ItemSequence_t lSeq2 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(lDataKind)); + lArgs.push_back(lSeq0); + lArgs.push_back(lSeq1); + lArgs.push_back(lSeq2); + + //invoke the HOF helper function using the arguments generated + Item lHofHelper = XQXQModule::getItemFactory()-> + createQName("http://www.zorba-xquery.com/modules/xqxq", "xqxq", "hof-invoker"); + + ItemSequence_t lResult = theCtx->invoke(lHofHelper, lArgs); + + //Check if the result is an empty sequence by creating an Iterator, this is + // cheaper than serializing the result and then checking if it was empty. + Iterator_t lIter = lResult->getIterator(); + Item lItem; + lIter->open(); + while (lIter->next(lItem)) + { + std::cout << lItem.getStringValue() << std::endl; + oUris.push_back(lItem.getStringValue()); + } + lIter->close(); +} + + +/******************************************************************************* + +********************************************************************************/ +Resource* PrepareMainModuleFunction::XQXQURLResolver::resolveURL( + const String& aUrl, + EntityData const* aEntityData) +{ + //Create entityData string to send to the new url resolver + String lDataKind; + switch (aEntityData->getKind()) + { + case EntityData::SCHEMA: + lDataKind = "schema"; + break; + case EntityData::MODULE: + lDataKind = "module"; + break; + default: + break; + } + + //construct the arguments for the url resolver + std::vector lArgs; + ItemSequence_t lSeq0 = new SingletonItemSequence(theFunction); + ItemSequence_t lSeq1 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(aUrl)); + ItemSequence_t lSeq2 = new SingletonItemSequence(XQXQModule::getItemFactory()->createString(lDataKind)); + lArgs.push_back(lSeq0); + lArgs.push_back(lSeq1); + lArgs.push_back(lSeq2); + + //invoke the HOF helper function using the arguments generated + Item lHofHelper = XQXQModule::getItemFactory()-> + createQName("http://www.zorba-xquery.com/modules/xqxq", "xqxq", "hof-invoker"); + + ItemSequence_t lResult = theCtx->invoke(lHofHelper, lArgs); + + // Check if the result is an empty sequence by creating an Iterator, this is + // cheaper than serializing the result and then checking if it was empty. + Iterator_t lIter = lResult->getIterator(); + Item lItem; + lIter->open(); + lIter->next(lItem); + lIter->close(); + + if (lItem.isNull()) + return NULL; + + //Serialize resulting sequence of the resolver + Zorba_SerializerOptions_t lOpt; + if (lItem.isNode()) + lOpt.ser_method = ZORBA_SERIALIZATION_METHOD_XML; + else + lOpt.ser_method = ZORBA_SERIALIZATION_METHOD_TEXT; + + lOpt.omit_xml_declaration = ZORBA_OMIT_XML_DECLARATION_YES; + Serializer_t lSer = Serializer::createSerializer(lOpt); + std::stringstream lSerResult; + lSer->serialize(lResult, lSerResult); + + //return resource + return StreamResource::create(new std::istringstream(lSerResult.str()), &streamReleaser); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t PrepareMainModuleFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + DynamicContext* lDynCtx = const_cast(aDctx); + StaticContext_t lSctxChild = aSctx->createChildContext(); + + QueryMap* lQueryMap; + if (!(lQueryMap = dynamic_cast(lDynCtx->getExternalFunctionParameter("xqxqQueryMap")))) + { + lQueryMap = new QueryMap(); + lDynCtx->addExternalFunctionParameter("xqxqQueryMap", lQueryMap); + } + + Zorba* lZorba = Zorba::getInstance(0); + + String lQueryString = getOneStringArgument(aArgs, 0); + + XQuery_t lQuery; + + StaticContext_t ltempSctx = lZorba->createStaticContext(); + + std::auto_ptr lResolver; + std::auto_ptr lMapper; + + if ( aArgs.size() > 2 ) + { + Item lMapperFunctionItem = getItemArgument(aArgs, 2); + if (!lMapperFunctionItem.isNull()) + { + lMapper.reset(new XQXQURIMapper(lMapperFunctionItem, lSctxChild)); + ltempSctx->registerURIMapper(lMapper.get()); + } + } + + if ( aArgs.size() > 1 ) + { + Item lResolverFunctionItem = getItemArgument(aArgs, 1); + if (!lResolverFunctionItem.isNull()) + { + lResolver.reset(new XQXQURLResolver(lResolverFunctionItem, lSctxChild)); + ltempSctx->registerURLResolver(lResolver.get()); + } + } + + try + { + lQuery = lZorba->compileQuery(lQueryString, ltempSctx); + } + catch (XQueryException& xe) + { + lQuery = NULL; + std::ostringstream err; + err << "The query compiled using xqxq:prepare-main-module raised an error at" + << " line " << xe.source_line() << " column " << xe.source_column() + << ": " << xe.what(); + + Item errQName = XQXQModule::getItemFactory()->createQName( + xe.diagnostic().qname().ns(), + xe.diagnostic().qname().localname()); + throw USER_EXCEPTION(errQName, err.str()); + } + catch (ZorbaException& e) + { + lQuery = NULL; + std::ostringstream err; + err << "The query compiled using xqxq:prepare-main-module raised an error: " + << e.what(); + + Item errQName = XQXQModule::getItemFactory()-> + createQName(e.diagnostic().qname().ns(), e.diagnostic().qname().localname()); + + throw USER_EXCEPTION(errQName, err.str()); + } + + uuid lUUID; + uuid::create(&lUUID); + + std::stringstream lStream; + lStream << lUUID; + + String lStrUUID = lStream.str(); + + lQueryMap->storeQuery(lStrUUID, lQuery, lMapper.release(), lResolver.release()); + + return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createAnyURI(lStrUUID))); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t PrepareLibraryModuleFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + Zorba *lZorba = Zorba::getInstance(0); + String lQueryString = getOneStringArgument(aArgs, 0); + + Zorba_CompilerHints_t hints; + hints.lib_module = true; + + try + { + lZorba->compileQuery(lQueryString, hints); + } + catch (XQueryException& xe) + { + std::ostringstream err; + err << "The query compiled using xqxq:prepare-library-module raised an error at" + << " line " << xe.source_line() << " column " << xe.source_column() + << ": " << xe.what(); + + Item errQName = XQXQModule::getItemFactory()-> + createQName(xe.diagnostic().qname().ns(), xe.diagnostic().qname().localname()); + + throw USER_EXCEPTION(errQName, err.str()); + } + catch (ZorbaException& e) + { + std::ostringstream err; + err << "The query compiled using xqxq:prepare-main-query raised an error: " + << e.what(); + + Item errQName = XQXQModule::getItemFactory()-> + createQName(e.diagnostic().qname().ns(), e.diagnostic().qname().localname()); + + throw USER_EXCEPTION(errQName, err.str()); + } + return ItemSequence_t(new EmptySequence()); + } + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t IsBoundContextItemFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + bool lIsContextItemBound = lQuery->getDynamicContext()->isBoundContextItem(); + + return ItemSequence_t(new SingletonItemSequence( + XQXQModule::getItemFactory()->createBoolean(lIsContextItemBound))); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t IsBoundVariableFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + Item lVarQName = XQXQFunction::getItemArgument(aArgs, 1); + bool lIsBoundVariable = false; + + try + { + lIsBoundVariable = lQuery->getDynamicContext()->isBoundExternalVariable(lVarQName.getNamespace(),lVarQName.getLocalName()); + } + catch (ZorbaException& ze) + { + if (ze.diagnostic() == zerr::ZAPI0011_VARIABLE_NOT_DECLARED) + XQXQFunction::throwError("UndeclaredVariable", ze.what()); + throw; // should not happen + } + return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createBoolean(lIsBoundVariable))); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t GetExternalVariablesFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + std::vector lVars; + Iterator_t lVarsIterator; + lQuery->getExternalVariables(lVarsIterator); + + Item lVar; + lVarsIterator->open(); + while(lVarsIterator->next(lVar)) + lVars.push_back(lVar); + lVarsIterator->close(); + + return ItemSequence_t(new VectorItemSequence(lVars)); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t IsUpdatingFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createBoolean(lQuery->isUpdating()))); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t IsSequentialFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + return ItemSequence_t(new SingletonItemSequence(XQXQModule::getItemFactory()->createBoolean(lQuery->isSequential()))); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t BindContextItemFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + // shouldn't raise errors + Item lItemContext = XQXQFunction::getItemArgument(aArgs, 1); + lQuery->getDynamicContext()->setContextItem(lItemContext); + + return ItemSequence_t(new EmptySequence()); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t BindContextPositionFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + XQXQFunction::throwError("ImplementationError", "This function is not implemented yet"); + + return ItemSequence_t(new EmptySequence()); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t BindContextSizeFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + XQXQFunction::throwError("ImplementationError", "This function is not implemented yet"); + + return ItemSequence_t(new EmptySequence()); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t BindVariableFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + Item lVarQName = XQXQFunction::getItemArgument(aArgs, 1); + + Iterator_t lVarValue = XQXQFunction::getIterArgument(aArgs, 2); + + if (!lQuery->getDynamicContext()->setVariable(lVarQName.getNamespace(), + lVarQName.getLocalName(), + lVarValue)) + { + std::ostringstream lMsg; + lMsg << "{" << lVarQName.getNamespace() << "}" << lVarQName.getLocalName() + << ": undefined variable"; + + throwError("UndeclaredVariable", lMsg.str()); + } + + return ItemSequence_t(new EmptySequence()); +} + + +/******************************************************************************* + +********************************************************************************/ +bool EvaluateItemSequence::EvaluateIterator::next(Item& aItem) +{ + try + { + return theIterator->next(aItem); + } + catch (XQueryException& xe) + { + std::ostringstream err; + err << "The query " << "(" << theQueryID + << ") evaluated using xqxq:evaluate raised an error at" + << " line " << xe.source_line() << " column " + << xe.source_column() << ": " << xe.what(); + + Item errQName = XQXQModule::getItemFactory()-> + createQName(xe.diagnostic().qname().ns(), xe.diagnostic().qname().localname()); + + throw USER_EXCEPTION(errQName, err.str()); + } + catch (ZorbaException& e) + { + std::ostringstream err; + err << "The query " << "(" << theQueryID + << ") evaluated using xqxq:evaluate raised an error at" + << e.what(); + + Item errQName = XQXQModule::getItemFactory()-> + createQName(e.diagnostic().qname().ns(), e.diagnostic().qname().localname()); + + throw USER_EXCEPTION(errQName, err.str()); + } +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t EvaluateFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + if(lQuery->isUpdating()) + { + throwError("QueryIsUpdating", "Executing Query shouldn't be updating."); + } + + if(lQuery->isSequential()) + { + throwError("QueryIsSequential", "Executing Query shouldn't be sequential."); + } + + Iterator_t lIterQuery = lQuery->iterator(); + + return ItemSequence_t(new EvaluateItemSequence(lIterQuery, lQueryID)); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t EvaluateUpdatingFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + if(lQuery->isSequential()) + { + throwError("QueryIsSequential", "Executing Query shouldn't be sequential."); + } + + if(!lQuery->isUpdating()) + { + throwError("QueryNotUpdating", "Executing Query should be updating.") ; + } + + Iterator_t lIterQuery = lQuery->iterator(); + return ItemSequence_t(new EvaluateItemSequence(lIterQuery, lQueryID)); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t EvaluateSequentialFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs, 0); + + XQuery_t lQuery = getQuery(aDctx, lQueryID); + + if(lQuery->isUpdating()) + { + throwError("QueryIsUpdating", "Executing Query shouldn't be updating."); + } + + if(!lQuery->isSequential()) + { + throwError("QueryNotSequential", "Executing Query should be sequential."); + } + + Iterator_t lIterQuery = lQuery->iterator(); + return ItemSequence_t(new EvaluateItemSequence(lIterQuery, lQueryID)); +} + + +/******************************************************************************* + +********************************************************************************/ +zorba::ItemSequence_t DeleteQueryFunction::evaluate( + const Arguments_t& aArgs, + const zorba::StaticContext* aSctx, + const zorba::DynamicContext* aDctx) const +{ + String lQueryID = XQXQFunction::getOneStringArgument(aArgs,0); + + QueryMap* lQueryMap; + if (!(lQueryMap= dynamic_cast(aDctx->getExternalFunctionParameter("xqxqQueryMap")))) + { + throwError("NoQueryMatch", "String identifying query does not exists."); + } + + if (!lQueryMap->deleteQuery(lQueryID)) + { + throwError("NoQueryMatch","String identifying query does not exists."); + } + + return ItemSequence_t(new EmptySequence()); +} + + +}/*namespace xqxq*/ }/*namespace zorba*/ + +#ifdef WIN32 +# define DLL_EXPORT __declspec(dllexport) +#else +# define DLL_EXPORT __attribute__ ((visibility("default"))) +#endif + +extern "C" DLL_EXPORT zorba::ExternalModule* createModule() { + return new zorba::xqxq::XQXQModule(); +} diff -Nru zorba-2.7.0-0/modules/xqxq/xqxq.xq.src/xqxq.h zorba-2.8.0-0/modules/xqxq/xqxq.xq.src/xqxq.h --- zorba-2.7.0-0/modules/xqxq/xqxq.xq.src/xqxq.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/modules/xqxq/xqxq.xq.src/xqxq.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,500 @@ +#ifndef __COM_ZORBA_WWW_MODULES_XQXQ_H__ +#define __COM_ZORBA_WWW_MODULES_XQXQ_H__ + +#include + +#include +#include +#include +#include + +#define XQXQ_MODULE_NAMESPACE "http://www.zorba-xquery.com/modules/xqxq" + +namespace zorba { namespace xqxq { + + +/******************************************************************************* + +********************************************************************************/ +class XQXQModule : public ExternalModule +{ +protected: + class ltstr + { + public: + bool operator()(const String& s1, const String& s2) const + { + return s1.compare(s2) < 0; + } + }; + + typedef std::map FuncMap_t; + + FuncMap_t theFunctions; + +public: + + virtual ~XQXQModule(); + + virtual zorba::String + getURI() const {return XQXQ_MODULE_NAMESPACE;} + + virtual zorba::ExternalFunction* + getExternalFunction(const String& localName); + + virtual void destroy(); + + static ItemFactory* + getItemFactory() + { + return Zorba::getInstance(0)->getItemFactory(); + } +}; + + +/******************************************************************************* + +********************************************************************************/ +/** + * @brief Bag class for objects associated with a prepared query + */ +class QueryData : public SmartObject +{ +private: + XQuery_t theQuery; + URIMapper* theURIMapper; + URLResolver* theURLResolver; + +public: + QueryData(XQuery_t aQuery, URIMapper* aMapper, URLResolver* aResolver); + virtual ~QueryData(); + XQuery_t getQuery() { return theQuery; } +}; + + +typedef SmartPtr QueryData_t; + + +/******************************************************************************* + +********************************************************************************/ +class QueryMap : public ExternalFunctionParameter +{ +private: + typedef std::map QueryMap_t; + QueryMap_t* queryMap; + +public: + QueryMap(); + bool + storeQuery(const String&, XQuery_t, URIMapper*, URLResolver*); + + XQuery_t + getQuery(const String&); + + bool + deleteQuery(const String&); + + virtual void + destroy() throw(); +}; + + +/******************************************************************************* + +********************************************************************************/ +class XQXQFunction : public ContextualExternalFunction +{ +protected: + const XQXQModule* theModule; + + String + getOneStringArgument(const Arguments_t&, int) const; + + Item + getItemArgument(const Arguments_t&, int) const; + + Iterator_t + getIterArgument(const Arguments_t&, int) const; + + static void + throwError(const char*, const std::string); + + XQuery_t + getQuery( + const zorba::DynamicContext* dctx, + const zorba::String& aIdent) const; + +public: + + XQXQFunction(const XQXQModule* module); + + virtual ~XQXQFunction(); + + virtual String + getURI() const; +}; + + +/******************************************************************************* + +********************************************************************************/ +class PrepareMainModuleFunction : public XQXQFunction +{ +public: + PrepareMainModuleFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~PrepareMainModuleFunction(){ } + + virtual zorba::String + getLocalName() const { return "prepare-main-module"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + +protected: + + class XQXQURLResolver : public URLResolver + { + protected: + Item theFunction; + StaticContext_t theCtx; + + public: + XQXQURLResolver(Item& aFunction, StaticContext_t& aSctx) + : + URLResolver(), + theFunction(aFunction), + theCtx(aSctx) + { + } + + virtual ~XQXQURLResolver() { } + + virtual Resource* resolveURL(const String& url, EntityData const* entityData); + }; + + + class XQXQURIMapper : public URIMapper + { + protected: + Item theFunction; + StaticContext_t theCtx; + + public: + XQXQURIMapper(Item& aFunction, StaticContext_t& aSctx) + : + URIMapper(), + theFunction(aFunction), + theCtx(aSctx) + { + } + + virtual ~XQXQURIMapper(){ } + + virtual void mapURI( + const zorba::String aUri, + EntityData const* aEntityData, + std::vector& oUris); + }; +}; + + +/******************************************************************************* + +********************************************************************************/ +class PrepareLibraryModuleFunction : public XQXQFunction +{ + public: + PrepareLibraryModuleFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~PrepareLibraryModuleFunction(){} + + virtual zorba::String + getLocalName() const { return "prepare-library-module"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + +/******************************************************************************* + +********************************************************************************/ + class IsBoundContextItemFunction : public XQXQFunction{ + public: + IsBoundContextItemFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~IsBoundContextItemFunction(){} + + virtual zorba::String + getLocalName() const { return "is-bound-context-item"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + +/******************************************************************************* + +********************************************************************************/ + class IsBoundVariableFunction : public XQXQFunction{ + public: + IsBoundVariableFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~IsBoundVariableFunction(){} + + virtual zorba::String + getLocalName() const { return "is-bound-variable"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class GetExternalVariablesFunction : public XQXQFunction{ + public: + GetExternalVariablesFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~GetExternalVariablesFunction() {} + + virtual zorba::String + getLocalName() const {return "external-variables"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class IsUpdatingFunction : public XQXQFunction{ + public: + IsUpdatingFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~IsUpdatingFunction() {} + + virtual zorba::String + getLocalName() const {return "is-updating"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + + }; + + class IsSequentialFunction : public XQXQFunction{ + public: + IsSequentialFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~IsSequentialFunction() {} + + virtual zorba::String + getLocalName() const {return "is-sequential"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class BindContextItemFunction : public XQXQFunction{ + public: + BindContextItemFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~BindContextItemFunction() {} + + virtual zorba::String + getLocalName() const {return "bind-context-item"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class BindContextPositionFunction : public XQXQFunction{ + public: + BindContextPositionFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~BindContextPositionFunction() {} + + virtual zorba::String + getLocalName() const {return "bind-context-position"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class BindContextSizeFunction : public XQXQFunction{ + public: + BindContextSizeFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~BindContextSizeFunction() {} + + virtual zorba::String + getLocalName() const {return "bind-context-size"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class BindVariableFunction : public XQXQFunction{ + public: + BindVariableFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~BindVariableFunction() {} + + virtual zorba::String + getLocalName() const {return "bind-variable"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + /******************************************************************************************* + *******************************************************************************************/ + class EvaluateItemSequence : public ItemSequence + { + protected: + + class EvaluateIterator : public Iterator + { + protected: + Iterator_t theIterator; + + String theQueryID; + + public: + EvaluateIterator(Iterator_t& aIter, String aQueryID) + : theIterator(aIter), theQueryID(aQueryID) + { + } + + virtual ~EvaluateIterator(){} + + virtual void + open() + { + theIterator->open(); + } + + virtual bool + next(Item& aItem); + + virtual void + close() + { + theIterator->close(); + } + + virtual bool + isOpen() const + { + return theIterator->isOpen(); + } + + }; + + typedef zorba::SmartPtr EvaluateIterator_t; + EvaluateIterator_t theIter; + + public: + EvaluateItemSequence(Iterator_t& aIter, String& aQueryID) + :theIter (new EvaluateIterator(aIter, aQueryID)) + { + + } + + virtual ~EvaluateItemSequence() {} + + Iterator_t + getIterator() { return theIter.get(); } + }; + + class EvaluateFunction : public XQXQFunction{ + public: + EvaluateFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~EvaluateFunction() {} + + virtual zorba::String + getLocalName() const {return "evaluate"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class EvaluateUpdatingFunction : public XQXQFunction{ + public: + EvaluateUpdatingFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~EvaluateUpdatingFunction() {} + + virtual zorba::String + getLocalName() const {return "evaluate-updating"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + class EvaluateSequentialFunction : public XQXQFunction{ + public: + EvaluateSequentialFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~EvaluateSequentialFunction() {} + + virtual zorba::String + getLocalName() const {return "evaluate-sequential"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + + virtual String getURI() const { + return theModule->getURI(); + } + + protected: + const XQXQModule* theModule; + }; + + class DeleteQueryFunction : public XQXQFunction{ + public: + DeleteQueryFunction(const XQXQModule* aModule) : XQXQFunction(aModule) {} + + virtual ~DeleteQueryFunction() {} + + virtual zorba::String + getLocalName() const {return "delete-query"; } + + virtual zorba::ItemSequence_t + evaluate(const Arguments_t&, + const zorba::StaticContext*, + const zorba::DynamicContext*) const; + }; + + + +}/*xqxq namespace*/}/*zorba namespace*/ + + +#endif //_COM_ZORBA_WWW_MODULES_XQXQ_H_ diff -Nru zorba-2.7.0-0/src/api/CMakeLists.txt zorba-2.8.0-0/src/api/CMakeLists.txt --- zorba-2.7.0-0/src/api/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -57,6 +57,7 @@ zorba_functions.cpp annotationimpl.cpp auditimpl.cpp + store_consts.cpp streambuf.cpp transcode_streambuf.cpp uuid.cpp diff -Nru zorba-2.7.0-0/src/api/base64_streambuf.cpp zorba-2.8.0-0/src/api/base64_streambuf.cpp --- zorba-2.7.0-0/src/api/base64_streambuf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/base64_streambuf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -110,9 +110,14 @@ } streambuf::int_type streambuf::pbackfail( int_type c ) { - if ( gptr() > eback() ) - gbump( -1 ); - return orig_buf_->sputbackc( traits_type::to_char_type( c ) ); + if ( !traits_type::eq_int_type( c, traits_type::eof() ) && + gptr() > eback() ) { + c = orig_buf_->sputbackc( traits_type::to_char_type( c ) ); + if ( !traits_type::eq_int_type( c, traits_type::eof() ) ) + gbump( -1 ); + return c; + } + return traits_type::eof(); } streambuf::int_type streambuf::underflow() { diff -Nru zorba-2.7.0-0/src/api/base64impl.cpp zorba-2.8.0-0/src/api/base64impl.cpp --- zorba-2.7.0-0/src/api/base64impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/base64impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -26,18 +26,19 @@ #include "diagnostics/xquery_exception.h" #include "util/base64_util.h" -#define CATCH_BASE64_EXCEPTION() \ - catch ( base64::exception const &e ) { \ - throw XQUERY_EXCEPTION( \ - err::FORG0001, ERROR_PARAMS( e.invalid_char(), ZED( Base64BadChar ) ) \ - ); \ - } \ - catch ( std::invalid_argument const& ) { \ - throw XQUERY_EXCEPTION( \ - err::FORG0001, ERROR_PARAMS( "", ZED( Base64Multiple4 ) ) \ - ); \ +#define CATCH_BASE64_EXCEPTION() \ + catch (const base64::exception& e) \ + { \ + throw XQUERY_EXCEPTION(err::FORG0001, \ + ERROR_PARAMS(ZED(FORG0001_Base64BadChar_2), e.invalid_char())); \ + } \ + catch (const std::invalid_argument&) \ + { \ + throw XQUERY_EXCEPTION(err::FORG0001, \ + ERROR_PARAMS(ZED(FORG0001_Base64Multiple4))); \ } + namespace zorba { namespace encoding { diff -Nru zorba-2.7.0-0/src/api/documentmanagerimpl.cpp zorba-2.8.0-0/src/api/documentmanagerimpl.cpp --- zorba-2.7.0-0/src/api/documentmanagerimpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/documentmanagerimpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -166,9 +166,7 @@ { ZORBA_DM_TRY { - Item lQName = theFactory->createQName( - theDocNamespace, - "available-documents"); + Item lQName = theFactory->createQName(theDocNamespace, "available-documents"); std::vector lArgs; diff -Nru zorba-2.7.0-0/src/api/dynamiccontextimpl.cpp zorba-2.8.0-0/src/api/dynamiccontextimpl.cpp --- zorba-2.7.0-0/src/api/dynamiccontextimpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/dynamiccontextimpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -129,11 +129,11 @@ if (!var) { throw XQUERY_EXCEPTION(err::XPST0008, - ERROR_PARAMS(BUILD_STRING('{', + ERROR_PARAMS(ZED(XPST0008_VariableName_2), + BUILD_STRING('{', qnameItem->getNamespace(), '}', - qnameItem->getLocalName()), - ZED(Variable))); + qnameItem->getLocalName()))); } return var; @@ -177,7 +177,8 @@ if (!var) { throw XQUERY_EXCEPTION(err::XPST0008, - ERROR_PARAMS(BUILD_STRING('{', inVarUri, '}', inVarLocalName ), ZED(Variable))); + ERROR_PARAMS(ZED(XPST0008_VariableName_2), + BUILD_STRING('{', inVarUri, '}', inVarLocalName ))); } return var; @@ -294,19 +295,19 @@ // For string items, check that the value is a valid Unicode codepoint sequence const char* invalid_char; - TypeManager* tm = theStaticContext->get_typemanager(); - RootTypeManager& rtm = GENV_TYPESYSTEM; - xqtref_t itemType = tm->create_value_type(value); + if (value->isStreamable() == false && value->isAtomic()) + { + store::SchemaTypeCode itemTypeCode = value->getTypeCode(); - if (value->isStreamable() == false && - TypeOps::is_equal(tm, *itemType, *rtm.STRING_TYPE_ONE, QueryLoc::null) && - (invalid_char = utf8::validate(value->getStringValue().c_str())) != NULL) - { - throw XQUERY_EXCEPTION(err::FOCH0001, - ERROR_PARAMS(zstring("#x") + - BUILD_STRING(std::uppercase << std::hex - << (static_cast(*invalid_char) & 0xFF)) )); + if (TypeOps::is_subtype(itemTypeCode, store::XS_STRING) && + (invalid_char = utf8::validate(value->getStringValue().c_str())) != NULL) + { + throw XQUERY_EXCEPTION(err::FOCH0001, + ERROR_PARAMS(zstring("#x") + + BUILD_STRING(std::uppercase << std::hex + << (static_cast(*invalid_char) & 0xFF)) )); + } } VarInfo* var = NULL; @@ -715,7 +716,7 @@ bool DynamicContextImpl::addExternalFunctionParameter ( const String& aName, - ExternalFunctionParameter* aValue ) + ExternalFunctionParameter* aValue ) const { ZORBA_DCTX_TRY { diff -Nru zorba-2.7.0-0/src/api/dynamiccontextimpl.h zorba-2.8.0-0/src/api/dynamiccontextimpl.h --- zorba-2.7.0-0/src/api/dynamiccontextimpl.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/dynamiccontextimpl.h 2013-01-16 18:28:18.000000000 +0000 @@ -151,7 +151,7 @@ getExternalFunctionParam(const String& aName, void*&) const; virtual bool - addExternalFunctionParameter(const String& aName, ExternalFunctionParameter* aParam); + addExternalFunctionParameter(const String& aName, ExternalFunctionParameter* aParam) const; virtual ExternalFunctionParameter* getExternalFunctionParameter(const String& aName) const; diff -Nru zorba-2.7.0-0/src/api/item.cpp zorba-2.8.0-0/src/api/item.cpp --- zorba-2.7.0-0/src/api/item.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/item.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -233,6 +233,7 @@ return String((const char*)0); } + int32_t Item::getIntValue() const { ITEM_TRY @@ -245,6 +246,7 @@ return 0; } + uint32_t Item::getUnsignedIntValue() const { ITEM_TRY @@ -257,30 +259,31 @@ return 0; } -double Item::getDoubleValue() const + +xs_long Item::getLongValue() const { ITEM_TRY SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);) - return m_item->getDoubleValue().getNumber(); + return m_item->getLongValue(); ITEM_CATCH return 0; + } -xs_long Item::getLongValue() const +double Item::getDoubleValue() const { ITEM_TRY SYNC_CODE(AutoLock lock(GENV_STORE.getGlobalLock(), Lock::READ);) - return m_item->getLongValue(); + return m_item->getDoubleValue().getNumber(); ITEM_CATCH return 0; - } diff -Nru zorba-2.7.0-0/src/api/itemfactoryimpl.cpp zorba-2.8.0-0/src/api/itemfactoryimpl.cpp --- zorba-2.7.0-0/src/api/itemfactoryimpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/itemfactoryimpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -16,21 +16,29 @@ #include "stdafx.h" #define __STDC_LIMIT_MACROS + #include #include + #include "diagnostics/xquery_diagnostics.h" +#include "diagnostics/util_macros.h" + #include "api/itemfactoryimpl.h" #include "zorbatypes/duration.h" + #include "system/globalenv.h" + #include "store/api/item_factory.h" -#include +#include "store/api/store.h" #include "store/api/copymode.h" +#include "store/api/item.h" + #include "api/unmarshaller.h" + #include "types/casting.h" -#include "store/api/item.h" -#include +#include "runtime/util/item_iterator.h" namespace zorba { @@ -112,14 +120,16 @@ zstring const &lLocalname = Unmarshaller::getInternalString( aLocalname ); if (!GenericCast::instance()->castableToNCName(lLocalname.c_str())) - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( lLocalname, ZED( MustBeNCName ) ) - ); + { + RAISE_ERROR_NO_LOC(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname)); + } if (lPrefix.size() && !GenericCast::instance()->castableToNCName(lPrefix.c_str())) - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( lPrefix, ZED( MustBeNCName ) ) - ); + { + RAISE_ERROR_NO_LOC(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_PrefixNotNCName_2), lPrefix)); + } store::Item_t lItem; theItemFactory->createQName(lItem, lNamespace, lPrefix, lLocalname); @@ -135,44 +145,51 @@ zstring const &lLocalname = Unmarshaller::getInternalString( aLocalname ); if (!GenericCast::instance()->castableToNCName(lLocalname.c_str())) - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( lLocalname, ZED( MustBeNCName ) ) - ); + { + RAISE_ERROR_NO_LOC(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname)); + } store::Item_t lItem; theItemFactory->createQName(lItem, lNamespace, zstring(), lLocalname); return &*lItem; } + Item ItemFactoryImpl::createQName(const String& aQNameString) { - zstring const &lQNameString = Unmarshaller::getInternalString( aQNameString ); + const zstring& lQNameString = Unmarshaller::getInternalString( aQNameString ); store::Item_t lItem; size_t lOpen = lQNameString.find("{"); size_t lClose = lQNameString.find("}"); - if (lOpen == 0 && lClose != std::string::npos) { + if (lOpen == 0 && lClose != std::string::npos) + { zstring const &lNamespace = lQNameString.substr(1, lClose - 1); zstring const &lLocalname = lQNameString.substr(lClose+1); theItemFactory->createQName(lItem, lNamespace, zstring(), lLocalname); + if (!GenericCast::instance()->castableToNCName(lLocalname.c_str())) - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( lLocalname, ZED( MustBeNCName ) ) - ); + { + RAISE_ERROR_NO_LOC(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), lLocalname)); + } } return &*lItem; } + Item ItemFactoryImpl::createNCName(const String& aValue) { zstring lString = Unmarshaller::getInternalString(aValue); if (!GenericCast::instance()->castableToNCName(lString.c_str())) - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( lString, ZED( MustBeNCName ) ) - ); + { + RAISE_ERROR_NO_LOC(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NameNotNCName_2), lString)); + } store::Item_t lItem; theItemFactory->createNCName(lItem, lString); @@ -191,9 +208,7 @@ } else { - throw ZORBA_EXCEPTION( - zerr::ZSTR0040_TYPE_ERROR, ERROR_PARAMS( lMessage ) - ); + throw ZORBA_EXCEPTION(zerr::ZSTR0040_TYPE_ERROR, ERROR_PARAMS(lMessage)); } return &*lItem; } diff -Nru zorba-2.7.0-0/src/api/serialization/serializer.cpp zorba-2.8.0-0/src/api/serialization/serializer.cpp --- zorba-2.7.0-0/src/api/serialization/serializer.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/serialization/serializer.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -2482,8 +2482,10 @@ case PARAMETER_VALUE_XHTML: m = "xhtml"; break; case PARAMETER_VALUE_TEXT: m = "text"; break; case PARAMETER_VALUE_BINARY: m = "binary"; break; +#ifdef ZORBA_WITH_JSON case PARAMETER_VALUE_JSON: m = "json"; break; case PARAMETER_VALUE_JSON_XML_HYBRID: m = "json-xml-hybrid"; break; +#endif default: ZORBA_ASSERT(false); } } diff -Nru zorba-2.7.0-0/src/api/staticcontextimpl.cpp zorba-2.8.0-0/src/api/staticcontextimpl.cpp --- zorba-2.7.0-0/src/api/staticcontextimpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/staticcontextimpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -1507,7 +1507,9 @@ // contains a reference to the query in order to do cleanup work. // The same is true for this sctx Iterator_t lIter = impl->iterator(); - return new InvokeItemSequence(impl.release(), lIter, const_cast(this)); + return new InvokeItemSequence(impl.release(), + lIter, + const_cast(this)); } catch (ZorbaException const& e) { diff -Nru zorba-2.7.0-0/src/api/store_consts.cpp zorba-2.8.0-0/src/api/store_consts.cpp --- zorba-2.7.0-0/src/api/store_consts.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/api/store_consts.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "stdafx.h" +#include + +namespace zorba { +namespace store { + +/////////////////////////////////////////////////////////////////////////////// + +std::ostream& operator<<( std::ostream &o, SchemaTypeCode c ) { + static char const *const s[] = { + "xs:anyAtomicType", // 0 + "xs:string", // 1 + "xs:normalizedString", // 2 + "xs:token", // 3 + "xs:language", // 4 + "xs:NMTOKEN", // 5 + "xs:Name", // 6 + "xs:NCName", // 7 + "xs:ID", // 8 + "xs:IDREF", // 9 + "xs:ENTITY", // 10 + "xs:untypedAtomic", // 11 + "xs:dateTime", // 12 + "xs:date", // 13 + "xs:time", // 14 + "xs:duration", // 15 + "xs:dayTimeDuration", // 16 + "xs:yearMonthDuration", // 17 + "xs:float", // 18 + "xs:double", // 19 + "xs:decimal", // 20 + "xs:integer", // 21 + "xs:nonPositiveInteger", // 22 + "xs:negativeInteger", // 23 + "xs:long", // 24 + "xs:int", // 25 + "xs:short", // 26 + "xs:byte", // 27 + "xs:nonNegativeInteger", // 28 + "xs:unsignedLong", // 29 + "xs:unsignedInt", // 30 + "xs:unsignedShort", // 31 + "xs:unsignedByte", // 32 + "xs:positiveInteger", // 33 + "xs:gYearMonth", // 34 + "xs:gYear", // 35 + "xs:gMonthDay", // 36 + "xs:gDay", // 37 + "xs:gMonth", // 38 + "xs:boolean", // 39 + "xs:base64Binary", // 40 + "xs:hexBinary", // 41 + "xs:anyURI", // 42 + "xs:QNAME", // 43 + "xs:NOTATION", // 44 + "js:null", // 45 + }; + + if ( c >= 0 && c < XS_LAST ) + o << s[ c ]; + else + o << "[illegal type code: " << (int)c << ']'; + + return o; +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace store +} // namespace zorba + +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/api/transcode_streambuf.cpp zorba-2.8.0-0/src/api/transcode_streambuf.cpp --- zorba-2.7.0-0/src/api/transcode_streambuf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/transcode_streambuf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -66,7 +66,8 @@ } streambuf::int_type streambuf::pbackfail( int_type c ) { - return proxy_buf_->sputbackc( traits_type::to_char_type( c ) ); + return traits_type::eq_int_type( c, traits_type::eof() ) ? + c : proxy_buf_->sputbackc( traits_type::to_char_type( c ) ); } streambuf::int_type streambuf::uflow() { diff -Nru zorba-2.7.0-0/src/api/xqueryimpl.cpp zorba-2.8.0-0/src/api/xqueryimpl.cpp --- zorba-2.7.0-0/src/api/xqueryimpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/api/xqueryimpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -848,12 +848,11 @@ if (!var) { - throw XQUERY_EXCEPTION(zerr::ZAPI0011_ELEMENT_NOT_DECLARED, + throw XQUERY_EXCEPTION(zerr::ZAPI0011_VARIABLE_NOT_DECLARED, ERROR_PARAMS(BUILD_STRING('{', qname->getNamespace(), '}', - qname->getLocalName()), - ZED(Variable))); + qname->getLocalName()))); } if (var->hasInitializer()) diff -Nru zorba-2.7.0-0/src/common/shared_types.h zorba-2.8.0-0/src/common/shared_types.h --- zorba-2.7.0-0/src/common/shared_types.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/common/shared_types.h 2013-01-16 18:28:18.000000000 +0000 @@ -96,8 +96,10 @@ class var_expr; class flwor_clause; class forletwin_clause; -class for_clause; -class let_clause; +class forlet_clause; + +typedef forlet_clause for_clause; +typedef forlet_clause let_clause; class ItemVariableIterator; typedef rchandle ItemVariableIterator_t; diff -Nru zorba-2.7.0-0/src/compiler/api/compiler_api.cpp zorba-2.8.0-0/src/compiler/api/compiler_api.cpp --- zorba-2.7.0-0/src/compiler/api/compiler_api.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/api/compiler_api.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -138,10 +138,10 @@ #ifdef ZORBA_XQUERYX char* converted_xquery_str = NULL; std::string xquery_str; - bool is_xqueryx = false; + bool is_xqueryx = false; + { - char strtemp[1000]; - //int nr_read = 1; + char strtemp[1000]; do { strtemp[0] = 0; @@ -175,26 +175,30 @@ { xquery_stream = new std::istringstream(xquery_str); } -#endif +#endif // ZORBA_XQUERYX + + theCompilerCB->setPhase(CompilerCB::PARSING); xquery_driver lDriver(&*theCompilerCB); lDriver.parse_stream(*xquery_stream, aFileName); + theCompilerCB->setPhase(CompilerCB::NONE); + #ifdef ZORBA_XQUERYX delete xquery_stream; - if(is_xqueryx) + if (is_xqueryx) { xqxconvertor->freeResult(converted_xquery_str); } #endif + parsenode_t node = lDriver.get_expr(); if (typeid (*node) == typeid (ParseErrorNode)) { ParseErrorNode* pen = static_cast(&*node); - throw XQUERY_EXCEPTION_VAR( - pen->err, ERROR_PARAMS(pen->msg), ERROR_LOC(pen->get_location()) - ); + throw XQUERY_EXCEPTION_VAR(pen->err, + ERROR_PARAMS(pen->msg), ERROR_LOC(pen->get_location())); } return node; @@ -285,7 +289,11 @@ audit::XQUERY_COMPILATION_CODEGENERATION_DURATION, lTimer); + theCompilerCB->setPhase(CompilerCB::CODEGEN); + plan = codegen("main query", rootExpr, theCompilerCB, nextDynamicVarId); + + theCompilerCB->setPhase(CompilerCB::NONE); } //theCompilerCB->getExprManager()->garbageCollect(); @@ -306,8 +314,12 @@ time::get_current_walltime(startTime); #endif + theCompilerCB->setPhase(CompilerCB::TRANSLATION); + expr* lExpr = translate(*aParsenode, theCompilerCB); + theCompilerCB->setPhase(CompilerCB::NONE); + #if 0 std::cout << "Num exprs after translation = " << theCompilerCB->getExprManager()->numExprs() @@ -321,7 +333,7 @@ if ( lExpr == NULL ) { // TODO: can this happen? - throw ZORBA_EXCEPTION( zerr::ZAPI0002_XQUERY_COMPILATION_FAILED ); + throw ZORBA_EXCEPTION(zerr::ZAPI0002_XQUERY_COMPILATION_FAILED); } return lExpr; @@ -333,6 +345,8 @@ ********************************************************************************/ expr* XQueryCompiler::optimize(expr* lExpr) { + theCompilerCB->setPhase(CompilerCB::OPTIMIZATION); + // Build the call-graph among the udfs that are actually used in the query // program. UDFGraph udfGraph(lExpr); @@ -343,7 +357,10 @@ udfGraph.inferDeterminism(); if (theCompilerCB->theConfig.opt_level <= CompilerCB::config::O0) + { + theCompilerCB->setPhase(CompilerCB::NONE); return lExpr; + } // Optimize the udfs. udfGraph.optimizeUDFs(theCompilerCB); @@ -362,6 +379,8 @@ if ( theCompilerCB->theConfig.optimize_cb != NULL ) theCompilerCB->theConfig.optimize_cb(lExpr, "main query"); + theCompilerCB->setPhase(CompilerCB::NONE); + return lExpr; } @@ -379,11 +398,9 @@ { public: FakeLibraryModuleURLResolver( - zstring const& aLibraryModuleNamespace, zstring const& aLibraryModuleFilename, std::istream& aStream) : - theLibraryModuleNamespace(aLibraryModuleNamespace), theLibraryModuleFilename(aLibraryModuleFilename), theStream(aStream) {} @@ -395,10 +412,14 @@ const zstring& aUrl, const internal::EntityData* aEntityData) { - if (aUrl != theLibraryModuleNamespace) - { - return NULL; - } + // Since we know this URL resolver will only be used when compiling the + // stub query, and the only URI that query will contain is the one we're + // interested in, then we don't actually need to check the URL at all - + // just return the stream. This is a good thing, because due to URI + // mapping, aUrl will probably be different than the one we're expecting. + // If we returned NULL here, Zorba's built-in URL Resolvers would attempt + // to load the resource from somewhere else, and that may result in the + // wrong information being compiled. See bug 992304. assert (theStream.good()); // Pass a nullptr StreamReleaser; memory ownership of the istream remains // with the caller of this method. @@ -407,7 +428,6 @@ } private: - zstring theLibraryModuleNamespace; zstring theLibraryModuleFilename; std::istream& theStream; }; @@ -443,7 +463,7 @@ aXQuery.seekg(0); FakeLibraryModuleURLResolver* aFakeResolver = - new FakeLibraryModuleURLResolver(lib_namespace.str(), aFileName, aXQuery); + new FakeLibraryModuleURLResolver(aFileName, aXQuery); theCompilerCB->theRootSctx->add_url_resolver(aFakeResolver); diff -Nru zorba-2.7.0-0/src/compiler/api/compilercb.cpp zorba-2.8.0-0/src/compiler/api/compilercb.cpp --- zorba-2.7.0-0/src/compiler/api/compilercb.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/api/compilercb.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -17,6 +17,7 @@ #include "compiler/api/compilercb.h" #include "compiler/expression/expr_base.h" +#include "compiler/expression/expr_manager.h" #ifdef ZORBA_WITH_DEBUGGER #include "debugger/debugger_commons.h" @@ -112,6 +113,7 @@ #ifdef ZORBA_WITH_DEBUGGER theDebuggerCommons(0), #endif + thePhase(NONE), theHasEval(false), theIsEval(false), theIsLoadProlog(false), @@ -120,9 +122,9 @@ theHaveTimeout(false), theTimeout(timeout), theTempIndexCounter(0), + theNextVisitId(1), theEM(new ExprManager(this)) { - if (timeout >= 0) theHaveTimeout = true; } @@ -140,6 +142,7 @@ #ifdef ZORBA_WITH_DEBUGGER theDebuggerCommons(cb.theDebuggerCommons), #endif + thePhase(NONE), theHasEval(false), theIsEval(false), theIsLoadProlog(false), @@ -148,6 +151,7 @@ theHaveTimeout(cb.theHaveTimeout), theTimeout(cb.theTimeout), theTempIndexCounter(0), + theNextVisitId(cb.theNextVisitId+1), theConfig(cb.theConfig), theEM(new ExprManager(this)) { @@ -165,8 +169,10 @@ #ifdef ZORBA_WITH_DEBUGGER theDebuggerCommons(NULL), #endif + thePhase(RUNTIME), theHasEval(false), theIsEval(false), + theNextVisitId(1), theEM(new ExprManager(this)) { } diff -Nru zorba-2.7.0-0/src/compiler/api/compilercb.h zorba-2.8.0-0/src/compiler/api/compilercb.h --- zorba-2.7.0-0/src/compiler/api/compilercb.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/api/compilercb.h 2013-01-16 18:28:18.000000000 +0000 @@ -29,19 +29,21 @@ // without having the definition of static_context availble. # include "context/static_context.h" #endif + #include "compiler/expression/pragma.h" #include "zorbaserialization/class_serializer.h" -#include "compiler/expression/mem_manager.h" -#include "compiler/expression/expr_manager.h" -namespace zorba { +namespace zorba +{ #ifdef ZORBA_WITH_DEBUGGER class DebuggerCommons; #endif class static_context; +class ExprManager; + /******************************************************************************* There is one CompilerCB per query plus one CompilerCB per invocation of an @@ -130,7 +132,7 @@ Pointer to the function to call to print the expr tree that results from translating the query AST. ********************************************************************************/ -class ZORBA_DLL_PUBLIC CompilerCB : public zorba::serialization::SerializeBaseClass +class CompilerCB : public zorba::serialization::SerializeBaseClass { public: struct config : public zorba::serialization::SerializeBaseClass @@ -166,8 +168,22 @@ void serialize(::zorba::serialization::Archiver& ar); }; + typedef enum + { + NONE, + PARSING, + TRANSLATION, + OPTIMIZATION, + CODEGEN, + RUNTIME + } ProcessingPhase; + typedef std::map SctxMap; + typedef std::multimap PragmaMap; + + typedef PragmaMap::const_iterator PragmaMapIter; + public: XQueryDiagnostics * theXQueryDiagnostics; @@ -179,6 +195,8 @@ DebuggerCommons * theDebuggerCommons; #endif + ProcessingPhase thePhase; + bool theHasEval; bool theIsEval; @@ -195,13 +213,13 @@ uint32_t theTempIndexCounter; + uint8_t theNextVisitId; + config theConfig; ExprManager * const theEM; - typedef std::multimap PragmaMap; - typedef PragmaMap::const_iterator PragmaMapIter; - PragmaMap thePragmas; + PragmaMap thePragmas; public: SERIALIZABLE_CLASS(CompilerCB); @@ -215,6 +233,10 @@ ~CompilerCB(); + ProcessingPhase getPhase() const { return thePhase; } + + void setPhase(ProcessingPhase v) { thePhase = v; } + bool isLoadPrologQuery() const { return theIsLoadProlog; } void setLoadPrologQuery() { theIsLoadProlog = true; } @@ -231,19 +253,14 @@ ExprManager* getExprManager() const { return theEM; } - MemoryManager& getMemoryManager() const { return theEM->getMemory(); } - // // Pragmas // void add_pragma(const expr* e, pragma* p); - void - lookup_pragmas(const expr* e, std::vector& pragmas) const; - - bool - lookup_pragma(const expr* e, const zstring& localname, pragma*&) const; + void lookup_pragmas(const expr* e, std::vector& pragmas) const; + bool lookup_pragma(const expr* e, const zstring& localname, pragma*&) const; }; diff -Nru zorba-2.7.0-0/src/compiler/codegen/plan_visitor.cpp zorba-2.8.0-0/src/compiler/codegen/plan_visitor.cpp --- zorba-2.7.0-0/src/compiler/codegen/plan_visitor.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/codegen/plan_visitor.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -31,6 +31,7 @@ #include "system/globalenv.h" #include "system/properties.h" +#include "compiler/expression/expr_manager.h" #include "compiler/api/compilercb.h" #include "compiler/codegen/plan_visitor.h" #include "compiler/expression/expr.h" @@ -196,6 +197,10 @@ public: PlanIter_t theInputVar; std::vector theOutputVarRefs; + bool theIsFakeLetVar; + +public: + VarRebind() : theIsFakeLetVar(false) {} }; @@ -775,12 +780,15 @@ ZORBA_ASSERT(i >= 0); } - // Create a var ref iter in the output of C. - varIter = create_var_iter(var, isForVar); - FlworClauseVarMap* clauseVarMap = theClauseStack[i]; - flwor_expr* flworExpr = clauseVarMap->theClause->get_flwor_expr(); + bool isFakeLetVar = clauseVarMap->theVarRebinds[varPos]->theIsFakeLetVar; + + if (isFakeLetVar) + isForVar = true; + + // Create a var ref iter in the output of C. + varIter = create_var_iter(var, isForVar); clauseVarMap->theVarRebinds[varPos]->theOutputVarRefs.push_back(varIter); @@ -806,6 +814,7 @@ clauseVarMap->theVarRebinds.push_back(varRebind); varRebind->theInputVar = varIter; + varRebind->theIsFakeLetVar = isFakeLetVar; varIter = create_var_iter(var, isForVar); @@ -896,7 +905,9 @@ { ++numForClauses; - if (c->get_expr()->is_sequential()) + const forlet_clause* fc = static_cast(c); + + if (fc->get_expr()->is_sequential()) { // TODO: do not convert to general flwor if the whole flwor consists // of a single FOR followed by RETURN. @@ -907,7 +918,9 @@ } else if (c->get_kind() == flwor_clause::let_clause) { - if (c->get_expr()->is_sequential()) + const forlet_clause* lc = static_cast(c); + + if (lc->get_expr()->is_sequential()) { if (numForClauses > 0) { @@ -933,7 +946,7 @@ { materialize_clause* mat = theCCB->theEM->create_materialize_clause(v.get_sctx(), - v.get_return_expr()->get_loc()); + v.get_return_expr()->get_loc()); v.add_clause(mat); ++numClauses; @@ -960,14 +973,17 @@ case flwor_clause::let_clause: case flwor_clause::window_clause: { + expr* domExpr = static_cast(c)->get_expr(); + if (k == flwor_clause::for_clause || k == flwor_clause::window_clause) { - xqtref_t domainType = c->get_expr()->get_return_type(); + xqtref_t domainType = domExpr->get_return_type(); + if (domainType->get_quantifier() != TypeConstants::QUANT_ONE) ++numForClauses; } - if (c->get_expr()->is_sequential()) + if (domExpr->is_sequential()) { if (k == flwor_clause::for_clause || k == flwor_clause::window_clause || @@ -981,12 +997,12 @@ v.get_clause(i-1)->get_kind() != flwor_clause::order_clause && v.get_clause(i-1)->get_kind() != flwor_clause::group_clause) { - orderby_clause* mat = - theCCB->theEM->create_orderby_clause(v.get_sctx(), - c->get_loc(), - true, - modifiers, - orderingExprs); + orderby_clause* mat = theCCB->theEM-> + create_orderby_clause(v.get_sctx(), + c->get_loc(), + true, + modifiers, + orderingExprs); v.add_clause(i, mat); ++i; @@ -997,12 +1013,12 @@ (i < numClauses - 1 && v.get_clause(i+1)->get_kind() != flwor_clause::group_clause)) { - orderby_clause* mat = - theCCB->theEM->create_orderby_clause(v.get_sctx(), - c->get_loc(), - true, - modifiers, - orderingExprs); + orderby_clause* mat = theCCB->theEM-> + create_orderby_clause(v.get_sctx(), + c->get_loc(), + true, + modifiers, + orderingExprs); v.add_clause(i+1, mat); ++numClauses; @@ -1032,12 +1048,12 @@ lastClause->get_kind() != flwor_clause::order_clause && lastClause->get_kind() != flwor_clause::group_clause) { - orderby_clause* mat = - theCCB->theEM->create_orderby_clause(v.get_sctx(), - v.get_return_expr()->get_loc(), - true, - modifiers, - orderingExprs); + orderby_clause* mat = theCCB->theEM-> + create_orderby_clause(v.get_sctx(), + v.get_return_expr()->get_loc(), + true, + modifiers, + orderingExprs); v.add_clause(mat); ++numClauses; @@ -1053,20 +1069,12 @@ { case flwor_clause::for_clause: - { - visit_flwor_clause(c, isGeneral); - - const for_clause* fc = reinterpret_cast(c); - fc->get_expr()->accept(*this); - break; - } - case flwor_clause::let_clause: { visit_flwor_clause(c, isGeneral); - const for_clause* fc = reinterpret_cast(c); - fc->get_expr()->accept(*this); + const forlet_clause* flc = reinterpret_cast(c); + flc->get_expr()->accept(*this); break; } @@ -1080,10 +1088,10 @@ flwor_wincond* stopCond = wc->get_win_stop(); if (startCond) - startCond->get_cond()->accept(*this); + startCond->get_expr()->accept(*this); if (stopCond) - stopCond->get_cond()->accept(*this); + stopCond->get_expr()->accept(*this); wc->get_expr()->accept(*this); @@ -1097,12 +1105,12 @@ const flwor_clause::rebind_list_t& gvars = gc->get_grouping_vars(); const flwor_clause::rebind_list_t& ngvars = gc->get_nongrouping_vars(); - for (ulong i = 0; i < gvars.size(); ++i) + for (csize i = 0; i < gvars.size(); ++i) { gvars[i].first->accept(*this); } - for (ulong i = 0; i < ngvars.size(); ++i) + for (csize i = 0; i < ngvars.size(); ++i) { ngvars[i].first->accept(*this); } @@ -1116,8 +1124,8 @@ { const orderby_clause* oc = reinterpret_cast(c); - ulong numCols = oc->num_columns(); - for (ulong i = 0; i < numCols; ++i) + csize numCols = oc->num_columns(); + for (csize i = 0; i < numCols; ++i) { oc->get_column_expr(i)->accept(*this); } @@ -1208,11 +1216,15 @@ case flwor_clause::let_clause: { const let_clause* lc = static_cast(c); + xqtref_t domType = lc->get_expr()->get_return_type(); VarRebind_t varRebind = new VarRebind; clauseVarMap->theVarExprs.push_back(lc->get_var()); clauseVarMap->theVarRebinds.push_back(varRebind); + if (domType->get_quantifier() == TypeConstants::QUANT_ONE) + varRebind->theIsFakeLetVar = true; + break; } @@ -1513,14 +1525,19 @@ std::vector& varRefs = clauseVarMap->theVarRebinds[0]->theOutputVarRefs; - return new flwor::LetIterator(sctx, - var->get_loc(), - var->get_name(), - PREV_ITER, - domainIter, - varRefs, - lc->lazyEval(), - true); // materilize + if (clauseVarMap->theVarRebinds[0]->theIsFakeLetVar) + { + std::vector* posVarRefs = &no_var_iters; + + return new flwor::ForIterator(sctx, var->get_loc(), var->get_name(), + PREV_ITER, domainIter, varRefs, *posVarRefs); + } + else + { + return new flwor::LetIterator(sctx, var->get_loc(), var->get_name(), + PREV_ITER, domainIter, varRefs, + lc->lazyEval(), true); // materialize + } } // @@ -1566,7 +1583,7 @@ return new flwor::WindowIterator(sctx, var->get_loc(), - wc->get_winkind() == window_clause::tumbling_window ? flwor::WindowIterator::TUMBLING : flwor::WindowIterator::SLIDING, + wc->get_winkind() == tumbling_window ? flwor::WindowIterator::TUMBLING : flwor::WindowIterator::SLIDING, PREV_ITER, domainIter, var->get_name(), @@ -1852,10 +1869,19 @@ std::vector& posVarRefs = clauseVarMap->theVarRebinds[1]->theOutputVarRefs; - forletClauses.push_back(flwor::ForLetClause(var->get_name(), - varRefs, - posVarRefs, - domainIter)); + if (!posVarRefs.empty()) + { + forletClauses.push_back(flwor::ForLetClause(var->get_name(), + varRefs, + posVarRefs, + domainIter)); + } + else + { + forletClauses.push_back(flwor::ForLetClause(var->get_name(), + varRefs, + domainIter)); + } } else { @@ -1885,11 +1911,20 @@ std::vector& varRefs = clauseVarMap->theVarRebinds[0]->theOutputVarRefs; - forletClauses.push_back(flwor::ForLetClause(var->get_name(), - varRefs, - domainIter, - lc->lazyEval(), - true)); // materialize + if (clauseVarMap->theVarRebinds[0]->theIsFakeLetVar) + { + forletClauses.push_back(flwor::ForLetClause(var->get_name(), + varRefs, + domainIter)); + } + else + { + forletClauses.push_back(flwor::ForLetClause(var->get_name(), + varRefs, + domainIter, + lc->lazyEval(), + true)); // materialize + } break; } @@ -2272,10 +2307,10 @@ enum FlowCtlException::action a; switch (v.get_action()) { - case flowctl_expr::BREAK: + case FLOW_BREAK: a = FlowCtlException::BREAK; break; - case flowctl_expr::CONTINUE: + case FLOW_CONTINUE: a = FlowCtlException::CONTINUE; break; default: @@ -2429,7 +2464,11 @@ { CODEGEN_TRACE_OUT(""); PlanIter_t lChild = pop_itstack(); - push_itstack(new CastableIterator(sctx, qloc, lChild, v.get_target_type())); + push_itstack(new CastableIterator(sctx, + qloc, + lChild, + v.get_target_type(), + v.allows_empty_input())); } @@ -2443,8 +2482,12 @@ void end_visit(cast_expr& v) { CODEGEN_TRACE_OUT(""); - PlanIter_t lChild = pop_itstack(); - push_itstack(new CastIterator(sctx, qloc, lChild, v.get_target_type())); + PlanIter_t child = pop_itstack(); + push_itstack(new CastIterator(sctx, + qloc, + child, + v.get_target_type(), + v.allows_empty_input())); } @@ -3022,7 +3065,7 @@ theConstructorsStack.push(&v); - if (v.get_type() == text_expr::text_constructor) + if (v.get_type() == text_constructor) theEnclosedContextStack.push(TEXT_CONTENT); else theEnclosedContextStack.push(ATTRIBUTE_CONTENT); @@ -3049,11 +3092,11 @@ switch (v.get_type()) { - case text_expr::text_constructor: + case text_constructor: push_itstack(new TextIterator(sctx, qloc, content, isRoot)); break; - case text_expr::comment_constructor: + case comment_constructor: push_itstack(new CommentIterator(sctx, qloc, content, isRoot)); break; diff -Nru zorba-2.7.0-0/src/compiler/expression/CMakeLists.txt zorba-2.8.0-0/src/compiler/expression/CMakeLists.txt --- zorba-2.7.0-0/src/compiler/expression/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -14,6 +14,7 @@ SET(EXPRESSION_SRCS expr_consts.cpp expr_base.cpp + expr_clone.cpp expr_iter.cpp expr_type.cpp expr.cpp diff -Nru zorba-2.7.0-0/src/compiler/expression/expr.cpp zorba-2.8.0-0/src/compiler/expression/expr.cpp --- zorba-2.7.0-0/src/compiler/expression/expr.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -83,22 +83,19 @@ DEF_EXPR_ACCEPT (pi_expr) -#define CLONE( e, s ) ((e) == NULL ? NULL : (e)->clone(s)) - - - /******************************************************************************* [68] IfExpr ::= "if" "(" Expr ")" "then" ExprSingle "else" ExprSingle ********************************************************************************/ if_expr::if_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* condExpr, expr* thenExpr, expr* elseExpr) : - expr(ccb, sctx, loc, if_expr_kind), + expr(ccb, sctx, udf, loc, if_expr_kind), theThenExpr(thenExpr), theElseExpr(elseExpr) { @@ -108,10 +105,13 @@ *GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE, loc)) { - fo_expr* boolExpr = theCCB->theEM->create_fo_expr(sctx, - loc, - GET_BUILTIN_FUNCTION(FN_BOOLEAN_1), - condExpr); + fo_expr* boolExpr = theCCB->theEM-> + create_fo_expr(sctx, + udf, + loc, + BUILTIN_FUNC(FN_BOOLEAN_1), + condExpr); + condExpr = boolExpr; } @@ -166,29 +166,20 @@ } -expr* if_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_if_expr(theSctx, - get_loc(), - get_cond_expr()->clone(subst), - get_then_expr()->clone(subst), - get_else_expr()->clone(subst)); -} - - /***************************************************************************//** ********************************************************************************/ order_expr::order_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, - order_type_t type, - expr* inExpr) + DocOrderMode type, + expr* input) : - expr(ccb, sctx, loc, order_expr_kind), - theType(type), - theExpr(inExpr) + expr(ccb, sctx, udf, loc, order_expr_kind), + theInput(input), + theType(type) { compute_scripting_kind(); } @@ -196,36 +187,31 @@ void order_expr::compute_scripting_kind() { - theScriptingKind = theExpr->get_scripting_detail(); + theScriptingKind = theInput->get_scripting_detail(); if (is_vacuous()) theScriptingKind = SIMPLE_EXPR; } -expr* order_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_order_expr(theSctx, get_loc(), get_type(), get_expr()->clone(subst)); -} - - /***************************************************************************//** ********************************************************************************/ validate_expr::validate_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, enum ParseConstants::validation_mode_t mode, const store::Item_t& typeName, - expr* inExpr, + expr* input, rchandle typemgr) : - expr(ccb, sctx, loc, validate_expr_kind), + expr(ccb, sctx, udf, loc, validate_expr_kind), + theInput(input), theMode(mode), theTypeName(typeName), - theTypeMgr(typemgr), - theExpr(inExpr) + theTypeMgr(typemgr) { compute_scripting_kind(); } @@ -233,25 +219,15 @@ void validate_expr::compute_scripting_kind() { - checkNonUpdating(theExpr); + checkNonUpdating(theInput); - theScriptingKind = theExpr->get_scripting_detail(); + theScriptingKind = theInput->get_scripting_detail(); if (is_vacuous()) theScriptingKind = SIMPLE_EXPR; } -expr* validate_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_validate_expr(theSctx, - get_loc(), - get_valmode(), - const_cast(get_type_name()), - get_expr()->clone(subst), - get_typemgr()); -} - /***************************************************************************//** Base for expression classes that require a namespace context @@ -259,11 +235,12 @@ namespace_context_base_expr::namespace_context_base_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr_kind_t kind, const namespace_context* aNSCtx) : - expr(ccb, sctx, loc, kind), + expr(ccb, sctx, udf, loc, kind), theNSCtx(const_cast(aNSCtx)) { } @@ -282,13 +259,14 @@ cast_or_castable_base_expr::cast_or_castable_base_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr_kind_t kind, expr* input, const xqtref_t& type) : - expr(ccb, sctx, loc, kind), - theInputExpr(input), + expr(ccb, sctx, udf, loc, kind), + theInput(input), theTargetType(type) { assert(type != NULL); @@ -312,9 +290,9 @@ void cast_or_castable_base_expr::compute_scripting_kind() { - checkNonUpdating(theInputExpr); + checkNonUpdating(theInput); - theScriptingKind = theInputExpr->get_scripting_detail(); + theScriptingKind = theInput->get_scripting_detail(); if (is_vacuous()) theScriptingKind = SIMPLE_EXPR; @@ -327,12 +305,13 @@ cast_base_expr::cast_base_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr_kind_t kind, expr* input, const xqtref_t& type) : - cast_or_castable_base_expr(ccb, sctx, loc, kind, input, type) + cast_or_castable_base_expr(ccb, sctx, udf, loc, kind, input, type) { setNonDiscardable(ANNOTATION_TRUE_FIXED); } @@ -346,29 +325,20 @@ cast_expr::cast_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inputExpr, - const xqtref_t& type) + const xqtref_t& type, + bool allowsEmptyInput) : - cast_base_expr(ccb, sctx, loc, cast_expr_kind, inputExpr, type) + cast_base_expr(ccb, sctx, udf, loc, cast_expr_kind, inputExpr, type), + theAllowsEmtpyInput(allowsEmptyInput) { assert(type->get_quantifier() == TypeConstants::QUANT_ONE || - type->get_quantifier() == TypeConstants::QUANT_QUESTION); -} - + type->get_quantifier() == TypeConstants::QUANT_QUESTION || + type->get_quantifier() == TypeConstants::QUANT_STAR); -bool cast_expr::is_optional() const -{ - return theTargetType->get_quantifier() == TypeConstants::QUANT_QUESTION; -} - - -expr* cast_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_cast_expr(theSctx, - get_loc(), - get_input()->clone(subst), - get_target_type()); + setNonDiscardable(ANNOTATION_TRUE_FIXED); } @@ -378,30 +348,20 @@ treat_expr::treat_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inputExpr, const xqtref_t& type, - TreatIterator::ErrorKind err, + TreatErrorKind err, bool check_prime, store::Item* qname) : - cast_base_expr(ccb, sctx, loc, treat_expr_kind, inputExpr, type), + cast_base_expr(ccb, sctx, udf, loc, treat_expr_kind, inputExpr, type), theErrorKind(err), theCheckPrime(check_prime), theQName(qname) { -} - - -expr* treat_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_treat_expr(theSctx, - get_loc(), - get_input()->clone(subst), - get_target_type(), - get_err(), - get_check_prime(), - get_qname()); + setNonDiscardable(ANNOTATION_TRUE_FIXED); } @@ -411,30 +371,22 @@ promote_expr::promote_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* input, const xqtref_t& type, - PromoteIterator::ErrorKind err, + PromoteErrorKind err, store::Item* qname) : - cast_base_expr(ccb, sctx, loc, promote_expr_kind, input, type), + cast_base_expr(ccb, sctx, udf, loc, promote_expr_kind, input, type), theErrorKind(err), theQName(qname) { assert(TypeOps::is_subtype(sctx->get_typemanager(), *type, *GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR)); -} - -expr* promote_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_promote_expr(theSctx, - get_loc(), - get_input()->clone(subst), - get_target_type(), - theErrorKind, - theQName.getp()); + setNonDiscardable(ANNOTATION_TRUE_FIXED); } @@ -444,12 +396,13 @@ castable_base_expr::castable_base_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr_kind_t kind, expr* input, const xqtref_t& type) : - cast_or_castable_base_expr(ccb, sctx, loc, kind, input, type) + cast_or_castable_base_expr(ccb, sctx, udf, loc, kind, input, type) { } @@ -462,27 +415,15 @@ castable_expr::castable_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inputExpr, - const xqtref_t& type) + const xqtref_t& type, + bool allowsEmtpyInput) : - castable_base_expr (ccb, sctx, loc, castable_expr_kind, inputExpr, type) -{ -} - - -bool castable_expr::is_optional() const -{ - return theTargetType->get_quantifier() == TypeConstants::QUANT_QUESTION; -} - - -expr* castable_expr::cloneImpl(substitution_t& subst) const + castable_base_expr(ccb, sctx, udf, loc, castable_expr_kind, inputExpr, type), + theAllowsEmtpyInput(allowsEmtpyInput) { - return theCCB->theEM->create_castable_expr(theSctx, - get_loc(), - get_input()->clone(subst), - get_target_type()); } @@ -492,38 +433,31 @@ instanceof_expr::instanceof_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inputExpr, const xqtref_t& type, bool checkPrimeOnly) : - castable_base_expr(ccb, sctx, loc, instanceof_expr_kind, inputExpr, type), + castable_base_expr(ccb, sctx, udf, loc, instanceof_expr_kind, inputExpr, type), theCheckPrimeOnly(checkPrimeOnly) { } -expr* instanceof_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_instanceof_expr(theSctx, - get_loc(), - get_input()->clone(subst), - get_target_type()); -} - - /***************************************************************************//** ********************************************************************************/ name_cast_expr::name_cast_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inputExpr, const namespace_context* aNSCtx, bool isAttrName) : - namespace_context_base_expr(ccb, sctx, loc, name_cast_expr_kind, aNSCtx), + namespace_context_base_expr(ccb, sctx, udf, loc, name_cast_expr_kind, aNSCtx), theInputExpr(inputExpr), theIsAttrName(isAttrName) { @@ -542,31 +476,25 @@ } -expr* name_cast_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_name_cast_expr(theSctx, - get_loc(), - get_input()->clone(subst), - getNSCtx(), - theIsAttrName); -} - - /***************************************************************************//** CompDocConstructor ::= "document" "{" Expr "}" ********************************************************************************/ doc_expr::doc_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aContent, bool copyNodes) : - expr(ccb, sctx, loc, doc_expr_kind), + expr(ccb, sctx, udf, loc, doc_expr_kind), theContent(aContent), theCopyInputNodes(copyNodes) { compute_scripting_kind(); + + setUnfoldable(ANNOTATION_TRUE_FIXED); + setConstructsNodes(ANNOTATION_TRUE_FIXED); } @@ -581,22 +509,13 @@ } -expr* doc_expr::cloneImpl(substitution_t& subst) const -{ - doc_expr* clone = theCCB->theEM->create_doc_expr(theSctx, - get_loc(), - CLONE(getContent(), subst), - theCopyInputNodes); - return clone; -} - - /***************************************************************************//** ********************************************************************************/ elem_expr::elem_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& aLoc, expr* aQNameExpr, expr* attrs, @@ -604,7 +523,7 @@ const namespace_context* aNSCtx, bool copyNodes) : - namespace_context_base_expr(ccb, sctx, aLoc, elem_expr_kind, aNSCtx), + namespace_context_base_expr(ccb, sctx, udf, aLoc, elem_expr_kind, aNSCtx), theQNameExpr(aQNameExpr), theAttrs(attrs), theContent(content), @@ -612,20 +531,26 @@ { compute_scripting_kind(); + // Node constructors are unfoldable because if a node constructor is inside + // a loop, then it will create a different xml tree every time it is invoked, + // even if the constructor itself is "constant" (i.e. does not reference any + // varialbes) setUnfoldable(ANNOTATION_TRUE_FIXED); + setConstructsNodes(ANNOTATION_TRUE_FIXED); } elem_expr::elem_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& aLoc, expr* aQNameExpr, expr* content, const namespace_context* aNSCtx, bool copyNodes) : - namespace_context_base_expr(ccb, sctx, aLoc, elem_expr_kind, aNSCtx), + namespace_context_base_expr(ccb, sctx, udf, aLoc, elem_expr_kind, aNSCtx), theQNameExpr(aQNameExpr), theAttrs(0), theContent(content), @@ -634,6 +559,7 @@ compute_scripting_kind(); setUnfoldable(ANNOTATION_TRUE_FIXED); + setConstructsNodes(ANNOTATION_TRUE_FIXED); } @@ -663,44 +589,34 @@ } -expr* elem_expr::cloneImpl(substitution_t& subst) const -{ - elem_expr* clone = theCCB->theEM->create_elem_expr(theSctx, - get_loc(), - CLONE(getQNameExpr(), subst), - CLONE(getAttrs(), subst), - CLONE(getContent(), subst), - getNSCtx(), - theCopyInputNodes); - return clone; -} - - /***************************************************************************//** ********************************************************************************/ attr_expr::attr_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aQNameExpr, expr* aValueExpr) : - expr(ccb, sctx, loc, attr_expr_kind), + expr(ccb, sctx, udf, loc, attr_expr_kind), theQNameExpr(aQNameExpr), theValueExpr(aValueExpr) { compute_scripting_kind(); setUnfoldable(ANNOTATION_TRUE_FIXED); + setConstructsNodes(ANNOTATION_TRUE_FIXED); } const store::Item* attr_expr::getQName() const { - const_expr* qnExpr = dynamic_cast(theQNameExpr); - if (qnExpr != 0) - return qnExpr->get_val(); + if (theQNameExpr->get_expr_kind() == const_expr_kind) + { + return static_cast(theQNameExpr)->get_val(); + } return 0; } @@ -730,15 +646,6 @@ } -expr* attr_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_attr_expr(theSctx, - get_loc(), - CLONE(getQNameExpr(), subst), - CLONE(getValueExpr(), subst)); -} - - DEF_EXPR_ACCEPT(attr_expr) @@ -748,17 +655,19 @@ text_expr::text_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, - text_constructor_type type_arg, + TextConstructorType type_arg, expr* content) : - expr(ccb, sctx, loc, text_expr_kind), + expr(ccb, sctx, udf, loc, text_expr_kind), type(type_arg), theContentExpr(content) { compute_scripting_kind(); setUnfoldable(ANNOTATION_TRUE_FIXED); + setConstructsNodes(ANNOTATION_TRUE_FIXED); } @@ -773,29 +682,25 @@ } -expr* text_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_text_expr(theSctx, get_loc(), get_type(), CLONE(get_text(), subst)); -} - - /***************************************************************************//** ********************************************************************************/ pi_expr::pi_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* targetExpr, expr* contentExpr) : - expr(ccb, sctx, loc, pi_expr_kind), + expr(ccb, sctx, udf, loc, pi_expr_kind), theTargetExpr(targetExpr), theContentExpr(contentExpr) { compute_scripting_kind(); setUnfoldable(ANNOTATION_TRUE_FIXED); + setConstructsNodes(ANNOTATION_TRUE_FIXED); } @@ -823,24 +728,19 @@ } -expr* pi_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_pi_expr(theSctx, - get_loc(), - CLONE(get_target_expr(), subst), - CLONE(get_content_expr(), subst)); -} - - - /******************************************************************************* Normally, it is used to wrap a var_expr in order to represent a var reference (see var_expr.h). But it may wrap any other kind of expr as well. ********************************************************************************/ -wrapper_expr::wrapper_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, expr* wrapped) +wrapper_expr::wrapper_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr* input) : - expr(ccb, sctx, loc, wrapper_expr_kind), - theWrappedExpr(wrapped) + expr(ccb, sctx, udf, loc, wrapper_expr_kind), + theInput(input) { compute_scripting_kind(); } @@ -848,37 +748,35 @@ void wrapper_expr::compute_scripting_kind() { - theScriptingKind = theWrappedExpr->get_scripting_detail(); -} - - -expr* wrapper_expr::cloneImpl(substitution_t& subst) const -{ - expr* e = theWrappedExpr->clone(subst); - - if (theWrappedExpr->get_expr_kind() == var_expr_kind && - e->get_expr_kind() != var_expr_kind) - return e; - else - return theCCB->theEM->create_wrapper_expr(theSctx, get_loc(), e); + theScriptingKind = theInput->get_scripting_detail(); } /***************************************************************************//** ********************************************************************************/ -const_expr::const_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, zstring& v) +const_expr::const_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + zstring& v) : - expr(ccb, sctx, loc, const_expr_kind) + expr(ccb, sctx, udf, loc, const_expr_kind) { GENV_ITEMFACTORY->createString(theValue, v); theScriptingKind = SIMPLE_EXPR; } -const_expr::const_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, const std::string& v) +const_expr::const_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + const std::string& v) : - expr(ccb, sctx, loc, const_expr_kind) + expr(ccb, sctx, udf, loc, const_expr_kind) { zstring tmp(v); GENV_ITEMFACTORY->createString(theValue, tmp); @@ -886,9 +784,14 @@ } -const_expr::const_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, const char* v) +const_expr::const_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + const char* v) : - expr(ccb, sctx, loc, const_expr_kind) + expr(ccb, sctx, udf, loc, const_expr_kind) { zstring tmp(v); GENV_ITEMFACTORY->createString(theValue, tmp); @@ -896,33 +799,42 @@ } -const_expr::const_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, xs_integer v) +const_expr::const_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + xs_integer v) : - expr(ccb, sctx, loc, const_expr_kind) + expr(ccb, sctx, udf, loc, const_expr_kind) { GENV_ITEMFACTORY->createInteger(theValue, v); theScriptingKind = SIMPLE_EXPR; } + const_expr::const_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, xs_decimal v) : - expr(ccb, sctx, loc, const_expr_kind) + expr(ccb, sctx, udf, loc, const_expr_kind) { GENV_ITEMFACTORY->createDecimal(theValue, v); theScriptingKind = SIMPLE_EXPR; } + const_expr::const_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, xs_double v) : - expr(ccb, sctx, loc, const_expr_kind) + expr(ccb, sctx, udf, loc, const_expr_kind) { GENV_ITEMFACTORY->createDouble(theValue, v); theScriptingKind = SIMPLE_EXPR; @@ -932,10 +844,11 @@ const_expr::const_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, xs_boolean v) : - expr(ccb, sctx, loc, const_expr_kind) + expr(ccb, sctx, udf, loc, const_expr_kind) { GENV_ITEMFACTORY->createBoolean(theValue, v); theScriptingKind = SIMPLE_EXPR; @@ -945,10 +858,11 @@ const_expr::const_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const store::Item_t& v) : - expr(ccb, sctx, loc, const_expr_kind), + expr(ccb, sctx, udf, loc, const_expr_kind), theValue(v) { theScriptingKind = SIMPLE_EXPR; @@ -958,12 +872,13 @@ const_expr::const_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& aLoc, const char* aNamespace, const char* aPrefix, const char* aLocal) : - expr(ccb, sctx, aLoc, const_expr_kind) + expr(ccb, sctx, udf, aLoc, const_expr_kind) { GENV_ITEMFACTORY->createQName(theValue, aNamespace, aPrefix, aLocal); theScriptingKind = SIMPLE_EXPR; @@ -976,21 +891,16 @@ } -expr* const_expr::cloneImpl(substitution_t&) const -{ - return theCCB->theEM->create_const_expr(theSctx, get_loc(), theValue); -} - - /******************************************************************************* ********************************************************************************/ extension_expr::extension_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc) : - expr(ccb, sctx, loc, extension_expr_kind) + expr(ccb, sctx, udf, loc, extension_expr_kind) { compute_scripting_kind(); } @@ -999,10 +909,11 @@ extension_expr::extension_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* e) : - expr(ccb, sctx, loc, extension_expr_kind), + expr(ccb, sctx, udf, loc, extension_expr_kind), theExpr(e) { compute_scripting_kind(); @@ -1020,23 +931,6 @@ } -expr* extension_expr::cloneImpl(substitution_t& subst) const -{ - extension_expr* lClone(0); - lClone = ( - theExpr == 0 ? theCCB->theEM->create_extension_expr(theSctx, get_loc()) - : theCCB->theEM->create_extension_expr(theSctx, get_loc(), theExpr->clone()) ); - // pragm doesn't contain expressions. Thus, it is not cloned. - for ( std::vector::const_iterator lIter = thePragmas.begin(); - lIter != thePragmas.end(); - ++lIter ) - { - lClone->add(*lIter); - } - return lClone; -} - - ///////////////////////////////////////////////////////////////////////// // // // XQuery 3.0 expressions // @@ -1049,7 +943,8 @@ ********************************************************************************/ catch_clause::catch_clause(CompilerCB* ccb) -:theCCB(ccb) + : + theCCB(ccb) { } @@ -1057,10 +952,11 @@ trycatch_expr::trycatch_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* tryExpr) : - expr(ccb, sctx, loc, trycatch_expr_kind), + expr(ccb, sctx, udf, loc, trycatch_expr_kind), theTryExpr(tryExpr) { compute_scripting_kind(); @@ -1145,6 +1041,7 @@ { lClause->add_nametest_h(lIter->getp()); } + for (var_map_t::const_iterator lIter = theVarMap.begin(); lIter != theVarMap.end(); ++lIter) @@ -1156,39 +1053,19 @@ } -expr* trycatch_expr::cloneImpl(substitution_t& subst) const -{ - std::auto_ptr lTryCatch( - theCCB->theEM->create_trycatch_expr(theSctx, get_loc(), theTryExpr->clone(subst))); - - for (std::vector::const_iterator lIter = theCatchExprs.begin(); - lIter != theCatchExprs.end(); - ++lIter) - { - lTryCatch->add_catch_expr((*lIter)->clone(subst)); - } - - for (csize i = 0; i < clause_count(); ++i) - { - lTryCatch->add_clause(theCatchClauses[i]->clone(subst)); - } - - return lTryCatch.release(); -} - - /******************************************************************************* ********************************************************************************/ eval_expr::eval_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* e, expr_script_kind_t scriptingKind, namespace_context* nsCtx) : - namespace_context_base_expr(ccb, sctx, loc, eval_expr_kind, nsCtx), + namespace_context_base_expr(ccb, sctx, udf, loc, eval_expr_kind, nsCtx), theExpr(e), theInnerScriptingKind(scriptingKind), theDoNodeCopy(false) @@ -1222,30 +1099,11 @@ } -expr* eval_expr::cloneImpl(substitution_t& s) const +void eval_expr::add_var(var_expr* var) { - eval_expr* new_eval = theCCB->theEM-> - create_eval_expr(theSctx, - theLoc, - theExpr->clone(s), - theInnerScriptingKind, - theNSCtx.getp()); - - new_eval->setNodeCopy(theDoNodeCopy); - - new_eval->theOuterVarNames = theOuterVarNames; - new_eval->theOuterVarTypes = theOuterVarTypes; - - csize numVars = theOuterVarNames.size(); - - new_eval->theArgs.resize(numVars); - - for (csize i = 0; i < numVars; ++i) - { - new_eval->theArgs[i] = theArgs[i]->clone(s); - } - - return new_eval; + theOuterVarNames.push_back(var->get_name()); + theOuterVarTypes.push_back(var->get_return_type()); + theArgs.push_back(var); } @@ -1256,12 +1114,13 @@ debugger_expr::debugger_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aChild, namespace_context* nsCtx, bool aIsVarDeclaration) : - namespace_context_base_expr(ccb, sctx, loc, debugger_expr_kind, nsCtx), + namespace_context_base_expr(ccb, sctx, udf, loc, debugger_expr_kind, nsCtx), theExpr(aChild), theIsVarDeclaration(aIsVarDeclaration) { @@ -1274,6 +1133,13 @@ theScriptingKind = theExpr->get_scripting_detail(); } + +void debugger_expr::add_var(var_expr* var, expr* arg) +{ + theVars.push_back(var); + theArgs.push_back(arg); +} + #endif @@ -1283,11 +1149,12 @@ function_trace_expr::function_trace_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, - expr* aChild) + expr* input) : - expr(ccb, sctx, loc, aChild->get_expr_kind()), - theExpr(aChild), + expr(ccb, sctx, udf, loc, function_trace_expr_kind), + theInput(input), theFunctionArity(0) { bool modified; @@ -1296,10 +1163,14 @@ } -function_trace_expr::function_trace_expr(expr* aExpr) +function_trace_expr::function_trace_expr(user_function* udf, expr* input) : - expr(aExpr->get_ccb(), aExpr->get_sctx(), aExpr->get_loc(), function_trace_expr_kind), - theExpr(aExpr), + expr(input->get_ccb(), + input->get_sctx(), + udf, + input->get_loc(), + function_trace_expr_kind), + theInput(input), theFunctionArity(0) { bool modified; @@ -1315,24 +1186,9 @@ void function_trace_expr::compute_scripting_kind() { - theScriptingKind = theExpr->get_scripting_detail(); + theScriptingKind = theInput->get_scripting_detail(); } -expr* function_trace_expr::cloneImpl(substitution_t& s) const -{ - function_trace_expr* clone = theCCB->theEM-> - create_function_trace_expr(theExpr->clone(s)); - - clone->theFunctionName = theFunctionName; - clone->theFunctionLocation = theFunctionLocation; - clone->theFunctionCallLocation = theFunctionCallLocation; - clone->theFunctionArity = theFunctionArity; - - return clone; -} - - - } /* namespace zorba */ /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/expr.h zorba-2.8.0-0/src/compiler/expression/expr.h --- zorba-2.7.0-0/src/compiler/expression/expr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr.h 2013-01-16 18:28:18.000000000 +0000 @@ -28,7 +28,7 @@ #include "functions/signature.h" -#include "compiler/expression/var_expr.h" +#include "compiler/expression/expr_base.h" #include "context/static_context.h" #include "context/namespace_context.h" @@ -37,7 +37,6 @@ #include "store/api/item.h" -#include "runtime/core/sequencetypes.h" namespace zorba { @@ -48,6 +47,7 @@ class signature; class pragma; + /******************************************************************************* [68] IfExpr ::= "if" "(" Expr ")" "then" ExprSingle "else" ExprSingle ********************************************************************************/ @@ -58,14 +58,15 @@ friend class expr; protected: - expr* theCondExpr; - expr* theThenExpr; - expr* theElseExpr; + expr * theCondExpr; + expr * theThenExpr; + expr * theElseExpr; protected: if_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* c, expr* t, @@ -80,8 +81,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -97,29 +96,26 @@ friend class ExprIterator; friend class expr; -public: - enum order_type_t - { - ordered, - unordered - }; - protected: - order_type_t theType; - expr* theExpr; + expr * theInput; + DocOrderMode theType; protected: - order_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&, order_type_t, expr*); + order_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + DocOrderMode, + expr*); public: - order_type_t get_type() const { return theType; } + expr* get_input() const { return theInput; } - expr* get_expr() const { return theExpr; } + DocOrderMode get_type() const { return theType; } void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -136,23 +132,24 @@ friend class expr; protected: - ParseConstants::validation_mode_t theMode; - store::Item_t theTypeName; - rchandle theTypeMgr; - expr* theExpr; + expr * theInput; + ParseConstants::validation_mode_t theMode; + store::Item_t theTypeName; + rchandle theTypeMgr; protected: validate_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc&, - ParseConstants::validation_mode_t, - const store::Item_t& aTypeName, - expr*, - rchandle); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + ParseConstants::validation_mode_t, + const store::Item_t& aTypeName, + expr*, + rchandle); public: - expr* get_expr() const { return theExpr; } + expr* get_input() const { return theInput; } const store::Item* get_type_name() const { return theTypeName; } @@ -162,8 +159,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -184,6 +179,7 @@ namespace_context_base_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr_kind_t kind, const namespace_context* aNSCtx); @@ -202,20 +198,21 @@ friend class expr; protected: - expr * theInputExpr; + expr * theInput; xqtref_t theTargetType; protected: cast_or_castable_base_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc& loc, - expr_kind_t kind, - expr* input, - const xqtref_t& type); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr_kind_t kind, + expr* input, + const xqtref_t& type); public: - expr* get_input() const { return theInputExpr; } + expr* get_input() const { return theInput; } xqtref_t get_target_type() const; @@ -234,12 +231,13 @@ protected: cast_base_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc& loc, - expr_kind_t kind, - expr* input, - const xqtref_t& type); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr_kind_t kind, + expr* input, + const xqtref_t& type); }; @@ -255,17 +253,20 @@ friend class expr; protected: + bool theAllowsEmtpyInput; + +protected: cast_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc&, expr*, - const xqtref_t&); + const xqtref_t&, + bool allowsEmptyInput); public: - bool is_optional() const; - - expr* cloneImpl(substitution_t& s) const; + bool allows_empty_input() const { return theAllowsEmtpyInput; } void accept(expr_visitor&); @@ -293,23 +294,24 @@ friend class expr; protected: - TreatIterator::ErrorKind theErrorKind; - bool theCheckPrime; - store::Item_t theQName; + TreatErrorKind theErrorKind; + bool theCheckPrime; + store::Item_t theQName; protected: treat_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc&, - expr*, - const xqtref_t&, - TreatIterator::ErrorKind err, - bool check_prime = true, - store::Item* qname = NULL); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr*, + const xqtref_t&, + TreatErrorKind err, + bool check_prime = true, + store::Item* qname = NULL); public: - TreatIterator::ErrorKind get_err() const { return theErrorKind; } + TreatErrorKind get_err() const { return theErrorKind; } bool get_check_prime() const { return theCheckPrime; } @@ -319,8 +321,6 @@ store::Item_t get_qname() const { return theQName; } - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -372,23 +372,22 @@ friend class expr; protected: - PromoteIterator::ErrorKind theErrorKind; - store::Item_t theQName; + PromoteErrorKind theErrorKind; + store::Item_t theQName; protected: promote_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* input, const xqtref_t& type, - PromoteIterator::ErrorKind err, + PromoteErrorKind err, store::Item* qname); public: - expr* cloneImpl(substitution_t& s) const; - - PromoteIterator::ErrorKind get_err() const { return theErrorKind; } + PromoteErrorKind get_err() const { return theErrorKind; } void set_qname(const store::Item_t& qname) { theQName = qname; } @@ -409,12 +408,13 @@ protected: castable_base_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc&, - expr_kind_t kind, - expr*, - const xqtref_t&); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr_kind_t kind, + expr*, + const xqtref_t&); }; @@ -430,17 +430,20 @@ friend class expr; protected: + bool theAllowsEmtpyInput; + +protected: castable_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc&, expr*, - const xqtref_t&); + const xqtref_t&, + bool allowsEmtpyInput); public: - bool is_optional() const; - - expr* cloneImpl(substitution_t& s) const; + bool allows_empty_input() const { return theAllowsEmtpyInput; } void accept(expr_visitor&); @@ -470,6 +473,7 @@ instanceof_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc&, expr*, const xqtref_t&, @@ -478,8 +482,6 @@ public: bool getCheckPrimeOnly() const { return theCheckPrimeOnly; } - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -503,13 +505,14 @@ friend class expr; private: - expr* theInputExpr; - bool theIsAttrName; + expr * theInputExpr; + bool theIsAttrName; protected: name_cast_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc&, expr*, const namespace_context*, @@ -522,8 +525,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -540,11 +541,17 @@ friend class expr; protected: - expr* theContent; - bool theCopyInputNodes; + expr * theContent; + bool theCopyInputNodes; protected: - doc_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&, expr* content, bool copyNodes); + doc_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr* content, + bool copyNodes); public: expr* getContent() const { return theContent; } @@ -555,8 +562,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -596,25 +601,27 @@ friend class expr; protected: - expr* theQNameExpr; - expr* theAttrs; - expr* theContent; - bool theCopyInputNodes; + expr * theQNameExpr; + expr * theAttrs; + expr * theContent; + bool theCopyInputNodes; protected: elem_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc&, - expr* qnameExpr, - expr* attrs, - expr* content, - const namespace_context* nsCtx, - bool copyNodes); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr* qnameExpr, + expr* attrs, + expr* content, + const namespace_context* nsCtx, + bool copyNodes); elem_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc&, expr* qnameExpr, expr* content, @@ -634,8 +641,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -673,16 +678,17 @@ friend class expr; protected: - expr* theQNameExpr; - expr* theValueExpr; + expr * theQNameExpr; + expr * theValueExpr; protected: attr_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc& loc, - expr* aQNameExpr, - expr* aValueExpr); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr* aQNameExpr, + expr* aValueExpr); public: expr* getQNameExpr() const { return theQNameExpr; } @@ -693,8 +699,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -710,34 +714,26 @@ friend class ExprIterator; friend class expr; -public: - typedef enum - { - text_constructor, - comment_constructor - } text_constructor_type; - protected: - text_constructor_type type; - expr* theContentExpr; + TextConstructorType type; + expr * theContentExpr; protected: text_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc&, - text_constructor_type, + TextConstructorType, expr*); public: expr* get_text() const { return theContentExpr; } - text_constructor_type get_type() const { return type; } + TextConstructorType get_type() const { return type; } void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -754,11 +750,17 @@ friend class expr; protected: - expr* theTargetExpr; - expr* theContentExpr; + expr * theTargetExpr; + expr * theContentExpr; protected: - pi_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&, expr*, expr*); + pi_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr*, + expr*); public: expr* get_target_expr() const { return theTargetExpr; } @@ -767,8 +769,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -788,31 +788,76 @@ store::Item_t theValue; protected: - const_expr(CompilerCB*, static_context*, const QueryLoc&, zstring& sval); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + zstring& sval); - const_expr(CompilerCB*, static_context*, const QueryLoc&, const std::string& sval); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + const std::string& sval); - const_expr(CompilerCB*, static_context*, const QueryLoc&, const char* sval); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + const char* sval); - const_expr(CompilerCB*, static_context*, const QueryLoc&, xs_integer); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + xs_integer); - const_expr(CompilerCB*, static_context*, const QueryLoc&, xs_decimal); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + xs_decimal); - const_expr(CompilerCB*, static_context*, const QueryLoc&, xs_double); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + xs_double); - const_expr(CompilerCB*, static_context*, const QueryLoc&, xs_boolean); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + xs_boolean); - const_expr(CompilerCB*, static_context*, const QueryLoc&, const store::Item_t&); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + const store::Item_t&); - const_expr(CompilerCB*, static_context*, const QueryLoc&, const char* ns, const char* pre, const char* local); + const_expr( + CompilerCB*, + static_context*, + user_function* udf, + const QueryLoc&, + const char* ns, + const char* pre, + const char* local); public: store::Item* get_val() const { return theValue.getp(); } void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -829,13 +874,22 @@ friend class expr; protected: - std::vector thePragmas; - expr* theExpr; + std::vector thePragmas; + expr * theExpr; protected: - extension_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&); + extension_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&); - extension_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&, expr*); + extension_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr*); public: void add(pragma* p) { thePragmas.push_back(p); } @@ -844,8 +898,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& subst) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -934,7 +986,12 @@ std::vector theCatchClauses; protected: - trycatch_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&, expr* tryExpr); + trycatch_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr* tryExpr); public: expr* get_try_expr() const { return theTryExpr; } @@ -953,8 +1010,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& subst) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -979,22 +1034,25 @@ friend class ExprManager; protected: - expr* theWrappedExpr; + expr * theInput; protected: - wrapper_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, expr* wrapped); + wrapper_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr* wrapped); public: - expr* get_expr() const { return theWrappedExpr; } + expr* get_input() const { return theInput; } - void set_expr(expr* e) { theWrappedExpr = e;} + void set_expr(expr* e) { theInput = e;} void compute_scripting_kind(); void accept(expr_visitor&); - expr* cloneImpl(substitution_t& s) const; - std::ostream& put(std::ostream&) const; }; @@ -1009,34 +1067,35 @@ friend class ExprManager; protected: - expr* theExpr; - store::Item_t theFunctionName; - QueryLoc theFunctionLocation; - QueryLoc theFunctionCallLocation; - unsigned int theFunctionArity; + expr * theInput; + store::Item_t theFunctionName; + QueryLoc theFunctionLocation; + QueryLoc theFunctionCallLocation; + unsigned int theFunctionArity; protected: function_trace_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aChild); - function_trace_expr(expr* aExpr); + function_trace_expr( + user_function* udf, + expr* aExpr); public: virtual ~function_trace_expr(); + expr* get_input() const { return theInput; } + void compute_scripting_kind(); void accept(expr_visitor&); - expr* cloneImpl(substitution_t& s) const; - std::ostream& put(std::ostream&) const; - expr* get_expr() const { return theExpr; } - void setFunctionName(store::Item_t aFunctionName) { theFunctionName = aFunctionName; @@ -1133,6 +1192,7 @@ eval_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* e, expr_script_kind_t scriptingKind, @@ -1149,12 +1209,7 @@ const std::vector& get_var_types() const { return theOuterVarTypes; } - void add_var(var_expr* var) - { - theOuterVarNames.push_back(var->get_name()); - theOuterVarTypes.push_back(var->get_return_type()); - theArgs.push_back(var); - } + void add_var(var_expr* var); expr_script_kind_t get_inner_scripting_kind() const; @@ -1166,8 +1221,6 @@ void accept(expr_visitor&); - expr* cloneImpl(substitution_t& s) const; - std::ostream& put(std::ostream&) const; }; @@ -1205,6 +1258,7 @@ debugger_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aChild, namespace_context* nsCtx, @@ -1223,11 +1277,7 @@ const var_expr* get_var(csize i) const { return theVars[i]; } - void add_var(var_expr* var, expr* arg) - { - theVars.push_back(var); - theArgs.push_back(arg); - } + void add_var(var_expr* var, expr* arg); void compute_scripting_kind(); }; diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_base.cpp zorba-2.8.0-0/src/compiler/expression/expr_base.cpp --- zorba-2.7.0-0/src/compiler/expression/expr_base.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_base.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -19,8 +19,8 @@ #include "compiler/expression/expr.h" #include "compiler/expression/fo_expr.h" #include "compiler/expression/flwor_expr.h" -#include "compiler/expression/script_exprs.h" #include "compiler/expression/path_expr.h" +#include "compiler/expression/script_exprs.h" #include "compiler/expression/expr_iter.h" #include "compiler/expression/expr_visitor.h" #include "compiler/expression/expr_manager.h" @@ -123,19 +123,45 @@ /******************************************************************************* ********************************************************************************/ -expr::expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, expr_kind_t k) +expr::expr() : + theCCB(NULL), + theSctx(NULL), + theUDF(NULL), + theAnnotationFlags(0), + theBoolFlags(0), + theVisitId(0) +{ +} + + +/******************************************************************************* + +********************************************************************************/ +expr::expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr_kind_t k) + : + theCCB(ccb), theSctx(sctx), + theUDF(udf), theLoc(loc), theKind(k), - theFlags1(0), - theCCB(ccb) + theAnnotationFlags(0), + theBoolFlags(0), + theVisitId(0) { theScriptingKind = UNKNOWN_SCRIPTING_KIND; // This is the default. The constructors for certain exprs set different values. setNonDiscardable(ANNOTATION_FALSE); setUnfoldable(ANNOTATION_FALSE); + setContainsRecursiveCall(ANNOTATION_FALSE); + setConstructsNodes(ANNOTATION_FALSE); + setDereferencesNodes(ANNOTATION_FALSE); } @@ -239,40 +265,6 @@ /******************************************************************************* ********************************************************************************/ -expr* expr::clone() const -{ - substitution_t subst; - return clone(subst); -} - - -expr* expr::clone(substitution_t& subst) const -{ - expr* lNewExpr = cloneImpl(subst); - - if (containsPragma()) - { - lNewExpr->setContainsPragma(ANNOTATION_TRUE); - std::vector lPragmas; - theCCB->lookup_pragmas(this, lPragmas); - for (size_t i = 0; i < lPragmas.size(); ++i) - { - theCCB->add_pragma(lNewExpr, lPragmas[i]); - } - } - return lNewExpr; -} - - -expr* expr::cloneImpl(substitution_t& subst) const -{ - throw XQUERY_EXCEPTION(zerr::ZXQP0003_INTERNAL_ERROR, ERROR_LOC(get_loc())); -} - - -/******************************************************************************* - -********************************************************************************/ void expr::accept_children(expr_visitor& v) { ExprIterator iter(this); @@ -326,12 +318,20 @@ setIgnoresDuplicateNodes(ANNOTATION_UNKNOWN); if (getNonDiscardable() != ANNOTATION_TRUE_FIXED) - setNonDiscardable(ANNOTATION_UNKNOWN); + setNonDiscardable(ANNOTATION_FALSE); if (getUnfoldable() != ANNOTATION_TRUE_FIXED) - setUnfoldable(ANNOTATION_UNKNOWN); + setUnfoldable(ANNOTATION_FALSE); + + setContainsRecursiveCall(ANNOTATION_FALSE); + + if (getConstructsNodes() != ANNOTATION_TRUE_FIXED) + setConstructsNodes(ANNOTATION_FALSE); - //theFlags1 = 0; + if (getDereferencesNodes() != ANNOTATION_TRUE_FIXED) + setDereferencesNodes(ANNOTATION_FALSE); + + //theAnnotationFlags = 0; //setNonDiscardable(ANNOTATION_FALSE); //setUnfoldable(ANNOTATION_FALSE); @@ -377,14 +377,14 @@ ********************************************************************************/ BoolAnnotationValue expr::getProducesSortedNodes() const { - return (BoolAnnotationValue)(theFlags1 & PRODUCES_SORTED_NODES_MASK); + return (BoolAnnotationValue)(theAnnotationFlags & PRODUCES_SORTED_NODES_MASK); } void expr::setProducesSortedNodes(BoolAnnotationValue v) { - theFlags1 &= ~PRODUCES_SORTED_NODES_MASK; - theFlags1 |= v; + theAnnotationFlags &= ~PRODUCES_SORTED_NODES_MASK; + theAnnotationFlags |= v; } @@ -401,14 +401,14 @@ BoolAnnotationValue expr::getProducesDistinctNodes() const { return (BoolAnnotationValue) - ((theFlags1 & PRODUCES_DISTINCT_NODES_MASK) >> PRODUCES_DISTINCT_NODES); + ((theAnnotationFlags & PRODUCES_DISTINCT_NODES_MASK) >> PRODUCES_DISTINCT_NODES); } void expr::setProducesDistinctNodes(BoolAnnotationValue v) { - theFlags1 &= ~PRODUCES_DISTINCT_NODES_MASK; - theFlags1 |= (v << PRODUCES_DISTINCT_NODES); + theAnnotationFlags &= ~PRODUCES_DISTINCT_NODES_MASK; + theAnnotationFlags |= (v << PRODUCES_DISTINCT_NODES); } @@ -425,14 +425,14 @@ BoolAnnotationValue expr::getIgnoresSortedNodes() const { return (BoolAnnotationValue) - ((theFlags1 & IGNORES_SORTED_NODES_MASK) >> IGNORES_SORTED_NODES); + ((theAnnotationFlags & IGNORES_SORTED_NODES_MASK) >> IGNORES_SORTED_NODES); } void expr::setIgnoresSortedNodes(BoolAnnotationValue v) { - theFlags1 &= ~IGNORES_SORTED_NODES_MASK; - theFlags1 |= (v << IGNORES_SORTED_NODES); + theAnnotationFlags &= ~IGNORES_SORTED_NODES_MASK; + theAnnotationFlags |= (v << IGNORES_SORTED_NODES); } @@ -449,14 +449,14 @@ BoolAnnotationValue expr::getIgnoresDuplicateNodes() const { return (BoolAnnotationValue) - ((theFlags1 & IGNORES_DUPLICATE_NODES_MASK) >> IGNORES_DUPLICATE_NODES); + ((theAnnotationFlags & IGNORES_DUPLICATE_NODES_MASK) >> IGNORES_DUPLICATE_NODES); } void expr::setIgnoresDuplicateNodes(BoolAnnotationValue v) { - theFlags1 &= ~IGNORES_DUPLICATE_NODES_MASK; - theFlags1 |= (v << IGNORES_DUPLICATE_NODES); + theAnnotationFlags &= ~IGNORES_DUPLICATE_NODES_MASK; + theAnnotationFlags |= (v << IGNORES_DUPLICATE_NODES); } @@ -472,14 +472,14 @@ BoolAnnotationValue expr::getNonDiscardable() const { return (BoolAnnotationValue) - ((theFlags1 & NON_DISCARDABLE_MASK) >> NON_DISCARDABLE); + ((theAnnotationFlags & NON_DISCARDABLE_MASK) >> NON_DISCARDABLE); } void expr::setNonDiscardable(BoolAnnotationValue v) { - theFlags1 &= ~NON_DISCARDABLE_MASK; - theFlags1 |= (v << NON_DISCARDABLE); + theAnnotationFlags &= ~NON_DISCARDABLE_MASK; + theAnnotationFlags |= (v << NON_DISCARDABLE); } @@ -496,14 +496,14 @@ BoolAnnotationValue expr::getUnfoldable() const { return (BoolAnnotationValue) - ((theFlags1 & UNFOLDABLE_MASK) >> UNFOLDABLE); + ((theAnnotationFlags & UNFOLDABLE_MASK) >> UNFOLDABLE); } void expr::setUnfoldable(BoolAnnotationValue v) { - theFlags1 &= ~UNFOLDABLE_MASK; - theFlags1 |= (v << UNFOLDABLE); + theAnnotationFlags &= ~UNFOLDABLE_MASK; + theAnnotationFlags |= (v << UNFOLDABLE); } @@ -520,14 +520,14 @@ BoolAnnotationValue expr::getContainsRecursiveCall() const { return (BoolAnnotationValue) - ((theFlags1 & CONTAINS_RECURSIVE_CALL_MASK) >> CONTAINS_RECURSIVE_CALL); + ((theAnnotationFlags & CONTAINS_RECURSIVE_CALL_MASK) >> CONTAINS_RECURSIVE_CALL); } void expr::setContainsRecursiveCall(BoolAnnotationValue v) { - theFlags1 &= ~CONTAINS_RECURSIVE_CALL_MASK; - theFlags1 |= (v << CONTAINS_RECURSIVE_CALL); + theAnnotationFlags &= ~CONTAINS_RECURSIVE_CALL_MASK; + theAnnotationFlags |= (v << CONTAINS_RECURSIVE_CALL); } @@ -541,47 +541,73 @@ /******************************************************************************* ********************************************************************************/ -BoolAnnotationValue expr::getInUnsafeContext() const +BoolAnnotationValue expr::getContainsPragma() const { return (BoolAnnotationValue) - ((theFlags1 & IN_UNSAFE_CONTEXT_MASK) >> IN_UNSAFE_CONTEXT); + ((theAnnotationFlags & CONTAINS_PRAGMA_MASK) >> CONTAINS_PRAGMA); } -void expr::setInUnsafeContext(BoolAnnotationValue v) +void expr::setContainsPragma(BoolAnnotationValue v) { - theFlags1 &= ~IN_UNSAFE_CONTEXT_MASK; - theFlags1 |= (v << IN_UNSAFE_CONTEXT); + theAnnotationFlags &= ~CONTAINS_PRAGMA_MASK; + theAnnotationFlags |= (v << CONTAINS_PRAGMA); } -bool expr::inUnsafeContext() const +bool expr::containsPragma() const { - BoolAnnotationValue v = getInUnsafeContext(); + BoolAnnotationValue v = getContainsPragma(); return (v == ANNOTATION_TRUE || v == ANNOTATION_TRUE_FIXED); } /******************************************************************************* + This annotation tells whether any nodes may be constructed during the + evaluation of the expr. +********************************************************************************/ +BoolAnnotationValue expr::getConstructsNodes() const +{ + return (BoolAnnotationValue) + ((theAnnotationFlags & CONSTRUCTS_NODES_MASK) >> CONSTRUCTS_NODES); +} + + +void expr::setConstructsNodes(BoolAnnotationValue v) +{ + theAnnotationFlags &= ~CONSTRUCTS_NODES_MASK; + theAnnotationFlags |= (v << CONSTRUCTS_NODES); +} + + +bool expr::constructsNodes() const +{ + BoolAnnotationValue v = getConstructsNodes(); + return (v == ANNOTATION_TRUE || v == ANNOTATION_TRUE_FIXED); +} + +/******************************************************************************* + This annotation tells whether any nodes may be dereferenced during the + evaluation of the expr. ********************************************************************************/ -BoolAnnotationValue expr::getContainsPragma() const +BoolAnnotationValue expr::getDereferencesNodes() const { return (BoolAnnotationValue) - ((theFlags1 & CONTAINS_PRAGMA_MASK) >> CONTAINS_PRAGMA); + ((theAnnotationFlags & DEREFERENCES_NODES_MASK) >> DEREFERENCES_NODES); } -void expr::setContainsPragma(BoolAnnotationValue v) +void expr::setDereferencesNodes(BoolAnnotationValue v) { - theFlags1 &= ~CONTAINS_PRAGMA_MASK; - theFlags1 |= (v << CONTAINS_PRAGMA); + theAnnotationFlags &= ~DEREFERENCES_NODES_MASK; + theAnnotationFlags |= (v << DEREFERENCES_NODES); } -bool expr::containsPragma() const +bool expr::dereferencesNodes() const { - BoolAnnotationValue v = getContainsPragma(); + BoolAnnotationValue v = getDereferencesNodes(); return (v == ANNOTATION_TRUE || v == ANNOTATION_TRUE_FIXED); } @@ -597,14 +623,14 @@ BoolAnnotationValue expr::getMustCopyNodes() const { return (BoolAnnotationValue) - ((theFlags1 & MUST_COPY_NODES_MASK) >> MUST_COPY_NODES); + ((theAnnotationFlags & MUST_COPY_NODES_MASK) >> MUST_COPY_NODES); } void expr::setMustCopyNodes(BoolAnnotationValue v) { - theFlags1 &= ~MUST_COPY_NODES_MASK; - theFlags1 |= (v << MUST_COPY_NODES); + theAnnotationFlags &= ~MUST_COPY_NODES_MASK; + theAnnotationFlags |= (v << MUST_COPY_NODES); } @@ -680,40 +706,6 @@ /******************************************************************************* - Check if the expr tree rooted at e contains any node-constructor expr. If so, - e cannot be hoisted. -********************************************************************************/ -bool expr::contains_node_construction() const -{ - expr_kind_t kind = get_expr_kind(); - - if (kind == elem_expr_kind || - kind == attr_expr_kind || - kind == text_expr_kind || - kind == doc_expr_kind || - kind == pi_expr_kind) - { - return true; - } - - ExprConstIterator iter(this); - while(!iter.done()) - { - const expr* ce = iter.get_expr(); - if (ce) - { - if (ce->contains_node_construction()) - { - return true; - } - } - iter.next(); - } - return false; -} - - -/******************************************************************************* ********************************************************************************/ void expr::get_exprs_of_kind( @@ -787,8 +779,7 @@ while (kind == wrapper_expr_kind) { - const wrapper_expr* wrapperExpr = static_cast(currExpr); - currExpr = wrapperExpr->get_expr(); + currExpr = static_cast(currExpr)->get_input(); kind = currExpr->get_expr_kind(); } @@ -855,14 +846,14 @@ case order_expr_kind: { - const order_expr* orderExpr = static_cast(this); - return orderExpr->get_expr()->is_map_internal(e, found); + return static_cast(this)->get_input()-> + is_map_internal(e, found); } case wrapper_expr_kind: { - const wrapper_expr* wrapperExpr = static_cast(this); - return wrapperExpr->get_expr()->is_map_internal(e, found); + return static_cast(this)->get_input()-> + is_map_internal(e, found); } case const_expr_kind: @@ -917,7 +908,9 @@ if (found) break; - if (clause->get_expr()->is_map_internal(e, found) && found) + const forlet_clause* fc = static_cast(clause); + + if (fc->get_expr()->is_map_internal(e, found) && found) { break; } @@ -929,12 +922,25 @@ break; } case flwor_clause::let_clause: + { + if (found) + break; + + const forlet_clause* lc = static_cast(clause); + + if (lc->get_expr()->contains_expr(e)) + return false; + + break; + } case flwor_clause::where_clause: { if (found) break; - if (clause->get_expr()->contains_expr(e)) + const where_clause* wc = static_cast(clause); + + if (wc->get_expr()->contains_expr(e)) return false; break; @@ -944,17 +950,18 @@ if (found) break; - if (clause->get_expr()->contains_expr(e)) + const window_clause* wc = static_cast(clause); + + if (wc->get_expr()->contains_expr(e)) return false; - const window_clause* wc = static_cast(clause); flwor_wincond* startCond = wc->get_win_start(); flwor_wincond* stopCond = wc->get_win_stop(); - if (startCond && startCond->get_cond()->contains_expr(e)) + if (startCond && startCond->get_expr()->contains_expr(e)) return false; - if (stopCond && stopCond->get_cond()->contains_expr(e)) + if (stopCond && stopCond->get_expr()->contains_expr(e)) return false; break; @@ -1164,10 +1171,10 @@ TypeManager* tm = sctx->get_typemanager(); - const const_expr* qnameExpr = dynamic_cast(this); - - if (qnameExpr != NULL) + if (get_expr_kind() == const_expr_kind) { + const const_expr* qnameExpr = static_cast(this); + xqtref_t valueType = tm->create_value_type(qnameExpr->get_val()); if (TypeOps::is_subtype(tm, *valueType, *rtm.QNAME_TYPE_ONE, get_loc())) @@ -1188,10 +1195,10 @@ dataExpr->get_func()->getKind() == FunctionConsts::FN_DATA_1) { argExpr = dataExpr->get_arg(0); - const const_expr* qnameExpr = dynamic_cast(argExpr); - if (qnameExpr != NULL) + if (argExpr->get_expr_kind() == const_expr_kind) { + const const_expr* qnameExpr = static_cast(argExpr); xqtref_t valueType = tm->create_value_type(qnameExpr->get_val()); if (TypeOps::is_subtype(tm, *valueType, *rtm.QNAME_TYPE_ONE, get_loc())) @@ -1212,13 +1219,18 @@ ********************************************************************************/ xqtref_t expr::get_return_type_with_empty_input(const expr* input) const { - expr* emptyExpr = theCCB->theEM->create_fo_expr(input->get_sctx(), - QueryLoc::null, - GET_BUILTIN_FUNCTION(OP_CONCATENATE_N)); + assert(input->get_udf() == theUDF); + + expr* emptyExpr = theCCB->theEM-> + create_fo_expr(input->get_sctx(), + theUDF, + QueryLoc::null, + BUILTIN_FUNC(OP_CONCATENATE_N)); + expr::substitution_t subst; subst[input] = emptyExpr; - expr* cloneExpr = clone(subst); + expr* cloneExpr = clone(theUDF, subst); return cloneExpr->get_return_type(); } diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_base.h zorba-2.8.0-0/src/compiler/expression/expr_base.h --- zorba-2.7.0-0/src/compiler/expression/expr_base.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_base.h 2013-01-16 18:28:18.000000000 +0000 @@ -17,6 +17,8 @@ #ifndef ZORBA_COMPILER_EXPR_BASE #define ZORBA_COMPILER_EXPR_BASE +#include + #include #include "common/shared_types.h" @@ -27,7 +29,7 @@ #include "functions/function_consts.h" -#include "types/typeimpl.h" +//#include "types/typeimpl.h" #include "context/static_context_consts.h" @@ -122,11 +124,9 @@ ********************************************************************************/ class expr { - friend class expr_iterator_data; friend class ExprIterator; friend class forletwin_clause; - friend class for_clause; - friend class let_clause; + friend class forlet_clause; friend class where_clause; friend class function_trace_expr; @@ -135,7 +135,7 @@ typedef substitution_t::iterator subst_iter_t; - typedef std::set FreeVars; + typedef std::set FreeVars; typedef enum { @@ -147,9 +147,10 @@ UNFOLDABLE = 10, CONTAINS_RECURSIVE_CALL = 12, PROPAGATES_INPUT_NODES = 14, - IN_UNSAFE_CONTEXT = 16, - MUST_COPY_NODES = 18, - CONTAINS_PRAGMA = 20 + MUST_COPY_NODES = 16, + CONTAINS_PRAGMA = 18, + CONSTRUCTS_NODES = 20, + DEREFERENCES_NODES = 22 } Annotationkey; typedef enum @@ -162,31 +163,44 @@ UNFOLDABLE_MASK = 0xC00, CONTAINS_RECURSIVE_CALL_MASK = 0x3000, PROPAGATES_INPUT_NODES_MASK = 0xC000, - IN_UNSAFE_CONTEXT_MASK = 0x30000, - MUST_COPY_NODES_MASK = 0xC0000, - CONTAINS_PRAGMA_MASK = 0x300000 + MUST_COPY_NODES_MASK = 0x30000, + CONTAINS_PRAGMA_MASK = 0xC0000, + CONSTRUCTS_NODES_MASK = 0x300000, + DEREFERENCES_NODES_MASK = 0xC00000 } AnnotationMask; + typedef enum + { + IN_TYPE_COMPUTE = 0x1 + } BoolFlags; + protected: static expr* iter_end_expr; static expr* * iter_done; protected: + CompilerCB * const theCCB; + static_context * theSctx; + user_function * theUDF; + QueryLoc theLoc; unsigned short theKind; + unsigned short theScriptingKind; xqtref_t theType; - uint32_t theFlags1; + uint32_t theAnnotationFlags; - FreeVars theFreeVars; + uint8_t theBoolFlags; + + uint8_t theVisitId; - CompilerCB *const theCCB; + FreeVars theFreeVars; public: static bool is_sequential(unsigned short theScriptingKind); @@ -196,14 +210,20 @@ static void checkNonUpdating(const expr* e); protected: - expr(CompilerCB*, static_context*, const QueryLoc&, expr_kind_t); + expr(CompilerCB*, static_context*, user_function*, const QueryLoc&, expr_kind_t); - expr() : theSctx(NULL), theFlags1(0), theCCB(NULL) {} + expr(); public: virtual ~expr(); - CompilerCB* get_ccb() {return theCCB;} + CompilerCB* get_ccb() { return theCCB; } + + static_context* get_sctx() const { return theSctx; } + + TypeManager* get_type_manager() const; + + user_function* get_udf() const { return theUDF; } expr_kind_t get_expr_kind() const { return static_cast(theKind); } @@ -211,13 +231,9 @@ void set_loc(const QueryLoc& loc) { theLoc = loc; } - static_context* get_sctx() const { return theSctx; } - - TypeManager* get_type_manager() const; - - uint32_t getFlags() const { return theFlags1; } + uint32_t getAnnotationFlags() const { return theAnnotationFlags; } - void setFlags(uint32_t flags) { theFlags1 = flags; } + void setAnnotationFlags(uint32_t flags) { theAnnotationFlags = flags; } unsigned short get_scripting_detail() const { return theScriptingKind; } @@ -241,11 +257,9 @@ xqtref_t get_return_type(); - expr* clone() const; - - expr* clone(substitution_t&) const; + expr* clone(user_function* udf) const; - virtual expr* cloneImpl(substitution_t& substitution) const; + expr* clone(user_function* udf, substitution_t& subst) const; virtual void accept(expr_visitor& v) = 0; @@ -256,6 +270,20 @@ std::string toString() const; public: + // + void setVisitId(uint8_t id) { theVisitId = id; } + + bool isVisited(uint8_t id) const { return theVisitId == id; } + + uint8_t getVisitId() const { return theVisitId; } + + // Transient flag used only during the type computation for global vars + bool isInTypeCompute() const { return theBoolFlags & IN_TYPE_COMPUTE; } + + void setInTypeCompute() { theBoolFlags |= IN_TYPE_COMPUTE; } + + void resetInTypeCompute() { theBoolFlags &= ~IN_TYPE_COMPUTE; } + // Annotation : produces-sorted-nodes BoolAnnotationValue getProducesSortedNodes() const; @@ -315,13 +343,6 @@ void setMustCopyNodes(BoolAnnotationValue v); - // Annotation : inUnsafeContext - BoolAnnotationValue getInUnsafeContext() const; - - void setInUnsafeContext(BoolAnnotationValue v); - - bool inUnsafeContext() const; - // Annotation : containsPragma BoolAnnotationValue getContainsPragma() const; @@ -329,6 +350,20 @@ bool containsPragma() const; + // Annotation : constructsNodes + BoolAnnotationValue getConstructsNodes() const; + + void setConstructsNodes(BoolAnnotationValue v); + + bool constructsNodes() const; + + // Annotation : dereferencesNodes + BoolAnnotationValue getDereferencesNodes() const; + + void setDereferencesNodes(BoolAnnotationValue v); + + bool dereferencesNodes() const; + // Annotation : free vars const FreeVars& getFreeVars() const { return theFreeVars; } @@ -336,6 +371,7 @@ void setFreeVars(FreeVars& s); + // bool is_constant() const; bool is_nondeterministic() const; @@ -344,8 +380,6 @@ bool contains_expr(const expr* e) const; - bool contains_node_construction() const; - void get_exprs_of_kind( expr_kind_t kind, bool deep, diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_clone.cpp zorba-2.8.0-0/src/compiler/expression/expr_clone.cpp --- zorba-2.7.0-0/src/compiler/expression/expr_clone.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_clone.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,794 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "stdafx.h" +#include "compiler/expression/expr_base.h" +#include "compiler/expression/update_exprs.h" +#include "compiler/expression/expr.h" +#include "compiler/expression/fo_expr.h" +#include "compiler/expression/flwor_expr.h" +#include "compiler/expression/script_exprs.h" +#include "compiler/expression/path_expr.h" +#include "compiler/expression/json_exprs.h" +#include "compiler/expression/function_item_expr.h" +#include "compiler/expression/ft_expr.h" +#include "compiler/expression/ftnode.h" +#include "compiler/expression/expr_manager.h" + +#include "compiler/api/compilercb.h" + +#include "functions/function.h" + +#include "diagnostics/xquery_diagnostics.h" +#include "diagnostics/util_macros.h" + +namespace zorba +{ + +#define CLONE(e, udf, subst) ((e) == NULL ? NULL : (e)->clone(udf, subst)) + + +/******************************************************************************* + +********************************************************************************/ +expr* expr::clone(user_function* udf) const +{ + substitution_t subst; + return clone(udf, subst); +} + + +expr* expr::clone(user_function* udf, substitution_t& subst) const +{ + expr* newExpr = NULL; + + switch (get_expr_kind()) + { + case const_expr_kind: + { + const const_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_const_expr(theSctx, udf, theLoc, e->theValue); + + break; + } + case var_expr_kind: + { + expr::subst_iter_t i = subst.find(this); + + if (i == subst.end()) + newExpr = const_cast(this); + else + newExpr = i->second; + + break; + } + case doc_expr_kind: + { + const doc_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_doc_expr(theSctx, + udf, + theLoc, + CLONE(e->getContent(), udf, subst), + e->theCopyInputNodes); + break; + } + case elem_expr_kind: + { + const elem_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_elem_expr(theSctx, + udf, + theLoc, + CLONE(e->getQNameExpr(), udf, subst), + CLONE(e->getAttrs(), udf, subst), + CLONE(e->getContent(), udf, subst), + e->getNSCtx(), + e->theCopyInputNodes); + break; + } + case attr_expr_kind: + { + const attr_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_attr_expr(theSctx, + udf, + theLoc, + CLONE(e->getQNameExpr(), udf, subst), + CLONE(e->getValueExpr(), udf, subst)); + break; + } + case text_expr_kind: + { + const text_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_text_expr(theSctx, + udf, + theLoc, + e->get_type(), + CLONE(e->get_text(), udf, subst)); + break; + } + case pi_expr_kind: + { + const pi_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_pi_expr(theSctx, + udf, + theLoc, + CLONE(e->get_target_expr(), udf, subst), + CLONE(e->get_content_expr(), udf, subst)); + break; + } +#ifdef ZORBA_WITH_JSON + case json_direct_object_expr_kind: + { + const json_direct_object_expr* e = static_cast(this); + + std::vector names; + std::vector values; + + names.reserve(e->theNames.size()); + values.reserve(e->theValues.size()); + + std::vector::const_iterator ite = e->theNames.begin(); + std::vector::const_iterator end = e->theNames.end(); + for (; ite != end; ++ite) + { + names.push_back((*ite)->clone(udf, subst)); + } + + ite = e->theValues.begin(); + end = e->theValues.end(); + for (; ite != end; ++ite) + { + values.push_back((*ite)->clone(udf, subst)); + } + + newExpr = theCCB->theEM-> + create_json_direct_object_expr(theSctx, udf, theLoc, names, values); + + break; + } + case json_object_expr_kind: + { + const json_object_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_json_object_expr(theSctx, + udf, + theLoc, + (e->theContentExpr ? + e->theContentExpr->clone(udf, subst) : NULL), + e->theAccumulate); + + break; + } + case json_array_expr_kind: + { + const json_array_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_json_array_expr(theSctx, + udf, + theLoc, + e->theContentExpr->clone(udf, subst)); + + break; + } +#endif + + case relpath_expr_kind: + { + const relpath_expr* e = static_cast(this); + + relpath_expr* cloneExpr = theCCB->theEM-> + create_relpath_expr(theSctx, udf, theLoc); + + for (csize i = 0; i < e->size(); ++i) + { + cloneExpr->add_back((*e)[i]->clone(udf, subst)); + } + + newExpr = cloneExpr; + break; + } + case axis_step_expr_kind: + { + const axis_step_expr* e = static_cast(this); + + axis_step_expr* cloneExpr = theCCB->theEM-> + create_axis_step_expr(theSctx, udf, theLoc); + + cloneExpr->setAxis(e->getAxis()); + cloneExpr->setTest(static_cast(CLONE(e->getTest(), udf, subst))); + cloneExpr->theReverseOrder = e->theReverseOrder; + + newExpr = cloneExpr; + break; + } + case match_expr_kind: + { + const match_expr* e = static_cast(this); + + match_expr* cloneExpr = theCCB->theEM-> + create_match_expr(theSctx, udf, theLoc); + + cloneExpr->setTestKind(e->getTestKind()); + cloneExpr->setDocTestKind(e->getDocTestKind()); + cloneExpr->setWildName(e->getWildName()); + cloneExpr->setWildKind(e->getWildKind()); + cloneExpr->setQName(e->getQName()); + cloneExpr->setTypeName(e->getTypeName()); + cloneExpr->setNilledAllowed(e->getNilledAllowed()); + + newExpr = cloneExpr; + break; + } + + case flwor_expr_kind: + case gflwor_expr_kind: + { + const flwor_expr* e = static_cast(this); + + flwor_expr* cloneExpr = theCCB->theEM-> + create_flwor_expr(theSctx, udf, theLoc, e->theIsGeneral); + + csize numClauses = e->num_clauses(); + + for (csize i = 0; i < numClauses; ++i) + { + flwor_clause* cloneClause = e->theClauses[i]->clone(udf, subst); + + cloneExpr->add_clause(cloneClause, false); + } + + cloneExpr->set_return_expr(e->theReturnExpr->clone(udf, subst)); + + newExpr = cloneExpr; + break; + } + case if_expr_kind: + { + const if_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_if_expr(theSctx, + udf, + theLoc, + e->get_cond_expr()->clone(udf, subst), + e->get_then_expr()->clone(udf, subst), + e->get_else_expr()->clone(udf, subst)); + break; + } + case trycatch_expr_kind: + { + const trycatch_expr* e = static_cast(this); + + trycatch_expr* cloneExpr = theCCB->theEM-> + create_trycatch_expr(theSctx, udf, theLoc, e->theTryExpr->clone(udf, subst)); + + for (std::vector::const_iterator ite = e->theCatchExprs.begin(); + ite != e->theCatchExprs.end(); + ++ite) + { + cloneExpr->add_catch_expr((*ite)->clone(udf, subst)); + } + + for (csize i = 0; i < e->clause_count(); ++i) + { + cloneExpr->add_clause(e->theCatchClauses[i]->clone(subst)); + } + + newExpr = cloneExpr; + break; + } + case fo_expr_kind: + { + const fo_expr* e = static_cast(this); + + if (e->get_func()->getKind() == FunctionConsts::STATIC_COLLECTIONS_DML_COLLECTION_1) + { + expr::subst_iter_t i = subst.find(this); + + if (i != subst.end()) + { + newExpr = i->second; + break; + } + } + + fo_expr* cloneExpr = theCCB->theEM-> + create_fo_expr(theSctx, udf, theLoc, e->get_func()); + + cloneExpr->theArgs.reserve(e->theArgs.size()); + + for (csize i = 0; i < e->theArgs.size(); ++i) + cloneExpr->theArgs.push_back(e->theArgs[i]->clone(udf, subst)); + + cloneExpr->theScriptingKind = e->theScriptingKind; + + newExpr = cloneExpr; + break; + } + case dynamic_function_invocation_expr_kind: + { + const dynamic_function_invocation_expr* e = + static_cast(this); + + checked_vector newArgs; + for (checked_vector::const_iterator ite = e->theArgs.begin(); + ite != e->theArgs.end(); + ++ite) + { + newArgs.push_back((*ite)->clone(udf, subst)); + } + + newExpr = theCCB->theEM-> + create_dynamic_function_invocation_expr(theSctx, + udf, + theLoc, + e->theExpr->clone(udf, subst), + newArgs); + break; + } + case function_item_expr_kind: + { + const function_item_expr* e = static_cast(this); + + function_item_expr* cloneExpr = theCCB->theEM-> + create_function_item_expr(theSctx, + udf, + theLoc, + e->theFunction->getName(), + e->theFunction.getp(), + e->theArity); + + std::vector lNewVariables; + for (std::vector::const_iterator ite = e->theScopedVariables.begin(); + ite != e->theScopedVariables.end(); + ++ite) + { + cloneExpr->add_variable((*ite)->clone(udf, subst)); + } + + newExpr = cloneExpr; + break; + } + case castable_expr_kind: + { + const castable_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_castable_expr(theSctx, + udf, + theLoc, + e->get_input()->clone(udf, subst), + e->get_target_type(), + e->allows_empty_input()); + + break; + } + case cast_expr_kind: + { + const cast_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_cast_expr(theSctx, + udf, + theLoc, + e->get_input()->clone(udf, subst), + e->get_target_type(), + e->allows_empty_input()); + break; + } + case instanceof_expr_kind: + { + const instanceof_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_instanceof_expr(theSctx, + udf, + theLoc, + e->get_input()->clone(udf, subst), + e->get_target_type()); + break; + } + case treat_expr_kind: + { + const treat_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_treat_expr(theSctx, + udf, + theLoc, + e->get_input()->clone(udf, subst), + e->get_target_type(), + e->get_err(), + e->get_check_prime(), + e->get_qname()); + break; + } + case promote_expr_kind: + { + const promote_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_promote_expr(theSctx, + udf, + theLoc, + e->get_input()->clone(udf, subst), + e->get_target_type(), + e->theErrorKind, + e->theQName.getp()); + break; + } + case name_cast_expr_kind: + { + const name_cast_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_name_cast_expr(theSctx, + udf, + theLoc, + e->get_input()->clone(udf, subst), + e->getNSCtx(), + e->theIsAttrName); + break; + } + case validate_expr_kind: + { + const validate_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_validate_expr(theSctx, + udf, + theLoc, + e->get_valmode(), + const_cast(e->get_type_name()), + e->get_input()->clone(udf, subst), + e->get_typemgr()); + + break; + } + case extension_expr_kind: + { + const extension_expr* e = static_cast(this); + + extension_expr* cloneExpr; + if(e->theExpr == 0) + { + cloneExpr = theCCB->theEM->create_extension_expr(theSctx, udf, theLoc); + } + else + { + cloneExpr = theCCB->theEM-> + create_extension_expr(theSctx, udf, theLoc, e->theExpr->clone(udf, subst)); + } + + // pragma doesn't contain expressions. Thus, it is not cloned. + for (std::vector::const_iterator lIter = e->thePragmas.begin(); + lIter != e->thePragmas.end(); + ++lIter) + { + cloneExpr->add(*lIter); + } + + newExpr = cloneExpr; + break; + } + case order_expr_kind: + { + const order_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_order_expr(theSctx, + udf, + theLoc, + e->get_type(), + e->get_input()->clone(udf, subst)); + break; + } +#ifndef ZORBA_NO_FULL_TEXT + case ft_expr_kind: + { + const ftcontains_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_ftcontains_expr(theSctx, + udf, + theLoc, + e->range_->clone(udf, subst), + e->ftselection_->clone(udf, subst).release(), + (e->ftignore_ == NULL ? 0 : e->ftignore_->clone(udf, subst))); + + break; + } +#endif /* ZORBA_NO_FULL_TEXT */ + + case delete_expr_kind: + { + const delete_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_delete_expr(theSctx, udf, theLoc, e->getTargetExpr()->clone(udf, subst)); + + break; + } + case insert_expr_kind: + { + const insert_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_insert_expr(theSctx, + udf, + theLoc, + e->getType(), + e->getSourceExpr()->clone(udf, subst), + e->getTargetExpr()->clone(udf, subst)); + break; + } + case rename_expr_kind: + { + const rename_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_rename_expr(theSctx, + udf, + theLoc, + e->getTargetExpr()->clone(udf, subst), + e->getNameExpr()->clone(udf, subst)); + break; + } + case replace_expr_kind: + { + const zorba::replace_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_replace_expr(theSctx, + udf, + theLoc, + e->getType(), + e->getTargetExpr()->clone(udf, subst), + e->getReplaceExpr()->clone(udf, subst)); + break; + } + case transform_expr_kind: + { + const transform_expr* e = static_cast(this); + + ZORBA_ASSERT(e->theModifyExpr && e->theReturnExpr); + + transform_expr* cloneExpr = theCCB->theEM-> + create_transform_expr(theSctx, udf, theLoc); + + for (std::vector::const_iterator ite = e->theCopyClauses.begin(); + ite != e->theCopyClauses.end(); + ++ite) + { + cloneExpr->add_back((*ite)->clone(udf, subst)); + } + + cloneExpr->setModifyExpr(e->theModifyExpr->clone(udf, subst)); + cloneExpr->setReturnExpr(e->theReturnExpr->clone(udf, subst)); + + newExpr = cloneExpr; + break; + } + + case block_expr_kind: + { + const block_expr* e = static_cast(this); + + checked_vector seq2; + for (csize i = 0; i < e->theArgs.size(); ++i) + seq2.push_back(e->theArgs[i]->clone(udf, subst)); + + newExpr = theCCB->theEM-> + create_block_expr(theSctx, udf, theLoc, true, seq2, NULL); + + break; + } + case var_decl_expr_kind: + { + const var_decl_expr* e = static_cast(this); + + var_expr* varCopy = theCCB->theEM->create_var_expr(udf, *e->theVarExpr); + subst[e->theVarExpr] = varCopy; + + newExpr = theCCB->theEM-> + create_var_decl_expr(theSctx, + udf, + theLoc, + varCopy, + (e->theExpr ? e->theExpr->clone(udf, subst) : NULL)); + + break; + } + case var_set_expr_kind: + { + const var_set_expr* e = static_cast(this); + + expr* varClone = e->theVarExpr->clone(udf, subst); + + ZORBA_ASSERT(varClone->get_expr_kind() == var_expr_kind); + + newExpr = theCCB->theEM-> + create_var_set_expr(theSctx, + udf, + theLoc, + static_cast(varClone), + e->theExpr->clone(udf, subst)); + break; + } + case apply_expr_kind: + { + const apply_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_apply_expr(theSctx, + udf, + theLoc, + e->theExpr->clone(udf, subst), + e->theDiscardXDM); + + break; + } + case exit_expr_kind: + { + const exit_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_exit_expr(theSctx, udf, theLoc, e->get_expr()->clone(udf, subst)); + + subst[this] = newExpr; + + break; + } + case exit_catcher_expr_kind: + { + const exit_catcher_expr* e = static_cast(this); + + expr* clonedInput = e->get_expr()->clone(udf, subst); + + std::vector clonedExits; + std::vector::const_iterator ite = e->theExitExprs.begin(); + std::vector::const_iterator end = e->theExitExprs.end(); + for (; ite != end; ++ite) + { + assert(subst.find(*ite) != subst.end()); + + clonedExits.push_back(subst[*ite]); + } + + newExpr = theCCB->theEM-> + create_exit_catcher_expr(theSctx, udf, theLoc, clonedInput, clonedExits); + + break; + } + case flowctl_expr_kind: + { + const flowctl_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_flowctl_expr(theSctx, udf, theLoc, e->get_action()); + + break; + } + case while_expr_kind: + { + const while_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_while_expr(theSctx, udf, theLoc, e->get_body()->clone(udf, subst)); + + break; + } + case eval_expr_kind: + { + const eval_expr* e = static_cast(this); + + newExpr = theCCB->theEM-> + create_eval_expr(theSctx, + udf, + theLoc, + e->theExpr->clone(udf, subst), + e->theInnerScriptingKind, + e->theNSCtx.getp()); + + eval_expr* newEval = static_cast(newExpr); + + newEval->setNodeCopy(e->theDoNodeCopy); + + newEval->theOuterVarNames = e->theOuterVarNames; + newEval->theOuterVarTypes = e->theOuterVarTypes; + + csize numVars = e->theOuterVarNames.size(); + + newEval->theArgs.resize(numVars); + + for (csize i = 0; i < numVars; ++i) + { + newEval->theArgs[i] = e->theArgs[i]->clone(udf, subst); + } + + break; + } + case wrapper_expr_kind: + { + const wrapper_expr* e = static_cast(this); + + expr* wrappedClone = e->theInput->clone(udf, subst); + + if (e->theInput->get_expr_kind() == var_expr_kind && + wrappedClone->get_expr_kind() != var_expr_kind) + { + newExpr = wrappedClone; + } + else + { + newExpr = theCCB->theEM->create_wrapper_expr(theSctx, udf, theLoc, wrappedClone); + } + + break; + } + case function_trace_expr_kind: + { + const function_trace_expr* e = static_cast(this); + + function_trace_expr* cloneExpr = theCCB->theEM-> + create_function_trace_expr(udf, e->theInput->clone(udf, subst)); + + cloneExpr->theFunctionName = e->theFunctionName; + cloneExpr->theFunctionLocation = e->theFunctionLocation; + cloneExpr->theFunctionCallLocation = e->theFunctionCallLocation; + cloneExpr->theFunctionArity = e->theFunctionArity; + + newExpr = cloneExpr; + break; + } + case debugger_expr_kind: + default: + { + RAISE_ERROR(zerr::ZXQP0003_INTERNAL_ERROR, theLoc, + ERROR_PARAMS(ZED(CloneNotImplemented))); + } + } + + if (containsPragma()) + { + newExpr->setContainsPragma(ANNOTATION_TRUE); + + std::vector pragmas; + theCCB->lookup_pragmas(this, pragmas); + + for (csize i = 0; i < pragmas.size(); ++i) + { + theCCB->add_pragma(newExpr, pragmas[i]); + } + } + + return newExpr; +} + +} diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_consts.h zorba-2.8.0-0/src/compiler/expression/expr_consts.h --- zorba-2.7.0-0/src/compiler/expression/expr_consts.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_consts.h 2013-01-16 18:28:18.000000000 +0000 @@ -21,6 +21,65 @@ { +enum PromoteErrorKind +{ + PROMOTE_FUNC_RETURN, + PROMOTE_FUNC_PARAM, + PROMOTE_TYPE_PROMOTION, + PROMOTE_JSONIQ_ARRAY_SELECTOR, + PROMOTE_JSONIQ_OBJECT_SELECTOR, + PROMOTE_JSONIQ_SELECTOR +}; + + +enum TreatErrorKind +{ + TREAT_FUNC_RETURN, + TREAT_FUNC_PARAM, + TREAT_TYPE_MATCH, + TREAT_EXPR, + TREAT_INDEX_DOMAIN, + TREAT_INDEX_KEY, + TREAT_PATH_STEP, + TREAT_PATH_DOT, + TREAT_MULTI_VALUED_GROUPING_KEY, + TREAT_JSONIQ_VALUE, + TREAT_JSONIQ_UPDATE_TARGET, + TREAT_JSONIQ_OBJECT_UPDATE_TARGET, + TREAT_JSONIQ_OBJECT_UPDATE_CONTENT, + TREAT_JSONIQ_ARRAY_UPDATE_TARGET, + TREAT_JSONIQ_OBJECT_UPDATE_VALUE +}; + + +enum WindowKind +{ + tumbling_window, + sliding_window +}; + + +enum TextConstructorType +{ + text_constructor, + comment_constructor +}; + + +enum FlowCtlAction +{ + FLOW_BREAK, + FLOW_CONTINUE +}; + + +enum DocOrderMode +{ + doc_ordered, + doc_unordered +}; + + enum axis_kind_t { axis_kind_self = 0, diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_iter.cpp zorba-2.8.0-0/src/compiler/expression/expr_iter.cpp --- zorba-2.7.0-0/src/compiler/expression/expr_iter.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_iter.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -40,7 +40,7 @@ #define EXPR_ITER_BEGIN() switch (theState) { case 0: -#define EXPR_ITER_END() theCurrentChild = expr::iter_done; } +#define EXPR_ITER_END() theIsDone = true; } #define EXPR_ITER_NEXT(subExprHandle) \ do \ @@ -48,10 +48,7 @@ theState = __LINE__; \ theCurrentChild = reinterpret_cast(&(subExprHandle)); \ \ - if ((subExprHandle) != NULL) \ - { \ - return; \ - } \ + return; \ \ case __LINE__:; \ \ @@ -64,10 +61,7 @@ theState = __LINE__; \ theCurrentChild = (subExprHandleP); \ \ - if (*(subExprHandleP) != NULL) \ - { \ - return; \ - } \ + return; \ \ case __LINE__:; \ \ @@ -79,7 +73,8 @@ : theExpr(e), theCurrentChild(NULL), - theState(0) + theState(0), + theIsDone(false) { #ifndef ZORBA_NO_FULL_TEXT if (e->get_expr_kind() == ft_expr_kind) @@ -99,12 +94,6 @@ void ExprIterator::next() { - flwor_clause* c = NULL; - window_clause* wc = NULL; - orderby_clause* oc = NULL; - group_clause* gc = NULL; - flwor_wincond* wincond = NULL; - switch (theExpr->get_expr_kind()) { case flwor_expr_kind: @@ -112,6 +101,223 @@ { flwor_expr* flworExpr = static_cast(theExpr); +#if 0 + switch (theState) + { + case 0: + { + theClausesIter = flworExpr->theClauses.begin(); + theClausesEnd = flworExpr->theClauses.end(); + + if (theClausesIter == theClausesEnd) + { + theIsDone = true; + theState = 10; + return; + } + + flwor_clause* c = *theClausesIter; + + switch (c->get_kind()) + { + case flwor_clause::for_clause: + case flwor_clause::let_clause: + { + theCurrentChild = &(static_cast(c)->theDomainExpr); + + ++theClausesIter; + theState = 1; + return; + } + case flwor_clause::window_clause: + { + theCurrentChild = &(static_cast(c)->theDomainExpr); + + theWincondIter = 0; + theState = 2; + return; + } + case flwor_clause::where_clause: + { + theCurrentChild = &(static_cast(c)->theWhereExpr); + + ++theClausesIter; + theState = 1; + return; + } + case flwor_clause::count_clause: + { + ++theClausesIter; + break; + } + default: + ZORBA_ASSERT(false); + } + } + case 1: + { +nextclause: + + while(theClausesIter != theClausesEnd) + { + flwor_clause* c = *theClausesIter; + + switch (c->get_kind()) + { + case flwor_clause::for_clause: + case flwor_clause::let_clause: + { + theCurrentChild = &(static_cast(c)->theDomainExpr); + ++theClausesIter; + return; + } + case flwor_clause::window_clause: + { + window_clause* wc = static_cast(*theClausesIter); + + theCurrentChild = &(wc->theDomainExpr); + + theState = 2; + theWincondIter = 0; + return; + } + + case flwor_clause::where_clause: + { + theCurrentChild = &(static_cast(c)->theWhereExpr); + ++theClausesIter; + return; + } + + case flwor_clause::order_clause: + { + orderby_clause* oc = static_cast(c); + + theArgsIter = oc->theOrderingExprs.begin(); + theArgsEnd = oc->theOrderingExprs.end(); + + theCurrentChild = &(*theArgsIter); + + ++theArgsIter; + theState = 3; + return; + } + + case flwor_clause::group_clause: + { + group_clause* gc = static_cast(c); + + theGroupVarsIter = gc->theGroupVars.begin(); + theGroupVarsEnd = gc->theGroupVars.end(); + theNonGroupVarsIter = gc->theNonGroupVars.begin(); + theNonGroupVarsEnd = gc->theNonGroupVars.end(); + + theCurrentChild = &((*theGroupVarsIter).first); + + ++theGroupVarsIter; + theState = 4; + return; + } + + case flwor_clause::count_clause: + { + ++theClausesIter; + break; + } + + default: + { + ZORBA_ASSERT(false); + } + } + } // while + + theCurrentChild = &(flworExpr->theReturnExpr); + theState = 10; + return; + } + + case 2: + { + while (theWincondIter < 2) + { + window_clause* wc = static_cast(*theClausesIter); + + flwor_wincond* wincond = (theWincondIter == 0 ? + wc->theWinStartCond : + wc->theWinStopCond ); + if (wincond != 0) + { + theCurrentChild = &(wincond->theCondExpr); + ++theWincondIter; + return; + } + + ++theWincondIter; + } + + theState = 1; + ++theClausesIter; + goto nextclause; + } + + case 3: + { + while (theArgsIter != theArgsEnd) + { + theCurrentChild = &(*theArgsIter); + ++theArgsIter; + return; + } + + theState = 1; + ++theClausesIter; + goto nextclause; + } + + case 4: + { + while (theGroupVarsIter != theGroupVarsEnd) + { + theCurrentChild = &((*theGroupVarsIter).first); + + ++theGroupVarsIter; + return; + } + + theState = 5; + } + + case 5: + { + while (theNonGroupVarsIter != theNonGroupVarsEnd) + { + theCurrentChild = &((*theNonGroupVarsIter).first); + + ++theNonGroupVarsIter; + return; + } + + theState = 1; + ++theClausesIter; + goto nextclause; + } + + default: + { + theIsDone = true; + return; + } + } + +#else + + flwor_clause* c = NULL; + window_clause* wc = NULL; + orderby_clause* oc = NULL; + group_clause* gc = NULL; + flwor_wincond* wincond = NULL; + EXPR_ITER_BEGIN(); theClausesBegin = flworExpr->theClauses.begin(); @@ -132,8 +338,17 @@ EXPR_ITER_NEXT(static_cast(c)->theDomainExpr); } + else if (c->get_kind() == flwor_clause::where_clause) + { + EXPR_ITER_NEXT(static_cast(c)->theWhereExpr); + } + else if (c->get_kind() == flwor_clause::window_clause) { + wc = static_cast(*theClausesIter); + + EXPR_ITER_NEXT(wc->theDomainExpr); + for (theWincondIter = 0; theWincondIter < 2; ++theWincondIter) { wc = static_cast(*theClausesIter); @@ -145,15 +360,6 @@ if (wincond != 0) EXPR_ITER_NEXT(wincond->theCondExpr); } - - wc = static_cast(*theClausesIter); - - EXPR_ITER_NEXT(wc->theDomainExpr); - } - - else if (c->get_kind() == flwor_clause::where_clause) - { - EXPR_ITER_NEXT(static_cast(c)->theWhereExpr); } else if (c->get_kind() == flwor_clause::group_clause) @@ -193,7 +399,8 @@ if (theClausesEnd != flworExpr->theClauses.end()) { - ulong pos = (ulong)(theClausesIter - theClausesBegin); + ZORBA_ASSERT(0); + csize pos = (theClausesIter - theClausesBegin); if (pos >= flworExpr->num_clauses()) break; @@ -205,116 +412,112 @@ EXPR_ITER_NEXT(flworExpr->theReturnExpr); EXPR_ITER_END(); - break; +#endif + return; } case relpath_expr_kind: { - relpath_expr* pathExpr = static_cast(theExpr); - EXPR_ITER_BEGIN(); - theArgsIter = pathExpr->theSteps.begin(); - theArgsEnd = pathExpr->theSteps.end(); + theArgsIter = static_cast(theExpr)->theSteps.begin(); + theArgsEnd = static_cast(theExpr)->theSteps.end(); for (; theArgsIter != theArgsEnd; ++theArgsIter) { EXPR_ITER_NEXT(*theArgsIter); } EXPR_ITER_END(); - break; + return; } case axis_step_expr_kind: { - axis_step_expr* axisExpr = static_cast(theExpr); - EXPR_ITER_BEGIN(); - - EXPR_ITER_NEXT(axisExpr->theNodeTest); - + EXPR_ITER_NEXT(static_cast(theExpr)->theNodeTest); EXPR_ITER_END(); - break; + return; } case match_expr_kind: + case var_expr_kind: + case const_expr_kind: + case flowctl_expr_kind: + { + theIsDone = true; + return; + } + + case fo_expr_kind: { EXPR_ITER_BEGIN(); + + theArgsIter = static_cast(theExpr)->theArgs.begin(); + theArgsEnd = static_cast(theExpr)->theArgs.end(); + for (; theArgsIter != theArgsEnd; ++theArgsIter) + { + EXPR_ITER_NEXT(*theArgsIter); + } + EXPR_ITER_END(); - break; + return; } - case var_expr_kind: + case cast_expr_kind: + case treat_expr_kind: + case promote_expr_kind: + case instanceof_expr_kind: + case castable_expr_kind: { EXPR_ITER_BEGIN(); + EXPR_ITER_NEXT(static_cast(theExpr)->theInput); EXPR_ITER_END(); - break; + return; } case wrapper_expr_kind: { - wrapper_expr* wrapperExpr = static_cast(theExpr); - EXPR_ITER_BEGIN(); - - EXPR_ITER_NEXT(wrapperExpr->theWrappedExpr); - + EXPR_ITER_NEXT(static_cast(theExpr)->theInput); EXPR_ITER_END(); - break; + return; } - case const_expr_kind: + case function_trace_expr_kind: { EXPR_ITER_BEGIN(); + EXPR_ITER_NEXT(static_cast(theExpr)->theInput); EXPR_ITER_END(); - break; + return; } - - case fo_expr_kind: + case order_expr_kind: { - fo_expr* foExpr = static_cast(theExpr); - - EXPR_ITER_BEGIN(); - - theArgsIter = foExpr->theArgs.begin(); - theArgsEnd = foExpr->theArgs.end(); - for (; theArgsIter != theArgsEnd; ++theArgsIter) + if (theState == 0) { - EXPR_ITER_NEXT(*theArgsIter); + theCurrentChild = &(static_cast(theExpr)->theInput); + theState = 1; + return; } - EXPR_ITER_END(); - break; + theIsDone = true; + return; } - case cast_expr_kind: - case treat_expr_kind: - case promote_expr_kind: - case instanceof_expr_kind: - case castable_expr_kind: + case validate_expr_kind: { - cast_or_castable_base_expr* castExpr = - static_cast(theExpr); - EXPR_ITER_BEGIN(); - - EXPR_ITER_NEXT(castExpr->theInputExpr); - + EXPR_ITER_NEXT(static_cast(theExpr)->theInput); EXPR_ITER_END(); - break; + return; } case name_cast_expr_kind: { - name_cast_expr* nameCastExpr = static_cast(theExpr); - EXPR_ITER_BEGIN(); - - EXPR_ITER_NEXT(nameCastExpr->theInputExpr); - + EXPR_ITER_NEXT(static_cast(theExpr)->theInputExpr); EXPR_ITER_END(); - break; + return; } case doc_expr_kind: @@ -323,10 +526,11 @@ EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(docExpr->theContent); + if (docExpr->theContent) + EXPR_ITER_NEXT(docExpr->theContent); EXPR_ITER_END(); - break; + return; } case elem_expr_kind: @@ -336,11 +540,15 @@ EXPR_ITER_BEGIN(); EXPR_ITER_NEXT(elemExpr->theQNameExpr); - EXPR_ITER_NEXT(elemExpr->theAttrs); - EXPR_ITER_NEXT(elemExpr->theContent); + + if (elemExpr->theAttrs) + EXPR_ITER_NEXT(elemExpr->theAttrs); + + if (elemExpr->theContent) + EXPR_ITER_NEXT(elemExpr->theContent); EXPR_ITER_END(); - break; + return; } case attr_expr_kind: @@ -350,10 +558,12 @@ EXPR_ITER_BEGIN(); EXPR_ITER_NEXT(attrExpr->theQNameExpr); - EXPR_ITER_NEXT(attrExpr->theValueExpr); + + if (attrExpr->theValueExpr) + EXPR_ITER_NEXT(attrExpr->theValueExpr); EXPR_ITER_END(); - break; + return; } case text_expr_kind: @@ -365,7 +575,7 @@ EXPR_ITER_NEXT(textExpr->theContentExpr); EXPR_ITER_END(); - break; + return; } case pi_expr_kind: @@ -373,12 +583,10 @@ pi_expr* piExpr = static_cast(theExpr); EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(piExpr->theTargetExpr); EXPR_ITER_NEXT(piExpr->theContentExpr); - EXPR_ITER_END(); - break; + return; } #ifdef ZORBA_WITH_JSON @@ -388,10 +596,11 @@ EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(e->theContentExpr); + if (e->theContentExpr) + EXPR_ITER_NEXT(e->theContentExpr); EXPR_ITER_END(); - break; + return; } case json_object_expr_kind: @@ -400,10 +609,11 @@ EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(e->theContentExpr); + if (e->theContentExpr) + EXPR_ITER_NEXT(e->theContentExpr); EXPR_ITER_END(); - break; + return; } case json_direct_object_expr_kind: @@ -427,7 +637,7 @@ } EXPR_ITER_END(); - break; + return; } #endif @@ -443,31 +653,7 @@ EXPR_ITER_NEXT(ifExpr->theElseExpr); EXPR_ITER_END(); - break; - } - - case order_expr_kind: - { - order_expr* ordExpr = static_cast(theExpr); - - EXPR_ITER_BEGIN(); - - EXPR_ITER_NEXT(ordExpr->theExpr); - - EXPR_ITER_END(); - break; - } - - case validate_expr_kind: - { - validate_expr* valExpr = static_cast(theExpr); - - EXPR_ITER_BEGIN(); - - EXPR_ITER_NEXT(valExpr->theExpr); - - EXPR_ITER_END(); - break; + return; } case extension_expr_kind: @@ -475,11 +661,9 @@ extension_expr* extExpr = static_cast(theExpr); EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(extExpr->theExpr); - EXPR_ITER_END(); - break; + return; } case trycatch_expr_kind: @@ -498,7 +682,7 @@ } EXPR_ITER_END(); - break; + return; } case function_item_expr_kind: @@ -515,7 +699,7 @@ } EXPR_ITER_END(); - break; + return; } case dynamic_function_invocation_expr_kind: @@ -535,7 +719,7 @@ } EXPR_ITER_END(); - break; + return; } case insert_expr_kind: @@ -548,7 +732,7 @@ EXPR_ITER_NEXT(insExpr->theTargetExpr); EXPR_ITER_END(); - break; + return; } case delete_expr_kind: @@ -560,7 +744,7 @@ EXPR_ITER_NEXT(delExpr->theTargetExpr); EXPR_ITER_END(); - break; + return; } case replace_expr_kind: @@ -573,7 +757,7 @@ EXPR_ITER_NEXT(repExpr->theSourceExpr); EXPR_ITER_END(); - break; + return; } case rename_expr_kind: @@ -586,7 +770,7 @@ EXPR_ITER_NEXT(renExpr->theSourceExpr); EXPR_ITER_END(); - break; + return; } case transform_expr_kind: @@ -606,7 +790,7 @@ EXPR_ITER_NEXT(trfExpr->theReturnExpr); EXPR_ITER_END(); - break; + return; } case block_expr_kind: @@ -623,7 +807,7 @@ } EXPR_ITER_END(); - break; + return; } case apply_expr_kind: @@ -632,16 +816,20 @@ EXPR_ITER_BEGIN(); EXPR_ITER_NEXT(applyExpr->theExpr); EXPR_ITER_END(); - break; + return; } case var_decl_expr_kind: { var_decl_expr* varDeclExpr = static_cast(theExpr); + EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(varDeclExpr->theInitExpr); + + if (varDeclExpr->theExpr) + EXPR_ITER_NEXT(varDeclExpr->theExpr); + EXPR_ITER_END(); - break; + return; } case var_set_expr_kind: @@ -650,14 +838,7 @@ EXPR_ITER_BEGIN(); EXPR_ITER_NEXT(varSetExpr->theExpr); EXPR_ITER_END(); - break; - } - - case flowctl_expr_kind: - { - EXPR_ITER_BEGIN(); - EXPR_ITER_END(); - break; + return; } case while_expr_kind: @@ -665,11 +846,9 @@ while_expr* whileExpr = static_cast(theExpr); EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(whileExpr->theBody); - EXPR_ITER_END(); - break; + return; } case exit_expr_kind: @@ -677,11 +856,9 @@ exit_expr* exitExpr = static_cast(theExpr); EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(exitExpr->theExpr); - EXPR_ITER_END(); - break; + return; } case exit_catcher_expr_kind: @@ -693,7 +870,7 @@ EXPR_ITER_NEXT(catcherExpr->theExpr); EXPR_ITER_END(); - break; + return; } #ifndef ZORBA_NO_FULL_TEXT @@ -709,13 +886,15 @@ theFTSelectionExprsEnd = theFTSelectionExprs.end(); for (; theFTSelectionExprsIter != theFTSelectionExprsEnd; ++theFTSelectionExprsIter) { - EXPR_ITER_NEXT2(*theFTSelectionExprsIter); + if (**theFTSelectionExprsIter) + EXPR_ITER_NEXT2(*theFTSelectionExprsIter); } - EXPR_ITER_NEXT(ftExpr->ftignore_); + if (ftExpr->ftignore_) + EXPR_ITER_NEXT(ftExpr->ftignore_); EXPR_ITER_END(); - break; + return; } #endif /* ZORBA_NO_FULL_TEXT */ @@ -735,7 +914,7 @@ } EXPR_ITER_END(); - break; + return; } #ifdef ZORBA_WITH_DEBUGGER @@ -755,19 +934,10 @@ } EXPR_ITER_END(); - break; + return; } #endif - case function_trace_expr_kind: - { - function_trace_expr* dummyExpr = static_cast(theExpr); - EXPR_ITER_BEGIN(); - EXPR_ITER_NEXT(dummyExpr->theExpr); - EXPR_ITER_END(); - break; - } - default: { ZORBA_ASSERT(false); diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_iter.h zorba-2.8.0-0/src/compiler/expression/expr_iter.h --- zorba-2.7.0-0/src/compiler/expression/expr_iter.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_iter.h 2013-01-16 18:28:18.000000000 +0000 @@ -37,9 +37,10 @@ expr ** theCurrentChild; int theState; + bool theIsDone; - std::vector::iterator theArgsIter; - std::vector::iterator theArgsEnd; + std::vector::iterator theArgsIter; + std::vector::iterator theArgsEnd; flwor_expr::clause_list_t::iterator theClausesIter; flwor_expr::clause_list_t::iterator theClausesBegin; @@ -68,7 +69,7 @@ expr** operator*() const { return (theCurrentChild); } - bool done() const { return theCurrentChild == expr::iter_done; } + bool done() const { return theIsDone; } private: // comparisson forbidden; use done() diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_manager.cpp zorba-2.8.0-0/src/compiler/expression/expr_manager.cpp --- zorba-2.7.0-0/src/compiler/expression/expr_manager.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_manager.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -35,60 +35,6 @@ namespace zorba { -#if 0 -//A simple expression that can just be deallocated without calling the -//destructor. -class NullExpr : public expr -{ -public: - NullExpr() : expr(NULL, NULL, QueryLoc(), unknown_expr_kind) {} - - void accept(expr_visitor& v) {} - - void compute_scripting_kind() {} - - std::ostream& put(std::ostream& stream) const { return stream; } -}; - - -class NullFlworClause : public flwor_clause -{ -public: - //it being a let clause is arbitrary, it doesn't matter what type it is. - NullFlworClause() :flwor_clause(NULL, NULL, QueryLoc(), flwor_clause::let_clause) {} - - std::ostream& put(std::ostream& stream) const { return stream; } - - flwor_clause* clone(expr::substitution_t &) const { return NULL; } -}; - - -class NullWincond : public flwor_wincond -{ -public: - NullWincond() : flwor_wincond(NULL, NULL, false, vars(), vars(), NULL) {} - - std::ostream& put(std::ostream& stream) const { return stream; } -}; - - -class NullCatchClause : public catch_clause -{ -public: - NullCatchClause() : catch_clause(NULL) {} - - std::ostream& put(std::ostream& stream) const{return stream;} -}; - - -class NullCopyClause : public copy_clause -{ -public: - NullCopyClause() : copy_clause(NULL, NULL, NULL) {} -}; -#endif - - ExprManager::ExprManager(CompilerCB* ccb) : theCCB(ccb) @@ -219,118 +165,131 @@ if_expr* ExprManager::create_if_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* cond_expr, expr* then_expr, expr* else_expr) { - CREATE_AND_RETURN_EXPR(if_expr, sctx, loc, cond_expr, then_expr, else_expr); + CREATE_AND_RETURN_EXPR(if_expr, sctx, udf, loc, cond_expr, then_expr, else_expr); } order_expr* ExprManager::create_order_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, - order_expr::order_type_t order, + DocOrderMode order, expr* exp) { - CREATE_AND_RETURN_EXPR(order_expr, sctx, loc, order, exp); + CREATE_AND_RETURN_EXPR(order_expr, sctx, udf, loc, order, exp); } validate_expr* ExprManager::create_validate_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, ParseConstants::validation_mode_t mode, const store::Item_t& aTypeName, expr* validated, rchandle tm) { - CREATE_AND_RETURN_EXPR(validate_expr, sctx, loc, mode, aTypeName, validated, tm); + CREATE_AND_RETURN_EXPR(validate_expr, sctx, udf, loc, mode, aTypeName, validated, tm); } cast_expr* ExprManager::create_cast_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* casted, - xqtref_t type) + const xqtref_t& type, + bool allowsEmptyInput) { - CREATE_AND_RETURN_EXPR(cast_expr, sctx, loc, casted, type); + CREATE_AND_RETURN_EXPR(cast_expr, sctx, udf, loc, casted, type, allowsEmptyInput); } treat_expr* ExprManager::create_treat_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* treated, const xqtref_t& type, - TreatIterator::ErrorKind err, + TreatErrorKind err, bool check_prime, store::Item* qname) { CREATE_AND_RETURN_EXPR(treat_expr, - sctx, loc, treated, type, err, check_prime, qname); + sctx, udf, loc, treated, type, err, check_prime, qname); } promote_expr* ExprManager::create_promote_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* promoted, const xqtref_t& type, - PromoteIterator::ErrorKind err, + PromoteErrorKind err, store::Item* qname) { - CREATE_AND_RETURN_EXPR(promote_expr, sctx, loc, promoted, type, err, qname); + CREATE_AND_RETURN_EXPR(promote_expr, sctx, udf, loc, promoted, type, err, qname); } castable_expr* ExprManager::create_castable_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* castable, - xqtref_t type) + const xqtref_t& type, + bool allowsEmptyInput) { - CREATE_AND_RETURN_EXPR(castable_expr, sctx, loc, castable, type); + CREATE_AND_RETURN_EXPR(castable_expr, sctx, udf, loc, castable, type, allowsEmptyInput); } instanceof_expr* ExprManager::create_instanceof_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* instanced, xqtref_t type, bool checkPrimeOnly) { CREATE_AND_RETURN_EXPR(instanceof_expr, - sctx, loc, instanced, type, checkPrimeOnly); + sctx, udf, loc, instanced, type, checkPrimeOnly); } name_cast_expr* ExprManager::create_name_cast_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* casted, const namespace_context* ns, bool isAttr) { - CREATE_AND_RETURN_EXPR(name_cast_expr, sctx, loc, casted, ns, isAttr); + CREATE_AND_RETURN_EXPR(name_cast_expr, sctx, udf, loc, casted, ns, isAttr); } doc_expr* ExprManager::create_doc_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content, bool copyNodes) { - CREATE_AND_RETURN_EXPR(doc_expr, sctx, loc, content, copyNodes); + CREATE_AND_RETURN_EXPR(doc_expr, sctx, udf, loc, content, copyNodes); } elem_expr* ExprManager::create_elem_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* qnameExpr, expr* attrs, @@ -339,12 +298,13 @@ bool copyNodes) { CREATE_AND_RETURN_EXPR(elem_expr, - sctx, loc, qnameExpr, attrs, content, nsCtx, copyNodes); + sctx, udf, loc, qnameExpr, attrs, content, nsCtx, copyNodes); } elem_expr* ExprManager::create_elem_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* qnameExpr, expr* content, @@ -352,137 +312,151 @@ bool copyNodes) { CREATE_AND_RETURN_EXPR(elem_expr, - sctx, loc, qnameExpr, content, nsCtx, copyNodes); + sctx, udf, loc, qnameExpr, content, nsCtx, copyNodes); } attr_expr* ExprManager::create_attr_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aQNameExpr, expr* aValueExpr) { - CREATE_AND_RETURN_EXPR(attr_expr, sctx, loc, aQNameExpr, aValueExpr); + CREATE_AND_RETURN_EXPR(attr_expr, sctx, udf, loc, aQNameExpr, aValueExpr); } text_expr* ExprManager::create_text_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, - text_expr::text_constructor_type textType, + TextConstructorType textType, expr* text) { - CREATE_AND_RETURN_EXPR(text_expr, sctx, loc, textType, text); + CREATE_AND_RETURN_EXPR(text_expr, sctx, udf, loc, textType, text); } pi_expr* ExprManager::create_pi_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* targetExpr, expr* contentExpr) { - CREATE_AND_RETURN_EXPR(pi_expr, sctx, loc, targetExpr, contentExpr); + CREATE_AND_RETURN_EXPR(pi_expr, sctx, udf, loc, targetExpr, contentExpr); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, zstring& sval) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, sval); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, sval); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const std::string& sval) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, sval); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, sval); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const char* sval) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, sval); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, sval); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, xs_integer val) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, val); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, val); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, xs_decimal val) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, val); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, val); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, xs_double val) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, val); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, val); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, xs_boolean val) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, val); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, val); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, store::Item_t val) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, val); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, val); } const_expr* ExprManager::create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const char* ns, const char* pre, const char* local) { - CREATE_AND_RETURN_EXPR(const_expr, sctx, loc, ns, pre, local); + CREATE_AND_RETURN_EXPR(const_expr, sctx, udf, loc, ns, pre, local); } extension_expr* ExprManager::create_extension_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc) { - CREATE_AND_RETURN_EXPR(extension_expr, sctx, loc); + CREATE_AND_RETURN_EXPR(extension_expr, sctx, udf, loc); } extension_expr* ExprManager::create_extension_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* extended) { - CREATE_AND_RETURN_EXPR(extension_expr, sctx, loc, extended); + CREATE_AND_RETURN_EXPR(extension_expr, sctx, udf, loc, extended); } @@ -494,35 +468,40 @@ trycatch_expr* ExprManager::create_trycatch_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* tryExpr) { - CREATE_AND_RETURN_EXPR(trycatch_expr, sctx, loc, tryExpr); + CREATE_AND_RETURN_EXPR(trycatch_expr, sctx, udf, loc, tryExpr); } wrapper_expr* ExprManager::create_wrapper_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* wrapped) { - CREATE_AND_RETURN_EXPR(wrapper_expr, sctx, loc, wrapped); + CREATE_AND_RETURN_EXPR(wrapper_expr, sctx, udf, loc, wrapped); } - +#if 0 function_trace_expr* ExprManager::create_function_trace_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aChild) { - CREATE_AND_RETURN_EXPR(function_trace_expr, sctx, loc, aChild); + CREATE_AND_RETURN_EXPR(function_trace_expr, sctx, udf, loc, aChild); } +#endif - -function_trace_expr* ExprManager::create_function_trace_expr(expr* aExpr) +function_trace_expr* ExprManager::create_function_trace_expr( + user_function* udf, + expr* aExpr) { //this function gets the ExprManager from the expression it recieves. - function_trace_expr* e = new (theMemoryMgr) function_trace_expr(aExpr); + function_trace_expr* e = new (theMemoryMgr) function_trace_expr(udf, aExpr); reg(e); return e; } @@ -530,25 +509,27 @@ eval_expr* ExprManager::create_eval_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* e, expr_script_kind_t scriptingKind, namespace_context* nsCtx) { - CREATE_AND_RETURN_EXPR(eval_expr, sctx, loc, e, scriptingKind, nsCtx); + CREATE_AND_RETURN_EXPR(eval_expr, sctx, udf, loc, e, scriptingKind, nsCtx); } #ifdef ZORBA_WITH_DEBUGGER debugger_expr* ExprManager::create_debugger_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aChild, namespace_context* nsCtx, bool aIsVarDeclaration) { CREATE_AND_RETURN_EXPR(debugger_expr, - sctx, loc, aChild, nsCtx, aIsVarDeclaration); + sctx, udf, loc, aChild, nsCtx, aIsVarDeclaration); } #endif @@ -557,17 +538,25 @@ var_expr* ExprManager::create_var_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, - var_expr::var_kind k, + ulong varKind, store::Item* name) { - CREATE_AND_RETURN_EXPR(var_expr, sctx, loc, k, name); + CREATE_AND_RETURN_EXPR(var_expr, + sctx, + udf, + loc, + static_cast(varKind), + name); } -var_expr* ExprManager::create_var_expr(const var_expr& source) +var_expr* ExprManager::create_var_expr( + user_function* udf, + const var_expr& source) { - var_expr* e = new (theMemoryMgr) var_expr(source); + var_expr* e = new (theMemoryMgr) var_expr(udf, source); reg(e); return e; } @@ -580,30 +569,33 @@ json_array_expr* ExprManager::create_json_array_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content) { - CREATE_AND_RETURN_EXPR(json_array_expr, sctx, loc, content); + CREATE_AND_RETURN_EXPR(json_array_expr, sctx, udf, loc, content); } json_object_expr* ExprManager::create_json_object_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content, bool accumulate) { - CREATE_AND_RETURN_EXPR(json_object_expr, sctx, loc, content, accumulate); + CREATE_AND_RETURN_EXPR(json_object_expr, sctx, udf, loc, content, accumulate); } json_direct_object_expr* ExprManager::create_json_direct_object_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, std::vector& names, std::vector& values) { - CREATE_AND_RETURN_EXPR(json_direct_object_expr, sctx, loc, names, values); + CREATE_AND_RETURN_EXPR(json_direct_object_expr, sctx, udf, loc, names, values); } @@ -614,43 +606,47 @@ insert_expr* ExprManager::create_insert_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, store::UpdateConsts::InsertType insertType, expr* aSourceExpr, expr* aTargetExpr) { CREATE_AND_RETURN_EXPR(insert_expr, - sctx, loc, insertType, aSourceExpr, aTargetExpr); + sctx, udf, loc, insertType, aSourceExpr, aTargetExpr); } delete_expr* ExprManager::create_delete_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aTargetExpr) { - CREATE_AND_RETURN_EXPR(delete_expr, sctx, loc, aTargetExpr); + CREATE_AND_RETURN_EXPR(delete_expr, sctx, udf, loc, aTargetExpr); } replace_expr* ExprManager::create_replace_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, store::UpdateConsts::ReplaceType aType, expr* aSourceExpr, expr* aTargetExpr) { - CREATE_AND_RETURN_EXPR(replace_expr, sctx, loc, aType, aSourceExpr, aTargetExpr); + CREATE_AND_RETURN_EXPR(replace_expr, sctx, udf, loc, aType, aSourceExpr, aTargetExpr); } rename_expr* ExprManager::create_rename_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aSourceExpr, expr* aTargetExpr) { - CREATE_AND_RETURN_EXPR(rename_expr, sctx, loc, aSourceExpr, aTargetExpr); + CREATE_AND_RETURN_EXPR(rename_expr, sctx, udf, loc, aSourceExpr, aTargetExpr); } @@ -662,112 +658,126 @@ transform_expr* ExprManager::create_transform_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc) { - CREATE_AND_RETURN_EXPR(transform_expr, sctx, loc); + CREATE_AND_RETURN_EXPR(transform_expr, sctx, udf, loc); } block_expr* ExprManager::create_block_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, bool allowLastUpdating, std::vector& seq, std::vector* assignedVars) { CREATE_AND_RETURN_EXPR(block_expr, - sctx, loc, allowLastUpdating, seq, assignedVars); + sctx, udf, loc, allowLastUpdating, seq, assignedVars); } apply_expr* ExprManager::create_apply_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, bool discardXDM) { - CREATE_AND_RETURN_EXPR(apply_expr, sctx, loc, inExpr, discardXDM); + CREATE_AND_RETURN_EXPR(apply_expr, sctx, udf, loc, inExpr, discardXDM); } var_decl_expr* ExprManager::create_var_decl_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, expr* initExpr) { - CREATE_AND_RETURN_EXPR(var_decl_expr, sctx, loc, varExpr, initExpr); + CREATE_AND_RETURN_EXPR(var_decl_expr, sctx, udf, loc, varExpr, initExpr); } var_set_expr* ExprManager::create_var_set_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, expr* setExpr) { - CREATE_AND_RETURN_EXPR(var_set_expr, sctx, loc, varExpr, setExpr); + CREATE_AND_RETURN_EXPR(var_set_expr, sctx, udf, loc, varExpr, setExpr); } exit_expr* ExprManager::create_exit_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr) { - CREATE_AND_RETURN_EXPR(exit_expr, sctx, loc, inExpr); + CREATE_AND_RETURN_EXPR(exit_expr, sctx, udf, loc, inExpr); } exit_catcher_expr* ExprManager::create_exit_catcher_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, std::vector& exitExprs) { - CREATE_AND_RETURN_EXPR(exit_catcher_expr, sctx, loc, inExpr, exitExprs); + CREATE_AND_RETURN_EXPR(exit_catcher_expr, sctx, udf, loc, inExpr, exitExprs); } flowctl_expr* ExprManager::create_flowctl_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, - flowctl_expr::action action) + FlowCtlAction action) { - CREATE_AND_RETURN_EXPR(flowctl_expr, sctx, loc, action); + CREATE_AND_RETURN_EXPR(flowctl_expr, sctx, udf, loc, action); } while_expr* ExprManager::create_while_expr( - static_context* sctx, const QueryLoc& loc, expr* body) + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr* body) { - CREATE_AND_RETURN_EXPR(while_expr, sctx, loc, body); + CREATE_AND_RETURN_EXPR(while_expr, sctx, udf, loc, body); } //////////////////////////////////////////////////////////////////////////////// relpath_expr* ExprManager::create_relpath_expr( - static_context* sctx, - const QueryLoc& loc) + static_context* sctx, + user_function* udf, + const QueryLoc& loc) { - CREATE_AND_RETURN_EXPR(relpath_expr, sctx, loc); + CREATE_AND_RETURN_EXPR(relpath_expr, sctx, udf, loc); } axis_step_expr* ExprManager::create_axis_step_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc) { - CREATE_AND_RETURN_EXPR(axis_step_expr, sctx, loc); + CREATE_AND_RETURN_EXPR(axis_step_expr, sctx, udf, loc); } match_expr* ExprManager::create_match_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc) { - CREATE_AND_RETURN_EXPR(match_expr, sctx, loc); + CREATE_AND_RETURN_EXPR(match_expr, sctx, udf, loc); } @@ -776,95 +786,108 @@ dynamic_function_invocation_expr* ExprManager::create_dynamic_function_invocation_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* anExpr, const std::vector& args) { - CREATE_AND_RETURN_EXPR(dynamic_function_invocation_expr, sctx, loc, anExpr, args); + CREATE_AND_RETURN_EXPR(dynamic_function_invocation_expr, sctx, udf, loc, anExpr, args); } function_item_expr* ExprManager::create_function_item_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const store::Item* aQName, function* f, uint32_t aArity) { - CREATE_AND_RETURN_EXPR(function_item_expr, sctx, loc, aQName, f, aArity); + CREATE_AND_RETURN_EXPR(function_item_expr, sctx, udf, loc, aQName, f, aArity); } function_item_expr* ExprManager::create_function_item_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc) { - CREATE_AND_RETURN_EXPR(function_item_expr, sctx, loc); + CREATE_AND_RETURN_EXPR(function_item_expr, sctx, udf, loc); } ftcontains_expr* ExprManager::create_ftcontains_expr( static_context* sctx, + user_function* udf, QueryLoc const& loc, expr* range, ftnode *ftselection, expr* ftignore) { - CREATE_AND_RETURN_EXPR(ftcontains_expr, sctx, loc, range, ftselection, ftignore); + CREATE_AND_RETURN_EXPR(ftcontains_expr, sctx, udf, loc, range, ftselection, ftignore); } //////////////////////////////////////////////////////////////////////////////// //this calls the static create_seq within fo_expr -fo_expr* ExprManager::create_seq(static_context* sctx, const QueryLoc& loc) +fo_expr* ExprManager::create_seq( + static_context* sctx, + user_function* udf, + const QueryLoc& loc) { //TODO make fo_expr use this factory to generate everything - return fo_expr::create_seq(theCCB, sctx, loc); + return fo_expr::create_seq(theCCB, sctx, udf, loc); } fo_expr* ExprManager::create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg) { - CREATE_AND_RETURN_EXPR(fo_expr, sctx, loc, f, arg); + CREATE_AND_RETURN_EXPR(fo_expr, sctx, udf, loc, f, arg); } fo_expr* ExprManager::create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg1, expr* arg2) { - CREATE_AND_RETURN_EXPR(fo_expr, sctx, loc, f, arg1, arg2); + CREATE_AND_RETURN_EXPR(fo_expr, sctx, udf, loc, f, arg1, arg2); } fo_expr* ExprManager::create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, const std::vector& args) { - CREATE_AND_RETURN_EXPR(fo_expr, sctx, loc, f, args); + CREATE_AND_RETURN_EXPR(fo_expr, sctx, udf, loc, f, args); } + fo_expr* ExprManager::create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f) { - CREATE_AND_RETURN_EXPR(fo_expr, sctx, loc, f); + CREATE_AND_RETURN_EXPR(fo_expr, sctx, udf, loc, f); } + //////////////////////////////////////////////////////////////////////////////// -for_clause* ExprManager::create_for_clause( +forlet_clause* ExprManager::create_for_clause( static_context* sctx, const QueryLoc& loc, var_expr* varExpr, @@ -873,24 +896,33 @@ var_expr* scoreVarExpr, bool isOuter) { - CREATE_AND_RETURN(for_clause, - sctx, theCCB, loc, varExpr, domainExpr, posVarExpr, scoreVarExpr, isOuter); + CREATE_AND_RETURN(forlet_clause, + sctx, theCCB, loc, + flwor_clause::for_clause, + varExpr, domainExpr, posVarExpr, scoreVarExpr, + isOuter, false); } -let_clause* ExprManager::create_let_clause( + +forlet_clause* ExprManager::create_let_clause( static_context* sctx, const QueryLoc& loc, var_expr* varExpr, expr* domainExpr, bool lazy) { - CREATE_AND_RETURN(let_clause, sctx, theCCB, loc, varExpr, domainExpr, lazy); + CREATE_AND_RETURN(forlet_clause, + sctx, theCCB, loc, + flwor_clause::let_clause, + varExpr, domainExpr, NULL, NULL, + false, lazy); } + window_clause* ExprManager::create_window_clause( static_context* sctx, const QueryLoc& loc, - window_clause::window_t winKind, + WindowKind winKind, var_expr* varExpr, expr* domainExpr, flwor_wincond* winStart, @@ -898,63 +930,81 @@ bool lazy) { CREATE_AND_RETURN(window_clause, - sctx, theCCB, loc, winKind, varExpr, domainExpr, winStart, winStop, lazy); + sctx, theCCB, loc, + winKind, varExpr, domainExpr, winStart, winStop, + lazy); } + flwor_wincond* ExprManager::create_flwor_wincond( - static_context* sctx, - bool isOnly, - const flwor_wincond::vars& in_vars, - const flwor_wincond::vars& out_vars, - expr* cond) + static_context* sctx, + bool isOnly, + const flwor_wincond::vars& in_vars, + const flwor_wincond::vars& out_vars, + expr* cond) { CREATE_AND_RETURN(flwor_wincond, theCCB, sctx, isOnly, in_vars, out_vars, cond); } + group_clause* ExprManager::create_group_clause( static_context* sctx, const QueryLoc& loc, const flwor_clause::rebind_list_t& gvars, - flwor_clause::rebind_list_t ngvars, + const flwor_clause::rebind_list_t& ngvars, const std::vector& collations) { CREATE_AND_RETURN(group_clause, sctx, theCCB, loc, gvars, ngvars, collations); } + orderby_clause* ExprManager::create_orderby_clause( - static_context* sctx, - const QueryLoc& loc, - bool stable, - const std::vector& modifiers, - const std::vector& orderingExprs) + static_context* sctx, + const QueryLoc& loc, + bool stable, + const std::vector& modifiers, + const std::vector& orderingExprs) { CREATE_AND_RETURN(orderby_clause, sctx, theCCB, loc, stable, modifiers, orderingExprs); } + materialize_clause* ExprManager::create_materialize_clause( - static_context* sctx, const QueryLoc& loc) + static_context* sctx, + const QueryLoc& loc) { CREATE_AND_RETURN(materialize_clause, sctx, theCCB, loc); } + count_clause* ExprManager::create_count_clause( - static_context* sctx, const QueryLoc& loc, var_expr* var) + static_context* sctx, + const QueryLoc& loc, + var_expr* var) { CREATE_AND_RETURN(count_clause, sctx, theCCB, loc, var); } + where_clause* ExprManager::create_where_clause( - static_context* sctx, const QueryLoc& loc, expr* where) + static_context* sctx, + const QueryLoc& loc, + expr* where) { CREATE_AND_RETURN(where_clause, sctx, theCCB, loc, where); } + flwor_expr* ExprManager::create_flwor_expr( - static_context* sctx, const QueryLoc& loc, bool general) + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + bool general) { - CREATE_AND_RETURN_EXPR(flwor_expr, sctx, loc, general); + CREATE_AND_RETURN_EXPR(flwor_expr, sctx, udf, loc, general); } + pragma* ExprManager::create_pragma( const store::Item_t& name, const zstring& lit) diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_manager.h zorba-2.8.0-0/src/compiler/expression/expr_manager.h --- zorba-2.7.0-0/src/compiler/expression/expr_manager.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_manager.h 2013-01-16 18:28:18.000000000 +0000 @@ -19,17 +19,39 @@ #define ZORBA_COMPILER_EXPRMANAGER_H #include "expr_classes.h" -#include "expr.h" -#include "script_exprs.h" -#include "flwor_expr.h" -#include "ftnode.h" - +#include "expr_consts.h" +#include "expr_utils.h" #include "mem_manager.h" +#include "compiler/parser/parse_constants.h" + +#include "zorbatypes/schema_types.h" + +#include "store/api/update_consts.h" + + namespace zorba { class CompilerCB; +class expr; +class var_expr; +class catch_clause; +class pragma; +class flwor_clause; +class forlet_clause; +class flwor_wincond; +class copy_clause; +class window_clause; +class group_clause; +class where_clause; +class count_clause; +class orderby_clause; +class materialize_clause; +struct flwor_wincond_vars; +class ftnode; + + class ExprManager { @@ -75,6 +97,7 @@ public: if_expr* create_if_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* cond_expr, expr* then_expr, @@ -82,12 +105,14 @@ order_expr* create_order_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, - order_expr::order_type_t, + DocOrderMode, expr*); validate_expr* create_validate_expr( static_context*, + user_function* udf, const QueryLoc&, ParseConstants::validation_mode_t, const store::Item_t& aTypeName, @@ -96,36 +121,43 @@ cast_expr* create_cast_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*, - xqtref_t); + const xqtref_t&, + bool allowsEmptyInput); treat_expr* create_treat_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* input, const xqtref_t& type, - TreatIterator::ErrorKind err, + TreatErrorKind err, bool check_prime = true, store::Item* qnname = NULL); promote_expr* create_promote_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* input, const xqtref_t& type, - PromoteIterator::ErrorKind err, + PromoteErrorKind err, store::Item* qname); castable_expr* create_castable_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*, - xqtref_t); + const xqtref_t&, + bool allowsEmptyInput); instanceof_expr* create_instanceof_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*, xqtref_t, @@ -133,6 +165,7 @@ name_cast_expr* create_name_cast_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*, const namespace_context*, @@ -140,12 +173,14 @@ doc_expr* create_doc_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr* content, bool copyNodes); elem_expr* create_elem_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr* qnameExpr, expr* attrs, @@ -155,6 +190,7 @@ elem_expr* create_elem_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr* qnameExpr, expr* content, @@ -163,64 +199,76 @@ attr_expr* create_attr_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aQNameExpr, expr* aValueExpr); text_expr* create_text_expr( static_context* sctx, + user_function* udf, const QueryLoc&, - text_expr::text_constructor_type, + TextConstructorType, expr*); pi_expr* create_pi_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*, expr*); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, zstring& sval); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, const std::string& sval); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, const char* sval); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, xs_integer); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, xs_decimal); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, xs_double); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, xs_boolean); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, store::Item_t); const_expr* create_const_expr( static_context* sctx, + user_function* udf, const QueryLoc&, const char* ns, const char* pre, @@ -228,10 +276,12 @@ extension_expr* create_extension_expr( static_context* sctx, + user_function* udf, const QueryLoc&); extension_expr* create_extension_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*); @@ -239,23 +289,31 @@ trycatch_expr* create_trycatch_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr* tryExpr); wrapper_expr* create_wrapper_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* wrapped); +#if 0 function_trace_expr* create_function_trace_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aChild); +#endif - function_trace_expr* create_function_trace_expr(expr* aExpr); + function_trace_expr* create_function_trace_expr( + user_function* udf, + expr* aExpr); eval_expr* create_eval_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* e, expr_script_kind_t scriptingKind, @@ -264,6 +322,7 @@ #ifdef ZORBA_WITH_DEBUGGER debugger_expr* create_debugger_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* aChild, namespace_context* nsCtx, @@ -274,11 +333,12 @@ var_expr* create_var_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, - var_expr::var_kind k, + ulong varKind, store::Item* name); - var_expr* create_var_expr(const var_expr& source); + var_expr* create_var_expr(user_function* udf, const var_expr& source); //////////////////////////////////////////////////////////////////////////////// @@ -286,17 +346,20 @@ json_array_expr* create_json_array_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content); json_object_expr* create_json_object_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content, bool accumulate); json_direct_object_expr* create_json_direct_object_expr( static_context* sctx, + user_function* udf, const QueryLoc&, std::vector& names, std::vector& values); @@ -307,6 +370,7 @@ insert_expr* create_insert_expr( static_context* sctx, + user_function* udf, const QueryLoc&, store::UpdateConsts::InsertType, expr* aSourceExpr, @@ -314,11 +378,13 @@ delete_expr* create_delete_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*); replace_expr* create_replace_expr( static_context* sctx, + user_function* udf, const QueryLoc&, store::UpdateConsts::ReplaceType aType, expr*, @@ -326,6 +392,7 @@ rename_expr* create_rename_expr( static_context* sctx, + user_function* udf, const QueryLoc&, expr*, expr*); @@ -334,10 +401,12 @@ transform_expr* create_transform_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc); block_expr* create_block_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, bool allowLastUpdating, std::vector& seq, @@ -345,61 +414,79 @@ apply_expr* create_apply_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, bool discardXDM); var_decl_expr* create_var_decl_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, expr* initExpr); var_set_expr* create_var_set_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, expr* setExpr); exit_expr* create_exit_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr); exit_catcher_expr* create_exit_catcher_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, std::vector& exitExprs); flowctl_expr* create_flowctl_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, - flowctl_expr::action action); + FlowCtlAction action); while_expr* create_while_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* body); //////////////////////////////////////////////////////////////////////////////// - relpath_expr* create_relpath_expr(static_context* sctx, const QueryLoc& loc); + relpath_expr* create_relpath_expr( + static_context* sctx, + user_function* udf, + const QueryLoc& loc); - axis_step_expr* create_axis_step_expr(static_context* sctx, const QueryLoc&); + axis_step_expr* create_axis_step_expr( + static_context* sctx, + user_function* udf, + const QueryLoc&); - match_expr* create_match_expr(static_context* sctx, const QueryLoc&); + match_expr* create_match_expr( + static_context* sctx, + user_function* udf, + const QueryLoc&); //////////////////////////////////////////////////////////////////////////////// dynamic_function_invocation_expr* create_dynamic_function_invocation_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* anExpr, const std::vector& args); function_item_expr* create_function_item_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const store::Item* aQName, function* f, @@ -407,28 +494,35 @@ function_item_expr* create_function_item_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc); ftcontains_expr* create_ftcontains_expr( static_context*, + user_function* udf, QueryLoc const&, expr* range, - ftnode *ftselection, + ftnode* ftselection, expr* ftignore); //////////////////////////////////////////////////////////////////////////////// //this calls the static create_seq within fo_expr - fo_expr* create_seq(static_context* sctx, const QueryLoc &); + fo_expr* create_seq( + static_context* sctx, + user_function* udf, + const QueryLoc &); fo_expr* create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg); fo_expr* create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg1, @@ -436,18 +530,20 @@ fo_expr* create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, const std::vector& args); fo_expr* create_fo_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f); //////////////////////////////////////////////////////////////////////////////// - for_clause* create_for_clause( + forlet_clause* create_for_clause( static_context* sctx, const QueryLoc& loc, var_expr* varExpr, @@ -456,7 +552,7 @@ var_expr* scoreVarExpr = NULL, bool isOuter = false); - let_clause* create_let_clause( + forlet_clause* create_let_clause( static_context* sctx, const QueryLoc& loc, var_expr* varExpr, @@ -466,7 +562,7 @@ window_clause* create_window_clause( static_context* sctx, const QueryLoc& loc, - window_clause::window_t winKind, + WindowKind winKind, var_expr* varExpr, expr* domainExpr, flwor_wincond* winStart, @@ -476,15 +572,15 @@ flwor_wincond* create_flwor_wincond( static_context* sctx, bool isOnly, - const flwor_wincond::vars& in_vars, - const flwor_wincond::vars& out_vars, + const flwor_wincond_vars& in_vars, + const flwor_wincond_vars& out_vars, expr* cond); group_clause* create_group_clause( static_context* sctx, const QueryLoc& loc, - const flwor_clause::rebind_list_t& gvars, - flwor_clause::rebind_list_t ngvars, + const var_rebind_list_t& gvars, + const var_rebind_list_t& ngvars, const std::vector& collations); orderby_clause * create_orderby_clause ( @@ -510,6 +606,7 @@ flwor_expr* create_flwor_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, bool general); @@ -524,17 +621,20 @@ json_array_expr* create_json_array_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content); json_object_expr* create_json_object_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content, bool accumulate); json_direct_object_expr* create_json_direct_object_expr( static_context* sctx, + user_function* udf, const QueryLoc& loc, std::vector& names, std::vector& values); diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_put.cpp zorba-2.8.0-0/src/compiler/expression/expr_put.cpp --- zorba-2.7.0-0/src/compiler/expression/expr_put.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_put.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -54,42 +54,38 @@ namespace zorba { -#define BEGIN_PUT_NO_LOCATION(LABEL) \ - os << indent << #LABEL << expr_addr(this) << " [\n" << inc_indent - -#define BEGIN_PUT(LABEL) \ - os << indent << #LABEL << expr_addr(this) \ - << expr_loc(dynamic_cast(this)) << " [\n" << inc_indent - -#define BEGIN_PUT2(STRING) \ - os << indent << STRING << expr_addr(this) \ - << expr_loc(dynamic_cast(this)) << " [\n" << inc_indent - -#define BEGIN_PUT_NO_EOL(LABEL) \ - os << indent << #LABEL << expr_addr(this) \ - << expr_loc(dynamic_cast(this)) << " [ " - -#define BEGIN_PUT1(LABEL,S1) \ - os << indent << #LABEL << ' ' << (S1) << expr_addr(this) \ - << expr_loc(dynamic_cast(this)) << " [\n" << inc_indent +#define BEGIN_PUT(LABEL) \ + os << indent << #LABEL << expr_addr(this) \ + << " [\n" << inc_indent + +#define BEGIN_PUT_NL(LABEL) \ + os << indent << #LABEL << expr_addr(this) \ + << std::endl << indent << "[\n" << inc_indent + +#define BEGIN_PUT_MSG(MSG) \ + os << indent << MSG << expr_addr(this) \ + << " [\n" << inc_indent + +#define BEGIN_PUT_NO_EOL(LABEL) \ + os << indent << #LABEL << expr_addr(this) \ + << " [ " #define END_PUT() \ os << dec_indent << indent << "]\n"; return os; -#define PUT_SUB( LABEL, EXPR ) \ - if ( !(EXPR) ) ; else { os << indent << (LABEL) << "\n" << inc_indent; (EXPR)->put(os); os << dec_indent; } +#define END_PUT_NO_RET() \ + os << dec_indent << indent << "]\n"; -static inline zstring qname_to_string(store::Item_t qname) -{ - zstring result; - zstring pfx = qname->getPrefix(); - zstring ns = qname->getNamespace(); - if (! ns.empty()) - result += pfx.str() + "[=" + ns.str() + "]:"; - result += qname->getLocalName().str(); - return result; -} +#define PUT_SUB( LABEL, EXPR ) \ + if ( !(EXPR) ) \ + ; \ + else \ + { \ + os << indent << (LABEL) << "\n" << inc_indent; \ + (EXPR)->put(os); \ + os << dec_indent; \ + } static inline ostream& put_qname(store::Item_t qname, ostream& os) @@ -105,7 +101,7 @@ static inline string expr_addr(const void* e) { - if (Properties::instance()->noTreeIds ()) + if (Properties::instance()->noTreeIds()) { return ""; } @@ -150,40 +146,39 @@ std::ostream& wrapper_expr::put(std::ostream& os) const { -#ifdef VERBOSE - get_expr()->put(os); - return os; -#else - if (get_expr()->get_expr_kind() == var_expr_kind) + if (get_input()->get_expr_kind() == var_expr_kind) { - const var_expr* varExpr = static_cast(get_expr()); + const var_expr* varExpr = static_cast(get_input()); - BEGIN_PUT_NO_EOL(var_ref) ; + BEGIN_PUT_NO_EOL(vref) ; put_qname(varExpr->get_name(), os); os << expr_addr(varExpr) << " ]" << endl; return os; } else { - BEGIN_PUT( wrapper_expr ); - get_expr()->put(os); + BEGIN_PUT(wrapper_expr); + get_input()->put(os); END_PUT(); } -#endif } ostream& block_expr::put( ostream& os) const { - BEGIN_PUT( block_expr ); - for (checked_vector::const_iterator i = this->theArgs.begin (); - i != theArgs.end (); i++) - (*i)->put (os); + BEGIN_PUT_NL(block_expr); + + checked_vector::const_iterator i = this->theArgs.begin(); + + for (; i != theArgs.end(); i++) + (*i)->put(os); + END_PUT(); } + ostream& var_expr::put(ostream& os) const { - os << indent << "var kind=" << decode_var_kind(get_kind()) << expr_addr(this); + os << indent << "var " << decode_var_kind(get_kind()) << expr_addr(this); if (theName != NULL) { os << " name="; @@ -193,7 +188,7 @@ #if VERBOSE if (theDeclaredType != NULL) { - os << " type=" << theDeclaredType->toString(); + os << " type=" << theDeclaredType->toSchemaString(); } #endif @@ -202,67 +197,43 @@ } -ostream& for_clause::put(ostream& os) const +ostream& forlet_clause::put(ostream& os) const { -#if VERBOSE - BEGIN_PUT( FOR ); - - theVarExpr->put(os); - PUT_SUB( "AT", thePosVarExpr ); - PUT_SUB( "SCORE", theScoreVarExpr ); - - PUT_SUB("IN", theDomainExpr); - -#else - os << indent << "FOR" << expr_addr(this) << " "; - - put_qname(theVarExpr->get_name(), os); - - os << expr_addr(theVarExpr); - - if (thePosVarExpr != NULL) + if (theKind == flwor_clause::for_clause) { - os << " AT "; - put_qname(thePosVarExpr->get_name(), os); - os << expr_addr(thePosVarExpr); - } - os << endl << indent << "[\n" << inc_indent; - - theDomainExpr->put(os); -#endif - - END_PUT(); -} + os << indent << "FOR" << expr_addr(this) << " "; + put_qname(theVarExpr->get_name(), os); -ostream& let_clause::put(ostream& os) const -{ -#if VERBOSE - BEGIN_PUT(LET); + os << expr_addr(theVarExpr); - theVarExpr->put(os); - PUT_SUB("SCORE", theScoreVarExpr); - - PUT_SUB(":=", theDomainExpr); - -#else - os << indent << "LET" << expr_addr(this) << " "; + if (thePosVarExpr != NULL) + { + os << " AT "; + put_qname(thePosVarExpr->get_name(), os); + os << expr_addr(thePosVarExpr); + } + } + else + { + os << indent << "LET" << expr_addr(this) << " "; - put_qname(theVarExpr->get_name(), os); + put_qname(theVarExpr->get_name(), os); - os << expr_addr(theVarExpr); + os << expr_addr(theVarExpr); + } os << endl << indent << "[\n" << inc_indent; - + theDomainExpr->put(os); -#endif END_PUT(); } + ostream& window_clause::put(ostream& os) const { - BEGIN_PUT(WINDOW); + BEGIN_PUT_NL(WINDOW); theVarExpr->put(os); PUT_SUB("IN", theDomainExpr); PUT_SUB("START", theWinStartCond); @@ -273,7 +244,7 @@ ostream& flwor_wincond::vars::put(ostream& os) const { - BEGIN_PUT_NO_LOCATION( flwor_wincond::vars ); + BEGIN_PUT(flwor_wincond::vars); PUT_SUB( "AT", posvar ); PUT_SUB( "CURR", curr ); PUT_SUB( "NEXT", next ); @@ -283,7 +254,7 @@ ostream& flwor_wincond::put(ostream& os) const { - BEGIN_PUT_NO_LOCATION(flwor_wincond); + BEGIN_PUT(flwor_wincond); PUT_SUB("IN-VARS", &get_in_vars()); PUT_SUB("OUT-VARS", &get_out_vars()); PUT_SUB("WHEN", theCondExpr); @@ -293,9 +264,7 @@ ostream& group_clause::put(ostream& os) const { - os << indent << "GROUP-BY" << expr_addr(this) << " "; - - os << endl << indent << "[\n" << inc_indent; + BEGIN_PUT_NL(GROUPBY); os << indent << "GROUPING SPECS"; @@ -328,9 +297,7 @@ ostream& orderby_clause::put(ostream& os) const { - BEGIN_PUT(orderby_clause); - - //os << indent << "ORDER BY "; + BEGIN_PUT_NL(ORDERBY); csize numColumns = num_columns(); @@ -338,34 +305,21 @@ { theOrderingExprs[i]->put(os); } -#if 0 - os << endl; - os << indent << "VAR REBINDS "; - for (unsigned i = 0; i < theRebindList.size (); i++) - { - os << "$"; - put_qname(theRebindList[i].first->get_varname(), os); - os << " (" << theRebindList[i].first << " -> " - << theRebindList[i].second << ") "; - } - os << endl; -#endif END_PUT(); } ostream& materialize_clause::put(ostream& os) const { - BEGIN_PUT(materialize_clause); - + BEGIN_PUT_NL(MATERIALIZE); END_PUT(); } ostream& flwor_expr::put(ostream& os) const { - BEGIN_PUT(flwor_expr); + BEGIN_PUT_NL(flwor_expr); for (csize i = 0; i < num_clauses(); i++) { @@ -375,7 +329,9 @@ { case flwor_clause::where_clause: { - PUT_SUB( "WHERE", static_cast(&c)->get_expr() ); + BEGIN_PUT_NL(WHERE); + static_cast(&c)->get_expr()->put(os); + END_PUT_NO_RET(); break; } case flwor_clause::count_clause: @@ -386,13 +342,9 @@ break; } case flwor_clause::for_clause: - { - static_cast(&c)->put(os); - break; - } case flwor_clause::let_clause: { - static_cast(&c)->put(os); + static_cast(&c)->put(os); break; } case flwor_clause::window_clause: @@ -422,7 +374,7 @@ } } - os << indent << "RETURN\n" << inc_indent; + BEGIN_PUT_NL(RETURN); if (theReturnExpr == NULL) { os << indent << "NULL"; @@ -431,7 +383,8 @@ { theReturnExpr->put(os); } - os << dec_indent; + END_PUT_NO_RET(); + END_PUT(); } @@ -440,7 +393,7 @@ { os << indent << "promote_expr " << theTargetType->toString() << expr_addr (this) << " [\n" << inc_indent; - theInputExpr->put(os); + theInput->put(os); END_PUT(); } @@ -491,7 +444,7 @@ ostream& function_trace_expr::put(ostream& os) const { BEGIN_PUT(function_trace_expr); - theExpr->put(os); + theInput->put(os); END_PUT(); } @@ -509,8 +462,8 @@ BEGIN_PUT(var_decl_expr); theVarExpr->put(os); - if (theInitExpr) - theInitExpr->put(os); + if (theExpr) + theExpr->put(os); END_PUT(); } @@ -529,10 +482,16 @@ ostream& if_expr::put(ostream& os) const { - BEGIN_PUT(if_expr); + BEGIN_PUT_NL(if_expr); + theCondExpr->put(os); - PUT_SUB("THEN", theThenExpr); - PUT_SUB("ELSE", theElseExpr); + + os << indent << "THEN" << std::endl; + theThenExpr->put(os); + + os << indent << "ELSE" << std::endl; + theElseExpr->put(os); + END_PUT(); } @@ -540,12 +499,12 @@ ostream& fo_expr::put(ostream& os) const { const store::Item* qname = theFunction->getName(); - BEGIN_PUT2( qname->getStringValue() << "/" << num_args() ); - csize numArgs = theArgs.size(); + BEGIN_PUT_MSG( qname->getStringValue() << "/" << num_args() ); + csize numArgs = num_args(); for (csize i = 0; i < numArgs; ++i) { - theArgs[i]->put(os); + get_arg(i)->put(os); } END_PUT(); @@ -589,7 +548,7 @@ theExpr->put(os); - for (ulong i = 0; i < theArgs.size(); ++i) + for (csize i = 0; i < theArgs.size(); ++i) theArgs[i]->put(os); END_PUT(); @@ -598,35 +557,35 @@ ostream& instanceof_expr::put( ostream& os) const { - BEGIN_PUT1( instanceof_expr, theTargetType->toString() ); - theInputExpr->put(os); + BEGIN_PUT_MSG("instanceof_expr " << theTargetType->toSchemaString()); + theInput->put(os); END_PUT(); } -ostream& treat_expr::put( ostream& os) const +ostream& treat_expr::put(ostream& os) const { - BEGIN_PUT1( treat_expr, theTargetType->toString() ); - theInputExpr->put(os); + BEGIN_PUT_MSG("treat_expr " << theTargetType->toSchemaString()); + theInput->put(os); END_PUT(); } -ostream& castable_expr::put( ostream& os) const +ostream& castable_expr::put(ostream& os) const { - BEGIN_PUT1( castable_expr, theTargetType->toString() ); - theInputExpr->put(os); + BEGIN_PUT_MSG("castable_expr " << theTargetType->toSchemaString()); + theInput->put(os); END_PUT(); } -ostream& cast_expr::put( ostream& os) const +ostream& cast_expr::put(ostream& os) const { - BEGIN_PUT1( cast_expr, theTargetType->toString() ); - theInputExpr->put(os); + BEGIN_PUT_MSG("cast_expr " << theTargetType->toSchemaString()); + theInput->put(os); END_PUT(); } -ostream& name_cast_expr::put( ostream& os) const +ostream& name_cast_expr::put(ostream& os) const { - BEGIN_PUT( name_cast_expr ); + BEGIN_PUT(name_cast_expr); theInputExpr->put(os); END_PUT(); } @@ -634,7 +593,7 @@ ostream& validate_expr::put(ostream& os) const { - BEGIN_PUT( validate_expr ); + BEGIN_PUT(validate_expr); switch (theMode) { @@ -643,7 +602,7 @@ case ParseConstants::val_typename: os << "typename\n"; break; default: os << "??\n"; } - theExpr->put(os) << endl; + theInput->put(os) << endl; END_PUT(); } @@ -779,15 +738,15 @@ ostream& const_expr::put(ostream& os) const { - BEGIN_PUT_NO_EOL( const_expr ); + BEGIN_PUT_NO_EOL(const_expr); + if (theValue->isFunction()) { os << "functrion item [ " << theValue->show() << " ]"; } else { - os << get_val()->getType()->getStringValue() - << " [ " << theValue->show() << " ]"; + os << " " << theValue->show(); } os << " ]\n"; return os; @@ -796,16 +755,16 @@ ostream& order_expr::put(ostream& os) const { - os << indent << "order_expr" << expr_addr (this) << "\n" << inc_indent - << indent << "[ "; + BEGIN_PUT(order_expr); switch (theType) { - case ordered: os << "ordered\n"; break; - case unordered: os << "unordered\n"; break; + case doc_ordered: os << "ordered\n"; break; + case doc_unordered: os << "unordered\n"; break; default: os << "??\n"; } - theExpr->put(os) << endl; + theInput->put(os) << endl; + END_PUT(); } @@ -939,7 +898,7 @@ ostream& copy_clause::put(ostream& os) const { - BEGIN_PUT_NO_LOCATION(copy); + BEGIN_PUT(copy); theVar->put(os); theExpr->put(os); END_PUT(); diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_type.cpp zorba-2.8.0-0/src/compiler/expression/expr_type.cpp --- zorba-2.7.0-0/src/compiler/expression/expr_type.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_type.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -31,6 +31,9 @@ #include "compiler/expression/var_expr.h" #include "compiler/expression/expr.h" #include "compiler/expression/expr_iter.h" + +#include "compiler/api/compilercb.h" + #include "compiler/xqddf/collection_decl.h" #include "functions/function.h" @@ -105,14 +108,6 @@ break; } - case order_expr_kind: - { - order_expr* e = static_cast(this); - - newType = e->theExpr->get_return_type(); - break; - } - case validate_expr_kind: { theType = rtm.ANY_NODE_TYPE_ONE; @@ -126,9 +121,9 @@ TypeConstants::quantifier_t quant = TypeConstants::QUANT_ONE; - ulong numClauses = e->num_clauses(); + csize numClauses = e->num_clauses(); - for (ulong i = 0; i < numClauses && quant != TypeConstants::QUANT_STAR; ++i) + for (csize i = 0; i < numClauses && quant != TypeConstants::QUANT_STAR; ++i) { const flwor_clause* c = e->theClauses[i]; @@ -221,8 +216,38 @@ } case var_expr::prolog_var: { - // For const global vars, their type is set in + // NOTE: For const global vars, their declared type is set to the + // type of their init expr, if any. This is done in // translator::end_visit(const GlobalVarDecl& v, void*) + + csize numSetExprs = e->num_set_exprs(); + + if (e->get_ccb()->getPhase() == CompilerCB::OPTIMIZATION && + numSetExprs > 0 && + !e->is_external() && + !e->isInTypeCompute()) + { + e->setInTypeCompute(); + + var_set_expr* setExpr = e->get_set_expr(0); + + derivedType = setExpr->get_expr()->get_return_type(); + + for (csize i = 1; i < numSetExprs; ++i) + { + if (derivedType == rtm.ITEM_TYPE_STAR) + break; + + setExpr = e->get_set_expr(i); + + derivedType = TypeOps::union_type(*derivedType, + *setExpr->get_expr()->get_return_type(), + tm); + } + + e->resetInTypeCompute(); + } + break; } case var_expr::local_var: // TODO: compute derived type for const local vars. @@ -316,60 +341,14 @@ { fo_expr* e = static_cast(this); - const function* func = e->get_func(); /* - const user_function* udf = dynamic_cast(func); + const user_function* udf = static_cast(func); if (udf != NULL) return udf->getUDFReturnType(sctx); */ - FunctionConsts::FunctionKind funcKind = func->getKind(); - - switch (funcKind) - { - case FunctionConsts::STATIC_COLLECTIONS_DML_COLLECTION_1: - { - const store::Item* qname = e->theArgs[0]->getQName(theSctx); - - if (qname != NULL) - { - const StaticallyKnownCollection* collection = theSctx->lookup_collection(qname); - if (collection != NULL) - { - newType = collection->getCollectionType(); - } - else - { - RAISE_ERROR(zerr::ZDDY0001_COLLECTION_NOT_DECLARED, get_loc(), - ERROR_PARAMS(qname->getStringValue())); - } - } - break; - } - case FunctionConsts::FN_SUBSEQUENCE_3: - { - const_expr* lenExpr = dynamic_cast(e->theArgs[2]); - if (lenExpr != NULL) - { - store::Item* val = lenExpr->get_val(); - xs_double len = val->getDoubleValue(); - if (len == 1.0) - { - newType = tm->create_type(*e->theArgs[0]->get_return_type(), - TypeConstants::QUANT_QUESTION); - } - } - break; - } - default: - break; - } - - if (newType == NULL) - { - newType = e->theFunction->getReturnType(e); - } + newType = e->theFunction->getReturnType(e); break; } @@ -378,22 +357,46 @@ { cast_expr* e = static_cast(this); - xqtref_t argType = e->theInputExpr->get_return_type(); + xqtref_t argType = e->theInput->get_return_type(); TypeConstants::quantifier_t argQuant = argType->get_quantifier(); TypeConstants::quantifier_t targetQuant = e->theTargetType->get_quantifier(); - if (TypeOps::is_equal(tm, *argType, *rtm.EMPTY_TYPE, get_loc()) && - (targetQuant == TypeConstants::QUANT_QUESTION || - targetQuant == TypeConstants::QUANT_STAR)) + if (TypeOps::is_equal(tm, *argType, *rtm.EMPTY_TYPE, get_loc())) { - newType = rtm.EMPTY_TYPE; + if (targetQuant == TypeConstants::QUANT_QUESTION || + targetQuant == TypeConstants::QUANT_STAR) + newType = rtm.EMPTY_TYPE; + else + newType = rtm.NONE_TYPE; } - else + else if (e->theTargetType->isAtomicAny()) { TypeConstants::quantifier_t q = TypeOps::intersect_quant(argQuant, targetQuant); newType = tm->create_type(*e->theTargetType, q); } + else + { + ZORBA_ASSERT(e->theTargetType->type_kind() == XQType::USER_DEFINED_KIND); + + const UserDefinedXQType* targetType = + static_cast(e->theTargetType.getp()); + + if (targetType->isList()) + { + newType = tm->create_type(*targetType->getListItemType(), + TypeConstants::QUANT_STAR); + } + else + { + assert(targetType->isAtomic() || targetType->isUnion()); + + TypeConstants::quantifier_t q = TypeOps::intersect_quant(argQuant, targetQuant); + + newType = tm->create_type(*e->theTargetType, q); + } + } + break; } @@ -424,7 +427,7 @@ { promote_expr* e = static_cast(this); - xqtref_t in_type = e->theInputExpr->get_return_type(); + xqtref_t in_type = e->theInput->get_return_type(); xqtref_t in_ptype = TypeOps::prime_type(tm, *in_type); xqtref_t target_ptype = TypeOps::prime_type(tm, *e->theTargetType); @@ -536,7 +539,7 @@ switch (e->type) { - case text_expr::text_constructor: + case text_constructor: { xqtref_t t = e->get_text()->get_return_type(); @@ -550,7 +553,7 @@ break; } - case text_expr::comment_constructor: + case comment_constructor: nodeKind = store::StoreConsts::commentNode; break; @@ -748,15 +751,19 @@ case function_trace_expr_kind: { - function_trace_expr* e = static_cast(this); - newType = e->theExpr->get_return_type(); + newType = static_cast(this)->theInput->get_return_type(); + break; + } + + case order_expr_kind: + { + newType = static_cast(this)->theInput->get_return_type(); break; } case wrapper_expr_kind: { - wrapper_expr* e = static_cast(this); - newType = e->theWrappedExpr->get_return_type(); + newType = static_cast(this)->theInput->get_return_type(); break; } diff -Nru zorba-2.7.0-0/src/compiler/expression/expr_utils.h zorba-2.8.0-0/src/compiler/expression/expr_utils.h --- zorba-2.7.0-0/src/compiler/expression/expr_utils.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/expr_utils.h 2013-01-16 18:28:18.000000000 +0000 @@ -22,6 +22,9 @@ namespace zorba { +class expr; +class var_expr; + /****************************************************************************** Used by the orderspecs of an order by clause, and by the keyspecs of an index declaration. @@ -47,6 +50,11 @@ }; +/****************************************************************************** + +********************************************************************************/ +typedef std::vector > var_rebind_list_t; + } #endif diff -Nru zorba-2.7.0-0/src/compiler/expression/flwor_expr.cpp zorba-2.8.0-0/src/compiler/expression/flwor_expr.cpp --- zorba-2.7.0-0/src/compiler/expression/flwor_expr.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/flwor_expr.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -25,6 +25,7 @@ #include "compiler/expression/fo_expr.h" #include "compiler/expression/expr.h" #include "compiler/expression/expr_visitor.h" +#include "compiler/expression/expr_manager.h" #include "compiler/api/compilercb.h" @@ -107,10 +108,11 @@ { theDomainExpr = theCCB->theEM-> create_treat_expr(theDomainExpr->get_sctx(), + theDomainExpr->get_udf(), theDomainExpr->get_loc(), theDomainExpr, varType, - TreatIterator::TYPE_MATCH); + TREAT_TYPE_MATCH); } } } @@ -120,20 +122,23 @@ /******************************************************************************* ********************************************************************************/ -for_clause::for_clause( +forlet_clause::forlet_clause( static_context* sctx, CompilerCB* ccb, const QueryLoc& loc, + flwor_clause::ClauseKind kind, var_expr* varExpr, expr* domainExpr, var_expr* posVarExpr, var_expr* scoreVarExpr, - bool isAllowingEmpty) + bool isAllowingEmpty, + bool lazy) : - forletwin_clause(sctx, ccb, loc, flwor_clause::for_clause, varExpr, domainExpr), + forletwin_clause(sctx, ccb, loc, kind, varExpr, domainExpr), thePosVarExpr(posVarExpr), theScoreVarExpr(scoreVarExpr), - theAllowingEmpty(isAllowingEmpty) + theAllowingEmpty(isAllowingEmpty), + theLazyEval(lazy) { if (thePosVarExpr != NULL) thePosVarExpr->set_flwor_clause(this); @@ -147,9 +152,10 @@ TypeManager* tm = sctx->get_typemanager(); xqtref_t declaredType = varExpr->get_type(); + if (declaredType != NULL) { - if (declaredType->is_empty()) + if (kind == flwor_clause::for_clause && declaredType->is_empty()) { RAISE_ERROR(err::XPTY0004, loc, ERROR_PARAMS(ZED(BadType_23o), "empty-sequence")); @@ -157,27 +163,28 @@ xqtref_t domainType = domainExpr->get_return_type(); - if (!TypeOps::is_subtype(tm, *rtm.ITEM_TYPE_STAR, *declaredType, loc)) + if (!TypeOps::is_equal(tm, *rtm.ITEM_TYPE_STAR, *declaredType, loc)) { - declaredType = tm->create_type(*declaredType, TypeConstants::QUANT_STAR); + if (kind == flwor_clause::for_clause) + declaredType = tm->create_type(*declaredType, domainType->get_quantifier()); if (!TypeOps::is_subtype(tm, *domainType, *declaredType, loc)) { xqtref_t varType = TypeOps::intersect_type(*domainType, *declaredType, tm); + if (TypeOps::is_equal(tm, *varType, *rtm.NONE_TYPE, loc)) { RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(BadType_23o), - *domainType, - ZED(NoTreatAs_4), - *declaredType)); + ERROR_PARAMS(ZED(BadType_23o), *domainType, ZED(NoTreatAs_4), *declaredType)); } - domainExpr = theCCB->theEM->create_treat_expr(sctx, - loc, - domainExpr, - declaredType, - TreatIterator::TYPE_MATCH); + domainExpr = theCCB->theEM-> + create_treat_expr(sctx, + domainExpr->get_udf(), + loc, + domainExpr, + declaredType, + TREAT_TYPE_MATCH); set_expr(domainExpr); } @@ -187,7 +194,7 @@ } -for_clause::~for_clause() +forlet_clause::~forlet_clause() { if (thePosVarExpr != NULL) thePosVarExpr->set_flwor_clause(NULL); @@ -197,19 +204,19 @@ } -var_expr* for_clause::get_pos_var() const +var_expr* forlet_clause::get_pos_var() const { return thePosVarExpr; } -var_expr* for_clause::get_score_var() const +var_expr* forlet_clause::get_score_var() const { return theScoreVarExpr; } -void for_clause::set_pos_var(var_expr* v) +void forlet_clause::set_pos_var(var_expr* v) { thePosVarExpr = v; if (thePosVarExpr != NULL) @@ -217,7 +224,7 @@ } -void for_clause::set_score_var(var_expr* v) +void forlet_clause::set_score_var(var_expr* v) { theScoreVarExpr = v; if (theScoreVarExpr != NULL) @@ -225,139 +232,49 @@ } -flwor_clause* for_clause::clone(expr::substitution_t& subst) const +flwor_clause* forlet_clause::clone(user_function* udf, expr::substitution_t& subst) const { - expr* domainCopy = theDomainExpr->clone(subst); + expr* domainCopy = theDomainExpr->clone(udf, subst); - var_expr* varCopy = theCCB->theEM->create_var_expr(*theVarExpr); + var_expr* varCopy = theCCB->theEM->create_var_expr(udf, *theVarExpr); subst[theVarExpr] = varCopy; var_expr* posvarCopy = NULL; var_expr* pos_var_ptr = thePosVarExpr; if (pos_var_ptr) { - posvarCopy = theCCB->theEM->create_var_expr(*pos_var_ptr); + posvarCopy = theCCB->theEM->create_var_expr(udf, *pos_var_ptr); subst[pos_var_ptr] = posvarCopy; } var_expr* scorevarCopy = NULL; - var_expr* score_var_ptr = theScoreVarExpr; - if (score_var_ptr) + if (theScoreVarExpr) { - scorevarCopy = theCCB->theEM->create_var_expr(*score_var_ptr); - subst[score_var_ptr] = scorevarCopy; + scorevarCopy = theCCB->theEM->create_var_expr(udf, *theScoreVarExpr); + subst[theScoreVarExpr] = scorevarCopy; } - return theCCB->theEM->create_for_clause(theContext, - get_loc(), - varCopy, - domainCopy, - posvarCopy, - scorevarCopy, - theAllowingEmpty); -} - - -/******************************************************************************* - -********************************************************************************/ -let_clause::let_clause( - static_context* sctx, - CompilerCB* ccb, - const QueryLoc& loc, - var_expr* varExpr, - expr* domainExpr, - bool lazy) - : - forletwin_clause(sctx, ccb, loc, flwor_clause::let_clause, varExpr, domainExpr), - theScoreVarExpr(NULL), - theLazyEval(lazy) -{ - if (theScoreVarExpr != NULL) - theScoreVarExpr->set_flwor_clause(this); - - if (varExpr != NULL && sctx != NULL) + if (theKind == flwor_clause::for_clause) { - RootTypeManager& rtm = GENV_TYPESYSTEM; - TypeManager* tm = sctx->get_typemanager(); - - xqtref_t declaredType = varExpr->get_type(); - - if (declaredType != NULL) - { - xqtref_t domainType = domainExpr->get_return_type(); - - if (!TypeOps::is_subtype(tm, *rtm.ITEM_TYPE_STAR, *declaredType, loc) && - !TypeOps::is_subtype(tm, *domainType, *declaredType, loc)) - { - xqtref_t varType = TypeOps::intersect_type(*domainType, *declaredType, tm); - - if (TypeOps::is_equal(tm, *varType, *rtm.NONE_TYPE, loc)) - { - RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(BadType_23o), *domainType, ZED(NoTreatAs_4), *declaredType)); - } - - domainExpr = theCCB->theEM->create_treat_expr(sctx, - loc, - domainExpr, - declaredType, - TreatIterator::TYPE_MATCH); - - set_expr(domainExpr); - } - } + return theCCB->theEM->create_for_clause(theContext, + get_loc(), + varCopy, + domainCopy, + posvarCopy, + scorevarCopy, + theAllowingEmpty); } -} - - -let_clause::~let_clause() -{ - if (theScoreVarExpr != NULL) - theScoreVarExpr->set_flwor_clause(NULL); -} - - -var_expr* let_clause::get_score_var() const -{ - return theScoreVarExpr; -} - - -void let_clause::set_score_var(var_expr* v) -{ - theScoreVarExpr = v; - if (theScoreVarExpr != NULL) - theScoreVarExpr->set_flwor_clause(this); -} - - -flwor_clause* let_clause::clone(expr::substitution_t& subst) const -{ - expr* domainCopy = theDomainExpr->clone(subst); - - var_expr* varCopy = theCCB->theEM->create_var_expr(*theVarExpr); - subst[theVarExpr] = varCopy; - -#if 0 - var_expr* scorevarCopy = NULL; - var_expr* score_var_ptr = theScoreVarExpr; - if (score_var_ptr) + else { - scorevarCopy = theCCB->theEM->create_var_expr(*score_var_ptr); - subst->get(score_var_ptr) = scorevarCopy; + return theCCB->theEM->create_let_clause(theContext, + get_loc(), + varCopy, + domainCopy, + theLazyEval); } -#endif - - return theCCB->theEM->create_let_clause(theContext, - get_loc(), - varCopy, - domainCopy, - theLazyEval); } - /******************************************************************************* ********************************************************************************/ @@ -365,7 +282,7 @@ static_context* sctx, CompilerCB* ccb, const QueryLoc& loc, - window_t winKind, + WindowKind winKind, var_expr* varExpr, expr* domainExpr, flwor_wincond* winStart, @@ -403,10 +320,11 @@ { domainExpr = theCCB->theEM-> create_treat_expr(sctx, + domainExpr->get_udf(), loc, domainExpr, varType, - TreatIterator::TYPE_MATCH); + TREAT_TYPE_MATCH); set_expr(domainExpr); } @@ -441,21 +359,23 @@ } -flwor_clause* window_clause::clone(expr::substitution_t& subst) const +flwor_clause* window_clause::clone( + user_function* udf, + expr::substitution_t& subst) const { - expr* domainCopy = theDomainExpr->clone(subst); + expr* domainCopy = theDomainExpr->clone(udf, subst); - var_expr* varCopy = theCCB->theEM->create_var_expr(*theVarExpr); + var_expr* varCopy = theCCB->theEM->create_var_expr(udf, *theVarExpr); subst[theVarExpr] = varCopy; flwor_wincond* cloneStartCond = NULL; flwor_wincond* cloneStopCond = NULL; if (theWinStartCond != NULL) - cloneStartCond = theWinStartCond->clone(subst); + cloneStartCond = theWinStartCond->clone(udf, subst); if (theWinStopCond != NULL) - cloneStopCond = theWinStopCond->clone(subst); + cloneStopCond = theWinStopCond->clone(udf, subst); return theCCB->theEM->create_window_clause(theContext, get_loc(), @@ -493,15 +413,17 @@ xqtref_t condType = theCondExpr->get_return_type(); - if(!TypeOps::is_equal(tm, + if (!TypeOps::is_equal(tm, *condType, *GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE, theCondExpr->get_loc())) { - theCondExpr = theCCB->theEM->create_fo_expr(theCondExpr->get_sctx(), - theCondExpr->get_loc(), - GET_BUILTIN_FUNCTION(FN_BOOLEAN_1), - theCondExpr); + theCondExpr = theCCB->theEM-> + create_fo_expr(theCondExpr->get_sctx(), + theCondExpr->get_udf(), + theCondExpr->get_loc(), + BUILTIN_FUNC(FN_BOOLEAN_1), + theCondExpr); } } } @@ -513,22 +435,23 @@ } -flwor_wincond::vars::vars() -: -posvar(NULL), -curr(NULL), -prev(NULL), -next(NULL) +flwor_wincond_vars::flwor_wincond_vars() + : + posvar(NULL), + curr(NULL), + prev(NULL), + next(NULL) { } -flwor_wincond::vars::~vars() + +flwor_wincond_vars::~flwor_wincond_vars() { // set_flwor_clause(NULL); } -void flwor_wincond::vars::set_flwor_clause(flwor_clause* c) +void flwor_wincond_vars::set_flwor_clause(flwor_clause* c) { if (posvar != NULL) posvar->set_flwor_clause(c); if (curr != NULL) curr->set_flwor_clause(c); @@ -537,35 +460,36 @@ } -void flwor_wincond::vars::clone( +void flwor_wincond_vars::clone( ExprManager* mgr, + user_function* udf, flwor_wincond::vars& cloneVars, expr::substitution_t& subst) const { if (posvar != NULL) { - var_expr* varCopy = mgr->create_var_expr(*posvar); + var_expr* varCopy = mgr->create_var_expr(udf, *posvar); subst[posvar] = varCopy; cloneVars.posvar = varCopy; } if (curr != NULL) { - var_expr* varCopy = mgr->create_var_expr(*curr); + var_expr* varCopy = mgr->create_var_expr(udf, *curr); subst[curr] = varCopy; cloneVars.curr = varCopy; } if (prev != NULL) { - var_expr* varCopy = mgr->create_var_expr(*prev); + var_expr* varCopy = mgr->create_var_expr(udf, *prev); subst[prev] = varCopy; cloneVars.prev = varCopy; } if (next != NULL) { - var_expr* varCopy = mgr->create_var_expr(*next); + var_expr* varCopy = mgr->create_var_expr(udf, *next); subst[next] = varCopy; cloneVars.next = varCopy; } @@ -579,21 +503,23 @@ } -flwor_wincond* flwor_wincond::clone(expr::substitution_t& subst) const +flwor_wincond* flwor_wincond::clone( + user_function* udf, + expr::substitution_t& subst) const { flwor_wincond::vars cloneInVars; flwor_wincond::vars cloneOutVars; - theInputVars.clone(theCCB->theEM, cloneInVars, subst); - theOutputVars.clone(theCCB->theEM, cloneOutVars, subst); + theInputVars.clone(theCCB->theEM, udf, cloneInVars, subst); + theOutputVars.clone(theCCB->theEM, udf, cloneOutVars, subst); - expr* cloneCondExpr = theCondExpr->clone(subst); + expr* cloneCondExpr = theCondExpr->clone(udf, subst); return theCCB->theEM->create_flwor_wincond(NULL, - theIsOnly, - cloneInVars, - cloneOutVars, - cloneCondExpr); + theIsOnly, + cloneInVars, + cloneOutVars, + cloneCondExpr); } @@ -605,7 +531,7 @@ CompilerCB* ccb, const QueryLoc& loc, const rebind_list_t& gvars, - rebind_list_t ngvars, + const rebind_list_t& ngvars, const std::vector& collations) : flwor_clause(sctx, ccb, loc, flwor_clause::group_clause), @@ -663,7 +589,9 @@ } -flwor_clause* group_clause::clone(expr::substitution_t& subst) const +flwor_clause* group_clause::clone( + user_function* udf, + expr::substitution_t& subst) const { csize numGroupVars = theGroupVars.size(); csize numNonGroupVars = theNonGroupVars.size(); @@ -680,23 +608,29 @@ for (csize i = 0; i < numGroupVars; ++i) { - cloneGroupVars[i].first = theGroupVars[i].first->clone(subst); - cloneGroupVars[i].second = exprMgr->create_var_expr(*theGroupVars[i].second); + cloneGroupVars[i].first = theGroupVars[i].first->clone(udf, subst); + + cloneGroupVars[i].second = exprMgr-> + create_var_expr(udf, *theGroupVars[i].second); + subst[theGroupVars[i].second] = cloneGroupVars[i].second; } for (csize i = 0; i < numNonGroupVars; ++i) { - cloneNonGroupVars[i].first = theNonGroupVars[i].first->clone(subst); - cloneNonGroupVars[i].second = exprMgr->create_var_expr(*theNonGroupVars[i].second); + cloneNonGroupVars[i].first = theNonGroupVars[i].first->clone(udf, subst); + + cloneNonGroupVars[i].second = exprMgr-> + create_var_expr(udf, *theNonGroupVars[i].second); + subst[theNonGroupVars[i].second] = cloneNonGroupVars[i].second; } return theCCB->theEM->create_group_clause(theContext, - get_loc(), - cloneGroupVars, - cloneNonGroupVars, - theCollations); + get_loc(), + cloneGroupVars, + cloneNonGroupVars, + theCollations); } @@ -726,7 +660,9 @@ } -flwor_clause* orderby_clause::clone(expr::substitution_t& subst) const +flwor_clause* orderby_clause::clone( + user_function* udf, + expr::substitution_t& subst) const { csize numColumns = num_columns(); @@ -734,14 +670,14 @@ for (csize i = 0; i < numColumns; ++i) { - cloneExprs[i] = theOrderingExprs[i]->clone(subst); + cloneExprs[i] = theOrderingExprs[i]->clone(udf, subst); } return theCCB->theEM->create_orderby_clause(theContext, - get_loc(), - theStableOrder, - theModifiers, - cloneExprs); + get_loc(), + theStableOrder, + theModifiers, + cloneExprs); } @@ -758,7 +694,9 @@ } -flwor_clause* materialize_clause::clone(expr::substitution_t& subst) const +flwor_clause* materialize_clause::clone( + user_function* udf, + expr::substitution_t& subst) const { // we will reach here under the following scenario: // 1. We do plan seriazation @@ -782,6 +720,8 @@ flwor_clause(sctx, ccb, loc, flwor_clause::count_clause), theVarExpr(var) { + if (theVarExpr != NULL) + theVarExpr->set_flwor_clause(this); } @@ -792,11 +732,13 @@ } -flwor_clause* count_clause::clone(expr::substitution_t& subst) const +flwor_clause* count_clause::clone( + user_function* udf, + expr::substitution_t& subst) const { ExprManager* exprMgr = theVarExpr->get_ccb()->theEM; - var_expr* cloneVar = exprMgr->create_var_expr(*theVarExpr); + var_expr* cloneVar = exprMgr->create_var_expr(udf, *theVarExpr); subst[theVarExpr] = cloneVar; return theCCB->theEM->create_count_clause(theContext, get_loc(), cloneVar); @@ -825,9 +767,11 @@ } -flwor_clause* where_clause::clone(expr::substitution_t& subst) const +flwor_clause* where_clause::clone( + user_function* udf, + expr::substitution_t& subst) const { - expr* cloneExpr = theWhereExpr->clone(subst); + expr* cloneExpr = theWhereExpr->clone(udf, subst); return theCCB->theEM->create_where_clause(theContext, get_loc(), cloneExpr); } @@ -839,10 +783,11 @@ flwor_expr::flwor_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, bool general) : - expr(ccb, sctx, loc, (general ? gflwor_expr_kind : flwor_expr_kind)), + expr(ccb, sctx, udf, loc, (general ? gflwor_expr_kind : flwor_expr_kind)), theIsGeneral(general), theHasSequentialClauses(false), theReturnExpr(NULL) @@ -1062,53 +1007,97 @@ } -/******************************************************************************* - Put in the given vector the var_exprs for the variables defined by this flwor - expr. -********************************************************************************/ -void flwor_expr::get_vars_defined(std::vector& varExprs) const +/***************************************************************************** + Returns a set containing all the variables defined by the clauses of this + flwor expr. +******************************************************************************/ +void flwor_expr::get_vars(expr::FreeVars& vars) const { - csize numClauses = theClauses.size(); + csize numClauses = num_clauses(); for (csize i = 0; i < numClauses; ++i) { - const flwor_clause* c = theClauses[i]; + const flwor_clause& c = *get_clause(i); - if (c->get_kind() == flwor_clause::for_clause) + switch (c.get_kind()) { - const for_clause* fc = static_cast(c); + case flwor_clause::for_clause: + { + const for_clause* fc = static_cast(&c); + + vars.insert(fc->get_var()); - varExprs.push_back(fc->get_var()); + if (fc->get_pos_var() != NULL) + vars.insert(fc->get_pos_var()); - if (fc->get_pos_var()) - varExprs.push_back(fc->get_pos_var()); + break; } - else if (c->get_kind() == flwor_clause::let_clause) + case flwor_clause::let_clause: { - const let_clause* lc = static_cast(c); + const let_clause* lc = static_cast(&c); + vars.insert(lc->get_var()); + break; + } + case flwor_clause::window_clause: + { + const window_clause* wc = static_cast(&c); + + vars.insert(wc->get_var()); + + if (wc->get_win_start() != NULL) + { + const flwor_wincond* cond = wc->get_win_start(); + const flwor_wincond::vars& condvars = cond->get_out_vars(); + + if (condvars.posvar != NULL) vars.insert(condvars.posvar); + if (condvars.curr != NULL) vars.insert(condvars.curr); + if (condvars.prev != NULL) vars.insert(condvars.prev); + if (condvars.next != NULL) vars.insert(condvars.next); + } - varExprs.push_back(lc->get_var()); + if (wc->get_win_stop() != NULL) + { + const flwor_wincond* cond = wc->get_win_stop(); + const flwor_wincond::vars& condvars = cond->get_out_vars(); + + if (condvars.posvar != NULL) vars.insert(condvars.posvar); + if (condvars.curr != NULL) vars.insert(condvars.curr); + if (condvars.prev != NULL) vars.insert(condvars.prev); + if (condvars.next != NULL) vars.insert(condvars.next); + } + + break; } - else if (c->get_kind() == flwor_clause::window_clause) + case flwor_clause::group_clause: { - const window_clause* wc = static_cast(c); + const group_clause* gc = static_cast(&c); - varExprs.push_back(wc->get_var()); + flwor_clause::rebind_list_t::const_iterator ite = gc->beginGroupVars(); + flwor_clause::rebind_list_t::const_iterator end = gc->endGroupVars(); - const flwor_wincond* startCond = wc->get_win_start(); - const flwor_wincond* stopCond = wc->get_win_stop(); - const flwor_wincond::vars& startVars = startCond->get_out_vars(); - const flwor_wincond::vars& stopVars = stopCond->get_out_vars(); - - if (startVars.posvar) varExprs.push_back(startVars.posvar); - if (startVars.curr) varExprs.push_back(startVars.curr); - if (startVars.prev) varExprs.push_back(startVars.prev); - if (startVars.next) varExprs.push_back(startVars.next); - - if (stopVars.posvar) varExprs.push_back(stopVars.posvar); - if (stopVars.curr) varExprs.push_back(stopVars.curr); - if (stopVars.prev) varExprs.push_back(stopVars.prev); - if (stopVars.next) varExprs.push_back(stopVars.next); + for (; ite != end; ++ite) + { + vars.insert((*ite).second); + } + + ite = gc->beginNonGroupVars(); + end = gc->endNonGroupVars(); + + for (; ite != end; ++ite) + { + vars.insert((*ite).second); + } + + break; + } + case flwor_clause::count_clause: + { + const count_clause* cc = static_cast(&c); + vars.insert(cc->get_var()); + break; + } + default: + break; } } } @@ -1167,27 +1156,5 @@ } -/******************************************************************************* - -********************************************************************************/ -expr* flwor_expr::cloneImpl(substitution_t& subst) const -{ - ulong numClauses = num_clauses(); - - flwor_expr* cloneFlwor = theCCB->theEM->create_flwor_expr(theSctx, get_loc(), theIsGeneral); - - for (ulong i = 0; i < numClauses; ++i) - { - flwor_clause* cloneClause = theClauses[i]->clone(subst); - - cloneFlwor->add_clause(cloneClause, false); - } - - cloneFlwor->set_return_expr(theReturnExpr->clone(subst)); - - return cloneFlwor; -} - - } // namespace zorba /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/flwor_expr.h zorba-2.8.0-0/src/compiler/expression/flwor_expr.h --- zorba-2.7.0-0/src/compiler/expression/flwor_expr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/flwor_expr.h 2013-01-16 18:28:18.000000000 +0000 @@ -30,9 +30,6 @@ class ExprManager; class order_modifier; -class flwor_clause; -class for_clause; -class let_clause; class window_clause; class flwor_wincond; class orderby_clause; @@ -45,12 +42,13 @@ ********************************************************************************/ class flwor_clause { + friend class expr; friend class flwor_expr; friend class ExprIterator; friend class ExprManager; public: - typedef std::vector > rebind_list_t; + typedef var_rebind_list_t rebind_list_t; typedef enum { @@ -95,17 +93,17 @@ ClauseKind get_kind() const { return theKind; } - flwor_expr* get_flwor_expr() const { return theFlworExpr; } + void set_kind(ClauseKind k) { theKind = k; } - virtual expr* get_expr() const { return NULL; } + flwor_expr* get_flwor_expr() const { return theFlworExpr; } virtual void set_expr(expr* v) { } virtual var_expr* get_pos_var() const { return NULL; } - virtual var_expr* get_score_var() const { return NULL; } - - virtual flwor_clause* clone(expr::substitution_t& substitution) const = 0; + virtual flwor_clause* clone( + user_function* udf, + expr::substitution_t& substitution) const = 0; }; @@ -137,6 +135,7 @@ ********************************************************************************/ class forletwin_clause : public flwor_clause { + friend class expr; friend class flwor_expr; friend class ExprManager; friend class ExprIterator; @@ -161,6 +160,8 @@ expr* get_expr() const { return theDomainExpr; } + expr** get_expr_ref() { return &theDomainExpr; } + var_expr* get_var() const { return theVarExpr; } void set_var(var_expr* v); @@ -170,7 +171,7 @@ /***************************************************************************//** ********************************************************************************/ -class for_clause : public forletwin_clause +class forlet_clause : public forletwin_clause { friend class flwor_expr; friend class ExprManager; @@ -180,25 +181,32 @@ var_expr * thePosVarExpr; var_expr * theScoreVarExpr; bool theAllowingEmpty; + bool theLazyEval; protected: - for_clause( + forlet_clause( static_context* sctx, CompilerCB* ccb, const QueryLoc& loc, + flwor_clause::ClauseKind kind, var_expr* varExpr, expr* domainExpr, - var_expr* posVarExpr = NULL, - var_expr* scoreVarExpr = NULL, - bool isOuter = false); + var_expr* posVarExpr, + var_expr* scoreVarExpr, + bool isOuter, + bool lazy); public: - ~for_clause(); + ~forlet_clause(); bool is_allowing_empty() const { return theAllowingEmpty; } void set_allowing_empty(bool allowing_empty) { theAllowingEmpty = allowing_empty; } + void setLazyEval(bool v) { theLazyEval = v; } + + bool lazyEval() const { return theLazyEval; } + var_expr* get_pos_var() const; var_expr* get_score_var() const; @@ -207,47 +215,7 @@ void set_score_var(var_expr* v); - flwor_clause* clone(expr::substitution_t& substitution) const; - - std::ostream& put(std::ostream&) const; -}; - - -/***************************************************************************//** - theScoreVarExpr : - theLazyEval : Whether the window var can be materilized lazily or not. -********************************************************************************/ -class let_clause : public forletwin_clause -{ - friend class flwor_expr; - friend class ExprManager; - friend class ExprIterator; - -protected: - var_expr * theScoreVarExpr; - bool theLazyEval; - -protected: - let_clause( - static_context* sctx, - CompilerCB* ccb, - const QueryLoc& loc, - var_expr* varExpr, - expr* domainExpr, - bool lazy = false); - -public: - ~let_clause(); - - var_expr* get_score_var() const; - - void set_score_var(var_expr* v); - - void setLazyEval(bool v) { theLazyEval = v; } - - bool lazyEval() const { return theLazyEval; } - - flwor_clause* clone(expr::substitution_t& substitution) const; + flwor_clause* clone(user_function* udf, expr::substitution_t& substitution) const; std::ostream& put(std::ostream&) const; }; @@ -261,15 +229,13 @@ ********************************************************************************/ class window_clause : public forletwin_clause { + friend class expr; friend class flwor_expr; friend class ExprManager; friend class ExprIterator; -public: - typedef enum { tumbling_window, sliding_window } window_t; - protected: - window_t theWindowKind; + WindowKind theWindowKind; flwor_wincond * theWinStartCond; flwor_wincond * theWinStopCond; bool theLazyEval; @@ -279,7 +245,7 @@ static_context* sctx, CompilerCB* ccb, const QueryLoc& loc, - window_t winKind, + WindowKind winKind, var_expr* varExpr, expr* domainExpr, flwor_wincond* winStart, @@ -289,7 +255,7 @@ public: ~window_clause(); - window_t get_winkind() const { return theWindowKind; } + WindowKind get_winkind() const { return theWindowKind; } flwor_wincond* get_win_start() const { return theWinStartCond; } @@ -303,7 +269,33 @@ bool lazyEval() const { return theLazyEval; } - flwor_clause* clone(expr::substitution_t& substitution) const; + flwor_clause* clone(user_function* udf, expr::substitution_t& substitution) const; + + std::ostream& put(std::ostream&) const; +}; + + +/***************************************************************************//** + +********************************************************************************/ +struct flwor_wincond_vars +{ + var_expr* posvar; + var_expr* curr; + var_expr* prev; + var_expr* next; + + flwor_wincond_vars(); + + ~flwor_wincond_vars(); + + void set_flwor_clause(flwor_clause* c); + + void clone( + ExprManager* mgr, + user_function* udf, + flwor_wincond_vars& cloneVars, + expr::substitution_t& subst) const; std::ostream& put(std::ostream&) const; }; @@ -341,26 +333,13 @@ ********************************************************************************/ class flwor_wincond { + friend class expr; friend class flwor_expr; friend class ExprManager; friend class ExprIterator; public: - struct vars - { - var_expr* posvar; - var_expr* curr; - var_expr* prev; - var_expr* next; - - vars(); - ~vars(); - void set_flwor_clause(flwor_clause* c); - - void clone(ExprManager* mgr, vars& cloneVars, expr::substitution_t& subst) const; - - std::ostream& put(std::ostream&) const; - }; + typedef flwor_wincond_vars vars; protected: bool theIsOnly; @@ -382,9 +361,9 @@ public: ~flwor_wincond(); - expr* get_cond() const { return theCondExpr; } + expr* get_expr() const { return theCondExpr; } - void set_cond(expr* cond) { theCondExpr = cond; } + void set_expr(expr* cond) { theCondExpr = cond; } bool is_only() const { return theIsOnly; } @@ -394,7 +373,7 @@ void set_flwor_clause(flwor_clause *); - flwor_wincond* clone(expr::substitution_t& substitution) const; + flwor_wincond* clone(user_function* udf, expr::substitution_t& substitution) const; std::ostream& put(std::ostream&) const; }; @@ -428,6 +407,7 @@ ********************************************************************************/ class group_clause : public flwor_clause { + friend class expr; friend class flwor_expr; friend class ExprManager; friend class ExprIterator; @@ -442,7 +422,7 @@ CompilerCB* ccb, const QueryLoc& loc, const rebind_list_t& gvars, - rebind_list_t ngvars, + const rebind_list_t& ngvars, const std::vector& collations); public: @@ -450,9 +430,9 @@ const std::vector& get_collations() const { return theCollations; } - csize getNumGroupingVars() const { return theGroupVars.size(); } + csize numGroupingVars() const { return theGroupVars.size(); } - csize getNumNonGroupingVars() const { return theNonGroupVars.size(); } + csize numNonGroupingVars() const { return theNonGroupVars.size(); } const rebind_list_t& get_grouping_vars() const { return theGroupVars; } @@ -484,7 +464,11 @@ expr* get_input_for_nongroup_var(const var_expr* var); - flwor_clause* clone(expr::substitution_t& substitution) const; + expr** get_gexpr_ref(csize i) { return &(theGroupVars[i].first); } + + expr** get_ngexpr_ref(csize i) { return &(theNonGroupVars[i].first); } + + flwor_clause* clone(user_function* udf, expr::substitution_t& substitution) const; std::ostream& put(std::ostream&) const; }; @@ -506,6 +490,7 @@ ********************************************************************************/ class orderby_clause : public flwor_clause { + friend class expr; friend class ExprIterator; friend class ExprManager; friend class flwor_expr; @@ -550,9 +535,11 @@ expr* get_column_expr(csize i) const { return theOrderingExprs[i]; } + expr** get_expr_ref(csize i) { return &theOrderingExprs[i]; } + void set_column_expr(csize i, expr* e) { theOrderingExprs[i] = e; } - flwor_clause* clone(expr::substitution_t& substitution) const; + flwor_clause* clone(user_function* udf, expr::substitution_t& substitution) const; std::ostream& put(std::ostream&) const; }; @@ -572,7 +559,7 @@ materialize_clause(static_context* sctx, CompilerCB* ccb, const QueryLoc& loc); public: - flwor_clause* clone(expr::substitution_t& substitution) const; + flwor_clause* clone(user_function* udf, expr::substitution_t& substitution) const; std::ostream& put(std::ostream&) const; }; @@ -597,7 +584,7 @@ var_expr* get_var() const { return theVarExpr; } - flwor_clause* clone(expr::substitution_t& substitution) const; + flwor_clause* clone(user_function* udf, expr::substitution_t& substitution) const; }; @@ -617,9 +604,11 @@ public: expr* get_expr() const { return theWhereExpr; } + expr** get_expr_ref() { return &theWhereExpr; } + void set_expr(expr* where); - flwor_clause* clone(expr::substitution_t& substitution) const; + flwor_clause* clone(user_function* udf, expr::substitution_t& substitution) const; }; @@ -665,7 +654,12 @@ expr * theReturnExpr; protected: - flwor_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, bool general); + flwor_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + bool general); public: bool is_general() const { return theIsGeneral; } @@ -674,6 +668,8 @@ expr* get_return_expr() const { return theReturnExpr; } + expr** get_return_expr_ref() { return &theReturnExpr; } + void set_return_expr(expr* e) { theReturnExpr = e; @@ -702,9 +698,7 @@ long defines_variable(const var_expr* v) const; - void get_vars_defined(std::vector& varExprs) const; - - expr* cloneImpl(substitution_t& substitution) const; + void get_vars(expr::FreeVars& vars) const; // The following 5 methods are for the simple flwor only. They should be // removed eventually. diff -Nru zorba-2.7.0-0/src/compiler/expression/fo_expr.cpp zorba-2.8.0-0/src/compiler/expression/fo_expr.cpp --- zorba-2.7.0-0/src/compiler/expression/fo_expr.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/fo_expr.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -19,6 +19,7 @@ #include "compiler/expression/fo_expr.h" #include "compiler/expression/expr_visitor.h" +#include "compiler/expression/expr_manager.h" #include "compiler/api/compilercb.h" @@ -55,11 +56,15 @@ UnionExpr, and IntersectExceptExpr. ********************************************************************************/ -fo_expr* fo_expr::create_seq(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc) +fo_expr* fo_expr::create_seq( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc) { function* f = BuiltinFunctionLibrary::getFunction(FunctionConsts::OP_CONCATENATE_N); - std::auto_ptr fo(ccb->theEM->create_fo_expr(sctx, loc, f)); + std::auto_ptr fo(ccb->theEM->create_fo_expr(sctx, udf, loc, f)); return fo.release(); } @@ -68,10 +73,11 @@ fo_expr::fo_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f) : - expr(ccb, sctx, loc, fo_expr_kind), + expr(ccb, sctx, udf, loc, fo_expr_kind), theFunction(const_cast(f)) { // This method is private and it is to be used only by the clone method @@ -83,11 +89,12 @@ fo_expr::fo_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg) : - expr(ccb, sctx, loc, fo_expr_kind), + expr(ccb, sctx, udf, loc, fo_expr_kind), theFunction(const_cast(f)) { assert(f != NULL); @@ -101,12 +108,13 @@ fo_expr::fo_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg1, expr* arg2) : - expr(ccb, sctx, loc, fo_expr_kind), + expr(ccb, sctx, udf, loc, fo_expr_kind), theFunction(const_cast(f)) { assert(f != NULL); @@ -121,11 +129,12 @@ fo_expr::fo_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, const std::vector& args) : - expr(ccb, sctx, loc, fo_expr_kind), + expr(ccb, sctx, udf, loc, fo_expr_kind), theArgs(args), theFunction(const_cast(f)) { @@ -273,29 +282,6 @@ } -expr* fo_expr::cloneImpl(substitution_t& subst) const -{ - if (get_func()->getKind() == FunctionConsts::STATIC_COLLECTIONS_DML_COLLECTION_1) - { - expr::subst_iter_t i = subst.find(this); - - if (i != subst.end()) - return i->second; - } - - std::auto_ptr fo(theCCB->theEM->create_fo_expr(theSctx, - get_loc(), - get_func())); - - for (csize i = 0; i < theArgs.size(); ++i) - fo->theArgs.push_back(theArgs[i]->clone(subst)); - - fo->theScriptingKind = theScriptingKind; - - return fo.release(); -} - - } /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/fo_expr.h zorba-2.8.0-0/src/compiler/expression/fo_expr.h --- zorba-2.7.0-0/src/compiler/expression/fo_expr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/fo_expr.h 2013-01-16 18:28:18.000000000 +0000 @@ -45,12 +45,24 @@ public: protected: - static fo_expr* create_seq(CompilerCB* ccb, static_context* sctx, const QueryLoc&); + static fo_expr* create_seq( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&); protected: fo_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, + const QueryLoc& loc, + const function* f); + + fo_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg); @@ -58,6 +70,7 @@ fo_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, expr* arg1, @@ -66,6 +79,7 @@ fo_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const function* f, const std::vector& args); @@ -95,8 +109,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -106,30 +118,6 @@ }; -////////// The following expressions in the AST "decay" into an fo_expr /////// - -typedef fo_expr additive_expr; - -typedef fo_expr and_expr; - -typedef fo_expr comparison_expr; - -typedef fo_expr enclosed_expr; - -typedef fo_expr intersect_except_expr; - -typedef fo_expr multiplicative_expr; - -typedef fo_expr or_expr; - -typedef fo_expr quantified_expr; - -typedef fo_expr range_expr; - -typedef fo_expr unary_expr; - -typedef fo_expr union_expr; - } // namespace zorba #endif diff -Nru zorba-2.7.0-0/src/compiler/expression/ft_expr.cpp zorba-2.8.0-0/src/compiler/expression/ft_expr.cpp --- zorba-2.7.0-0/src/compiler/expression/ft_expr.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/ft_expr.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -35,12 +35,13 @@ ftcontains_expr::ftcontains_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, QueryLoc const &loc, expr* range, ftnode *ftselection, expr* ftignore ) : - expr(ccb, sctx, loc, ft_expr_kind ), + expr(ccb, sctx, udf, loc, ft_expr_kind ), range_( range ), ftselection_( ftselection ), ftignore_( ftignore ) @@ -50,6 +51,7 @@ compute_scripting_kind(); } + void ftcontains_expr::accept( expr_visitor &v ) { if ( v.begin_visit( *this ) ) { EV_ACCEPT( range_, v ); @@ -59,16 +61,9 @@ v.end_visit( *this ); } -expr* ftcontains_expr::cloneImpl( substitution_t &s ) const { - return theCCB->theEM->create_ftcontains_expr( - theSctx, get_loc(), - range_->clone( s ), - ftselection_->clone( s ).release(), - ftignore_ == NULL ? 0 : ftignore_->clone( s ) - ); -} -void ftcontains_expr::compute_scripting_kind() { +void ftcontains_expr::compute_scripting_kind() +{ checkSimpleExpr(range_); theScriptingKind = SIMPLE_EXPR; @@ -76,5 +71,11 @@ } +ftnode_t ftcontains_expr::get_ftselection() const +{ + return ftselection_; +} + + } // namespace zorba /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/ft_expr.h zorba-2.8.0-0/src/compiler/expression/ft_expr.h --- zorba-2.7.0-0/src/compiler/expression/ft_expr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/ft_expr.h 2013-01-16 18:28:18.000000000 +0000 @@ -29,6 +29,7 @@ */ class ftcontains_expr : public expr { + friend class expr; friend class ExprIterator; friend class ExprManager; @@ -36,6 +37,7 @@ ftcontains_expr( CompilerCB* ccb, static_context*, + user_function*, QueryLoc const&, expr* range, ftnode *ftselection, @@ -43,12 +45,10 @@ ); public: - expr* cloneImpl( substitution_t& ) const; - void compute_scripting_kind(); expr* get_range() const { return range_; } - ftnode_t get_ftselection() const { return ftselection_; } + ftnode_t get_ftselection() const; expr* get_ignore() const { return ftignore_; } void accept( expr_visitor& ); diff -Nru zorba-2.7.0-0/src/compiler/expression/ftnode.cpp zorba-2.8.0-0/src/compiler/expression/ftnode.cpp --- zorba-2.7.0-0/src/compiler/expression/ftnode.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/ftnode.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -171,37 +171,60 @@ /////////////////////////////////////////////////////////////////////////////// template -inline PointerType clone_ptr( PointerType p, expr::substitution_t &s ) { - return static_cast( p->clone( s ).release() ); +inline PointerType clone_ptr( + PointerType p, + user_function* udf, + expr::substitution_t &s ) +{ + return static_cast( p->clone( udf, s ).release() ); } + template<> -inline expr* clone_ptr( expr* p, expr::substitution_t &s ) { - return static_cast( p->clone( s ) ); +inline expr* clone_ptr( expr* p, user_function* udf, expr::substitution_t &s ) { + return static_cast( p->clone(udf, s) ); } + template -inline RCHandleValueType* clone_ptr( rchandle const &p, - expr::substitution_t &s ) { - return static_cast( p->clone( s ).release() ); +inline RCHandleValueType* clone_ptr( + rchandle const &p, + user_function* udf, + expr::substitution_t &s ) +{ + return static_cast( p->clone(udf, s).release() ); } + template -inline PointerType clone_ptr_if( PointerType p, expr::substitution_t &s ) { - return p ? clone_ptr( p, s ) : nullptr; +inline PointerType clone_ptr_if( + PointerType p, + user_function* udf, + expr::substitution_t &s ) +{ + return p ? clone_ptr( p, udf, s ) : nullptr; } + template -inline RCHandleValueType* clone_ptr_if( rchandle const &p, - expr::substitution_t &s ) { - return p.isNull() ? nullptr : clone_ptr( p, s ); +inline RCHandleValueType* clone_ptr_if( + rchandle const &p, + user_function* udf, + expr::substitution_t &s ) +{ + return p.isNull() ? nullptr : clone_ptr( p, udf, s ); } + template -void clone_list( ContainerType const &from, ContainerType *to, - expr::substitution_t &s ) { +void clone_list( + ContainerType const &from, + ContainerType *to, + user_function* udf, + expr::substitution_t &s ) +{ FOR_EACH( typename ContainerType, i, from ) - to->push_back( clone_ptr( *i, s ) ); + to->push_back( clone_ptr( *i, udf, s ) ); } /////////////////////////////////////////////////////////////////////////////// @@ -221,9 +244,9 @@ END_VISIT( v ); } -ftnode_t ftand::clone( expr::substitution_t &s ) const { +ftnode_t ftand::clone(user_function* udf, expr::substitution_t &s ) const { ftnode_list_t copy; - clone_list( get_node_list(), ©, s ); + clone_list( get_node_list(), ©, udf, s ); return new ftand( get_loc(), copy ); } @@ -251,7 +274,7 @@ END_VISIT( v ); } -ftnode_t ftcase_option::clone( expr::substitution_t& ) const { +ftnode_t ftcase_option::clone(user_function* udf, expr::substitution_t& ) const { return new ftcase_option( get_loc(), mode_ ); } @@ -279,7 +302,7 @@ END_VISIT( v ); } -ftnode_t ftcontent_filter::clone( expr::substitution_t &s ) const { +ftnode_t ftcontent_filter::clone(user_function* udf, expr::substitution_t &s ) const { return new ftcontent_filter( get_loc(), mode_ ); } @@ -308,7 +331,7 @@ END_VISIT( v ); } -ftnode_t ftdiacritics_option::clone( expr::substitution_t& ) const { +ftnode_t ftdiacritics_option::clone(user_function* udf, expr::substitution_t& ) const { return new ftdiacritics_option( get_loc(), mode_ ); } @@ -345,8 +368,8 @@ END_VISIT( v ); } -ftnode_t ftdistance_filter::clone( expr::substitution_t &s ) const { - return new ftdistance_filter( get_loc(), clone_ptr_if( range_, s ), unit_ ); +ftnode_t ftdistance_filter::clone(user_function* udf, expr::substitution_t &s ) const { + return new ftdistance_filter( get_loc(), clone_ptr_if( range_, udf, s ), unit_ ); } ostream& ftdistance_filter::put( ostream &o ) const { @@ -384,9 +407,9 @@ END_VISIT( v ); } -ftnode_t ftextension_selection::clone( expr::substitution_t &s ) const { +ftnode_t ftextension_selection::clone(user_function* udf, expr::substitution_t &s ) const { return new ftextension_selection( - get_loc(), pragmas_, clone_ptr_if( ftselection_, s ) + get_loc(), pragmas_, clone_ptr_if( ftselection_, udf, s ) ); } @@ -418,7 +441,7 @@ END_VISIT( v ); } -ftnode_t ftextension_option::clone( expr::substitution_t& ) const { +ftnode_t ftextension_option::clone(user_function* udf, expr::substitution_t& ) const { return new ftextension_option( get_loc(), qname_, val_ ); } @@ -449,7 +472,7 @@ ), ERROR_LOC( loc ) ); - if ( !(lang_ = locale::find_lang( lang.c_str() )) ) + if ( !(lang_ = locale::find_lang( lang )) ) throw XQUERY_EXCEPTION( err::FTST0009, ERROR_PARAMS( lang ), ERROR_LOC( loc ) ); @@ -475,7 +498,7 @@ END_VISIT( v ); } -ftnode_t ftlanguage_option::clone( expr::substitution_t& ) const { +ftnode_t ftlanguage_option::clone(user_function* udf, expr::substitution_t& ) const { return new ftlanguage_option( get_loc(), lang_ ); } @@ -508,30 +531,28 @@ END_VISIT( v ); } -ftnode_t ftmatch_options::clone( expr::substitution_t &s ) const { +ftnode_t ftmatch_options::clone(user_function* udf, expr::substitution_t &s ) const { unique_ptr p( new ftmatch_options( get_loc() ) ); if ( case_option_ ) - p->set_case_option( clone_ptr( case_option_, s ) ); + p->set_case_option( clone_ptr( case_option_, udf, s ) ); if ( diacritics_option_ ) - p->set_diacritics_option( - clone_ptr( diacritics_option_, s ) - ); + p->set_diacritics_option( clone_ptr( diacritics_option_, udf, s ) ); FOR_EACH( ftextension_option_list_t, i, extension_options_ ) - p->add_extension_option( clone_ptr( *i, s ) ); + p->add_extension_option( clone_ptr( *i, udf, s ) ); if ( current_extension_options_ != &extension_options_ ) p->set_extension_options( current_extension_options_ ); if ( language_option_ ) - p->set_language_option( clone_ptr( language_option_, s ) ); + p->set_language_option( clone_ptr( language_option_, udf, s ) ); if ( stem_option_ ) - p->set_stem_option( clone_ptr( stem_option_, s ) ); + p->set_stem_option( clone_ptr( stem_option_, udf, s ) ); if ( stop_word_option_ ) - p->set_stop_word_option( clone_ptr( stop_word_option_, s ) ); + p->set_stop_word_option( clone_ptr( stop_word_option_, udf, s ) ); if ( thesaurus_option_ ) - p->set_thesaurus_option( clone_ptr( thesaurus_option_, s ) ); + p->set_thesaurus_option( clone_ptr( thesaurus_option_, udf, s ) ); if ( wild_card_option_ ) - p->set_wild_card_option( clone_ptr( wild_card_option_, s ) ); + p->set_wild_card_option( clone_ptr( wild_card_option_, udf, s ) ); return p.release(); } @@ -589,9 +610,9 @@ END_VISIT( v ); } -ftnode_t ftmild_not::clone( expr::substitution_t &s ) const { +ftnode_t ftmild_not::clone(user_function* udf, expr::substitution_t &s ) const { ftnode_list_t copy; - clone_list( get_node_list(), ©, s ); + clone_list( get_node_list(), ©, udf, s ); return new ftmild_not( get_loc(), copy ); } @@ -631,9 +652,9 @@ END_VISIT( v ); } -ftnode_t ftor::clone( expr::substitution_t &s ) const { +ftnode_t ftor::clone(user_function* udf, expr::substitution_t &s ) const { ftnode_list_t copy; - clone_list( get_node_list(), ©, s ); + clone_list( get_node_list(), ©, udf, s ); return new ftor( get_loc(), copy ); } @@ -657,7 +678,7 @@ END_VISIT( v ); } -ftnode_t ftorder_filter::clone( expr::substitution_t &s ) const { +ftnode_t ftorder_filter::clone(user_function* udf, expr::substitution_t &s ) const { return new ftorder_filter( get_loc() ); } @@ -701,14 +722,14 @@ END_VISIT( v ); } -ftnode_t ftprimary_with_options::clone( expr::substitution_t &s ) const { +ftnode_t ftprimary_with_options::clone(user_function* udf, expr::substitution_t &s ) const { unique_ptr p( new ftprimary_with_options( get_loc() ) ); - p->set_match_options( clone_ptr( match_options_, s ) ); - p->set_primary( clone_ptr( primary_, s ) ); + p->set_match_options( clone_ptr( match_options_, udf, s ) ); + p->set_primary( clone_ptr( primary_, udf, s ) ); if ( weight_ ) - p->set_weight( clone_ptr( weight_, s ) ); + p->set_weight( clone_ptr( weight_, udf, s ) ); return p.release(); } @@ -757,11 +778,11 @@ END_VISIT( v ); } -ftnode_t ftrange::clone( expr::substitution_t &s ) const { +ftnode_t ftrange::clone(user_function* udf, expr::substitution_t &s ) const { return new ftrange( get_loc(), mode_, - clone_ptr( expr1_, s ), - clone_ptr_if( expr2_, s ) + clone_ptr( expr1_, udf, s ), + clone_ptr_if( expr2_, udf, s ) ); // TODO: do PlanIter_t's have to be cloned? } @@ -796,7 +817,7 @@ END_VISIT( v ); } -ftnode_t ftscope_filter::clone( expr::substitution_t &s ) const { +ftnode_t ftscope_filter::clone(user_function* udf, expr::substitution_t &s ) const { return new ftscope_filter( get_loc(), scope_, unit_ ); } @@ -853,8 +874,8 @@ END_VISIT( v ); } -ftnode_t ftselection::clone( expr::substitution_t &s ) const { - return new ftselection( get_loc(), ftor_->clone( s ).release(), list_ ); +ftnode_t ftselection::clone(user_function* udf, expr::substitution_t &s ) const { + return new ftselection( get_loc(), ftor_->clone( udf, s ).release(), list_ ); } ostream& ftselection::put( ostream &o ) const { @@ -884,7 +905,7 @@ END_VISIT( v ); } -ftnode_t ftstem_option::clone( expr::substitution_t& ) const { +ftnode_t ftstem_option::clone(user_function* udf, expr::substitution_t& ) const { return new ftstem_option( get_loc(), mode_ ); } @@ -918,7 +939,7 @@ END_VISIT( v ); } -ftnode_t ftstop_words::clone( expr::substitution_t& ) const { +ftnode_t ftstop_words::clone(user_function* udf, expr::substitution_t& ) const { return new ftstop_words( get_loc(), uri_, list_, mode_ ); } @@ -970,9 +991,9 @@ END_VISIT( v ); } -ftnode_t ftstop_word_option::clone( expr::substitution_t &s ) const { +ftnode_t ftstop_word_option::clone(user_function* udf, expr::substitution_t &s ) const { list_t copy; - clone_list( stop_words_, ©, s ); + clone_list( stop_words_, ©, udf, s ); return new ftstop_word_option( get_loc(), copy, mode_ ); } @@ -1018,9 +1039,9 @@ END_VISIT( v ); } -ftnode_t ftthesaurus_id::clone( expr::substitution_t &s ) const { +ftnode_t ftthesaurus_id::clone(user_function* udf, expr::substitution_t &s ) const { return new ftthesaurus_id( - get_loc(), uri_, relationship_, clone_ptr_if( levels_, s ) + get_loc(), uri_, relationship_, clone_ptr_if( levels_, udf, s ) ); } @@ -1065,11 +1086,11 @@ END_VISIT( v ); } -ftnode_t ftthesaurus_option::clone( expr::substitution_t &s ) const { +ftnode_t ftthesaurus_option::clone(user_function* udf, expr::substitution_t &s ) const { thesaurus_id_list_t copy; - clone_list( thesaurus_id_list_, ©, s ); + clone_list( thesaurus_id_list_, ©, udf, s ); return new ftthesaurus_option( - get_loc(), clone_ptr_if( default_tid_, s ), copy, no_thesaurus_ + get_loc(), clone_ptr_if( default_tid_, udf, s ), copy, no_thesaurus_ ); } @@ -1104,8 +1125,8 @@ END_VISIT( v ); } -ftnode_t ftunary_not::clone( expr::substitution_t &s ) const { - return new ftunary_not( get_loc(), subnode_->clone( s ).release() ); +ftnode_t ftunary_not::clone(user_function* udf, expr::substitution_t &s ) const { + return new ftunary_not( get_loc(), subnode_->clone( udf, s ).release() ); } ostream& ftunary_not::put( ostream &o ) const { @@ -1130,8 +1151,8 @@ END_VISIT( v ); } -ftnode_t ftweight::clone( expr::substitution_t &s ) const { - return new ftweight( get_loc(), weight_expr_->clone( s ) ); +ftnode_t ftweight::clone(user_function* udf, expr::substitution_t &s ) const { + return new ftweight( get_loc(), weight_expr_->clone( udf, s ) ); } ostream& ftweight::put( ostream &o ) const { @@ -1160,7 +1181,7 @@ END_VISIT( v ); } -ftnode_t ftwild_card_option::clone( expr::substitution_t &s ) const { +ftnode_t ftwild_card_option::clone(user_function* udf, expr::substitution_t &s ) const { return new ftwild_card_option( get_loc(), mode_ ); } @@ -1193,10 +1214,8 @@ END_VISIT( v ); } -ftnode_t ftwindow_filter::clone( expr::substitution_t &s ) const { - return new ftwindow_filter( - get_loc(), window_expr_->clone( s ), unit_ - ); +ftnode_t ftwindow_filter::clone(user_function* udf, expr::substitution_t &s ) const { + return new ftwindow_filter(get_loc(), window_expr_->clone( udf, s ), unit_ ); } ostream& ftwindow_filter::put( ostream &o ) const { @@ -1231,8 +1250,8 @@ END_VISIT( v ); } -ftnode_t ftwords::clone( expr::substitution_t &s ) const { - return new ftwords( get_loc(), value_expr_->clone( s ), mode_ ); +ftnode_t ftwords::clone(user_function* udf, expr::substitution_t &s ) const { + return new ftwords( get_loc(), value_expr_->clone( udf, s ), mode_ ); } ostream& ftwords::put( ostream &o ) const { @@ -1274,9 +1293,10 @@ END_VISIT( v ); } -ftnode_t ftwords_times::clone( expr::substitution_t &s ) const { - return new ftwords_times( - get_loc(), clone_ptr( ftwords_, s ), clone_ptr_if( fttimes_, s ) +ftnode_t ftwords_times::clone(user_function* udf, expr::substitution_t &s ) const { + return new ftwords_times(get_loc(), + clone_ptr( ftwords_, udf, s ), + clone_ptr_if( fttimes_, udf, s ) ); } diff -Nru zorba-2.7.0-0/src/compiler/expression/ftnode.h zorba-2.8.0-0/src/compiler/expression/ftnode.h --- zorba-2.7.0-0/src/compiler/expression/ftnode.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/ftnode.h 2013-01-16 18:28:18.000000000 +0000 @@ -20,13 +20,17 @@ #include #include "common/shared_types.h" + #include "compiler/expression/expr_base.h" #include "compiler/expression/ftnode_classes.h" #include "compiler/parser/ft_types.h" #include "compiler/parser/parse_constants.h" #include "compiler/parsetree/parsenodes.h" + #include "runtime/base/plan_iterator.h" + #include "util/cxx_util.h" + #include "zorbatypes/rchandle.h" #include "zorbatypes/zstring.h" @@ -44,8 +48,11 @@ void serialize( serialization::Archiver& ); virtual ft_visit_result::type accept( ftnode_visitor& ) = 0; - virtual ftnode_t clone( expr::substitution_t& ) const = 0; + + virtual ftnode_t clone(user_function*, expr::substitution_t& ) const = 0; + QueryLoc const& get_loc() const { return loc_; } + virtual std::ostream& put( std::ostream& ) const = 0; protected: @@ -85,7 +92,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_case_mode::type get_mode() const { return mode_; } std::ostream& put( std::ostream& ) const; @@ -107,7 +114,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_diacritics_mode::type get_mode() const { return mode_; } std::ostream& put( std::ostream& ) const; @@ -130,7 +137,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; rchandle const& get_qname() const { return qname_; } zstring const& get_val() const { return val_; } std::ostream& put( std::ostream& ) const; @@ -159,7 +166,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; locale::iso639_1::type get_language() const { return lang_; } std::ostream& put( std::ostream& ) const; @@ -181,7 +188,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_stem_mode::type get_mode() const { return mode_; } std::ostream& put( std::ostream& ) const; @@ -207,7 +214,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; zstring const& get_uri() const { return uri_; } list_t const& get_list() const { return list_; } ft_stop_words_unex::type get_mode() const { return mode_; } @@ -246,7 +253,7 @@ ~ftstop_word_option(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_stop_words_mode::type get_mode() const { return mode_; } list_t const& get_stop_words() const { return stop_words_; } std::ostream& put( std::ostream& ) const; @@ -273,7 +280,7 @@ ~ftthesaurus_id(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; zstring const& get_uri() const { return uri_; } zstring const& get_relationship() const { return relationship_; } ftrange const* get_levels() const { return levels_; } @@ -310,7 +317,7 @@ } ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; bool no_thesaurus() const { return no_thesaurus_; } std::ostream& put( std::ostream& ) const; @@ -334,7 +341,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_wild_card_mode::type get_mode() const { return mode_; } std::ostream& put( std::ostream& ) const; @@ -355,7 +362,7 @@ ftmatch_options( QueryLoc const& ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ftcase_option const* get_case_option() const { return case_option_.getp(); @@ -462,7 +469,7 @@ ftweight( QueryLoc const&, expr* const &weight_expr ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; expr** get_weight_expr() { return &weight_expr_; } PlanIter_t get_weight_iter() const { return weight_iter_; } std::ostream& put( std::ostream& ) const; @@ -501,7 +508,7 @@ ~ftprimary_with_options(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ftprimary const* get_primary() const { return primary_; } ftweight* get_weight() { return weight_; } ftmatch_options const* get_match_options() const { return match_options_; } @@ -543,7 +550,7 @@ ~ftextension_selection(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; rchandle const& get_pragmas() const { return pragmas_; } ftselection const* get_ftselection() const { return ftselection_; } std::ostream& put( std::ostream& ) const; @@ -570,7 +577,7 @@ ~ftselection(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ftpos_filter_list_t const& get_ftpos_filter_list() const { return list_; } ftnode const* get_ftor() const { return ftor_; }; std::ostream& put( std::ostream& ) const; @@ -595,7 +602,7 @@ ~ftwords_times(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ftwords const* get_words() const { return ftwords_; } ftrange const* get_times() const { return fttimes_; } std::ostream& put( std::ostream& ) const; @@ -627,7 +634,7 @@ ftcontent_filter( QueryLoc const&, ft_content_mode::type ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_content_mode::type get_mode() const { return mode_; } std::ostream& put( std::ostream& ) const; @@ -646,7 +653,7 @@ ~ftdistance_filter(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ftrange const* get_range() const { return range_; } ft_unit::type get_unit() const { return unit_; } std::ostream& put( std::ostream& ) const; @@ -666,7 +673,7 @@ ftorder_filter( QueryLoc const& ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; std::ostream& put( std::ostream& ) const; }; @@ -680,7 +687,7 @@ ftscope_filter( QueryLoc const&, ft_scope::type, ft_big_unit::type ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_scope::type get_scope() const { return scope_; } ft_big_unit::type get_unit() const { return unit_; } std::ostream& put( std::ostream& ) const; @@ -700,7 +707,7 @@ ftwindow_filter( QueryLoc const&, expr* const&, ft_unit::type ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ft_unit::type get_unit() const { return unit_; } expr** get_window_expr() { return &window_expr_; } PlanIter_t get_window_iter() const { return window_iter_; } @@ -751,7 +758,7 @@ ftand( QueryLoc const&, ftnode_list_t& ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; std::ostream& put( std::ostream& ) const; }; @@ -765,7 +772,7 @@ ftmild_not( QueryLoc const&, ftnode_list_t& ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; std::ostream& put( std::ostream& ) const; }; @@ -779,7 +786,7 @@ ftor( QueryLoc const&, ftnode_list_t& ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; std::ostream& put( std::ostream& ) const; }; @@ -794,7 +801,7 @@ ~ftunary_not(); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; ftnode const* get_subnode() const { return subnode_; } std::ostream& put( std::ostream& ) const; @@ -818,7 +825,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; expr** get_expr1() { return &expr1_; } expr** get_expr2() { return &expr2_; } PlanIter_t get_plan_iter1() const { return iter1_; } @@ -853,7 +860,7 @@ ); ft_visit_result::type accept( ftnode_visitor& ); - ftnode_t clone( expr::substitution_t& ) const; + ftnode_t clone(user_function*, expr::substitution_t& ) const; expr** get_value_expr() { return &value_expr_; } PlanIter_t get_value_iter() const { return value_iter_; } ft_anyall_mode::type get_mode() const { return mode_; } diff -Nru zorba-2.7.0-0/src/compiler/expression/function_item_expr.cpp zorba-2.8.0-0/src/compiler/expression/function_item_expr.cpp --- zorba-2.7.0-0/src/compiler/expression/function_item_expr.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/function_item_expr.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -33,11 +33,12 @@ dynamic_function_invocation_expr::dynamic_function_invocation_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* anExpr, const std::vector& args) : - expr(ccb, sctx, loc, dynamic_function_invocation_expr_kind), + expr(ccb, sctx, udf, loc, dynamic_function_invocation_expr_kind), theExpr(anExpr), theArgs(args) { @@ -56,23 +57,6 @@ } -expr* dynamic_function_invocation_expr::cloneImpl(substitution_t& s) const -{ - checked_vector lNewArgs; - for (checked_vector::const_iterator lIter = theArgs.begin(); - lIter != theArgs.end(); - ++lIter) - { - lNewArgs.push_back((*lIter)->clone(s)); - } - - return theCCB->theEM->create_dynamic_function_invocation_expr(theSctx, - get_loc(), - theExpr->clone(s), - lNewArgs); -} - - /******************************************************************************* ********************************************************************************/ @@ -83,12 +67,13 @@ function_item_expr::function_item_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const store::Item* aQName, function* f, uint32_t aArity) : - expr(ccb, sctx, loc, function_item_expr_kind), + expr(ccb, sctx, udf, loc, function_item_expr_kind), theQName(const_cast(aQName)), theFunction(f), theArity(aArity) @@ -101,9 +86,10 @@ function_item_expr::function_item_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc) : - expr(ccb, sctx, loc, function_item_expr_kind), + expr(ccb, sctx, udf, loc, function_item_expr_kind), theQName(0), theFunction(NULL), theArity(0) @@ -117,6 +103,13 @@ } +user_function* function_item_expr::get_function() const +{ + assert(theFunction->isUdf()); + return static_cast(theFunction.getp()); +} + + void function_item_expr::add_variable(expr* var) { theScopedVariables.push_back(var); @@ -144,27 +137,5 @@ } -expr* function_item_expr::cloneImpl(substitution_t& s) const -{ - std::auto_ptr lNewExpr( - theCCB->theEM->create_function_item_expr(theSctx, - get_loc(), - theFunction->getName(), - theFunction.getp(), - theArity) - ); - - std::vector lNewVariables; - for (std::vector::const_iterator lIter = theScopedVariables.begin(); - lIter != theScopedVariables.end(); - ++lIter) - { - lNewExpr->add_variable((*lIter)->clone(s)); - } - - return lNewExpr.release(); -} - - }//end of namespace /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/function_item_expr.h zorba-2.8.0-0/src/compiler/expression/function_item_expr.h --- zorba-2.7.0-0/src/compiler/expression/function_item_expr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/function_item_expr.h 2013-01-16 18:28:18.000000000 +0000 @@ -48,6 +48,7 @@ dynamic_function_invocation_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* anExpr, const std::vector& args); @@ -59,8 +60,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream& os) const; @@ -105,9 +104,9 @@ friend class ExprManager; private: - store::Item_t theQName; - function_t theFunction; - uint32_t theArity; + store::Item_t theQName; + function_t theFunction; + uint32_t theArity; std::vector theScopedVariables; public: @@ -116,6 +115,7 @@ function_item_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, const store::Item* aQName, function* f, @@ -124,6 +124,7 @@ function_item_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc); public: @@ -133,7 +134,7 @@ void set_function(user_function_t& udf); - function* get_function() const { return theFunction.getp(); } + user_function* get_function() const; const store::Item_t& get_qname() const { return theQName; } @@ -143,8 +144,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream& os) const; diff -Nru zorba-2.7.0-0/src/compiler/expression/json_exprs.cpp zorba-2.8.0-0/src/compiler/expression/json_exprs.cpp --- zorba-2.7.0-0/src/compiler/expression/json_exprs.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/json_exprs.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -33,10 +33,11 @@ json_array_expr::json_array_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content) : - expr(ccb, sctx, loc, json_array_expr_kind), + expr(ccb, sctx, udf, loc, json_array_expr_kind), theContentExpr(content) { compute_scripting_kind(); @@ -60,15 +61,6 @@ } -expr* json_array_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM-> - create_json_array_expr(theSctx, - get_loc(), - theContentExpr->clone(subst)); -} - - /******************************************************************************* SimpleObjectUnion ::= "{|" Expr? "|}" @@ -79,11 +71,12 @@ json_object_expr::json_object_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content, bool accumulate) : - expr(ccb, sctx, loc, json_object_expr_kind), + expr(ccb, sctx, udf, loc, json_object_expr_kind), theContentExpr(content), theAccumulate(accumulate) { @@ -108,17 +101,6 @@ } -expr* json_object_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM-> - create_json_object_expr(theSctx, - get_loc(), - (theContentExpr ? - theContentExpr->clone(subst) : NULL), - theAccumulate); -} - - /******************************************************************************* DirectObjectConstructor ::= "{" PairConstructor ("," PairConstructor )* "}" @@ -130,11 +112,12 @@ json_direct_object_expr::json_direct_object_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, std::vector& names, std::vector& values) : - expr(ccb, sctx, loc, json_direct_object_expr_kind) + expr(ccb, sctx, udf, loc, json_direct_object_expr_kind) { assert(names.size() == values.size()); @@ -175,33 +158,6 @@ } -expr* json_direct_object_expr::cloneImpl(substitution_t& subst) const -{ - std::vector names; - std::vector values; - - names.reserve(theNames.size()); - values.reserve(theValues.size()); - - std::vector::const_iterator ite = theNames.begin(); - std::vector::const_iterator end = theNames.end(); - for (; ite != end; ++ite) - { - names.push_back((*ite)->clone(subst)); - } - - ite = theValues.begin(); - end = theValues.end(); - for (; ite != end; ++ite) - { - values.push_back((*ite)->clone(subst)); - } - - return theCCB->theEM-> - create_json_direct_object_expr(theSctx, get_loc(), names, values); -} - - } #endif // ZORBA_WITH_JSON diff -Nru zorba-2.7.0-0/src/compiler/expression/json_exprs.h zorba-2.8.0-0/src/compiler/expression/json_exprs.h --- zorba-2.7.0-0/src/compiler/expression/json_exprs.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/json_exprs.h 2013-01-16 18:28:18.000000000 +0000 @@ -35,6 +35,7 @@ ********************************************************************************/ class json_array_expr : public expr { + friend class expr; friend class ExprIterator; friend class ExprManager; @@ -45,6 +46,7 @@ json_array_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content); @@ -53,8 +55,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -70,6 +70,7 @@ ********************************************************************************/ class json_object_expr : public expr { + friend class expr; friend class ExprIterator; friend class ExprManager; @@ -81,6 +82,7 @@ json_object_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* content, bool accumulate); @@ -92,8 +94,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -110,6 +110,7 @@ ********************************************************************************/ class json_direct_object_expr : public expr { + friend class expr; friend class ExprIterator; friend class ExprManager; @@ -121,6 +122,7 @@ json_direct_object_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, std::vector& names, std::vector& values); @@ -134,8 +136,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; diff -Nru zorba-2.7.0-0/src/compiler/expression/path_expr.cpp zorba-2.8.0-0/src/compiler/expression/path_expr.cpp --- zorba-2.7.0-0/src/compiler/expression/path_expr.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/path_expr.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -42,9 +42,13 @@ RelativPathExpr ::= "/" | ("/" | "//")? StepExpr (("/" | "//") StepExpr)* ********************************************************************************/ -relpath_expr::relpath_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc) +relpath_expr::relpath_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc) : - expr(ccb, sctx, loc, relpath_expr_kind) + expr(ccb, sctx, udf, loc, relpath_expr_kind) { theScriptingKind = SIMPLE_EXPR; } @@ -100,28 +104,18 @@ } -expr* relpath_expr::cloneImpl(substitution_t& subst) const -{ - std::auto_ptr re(theCCB->theEM->create_relpath_expr(theSctx, get_loc())); - - for (unsigned i = 0; i < size(); ++i) - { - re->add_back((*this)[i]->clone(subst)); - } - - return re.release(); -} - - - /******************************************************************************* AxisStep ::= Axis NodeTest Predicate* ********************************************************************************/ -axis_step_expr::axis_step_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc) +axis_step_expr::axis_step_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc) : - expr(ccb, sctx, loc, axis_step_expr_kind), + expr(ccb, sctx, udf, loc, axis_step_expr_kind), theReverseOrder(false) { compute_scripting_kind(); @@ -148,16 +142,6 @@ } -expr* axis_step_expr::cloneImpl(substitution_t& subst) const -{ - axis_step_expr* ae = theCCB->theEM->create_axis_step_expr(theSctx, get_loc()); - ae->setAxis(getAxis()); - ae->setTest(getTest()); - ae->theReverseOrder = theReverseOrder; - return ae; -} - - /******************************************************************************* [78] NodeTest ::= KindTest | NameTest @@ -170,9 +154,13 @@ PITest | CommentTest | TextTest | AnyKindTest ********************************************************************************/ -match_expr::match_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc) +match_expr::match_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc) : - expr(ccb, sctx, loc, match_expr_kind), + expr(ccb, sctx, udf, loc, match_expr_kind), theDocTestKind(match_no_test), theWildKind(match_no_wild), theQName(NULL), @@ -220,20 +208,6 @@ } -expr* match_expr::cloneImpl(substitution_t& subst) const -{ - match_expr* me = theCCB->theEM->create_match_expr(theSctx, get_loc()); - me->setTestKind(getTestKind()); - me->setDocTestKind(getDocTestKind()); - me->setWildName(getWildName()); - me->setWildKind(getWildKind()); - me->setQName(getQName()); - me->setTypeName(getTypeName()); - me->setNilledAllowed(getNilledAllowed()); - return me; -} - - } /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/path_expr.h zorba-2.8.0-0/src/compiler/expression/path_expr.h --- zorba-2.7.0-0/src/compiler/expression/path_expr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/path_expr.h 2013-01-16 18:28:18.000000000 +0000 @@ -59,7 +59,11 @@ std::vector theSteps; protected: - relpath_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc); + relpath_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc); public: size_t size() const { return theSteps.size(); } @@ -78,8 +82,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t &) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -113,7 +115,11 @@ static bool is_reverse_axis(axis_kind_t kind); protected: - axis_step_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&); + axis_step_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&); public: axis_kind_t getAxis() const { return theAxis; } @@ -135,8 +141,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t &) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -177,7 +181,11 @@ bool theNilledAllowed; protected: - match_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&); + match_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&); public: match_test_t getTestKind() const { return theTestKind; } @@ -213,8 +221,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t &) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; diff -Nru zorba-2.7.0-0/src/compiler/expression/pragma.cpp zorba-2.8.0-0/src/compiler/expression/pragma.cpp --- zorba-2.7.0-0/src/compiler/expression/pragma.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/pragma.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include "stdafx.h" #include "pragma.h" #include "zorbatypes/rchandle.h" #include "store/api/item.h" diff -Nru zorba-2.7.0-0/src/compiler/expression/script_exprs.cpp zorba-2.8.0-0/src/compiler/expression/script_exprs.cpp --- zorba-2.7.0-0/src/compiler/expression/script_exprs.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/script_exprs.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -26,7 +26,7 @@ #include "functions/function.h" #include "diagnostics/assert.h" - +#include "diagnostics/xquery_diagnostics.h" namespace zorba { @@ -47,12 +47,13 @@ block_expr::block_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, bool allowLastUpdating, std::vector& seq, std::vector* assignedVars) : - expr(ccb, sctx, loc, block_expr_kind), + expr(ccb, sctx, udf, loc, block_expr_kind), theArgs(seq) { compute_scripting_kind2(assignedVars, allowLastUpdating); @@ -166,27 +167,18 @@ } -expr* block_expr::cloneImpl(substitution_t& subst) const -{ - checked_vector seq2; - for (csize i = 0; i < theArgs.size(); ++i) - seq2.push_back(theArgs[i]->clone(subst)); - - return theCCB->theEM->create_block_expr(theSctx, get_loc(), true, seq2, NULL); -} - - /******************************************************************************* ********************************************************************************/ apply_expr::apply_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, bool discardXDM) : - expr(ccb, sctx, loc, apply_expr_kind), + expr(ccb, sctx, udf, loc, apply_expr_kind), theExpr(inExpr), theDiscardXDM(discardXDM) { @@ -205,33 +197,22 @@ } -expr* apply_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_apply_expr(theSctx, get_loc(), theExpr->clone(subst), theDiscardXDM); -} - - /******************************************************************************* ********************************************************************************/ var_decl_expr::var_decl_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, expr* initExpr) : - expr(ccb, sctx, loc, var_decl_expr_kind), - theVarExpr(varExpr), - theInitExpr(initExpr) + var_set_expr(ccb, sctx, udf, loc, varExpr, initExpr, true) { - compute_scripting_kind(); + theKind = var_decl_expr_kind; - // var_decl_expr is unfoldable because it requires access to the dyn ctx. - setUnfoldable(ANNOTATION_TRUE_FIXED); - - if (initExpr) - varExpr->add_set_expr(this); + compute_scripting_kind(); } @@ -247,56 +228,49 @@ void var_decl_expr::compute_scripting_kind() { if (theVarExpr->get_kind() == var_expr::prolog_var) - checkSimpleExpr(theInitExpr); + checkSimpleExpr(theExpr); else - checkNonUpdating(theInitExpr); + checkNonUpdating(theExpr); - if (theInitExpr == NULL) + if (theExpr == NULL) { theScriptingKind = SIMPLE_EXPR; } else { - theScriptingKind = theInitExpr->get_scripting_detail(); + theScriptingKind = theExpr->get_scripting_detail(); } } -expr* var_decl_expr::cloneImpl(substitution_t& s) const -{ - var_expr* varCopy = theCCB->theEM->create_var_expr(*theVarExpr); - s[theVarExpr] = varCopy; - - return theCCB->theEM->create_var_decl_expr(theSctx, - get_loc(), - varCopy, - (theInitExpr ? theInitExpr->clone(s) : NULL)); -} - - /******************************************************************************* ********************************************************************************/ var_set_expr::var_set_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, - expr* setExpr) + expr* setExpr, + bool isDecl) : - expr(ccb, sctx, loc, var_set_expr_kind), + expr(ccb, sctx, udf, loc, var_set_expr_kind), theVarExpr(varExpr), theExpr(setExpr) { assert(varExpr->get_kind() == var_expr::prolog_var || varExpr->get_kind() == var_expr::local_var); - compute_scripting_kind(); + if (!isDecl) + compute_scripting_kind(); - // var_set_expr is unfoldable because it requires access to the dyn ctx. + // var_set_expr and var_decl_expr are unfoldable because they require access + // to the dyn ctx. setUnfoldable(ANNOTATION_TRUE_FIXED); - varExpr->add_set_expr(this); + if (setExpr) + varExpr->add_set_expr(this); } @@ -319,29 +293,17 @@ } -expr* var_set_expr::cloneImpl(substitution_t& s) const -{ - expr* varClone = theVarExpr->clone(s); - - ZORBA_ASSERT(varClone->get_expr_kind() == var_expr_kind); - - return theCCB->theEM->create_var_set_expr(theSctx, - get_loc(), - static_cast(varClone), - theExpr->clone(s)); -} - - /******************************************************************************* ********************************************************************************/ exit_expr::exit_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr) : - expr(ccb, sctx, loc, exit_expr_kind), + expr(ccb, sctx, udf, loc, exit_expr_kind), theExpr(inExpr), theCatcherExpr(NULL) { @@ -368,27 +330,18 @@ } -expr* exit_expr::cloneImpl(substitution_t& subst) const -{ - expr* clone = theCCB->theEM->create_exit_expr(theSctx, get_loc(), get_expr()->clone(subst)); - - subst[this] = clone; - - return clone; -} - - /******************************************************************************* ********************************************************************************/ exit_catcher_expr::exit_catcher_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, std::vector& exitExprs) : - expr(ccb, sctx, loc, exit_catcher_expr_kind), + expr(ccb, sctx, udf, loc, exit_catcher_expr_kind), theExpr(inExpr) { theExitExprs.swap(exitExprs); @@ -438,31 +391,17 @@ } -expr* exit_catcher_expr::cloneImpl(substitution_t& subst) const -{ - expr* clonedInput = get_expr()->clone(subst); - - std::vector clonedExits; - std::vector::const_iterator ite = theExitExprs.begin(); - std::vector::const_iterator end = theExitExprs.end(); - for (; ite != end; ++ite) - { - assert(subst.find(*ite) != subst.end()); - - clonedExits.push_back(subst[*ite]); - } - - return theCCB->theEM->create_exit_catcher_expr(theSctx, get_loc(), clonedInput, clonedExits); -} - - - /******************************************************************************* ********************************************************************************/ -flowctl_expr::flowctl_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, enum action action) +flowctl_expr::flowctl_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + FlowCtlAction action) : - expr(ccb, sctx, loc, flowctl_expr_kind), + expr(ccb, sctx, udf, loc, flowctl_expr_kind), theAction(action) { compute_scripting_kind(); @@ -479,18 +418,17 @@ } -expr* flowctl_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_flowctl_expr(theSctx, get_loc(), get_action()); -} - - /******************************************************************************* ********************************************************************************/ -while_expr::while_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, expr* body) +while_expr::while_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr* body) : - expr(ccb, sctx, loc, while_expr_kind), + expr(ccb, sctx, udf, loc, while_expr_kind), theBody(body) { compute_scripting_kind(); @@ -523,12 +461,5 @@ theScriptingKind = SIMPLE_EXPR; } - -expr* while_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_while_expr(theSctx, get_loc(), get_body()->clone(subst)); -} - - } /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/script_exprs.h zorba-2.8.0-0/src/compiler/expression/script_exprs.h --- zorba-2.7.0-0/src/compiler/expression/script_exprs.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/script_exprs.h 2013-01-16 18:28:18.000000000 +0000 @@ -114,6 +114,7 @@ block_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, bool allowLastUpdating, std::vector& seq, @@ -130,8 +131,6 @@ expr* operator[](csize i) { return theArgs[i]; } - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -162,6 +161,7 @@ apply_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, bool discardXDM); @@ -173,8 +173,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -183,33 +181,16 @@ /******************************************************************************* - For Global Var: - ---------------- - - AnnotatedDecl ::= "declare" Annotation* (VarDecl | FunctionDecl) - - Annotation ::= "%" EQName ("(" Literal ("," Literal)* ")")? - - VarDecl ::= "variable" "$" VarName TypeDeclaration? - ((":=" VarValue) | ("external" (":=" VarDefaultValue)?)) - - For Local Var: - -------------- - - VarDeclExpr ::= ("local" Annotation*)? "variable" "$" VarName TypeDeclaration? - (":=" ExprSingle)? + AssignStatement ::= "$" VarName ":=" ExprSingle ";" - var_decl_expr is used to declare block-local and prolog variables (including - the context item, if it is declared in the prolog). During runtime, the - associated iterator creates in the local dynamic context a binding between - the variable id and the variable value. If the declaration includes an - initializing expr, the iterator computes the initExpr and stores the resulting - value inside this binding. + The RHS of the assignment must be a non-updating expr. - Note: the init expr must be non-updating. For global vars, it must also be - non-sequential. + var_set_expr is used to assign a value to a prolog or block-local var. During + runtime, the function computes theExpr and stores the resulting value inside + the appropriate dynamic ctx (global or local), at the location that is identified + by the variable id. ********************************************************************************/ -class var_decl_expr : public expr +class var_set_expr : public expr { friend class ExprManager; friend class ExprIterator; @@ -217,27 +198,27 @@ protected: var_expr * theVarExpr; - expr * theInitExpr; + expr * theExpr; protected: - var_decl_expr( + var_set_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, - expr* initExpr); + expr* setExpr, + bool isDecl = false); public: - ~var_decl_expr(); + ~var_set_expr(); var_expr* get_var_expr() const { return theVarExpr; } - expr* get_init_expr() const { return theInitExpr; } + expr* get_expr() const { return theExpr; } void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -246,44 +227,54 @@ /******************************************************************************* - AssignStatement ::= "$" VarName ":=" ExprSingle ";" + For Global Var: + ---------------- - The RHS of the assignment must be a non-updating expr. + AnnotatedDecl ::= "declare" Annotation* (VarDecl | FunctionDecl) - var_set_expr is used to assign a value to a prolog or block-local var. During - runtime, the function computes theExpr and stores the resulting value inside - the appropriate dynamic ctx (global or local), at the location that is identified - by the variable id. + Annotation ::= "%" EQName ("(" Literal ("," Literal)* ")")? + + VarDecl ::= "variable" "$" VarName TypeDeclaration? + ((":=" VarValue) | ("external" (":=" VarDefaultValue)?)) + + For Local Var: + -------------- + + VarDeclExpr ::= ("local" Annotation*)? "variable" "$" VarName TypeDeclaration? + (":=" ExprSingle)? + + var_decl_expr is used to declare block-local and prolog variables (including + the context item, if it is declared in the prolog). During runtime, the + associated iterator creates in the local dynamic context a binding between + the variable id and the variable value. If the declaration includes an + initializing expr, the iterator computes the initExpr and stores the resulting + value inside this binding. + + Note: the init expr must be non-updating. For global vars, it must also be + non-sequential. ********************************************************************************/ -class var_set_expr : public expr +class var_decl_expr : public var_set_expr { friend class ExprManager; friend class ExprIterator; friend class expr; protected: - var_expr * theVarExpr; - expr * theExpr; - -protected: - var_set_expr( + var_decl_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, var_expr* varExpr, - expr* setExpr); + expr* initExpr); public: - ~var_set_expr(); - - var_expr* get_var_expr() const { return theVarExpr; } + ~var_decl_expr(); - expr* get_expr() const { return theExpr; } + expr* get_init_expr() const { return theExpr; } void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -308,6 +299,7 @@ exit_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr); @@ -320,8 +312,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -356,6 +346,7 @@ exit_catcher_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* inExpr, std::vector& exitExprs); @@ -379,8 +370,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -396,19 +385,19 @@ friend class ExprIterator; friend class expr; -public: - enum action { BREAK, CONTINUE }; - protected: - enum action theAction; + FlowCtlAction theAction; protected: - flowctl_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, enum action action); + flowctl_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + FlowCtlAction action); public: - enum action get_action() const { return theAction; } - - expr* cloneImpl(substitution_t& s) const; + FlowCtlAction get_action() const { return theAction; } void compute_scripting_kind(); @@ -435,15 +424,18 @@ expr* theBody; protected: - while_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc, expr* body); + while_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc, + expr* body); public: expr* get_body() const { return theBody; } void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; diff -Nru zorba-2.7.0-0/src/compiler/expression/update_exprs.cpp zorba-2.8.0-0/src/compiler/expression/update_exprs.cpp --- zorba-2.7.0-0/src/compiler/expression/update_exprs.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/update_exprs.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -18,6 +18,7 @@ #include "compiler/expression/update_exprs.h" #include "compiler/expression/var_expr.h" #include "compiler/expression/expr_visitor.h" +#include "compiler/expression/expr_manager.h" #include "compiler/api/compilercb.h" @@ -41,16 +42,19 @@ update_expr_base::update_expr_base( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr_kind_t kind, expr* targetExpr, expr* sourceExpr) : - expr(ccb, sctx, loc, kind), + expr(ccb, sctx, udf, loc, kind), theTargetExpr(targetExpr), theSourceExpr(sourceExpr) { compute_scripting_kind(); + + setUnfoldable(ANNOTATION_TRUE_FIXED); } @@ -71,44 +75,30 @@ insert_expr::insert_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, store::UpdateConsts::InsertType aType, expr* sourceExpr, expr* targetExpr) : - update_expr_base(ccb, sctx, loc, insert_expr_kind, targetExpr, sourceExpr), + update_expr_base(ccb, sctx, udf, loc, insert_expr_kind, targetExpr, sourceExpr), theType(aType) { } -expr* insert_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_insert_expr(theSctx, - get_loc(), - getType(), - getSourceExpr()->clone(subst), - getTargetExpr()->clone(subst)); -} - - /******************************************************************************* ********************************************************************************/ delete_expr::delete_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* targetExpr) : - update_expr_base(ccb, sctx, loc, delete_expr_kind, targetExpr, NULL) -{ -} - - -expr* delete_expr::cloneImpl(substitution_t& subst) const + update_expr_base(ccb, sctx, udf, loc, delete_expr_kind, targetExpr, NULL) { - return theCCB->theEM->create_delete_expr(theSctx, get_loc(), getTargetExpr()->clone(subst)); } @@ -118,51 +108,34 @@ replace_expr::replace_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, store::UpdateConsts::ReplaceType aType, expr* targetExpr, expr* replaceExpr) : - update_expr_base(ccb, sctx, loc, replace_expr_kind, targetExpr, replaceExpr), + update_expr_base(ccb, sctx, udf, loc, replace_expr_kind, targetExpr, replaceExpr), theType(aType) { } -expr* replace_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_replace_expr(theSctx, - get_loc(), - getType(), - getTargetExpr()->clone(subst), - getReplaceExpr()->clone(subst)); -} - - /******************************************************************************* ********************************************************************************/ rename_expr::rename_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, expr* targetExpr, expr* nameExpr) : - update_expr_base(ccb, sctx, loc, rename_expr_kind, targetExpr, nameExpr) + update_expr_base(ccb, sctx, udf, loc, rename_expr_kind, targetExpr, nameExpr) { } -expr* rename_expr::cloneImpl(substitution_t& subst) const -{ - return theCCB->theEM->create_rename_expr(theSctx, - get_loc(), - getTargetExpr()->clone(subst), - getNameExpr()->clone(subst)); -} - - /******************************************************************************* ********************************************************************************/ @@ -183,13 +156,15 @@ } -copy_clause* copy_clause::clone(expr::substitution_t& subst) const +copy_clause* copy_clause::clone( + user_function* udf, + expr::substitution_t& subst) const { ZORBA_ASSERT(theVar && theExpr); - expr* domainCopy = theExpr->clone(subst); + expr* domainCopy = theExpr->clone(udf, subst); - var_expr* varCopy = theExpr->get_ccb()->theEM->create_var_expr(*theVar); + var_expr* varCopy = theExpr->get_ccb()->theEM->create_var_expr(udf, *theVar); subst[theVar] = varCopy; @@ -200,9 +175,10 @@ transform_expr::transform_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc) : - expr(ccb, sctx, loc, transform_expr_kind) + expr(ccb, sctx, udf, loc, transform_expr_kind) { theScriptingKind = SIMPLE_EXPR; } @@ -247,26 +223,5 @@ } -expr* transform_expr::cloneImpl(substitution_t& subst) const -{ - ZORBA_ASSERT(theModifyExpr && theReturnExpr); - - transform_expr* cloneExpr = - theCCB->theEM->create_transform_expr(theSctx, get_loc()); - - for (std::vector::const_iterator lIter = theCopyClauses.begin(); - lIter != theCopyClauses.end(); - ++lIter) - { - cloneExpr->add_back((*lIter)->clone(subst)); - } - - cloneExpr->setModifyExpr(theModifyExpr->clone(subst)); - cloneExpr->setReturnExpr(theReturnExpr->clone(subst)); - - return cloneExpr; -} - - } /* namespace zorba */ /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/expression/update_exprs.h zorba-2.8.0-0/src/compiler/expression/update_exprs.h --- zorba-2.7.0-0/src/compiler/expression/update_exprs.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/update_exprs.h 2013-01-16 18:28:18.000000000 +0000 @@ -45,12 +45,13 @@ public: update_expr_base( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc&, - expr_kind_t kind, - expr* targetExpr, - expr* sourceExpr); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr_kind_t kind, + expr* targetExpr, + expr* sourceExpr); expr* getTargetExpr() const { return theTargetExpr; } @@ -75,18 +76,17 @@ protected: insert_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc&, - store::UpdateConsts::InsertType, - expr* aSourceExpr, - expr* aTargetExpr); + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + store::UpdateConsts::InsertType, + expr* aSourceExpr, + expr* aTargetExpr); public: store::UpdateConsts::InsertType getType() const { return theType; } - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -96,18 +96,29 @@ /******************************************************************************* ********************************************************************************/ -class delete_expr : public update_expr_base +class replace_expr : public update_expr_base { friend class ExprIterator; friend class expr; friend class ExprManager; +protected: + store::UpdateConsts::ReplaceType theType; protected: - delete_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc&, expr*); + replace_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + store::UpdateConsts::ReplaceType aType, + expr*, + expr*); public: - expr* cloneImpl(substitution_t& s) const; + store::UpdateConsts::ReplaceType getType() const { return theType; } + + expr* getReplaceExpr() const { return theSourceExpr; } void accept(expr_visitor&); @@ -118,29 +129,22 @@ /******************************************************************************* ********************************************************************************/ -class replace_expr : public update_expr_base +class delete_expr : public update_expr_base { friend class ExprIterator; friend class expr; friend class ExprManager; -protected: - store::UpdateConsts::ReplaceType theType; protected: - replace_expr( - CompilerCB* ccb, - static_context* sctx, - const QueryLoc&, - store::UpdateConsts::ReplaceType aType, - expr*, - expr*); + delete_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc&, + expr*); public: - store::UpdateConsts::ReplaceType getType() const { return theType; } - - expr* getReplaceExpr() const { return theSourceExpr; } - expr* cloneImpl(substitution_t& s) const; void accept(expr_visitor&); @@ -162,6 +166,7 @@ rename_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc&, expr*, expr*); @@ -169,8 +174,6 @@ public: expr* getNameExpr() const { return theSourceExpr; } - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; @@ -206,7 +209,7 @@ expr* getExpr() const { return theExpr; } - copy_clause* clone(expr::substitution_t& s) const; + copy_clause* clone(user_function* udf, expr::substitution_t& s) const; std::ostream& put(std::ostream&) const; }; @@ -224,7 +227,11 @@ expr * theReturnExpr; protected: - transform_expr(CompilerCB* ccb, static_context* sctx, const QueryLoc& loc); + transform_expr( + CompilerCB* ccb, + static_context* sctx, + user_function* udf, + const QueryLoc& loc); public: expr* getModifyExpr() const { return theModifyExpr; } @@ -249,8 +256,6 @@ void compute_scripting_kind(); - expr* cloneImpl(substitution_t& s) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; diff -Nru zorba-2.7.0-0/src/compiler/expression/var_expr.cpp zorba-2.8.0-0/src/compiler/expression/var_expr.cpp --- zorba-2.7.0-0/src/compiler/expression/var_expr.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/var_expr.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -18,6 +18,7 @@ #include "functions/udf.h" #include "compiler/expression/var_expr.h" +#include "compiler/expression/script_exprs.h" #include "compiler/expression/update_exprs.h" #include "compiler/expression/flwor_expr.h" #include "compiler/expression/expr_visitor.h" @@ -70,11 +71,12 @@ var_expr::var_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, var_kind k, store::Item* name) : - expr(ccb, sctx, loc, var_expr_kind), + expr(ccb, sctx, udf, loc, var_expr_kind), theUniqueId(0), theVarKind(k), theName(name), @@ -82,7 +84,6 @@ theFlworClause(NULL), theCopyClause(NULL), theParamPos(0), - theUDF(NULL), theVarInfo(NULL), theIsExternal(false), theIsPrivate(false), @@ -90,15 +91,13 @@ theHasInitializer(false) { compute_scripting_kind(); - - setUnfoldable(ANNOTATION_TRUE_FIXED); } /******************************************************************************* ********************************************************************************/ -var_expr::var_expr(const var_expr& source) +var_expr::var_expr(user_function* udf, const var_expr& source) : expr(source), theUniqueId(0), @@ -108,13 +107,13 @@ theFlworClause(NULL), theCopyClause(NULL), theParamPos(source.theParamPos), - theUDF(source.theUDF), theVarInfo(NULL), theIsExternal(source.theIsExternal), theIsPrivate(source.theIsPrivate), theIsMutable(source.theIsMutable), theHasInitializer(source.theHasInitializer) { + theUDF = udf; } @@ -279,16 +278,35 @@ ********************************************************************************/ forletwin_clause* var_expr::get_forletwin_clause() const { - return dynamic_cast(theFlworClause); + assert(theFlworClause->get_kind() == flwor_clause::for_clause || + theFlworClause->get_kind() == flwor_clause::let_clause || + theFlworClause->get_kind() == flwor_clause::window_clause); + + return static_cast(theFlworClause); +} + + +/******************************************************************************* + +********************************************************************************/ +forlet_clause* var_expr::get_forlet_clause() const +{ + assert(theFlworClause->get_kind() == flwor_clause::for_clause || + theFlworClause->get_kind() == flwor_clause::let_clause); + + return static_cast(theFlworClause); } /******************************************************************************* ********************************************************************************/ -for_clause* var_expr::get_for_clause() const +void var_expr::add_set_expr(expr* e) { - return dynamic_cast(theFlworClause); + assert(e->get_expr_kind() == var_decl_expr_kind || + e->get_expr_kind() == var_set_expr_kind); + + theSetExprs.push_back(static_cast(e)); } @@ -300,8 +318,8 @@ assert(theVarKind == local_var || theVarKind == prolog_var); bool found = false; - std::vector::iterator ite = theSetExprs.begin(); - std::vector::iterator end = theSetExprs.end(); + VarSetExprs::iterator ite = theSetExprs.begin(); + VarSetExprs::iterator end = theSetExprs.end(); for (; ite != end; ++ite) { if (*ite == e) @@ -337,20 +355,6 @@ /******************************************************************************* ********************************************************************************/ -expr* var_expr::cloneImpl(expr::substitution_t& subst) const -{ - expr::subst_iter_t i = subst.find(this); - - if (i == subst.end()) - return const_cast(this); - - return i->second; -} - - -/******************************************************************************* - -********************************************************************************/ void var_expr::accept(expr_visitor& v) { if (v.begin_visit(*this)) diff -Nru zorba-2.7.0-0/src/compiler/expression/var_expr.h zorba-2.8.0-0/src/compiler/expression/var_expr.h --- zorba-2.7.0-0/src/compiler/expression/var_expr.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/expression/var_expr.h 2013-01-16 18:28:18.000000000 +0000 @@ -24,10 +24,12 @@ class flwor_clause; class forletwin_clause; -class for_clause; +class forlet_clause; class copy_clause; class var_expr; class VarInfo; +class var_set_expr; + /****************************************************************************** @@ -89,10 +91,6 @@ For arg vars, it is the position, within the param list, of parameter that is bound to this arg var. - theUDF: - ------- - For arg vars, the corresponding UDF. - theSetExprs: ------------ For global and local vars, this vector contains a pointer to the var_decl_expr @@ -120,6 +118,8 @@ friend class ExprManager; public: + typedef std::vector VarSetExprs; + enum var_kind { unknown_var = 0, @@ -165,9 +165,7 @@ csize theParamPos; - user_function * theUDF; - - std::vector theSetExprs; + VarSetExprs theSetExprs; VarInfo * theVarInfo; @@ -186,11 +184,12 @@ var_expr( CompilerCB* ccb, static_context* sctx, + user_function* udf, const QueryLoc& loc, var_kind k, store::Item* name); - var_expr(const var_expr& source); + var_expr(user_function* udf, const var_expr& source); virtual ~var_expr(); @@ -235,7 +234,7 @@ forletwin_clause* get_forletwin_clause() const; - for_clause* get_for_clause() const; + forlet_clause* get_forlet_clause() const; copy_clause* get_copy_clause() const { return theCopyClause; } @@ -249,28 +248,22 @@ void set_param_pos(csize pos) { theParamPos = pos; } - user_function* get_udf() const { return theUDF; } - - void set_udf(const user_function* udf) { theUDF = const_cast(udf); } - - void add_set_expr(expr* e) { theSetExprs.push_back(e); } + void add_set_expr(expr* e); void remove_set_expr(expr* e); csize num_set_exprs() const { return theSetExprs.size(); } - expr* get_set_expr(csize i) const { return theSetExprs[i]; } + var_set_expr* get_set_expr(csize i) const { return theSetExprs[i]; } - std::vector::const_iterator setExprsBegin() const { return theSetExprs.begin(); } + VarSetExprs::const_iterator setExprsBegin() const { return theSetExprs.begin(); } - std::vector::const_iterator setExprsEnd() const { return theSetExprs.end(); } + VarSetExprs::const_iterator setExprsEnd() const { return theSetExprs.end(); } bool is_context_item() const; void compute_scripting_kind(); - expr* cloneImpl(substitution_t& subst) const; - void accept(expr_visitor&); std::ostream& put(std::ostream&) const; diff -Nru zorba-2.7.0-0/src/compiler/parser/query_loc.h zorba-2.8.0-0/src/compiler/parser/query_loc.h --- zorba-2.7.0-0/src/compiler/parser/query_loc.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/query_loc.h 2013-01-16 18:28:18.000000000 +0000 @@ -17,9 +17,9 @@ #ifndef ZORBA_QUERY_LOC_H #define ZORBA_QUERY_LOC_H +#include #include "zorbatypes/zstring.h" - namespace zorba { namespace serialization @@ -27,6 +27,8 @@ class Archiver; } +/////////////////////////////////////////////////////////////////////////////// + /** * Class to save the query location of zorba elements that correspond to a code * snipped in the query. @@ -36,6 +38,7 @@ */ class QueryLoc { + typedef zorba::internal::ztd::explicit_bool explicit_bool; public: static QueryLoc null; @@ -79,21 +82,30 @@ bool equals(const QueryLoc& loc) const; - bool operator==(const QueryLoc& loc) const - { - return equals(loc); - } - - bool operator<(const QueryLoc& loc) const - { - return theLineBegin < loc.getLineBegin(); + operator explicit_bool::type() const { + return explicit_bool::value_of( !equals( null ) ); } }; +inline bool operator==( QueryLoc const &q1, QueryLoc const &q2 ) { + return q1.equals( q2 ); +} + +inline bool operator!=( QueryLoc const &q1, QueryLoc const &q2 ) { + return !(q1 == q2); +} + +inline bool operator<( QueryLoc const &q1, QueryLoc const &q2 ) { + return q1.getLineBegin() < q2.getLineBegin() + || (q1.getLineBegin() == q2.getLineBegin() + && q1.getColumnBegin() < q2.getColumnBegin()); +} std::ostream& operator<< (std::ostream& aOstr, const QueryLoc& aQueryLoc); +/////////////////////////////////////////////////////////////////////////////// + } // namespace zorba -#endif +#endif /* ZORBA_QUERY_LOC_H */ /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/parser/symbol_table.cpp zorba-2.8.0-0/src/compiler/parser/symbol_table.cpp --- zorba-2.7.0-0/src/compiler/parser/symbol_table.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/symbol_table.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -56,8 +56,9 @@ } symbol_table::symbol_table(uint32_t initial_heapsize) -: - heap(initial_heapsize) + : + heap(initial_heapsize), + last_qname(-1) { } @@ -107,7 +108,8 @@ off_t symbol_table::put_ncname(char const* text, uint32_t length) { - return heap.put(text, 0, length); + last_qname = heap.put(text, 0, length); + return last_qname; } off_t symbol_table::put_qname(char const* text, uint32_t length, bool do_trim_start, bool do_trim_end, bool is_eqname) @@ -125,7 +127,9 @@ } if (!is_eqname) - return heap.put(text, 0, length); + { + last_qname = heap.put(text, 0, length); + } else { // EQName: Q{prefix}name @@ -138,8 +142,10 @@ off_t uri = put_uri(prefix.c_str(), prefix.size()); name = get(uri) + ":" + name; - return heap.put(name.c_str(), 0, name.size()); + last_qname = heap.put(name.c_str(), 0, name.size()); } + + return last_qname; } off_t symbol_table::put_uri(char const* text, uint32_t length) @@ -226,15 +232,19 @@ std::string symbol_table::get(off_t id) { - uint32_t n = heap.get_length0(id); - char *buf; - buf = (char*)malloc(n+1); - heap.get0(id, buf, 0, n+1); - std::string retstr = string(buf, 0, n); - free(buf); - return retstr; + uint32_t n = heap.get_length0(id); + char *buf; + buf = (char*)malloc(n+1); + heap.get0(id, buf, 0, n+1); + std::string retstr = string(buf, 0, n); + free(buf); + return retstr; } +std::string symbol_table::get_last_qname() +{ + return get(last_qname); +} } /* namespace zorba */ /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/parser/symbol_table.h zorba-2.8.0-0/src/compiler/parser/symbol_table.h --- zorba-2.7.0-0/src/compiler/parser/symbol_table.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/symbol_table.h 2013-01-16 18:28:18.000000000 +0000 @@ -28,14 +28,15 @@ class ZORBA_DLL_PUBLIC symbol_table { -protected: // state - fxcharheap heap; +protected: // state + fxcharheap heap; + off_t last_qname; // will store the offset of the last added qname or ncname + +public: // ctor,dtor + symbol_table(uint32_t initial_heapsize=1024); + ~symbol_table(); -public: // ctor,dtor - symbol_table(uint32_t initial_heapsize=1024); - ~symbol_table(); - -public: // table interface +public: // table interface off_t put(char const* text); /* Accepted values for normalizationType: @@ -43,22 +44,25 @@ * normalizationType = 1 -- EOL normalization * normalizationType = 2 -- Attribute value normalization */ - off_t put(char const* text, uint32_t length, int normalizationType = 0); + off_t put(char const* text, uint32_t length, int normalizationType = 0); - off_t put_ncname(char const* text, uint32_t length); - off_t put_qname(char const* text, uint32_t length, + off_t put_ncname(char const* text, uint32_t length); + off_t put_qname(char const* text, uint32_t length, bool do_trim_start = false, bool do_trim_end = false, bool is_eqname = false); - off_t put_uri(char const* text, uint32_t length); - off_t put_varname(char const* text, uint32_t length); - off_t put_entityref(char const* text, uint32_t length); - off_t put_charref(char const* text, uint32_t length); - off_t put_stringlit(char const* text, uint32_t length); - off_t put_commentcontent(char const* text, uint32_t length); - - std::string get(off_t id); - uint32_t size() const; + off_t put_uri(char const* text, uint32_t length); + off_t put_varname(char const* text, uint32_t length); + off_t put_entityref(char const* text, uint32_t length); + off_t put_charref(char const* text, uint32_t length); + off_t put_stringlit(char const* text, uint32_t length); + off_t put_commentcontent(char const* text, uint32_t length); + + uint32_t size() const; + + std::string get(off_t id); + + std::string get_last_qname(); // It will return the last added qname or ncname - xs_decimal* decimalval(char const* text, uint32_t length); + xs_decimal* decimalval(char const* text, uint32_t length); xs_double* doubleval(char const* text, uint32_t length); // Will return NULL if std::range_error is raised xs_integer* integerval(char const* text, uint32_t length); // Will return NULL if std::range_error is raised diff -Nru zorba-2.7.0-0/src/compiler/parser/xquery_driver.cpp zorba-2.8.0-0/src/compiler/parser/xquery_driver.cpp --- zorba-2.7.0-0/src/compiler/parser/xquery_driver.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/xquery_driver.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -146,7 +146,6 @@ return parserError; } - ZorbaParserError* xquery_driver::parserErr(const std::string& _message, const location& loc, Error const &code) { parserError = new ZorbaParserError(_message, loc, code); @@ -159,7 +158,6 @@ return parserError; } - bool xquery_driver::parse_stream(std::istream& in, const zstring& aFilename) { int ch[3]; diff -Nru zorba-2.7.0-0/src/compiler/parser/xquery_driver.h zorba-2.8.0-0/src/compiler/parser/xquery_driver.h --- zorba-2.7.0-0/src/compiler/parser/xquery_driver.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/xquery_driver.h 2013-01-16 18:28:18.000000000 +0000 @@ -70,9 +70,9 @@ bool parse_file(const zstring& aFilename); - void set_expr(parsenode* e_p); + void set_expr(parsenode* e_p); - parsenode* get_expr() { return expr_p; } + parsenode* get_expr() { return expr_p; } QueryLoc createQueryLoc(const location& aLoc) const; diff -Nru zorba-2.7.0-0/src/compiler/parser/xquery_parser.cpp zorba-2.8.0-0/src/compiler/parser/xquery_parser.cpp --- zorba-2.7.0-0/src/compiler/parser/xquery_parser.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/xquery_parser.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -1,10 +1,8 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.5. */ /* Skeleton implementation for Bison LALR(1) parsers in C++ - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software - Foundation, Inc. + Copyright (C) 2002-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,8 +35,8 @@ /* First part of user declarations. */ -/* Line 311 of lalr1.cc */ -#line 87 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 293 of lalr1.cc */ +#line 87 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" #include "common/common.h" @@ -74,16 +72,16 @@ -/* Line 311 of lalr1.cc */ -#line 79 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +/* Line 293 of lalr1.cc */ +#line 77 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" #include "xquery_parser.hpp" /* User implementation prologue. */ -/* Line 317 of lalr1.cc */ -#line 908 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 299 of lalr1.cc */ +#line 910 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" // HACK to trigger rchandle release: rchandles are freed when refcount == 0 // (not <= 0); but Bison never increments the refcount, so we do it manually... @@ -94,8 +92,8 @@ } } -/* Line 317 of lalr1.cc */ -#line 1033 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 299 of lalr1.cc */ +#line 1035 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" #include "compiler/parser/xquery_scanner.h" @@ -104,11 +102,11 @@ -/* Line 317 of lalr1.cc */ -#line 109 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +/* Line 299 of lalr1.cc */ +#line 107 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* FIXME: INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -119,6 +117,26 @@ # endif #endif +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (N) \ + { \ + (Current).begin = YYRHSLOC (Rhs, 1).begin; \ + (Current).end = YYRHSLOC (Rhs, N).end; \ + } \ + else \ + { \ + (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end; \ + } \ + while (false) +#endif + /* Suppress unused-variable warnings by "using" E. */ #define YYUSE(e) ((void) (e)) @@ -168,14 +186,10 @@ #define YYRECOVERING() (!!yyerrstatus_) -/* Line 380 of lalr1.cc */ -#line 1 "[Bison:b4_percent_define_default]" - namespace zorba { -/* Line 380 of lalr1.cc */ -#line 178 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" -#if YYERROR_VERBOSE +/* Line 382 of lalr1.cc */ +#line 193 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is @@ -214,7 +228,6 @@ return yystr; } -#endif /// Build a parser object. xquery_parser::xquery_parser (xquery_driver& driver_yyarg) @@ -277,2522 +290,2531 @@ case 110: /* "\"'DECIMAL'\"" */ /* Line 480 of lalr1.cc */ -#line 906 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 908 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->decval); }; /* Line 480 of lalr1.cc */ -#line 285 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 298 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 124: /* "\"'DOUBLE'\"" */ /* Line 480 of lalr1.cc */ -#line 905 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 907 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->dval); }; /* Line 480 of lalr1.cc */ -#line 294 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 307 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 149: /* "\"'INTEGER'\"" */ /* Line 480 of lalr1.cc */ -#line 904 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 906 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->ival); }; /* Line 480 of lalr1.cc */ -#line 303 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 316 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 338: /* "VersionDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 312 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 325 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 339: /* "MainModule" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 321 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 334 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 340: /* "LibraryModule" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 330 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 343 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 341: /* "ModuleDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 339 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 352 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 342: /* "SIND_DeclList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 348 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 361 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 343: /* "SIND_Decl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 357 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 370 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 344: /* "Setter" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 366 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 379 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 345: /* "BoundarySpaceDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 375 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 388 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 346: /* "DefaultCollationDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 384 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 397 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 347: /* "BaseURIDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 393 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 406 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 348: /* "ConstructionDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 402 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 415 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 349: /* "OrderingModeDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 411 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 424 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 350: /* "EmptyOrderDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 420 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 433 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 351: /* "CopyNamespacesDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 429 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 442 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 352: /* "Import" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 438 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 451 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 353: /* "SchemaImport" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 447 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 460 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 354: /* "URILiteralList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 456 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 469 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 355: /* "SchemaPrefix" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 465 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 478 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 356: /* "ModuleImport" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 474 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 487 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 357: /* "NamespaceDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 483 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 496 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 358: /* "DefaultNamespaceDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 492 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 505 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 359: /* "VFO_DeclList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 501 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 514 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 360: /* "VFO_Decl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 510 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 523 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 361: /* "DecimalFormatDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 519 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 532 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 362: /* "DecimalFormatParamList" */ /* Line 480 of lalr1.cc */ -#line 932 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 934 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->vstrpair); }; /* Line 480 of lalr1.cc */ -#line 528 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 541 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 363: /* "DecimalFormatParam" */ /* Line 480 of lalr1.cc */ -#line 932 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 934 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->strpair); }; /* Line 480 of lalr1.cc */ -#line 537 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 550 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 365: /* "OptionDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 546 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 559 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 366: /* "FTOptionDecl" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 555 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 568 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 367: /* "CtxItemDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 564 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 577 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 368: /* "CtxItemDecl2" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 573 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 586 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 369: /* "CtxItemDecl3" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 582 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 595 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 370: /* "CtxItemDecl4" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 591 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 604 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 371: /* "VarDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 600 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 613 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 372: /* "VarNameAndType" */ /* Line 480 of lalr1.cc */ -#line 932 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 934 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->varnametype); }; /* Line 480 of lalr1.cc */ -#line 609 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 622 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 373: /* "AnnotationList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 618 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 631 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 374: /* "Annotation" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 627 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 640 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 375: /* "AnnotationLiteralList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 636 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 649 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 376: /* "FunctionDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 645 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 658 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 377: /* "FunctionDecl2" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 654 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 667 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 378: /* "FunctionDeclSimple" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 663 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 676 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 379: /* "FunctionDeclUpdating" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 672 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 685 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 380: /* "FunctionSig" */ /* Line 480 of lalr1.cc */ -#line 932 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 934 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->fnsig); }; /* Line 480 of lalr1.cc */ -#line 681 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 694 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 381: /* "ParamList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 690 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 703 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 382: /* "Param" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 699 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 712 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 383: /* "CollectionDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 708 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 721 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 385: /* "IndexDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 717 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 730 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 386: /* "IndexKeyList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 726 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 739 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 387: /* "IndexKeySpec" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 735 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 748 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 388: /* "IntegrityConstraintDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 744 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 757 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 389: /* "QueryBody" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 753 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 766 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 390: /* "StatementsAndOptionalExprTop" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 762 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 775 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 391: /* "StatementsAndOptionalExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 771 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 784 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 392: /* "StatementsAndExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 780 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 793 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 393: /* "Statements" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 789 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 802 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 394: /* "Statement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 798 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 811 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 395: /* "BlockStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 807 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 820 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 396: /* "BlockExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 816 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 829 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 397: /* "EnclosedStatementsAndOptionalExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 825 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 838 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 398: /* "VarDeclStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 834 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 847 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 401: /* "AssignStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 843 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 856 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 402: /* "ApplyStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 852 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 865 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 403: /* "ExitStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 861 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 874 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 404: /* "WhileStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 870 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 883 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 405: /* "FlowCtlStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 879 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 892 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 406: /* "FLWORStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 888 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 901 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 407: /* "ReturnStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 897 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 910 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 408: /* "IfStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 906 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 919 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 409: /* "TryStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 915 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 928 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 410: /* "CatchListStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 924 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 937 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 411: /* "CatchStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 933 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 946 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 412: /* "Expr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 942 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 955 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 413: /* "ExprSingle" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 951 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 964 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 414: /* "ExprSimple" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 960 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 973 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 415: /* "FLWORExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 969 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 982 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 416: /* "ReturnExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 978 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 991 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 419: /* "FLWORWinCond" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 987 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1000 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 420: /* "WindowClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 996 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1009 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 421: /* "CountClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1005 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1018 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 422: /* "ForLetWinClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1014 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1027 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 424: /* "FLWORClauseList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1023 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1036 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 425: /* "ForClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1032 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1045 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 426: /* "VarInDeclList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1041 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1054 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 427: /* "VarInDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1050 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1063 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 428: /* "PositionalVar" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1059 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1072 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 429: /* "FTScoreVar" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1068 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1081 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 430: /* "LetClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1077 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1090 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 431: /* "VarGetsDeclList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1086 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1099 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 432: /* "VarGetsDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1095 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1108 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 433: /* "WindowVarDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1104 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1117 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 434: /* "WindowVars" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1113 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1126 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 435: /* "WindowVars3" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1122 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1135 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 436: /* "WindowVars2" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1131 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1144 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 437: /* "WhereClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1140 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1153 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 438: /* "GroupByClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1149 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1162 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 439: /* "GroupSpecList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1158 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1171 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 440: /* "GroupSpec" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1167 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1180 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 441: /* "GroupCollationSpec" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1176 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1189 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 442: /* "OrderByClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1185 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1198 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 443: /* "OrderSpecList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1194 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1207 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 444: /* "OrderSpec" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1203 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1216 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 445: /* "OrderModifier" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1212 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1225 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 446: /* "OrderDirSpec" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1221 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1234 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 447: /* "OrderEmptySpec" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1230 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1243 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 448: /* "OrderCollationSpec" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1239 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1252 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 449: /* "QuantifiedExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1248 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1261 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 450: /* "QVarInDeclList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1257 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1270 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 451: /* "QVarInDecl" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1266 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1279 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 452: /* "SwitchExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1275 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1288 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 453: /* "SwitchCaseClauseList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1284 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1297 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 454: /* "SwitchCaseClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1293 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1306 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 455: /* "SwitchCaseOperandList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1302 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1315 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 456: /* "SwitchStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1311 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1324 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 459: /* "TypeswitchExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1320 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1333 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 460: /* "TypeswitchStatement" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1329 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1342 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 461: /* "CaseClauseList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1338 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1351 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 462: /* "CaseClause" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1347 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1360 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 465: /* "IfExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1356 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1369 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 466: /* "OrExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1365 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1378 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 467: /* "AndExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1374 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1387 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 468: /* "ComparisonExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1383 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1396 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 470: /* "FTContainsExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1392 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1405 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 471: /* "StringConcatExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1401 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1414 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 472: /* "opt_FTIgnoreOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1410 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1423 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 473: /* "RangeExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1419 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1432 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 474: /* "AdditiveExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1428 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1441 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 475: /* "MultiplicativeExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1437 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1450 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 476: /* "UnionExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1446 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1459 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 477: /* "IntersectExceptExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1455 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1468 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 478: /* "InstanceofExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1464 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1477 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 479: /* "TreatExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1473 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1486 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 480: /* "CastableExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1482 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1495 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 481: /* "CastExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1491 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1504 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" + break; + case 482: /* "SingleType" */ + +/* Line 480 of lalr1.cc */ +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { release_hack( (yyvaluep->node) ); }; + +/* Line 480 of lalr1.cc */ +#line 1513 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 482: /* "UnaryExpr" */ + case 483: /* "UnaryExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1500 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1522 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 483: /* "SignList" */ + case 484: /* "SignList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1509 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1531 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 484: /* "ValueExpr" */ + case 485: /* "ValueExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1518 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1540 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 485: /* "SimpleMapExpr" */ + case 486: /* "SimpleMapExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1527 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1549 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 486: /* "ValueComp" */ + case 487: /* "ValueComp" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1536 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1558 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 487: /* "NodeComp" */ + case 488: /* "NodeComp" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1545 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1567 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 488: /* "ValidateExpr" */ + case 489: /* "ValidateExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1554 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1576 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 489: /* "ExtensionExpr" */ + case 490: /* "ExtensionExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1563 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1585 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 490: /* "Pragma_list" */ + case 491: /* "Pragma_list" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1572 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1594 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 491: /* "Pragma" */ + case 492: /* "Pragma" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1581 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1603 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 492: /* "PathExpr" */ + case 493: /* "PathExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1590 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1612 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 494: /* "RelativePathExpr" */ + case 495: /* "RelativePathExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1599 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1621 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 495: /* "StepExpr" */ + case 496: /* "StepExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1608 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1630 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 496: /* "AxisStep" */ + case 497: /* "AxisStep" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1617 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1639 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 497: /* "ForwardStep" */ + case 498: /* "ForwardStep" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1626 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1648 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 498: /* "ForwardAxis" */ + case 499: /* "ForwardAxis" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1635 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1657 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 499: /* "AbbrevForwardStep" */ + case 500: /* "AbbrevForwardStep" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1644 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1666 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 500: /* "ReverseStep" */ + case 501: /* "ReverseStep" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1653 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1675 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 501: /* "ReverseAxis" */ + case 502: /* "ReverseAxis" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1662 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1684 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 502: /* "NodeTest" */ + case 503: /* "NodeTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1671 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1693 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 503: /* "NameTest" */ + case 504: /* "NameTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1680 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1702 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 504: /* "Wildcard" */ + case 505: /* "Wildcard" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1689 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1711 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 505: /* "FilterExpr" */ + case 506: /* "FilterExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1698 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1720 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 506: /* "PredicateList" */ + case 507: /* "PredicateList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1707 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1729 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 507: /* "Predicate" */ + case 508: /* "Predicate" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1716 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1738 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 508: /* "PrimaryExpr" */ + case 509: /* "PrimaryExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1725 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1747 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 509: /* "Literal" */ + case 510: /* "Literal" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1734 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1756 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 510: /* "NumericLiteral" */ + case 511: /* "NumericLiteral" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1743 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1765 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 511: /* "VarRef" */ + case 512: /* "VarRef" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1752 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1774 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 512: /* "ParenthesizedExpr" */ + case 513: /* "ParenthesizedExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1761 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1783 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 513: /* "ContextItemExpr" */ + case 514: /* "ContextItemExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1770 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1792 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 514: /* "OrderedExpr" */ + case 515: /* "OrderedExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1779 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1801 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 515: /* "UnorderedExpr" */ + case 516: /* "UnorderedExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1788 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1810 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 516: /* "FunctionCall" */ + case 517: /* "FunctionCall" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1797 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1819 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 517: /* "ArgList" */ + case 518: /* "ArgList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1806 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1828 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 518: /* "Constructor" */ + case 519: /* "Constructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1815 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1837 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 519: /* "DirectConstructor" */ + case 520: /* "DirectConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1824 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1846 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 520: /* "DirElemConstructor" */ + case 521: /* "DirElemConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1833 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1855 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 521: /* "DirElemContentList" */ + case 522: /* "DirElemContentList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1842 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1864 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 522: /* "DirAttributeList" */ + case 523: /* "DirAttributeList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1851 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1873 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 523: /* "DirAttr" */ + case 524: /* "DirAttr" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1860 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1882 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 525: /* "DirAttributeValue" */ + case 526: /* "DirAttributeValue" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1869 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1891 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 526: /* "opt_QuoteAttrContentList" */ + case 527: /* "opt_QuoteAttrContentList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1878 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1900 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 527: /* "QuoteAttrContentList" */ + case 528: /* "QuoteAttrContentList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1887 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1909 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 528: /* "opt_AposAttrContentList" */ + case 529: /* "opt_AposAttrContentList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1896 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1918 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 529: /* "AposAttrContentList" */ + case 530: /* "AposAttrContentList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1905 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1927 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 530: /* "QuoteAttrValueContent" */ + case 531: /* "QuoteAttrValueContent" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1914 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1936 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 531: /* "AposAttrValueContent" */ + case 532: /* "AposAttrValueContent" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 1923 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1945 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 532: /* "DirElemContent" */ + case 533: /* "DirElemContent" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1932 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1954 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 533: /* "CommonContent" */ + case 534: /* "CommonContent" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1941 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1963 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 534: /* "DirCommentConstructor" */ + case 535: /* "DirCommentConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1950 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1972 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 535: /* "DirPIConstructor" */ + case 536: /* "DirPIConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1959 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1981 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 536: /* "CDataSection" */ + case 537: /* "CDataSection" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1968 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1990 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 537: /* "ComputedConstructor" */ + case 538: /* "ComputedConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1977 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 1999 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 538: /* "CompDocConstructor" */ + case 539: /* "CompDocConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1986 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2008 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 539: /* "CompElemConstructor" */ + case 540: /* "CompElemConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 1995 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2017 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 540: /* "CompAttrConstructor" */ + case 541: /* "CompAttrConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2004 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2026 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 541: /* "CompTextConstructor" */ + case 542: /* "CompTextConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2013 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2035 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 542: /* "CompCommentConstructor" */ + case 543: /* "CompCommentConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2022 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2044 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 543: /* "CompPIConstructor" */ + case 544: /* "CompPIConstructor" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2031 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" - break; - case 544: /* "SingleType" */ - -/* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" - { release_hack( (yyvaluep->node) ); }; - -/* Line 480 of lalr1.cc */ -#line 2040 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2053 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 545: /* "TypeDeclaration" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2049 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2062 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 546: /* "SequenceType" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2058 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2071 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 547: /* "OccurrenceIndicator" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2067 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2080 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 548: /* "ItemType" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2076 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2089 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 549: /* "TypeList" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2085 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2098 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; case 550: /* "AtomicType" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { release_hack( (yyvaluep->node) ); }; + +/* Line 480 of lalr1.cc */ +#line 2107 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" + break; + case 551: /* "SimpleType" */ + +/* Line 480 of lalr1.cc */ +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2094 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2116 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 551: /* "KindTest" */ + case 552: /* "KindTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2103 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2125 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 552: /* "AnyKindTest" */ + case 553: /* "AnyKindTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2112 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2134 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 553: /* "DocumentTest" */ + case 554: /* "DocumentTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2121 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2143 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 554: /* "TextTest" */ + case 555: /* "TextTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2130 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2152 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 555: /* "CommentTest" */ + case 556: /* "CommentTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2139 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2161 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 556: /* "PITest" */ + case 557: /* "PITest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2148 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2170 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 557: /* "AttributeTest" */ + case 558: /* "AttributeTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2157 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2179 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 558: /* "SchemaAttributeTest" */ + case 559: /* "SchemaAttributeTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2166 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2188 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 559: /* "ElementTest" */ + case 560: /* "ElementTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2175 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2197 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 560: /* "SchemaElementTest" */ + case 561: /* "SchemaElementTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2184 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2206 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 561: /* "TypeName" */ + case 562: /* "TypeName" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2193 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2215 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 562: /* "TypeName_WITH_HOOK" */ + case 563: /* "TypeName_WITH_HOOK" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2202 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2224 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 563: /* "StringLiteral" */ + case 564: /* "StringLiteral" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2211 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2233 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 568: /* "AnyFunctionTest" */ + case 569: /* "AnyFunctionTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2220 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2242 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 569: /* "TypedFunctionTest" */ + case 570: /* "TypedFunctionTest" */ /* Line 480 of lalr1.cc */ -#line 920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2229 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2251 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 572: /* "InsertExpr" */ + case 573: /* "InsertExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2238 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2260 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 573: /* "DeleteExpr" */ + case 574: /* "DeleteExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2247 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2269 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 574: /* "ReplaceExpr" */ + case 575: /* "ReplaceExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2256 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2278 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 575: /* "RenameExpr" */ + case 576: /* "RenameExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2265 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2287 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 576: /* "TransformExpr" */ + case 577: /* "TransformExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2274 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2296 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 577: /* "VarNameList" */ + case 578: /* "VarNameList" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2283 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2305 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 578: /* "VarNameDecl" */ + case 579: /* "VarNameDecl" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2292 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2314 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 579: /* "TryExpr" */ + case 580: /* "TryExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2301 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2323 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 580: /* "CatchListExpr" */ + case 581: /* "CatchListExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2310 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2332 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 581: /* "CatchExpr" */ + case 582: /* "CatchExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2319 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2341 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 582: /* "BracedExpr" */ + case 583: /* "BracedExpr" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2328 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2350 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 583: /* "NameTestList" */ + case 584: /* "NameTestList" */ /* Line 480 of lalr1.cc */ -#line 932 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 934 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { delete (yyvaluep->name_test_list); }; /* Line 480 of lalr1.cc */ -#line 2337 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2359 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 584: /* "FTSelection" */ + case 585: /* "FTSelection" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2346 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2368 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 587: /* "FTOr" */ + case 588: /* "FTOr" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2355 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2377 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 588: /* "FTAnd" */ + case 589: /* "FTAnd" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2364 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2386 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 589: /* "FTMildNot" */ + case 590: /* "FTMildNot" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2373 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2395 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 590: /* "FTUnaryNot" */ + case 591: /* "FTUnaryNot" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2382 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2404 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 591: /* "FTPrimaryWithOptions" */ + case 592: /* "FTPrimaryWithOptions" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2391 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2413 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 592: /* "opt_FTMatchOptions" */ + case 593: /* "opt_FTMatchOptions" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2400 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2422 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 594: /* "FTWeight" */ + case 595: /* "FTWeight" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2409 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2431 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 595: /* "FTPrimary" */ + case 596: /* "FTPrimary" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2418 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2440 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 596: /* "opt_FTTimes" */ + case 597: /* "opt_FTTimes" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2427 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2449 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 597: /* "FTExtensionSelection" */ + case 598: /* "FTExtensionSelection" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2436 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2458 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 599: /* "FTWords" */ + case 600: /* "FTWords" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2445 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2467 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 600: /* "FTWordsValue" */ + case 601: /* "FTWordsValue" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2454 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2476 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 602: /* "FTAnyallOption" */ + case 603: /* "FTAnyallOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2463 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2485 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 605: /* "FTPosFilter" */ + case 606: /* "FTPosFilter" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2472 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2494 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 606: /* "FTOrder" */ + case 607: /* "FTOrder" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2481 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2503 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 607: /* "FTWindow" */ + case 608: /* "FTWindow" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2490 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2512 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 608: /* "FTDistance" */ + case 609: /* "FTDistance" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2499 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2521 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 609: /* "FTUnit" */ + case 610: /* "FTUnit" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2508 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2530 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 610: /* "FTMatchOptions" */ + case 611: /* "FTMatchOptions" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2517 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2539 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 611: /* "FTMatchOption" */ + case 612: /* "FTMatchOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2526 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2548 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 612: /* "FTCaseOption" */ + case 613: /* "FTCaseOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2535 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2557 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 613: /* "FTDiacriticsOption" */ + case 614: /* "FTDiacriticsOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2544 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2566 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 614: /* "FTExtensionOption" */ + case 615: /* "FTExtensionOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2553 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2575 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 615: /* "FTStemOption" */ + case 616: /* "FTStemOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2562 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2584 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 616: /* "FTThesaurusOption" */ + case 617: /* "FTThesaurusOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2571 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2593 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 620: /* "FTThesaurusID" */ + case 621: /* "FTThesaurusID" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2580 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2602 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 623: /* "FTStopWordOption" */ + case 624: /* "FTStopWordOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2589 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2611 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 624: /* "FTStopWords" */ + case 625: /* "FTStopWords" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2598 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2620 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 628: /* "FTStopWordsInclExcl" */ + case 629: /* "FTStopWordsInclExcl" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2607 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2629 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 629: /* "FTLanguageOption" */ + case 630: /* "FTLanguageOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2616 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2638 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 630: /* "FTWildCardOption" */ + case 631: /* "FTWildCardOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2625 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2647 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 631: /* "FTContent" */ + case 632: /* "FTContent" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2634 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2656 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 632: /* "FTTimes" */ + case 633: /* "FTTimes" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2643 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2665 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 633: /* "FTRange" */ + case 634: /* "FTRange" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2652 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2674 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 634: /* "FTScope" */ + case 635: /* "FTScope" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2661 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2683 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 635: /* "FTBigUnit" */ + case 636: /* "FTBigUnit" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2670 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2692 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 636: /* "FTIgnoreOption" */ + case 637: /* "FTIgnoreOption" */ /* Line 480 of lalr1.cc */ -#line 923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2679 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2701 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 637: /* "JSONArrayConstructor" */ + case 638: /* "JSONArrayConstructor" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2688 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2710 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 638: /* "JSONSimpleObjectUnion" */ + case 639: /* "JSONSimpleObjectUnion" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2697 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2719 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 639: /* "JSONAccumulatorObjectUnion" */ + case 640: /* "JSONAccumulatorObjectUnion" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2706 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2728 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 640: /* "JSONObjectConstructor" */ + case 641: /* "JSONObjectConstructor" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2715 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2737 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 641: /* "JSONPairList" */ + case 642: /* "JSONPairList" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->node) ); }; /* Line 480 of lalr1.cc */ -#line 2724 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2746 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 642: /* "JSONInsertExpr" */ + case 643: /* "JSONInsertExpr" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2733 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2755 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 643: /* "JSONAppendExpr" */ + case 644: /* "JSONAppendExpr" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2742 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2764 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 644: /* "JSONDeleteExpr" */ + case 645: /* "JSONDeleteExpr" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2751 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2773 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 645: /* "JSONRenameExpr" */ + case 646: /* "JSONRenameExpr" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2760 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2782 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 646: /* "JSONReplaceExpr" */ + case 647: /* "JSONReplaceExpr" */ /* Line 480 of lalr1.cc */ -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2769 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2791 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 653: /* "QNAME" */ + case 654: /* "QNAME" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2778 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2800 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 654: /* "FUNCTION_NAME" */ + case 655: /* "FUNCTION_NAME" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2787 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2809 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; - case 655: /* "EQNAME" */ + case 656: /* "EQNAME" */ /* Line 480 of lalr1.cc */ -#line 929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { release_hack( (yyvaluep->expr) ); }; /* Line 480 of lalr1.cc */ -#line 2796 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +#line 2818 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" break; default: @@ -2835,6 +2857,18 @@ } #endif + inline bool + xquery_parser::yy_pact_value_is_default_ (int yyvalue) + { + return yyvalue == yypact_ninf_; + } + + inline bool + xquery_parser::yy_table_value_is_error_ (int yyvalue) + { + return yyvalue == yytable_ninf_; + } + int xquery_parser::parse () { @@ -2856,7 +2890,7 @@ /// Location of the lookahead. location_type yylloc; /// The locations where the error started and ended. - location_type yyerror_range[2]; + location_type yyerror_range[3]; /// $$. semantic_type yyval; @@ -2870,14 +2904,14 @@ /* User initialization code. */ -/* Line 553 of lalr1.cc */ -#line 140 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 565 of lalr1.cc */ +#line 140 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { yylloc.begin.filename = yylloc.end.filename = &(driver.theFilename2); } -/* Line 553 of lalr1.cc */ -#line 2881 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +/* Line 565 of lalr1.cc */ +#line 2915 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" /* Initialize the stacks. The initial state will be pushed in yynewstate, since the latter expects the semantical and the @@ -2905,7 +2939,7 @@ /* Try to take a decision without lookahead. */ yyn = yypact_[yystate]; - if (yyn == yypact_ninf_) + if (yy_pact_value_is_default_ (yyn)) goto yydefault; /* Read a lookahead token. */ @@ -2938,8 +2972,8 @@ yyn = yytable_[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == yytable_ninf_) - goto yyerrlab; + if (yy_table_value_is_error_ (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -2995,8 +3029,8 @@ { case 3: -/* Line 678 of lalr1.cc */ -#line 1051 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1053 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(2) - (2)].node); } @@ -3004,8 +3038,8 @@ case 4: -/* Line 678 of lalr1.cc */ -#line 1055 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1057 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(2) - (2)].node); } @@ -3013,8 +3047,8 @@ case 5: -/* Line 678 of lalr1.cc */ -#line 1059 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1061 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (3)].node); } @@ -3022,27 +3056,45 @@ case 6: -/* Line 678 of lalr1.cc */ -#line 1070 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1069 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { - (yyval.node) = NULL; YYABORT; + (yyval.node) = NULL; } break; case 7: -/* Line 678 of lalr1.cc */ -#line 1079 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1075 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { + (yyval.node) = NULL; YYABORT; + } + break; + + case 8: + +/* Line 690 of lalr1.cc */ +#line 1079 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { + (yyval.node) = NULL; YYABORT; + } + break; + + case 9: + +/* Line 690 of lalr1.cc */ +#line 1088 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); driver.set_expr( (yyval.node) ); } break; - case 8: + case 10: -/* Line 678 of lalr1.cc */ -#line 1085 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1094 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { MainModule* mm = dynamic_cast((yysemantic_stack_[(2) - (2)].node)); mm->set_version_decl( static_cast((yysemantic_stack_[(2) - (1)].node)) ); @@ -3051,20 +3103,20 @@ } break; - case 9: + case 11: -/* Line 678 of lalr1.cc */ -#line 1093 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1102 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); driver.set_expr( (yyval.node) ); } break; - case 10: + case 12: -/* Line 678 of lalr1.cc */ -#line 1099 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1108 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { LibraryModule* lm = dynamic_cast((yysemantic_stack_[(2) - (2)].node)); lm->set_version_decl( static_cast((yysemantic_stack_[(2) - (1)].node)) ); @@ -3073,28 +3125,28 @@ } break; - case 11: + case 13: -/* Line 678 of lalr1.cc */ -#line 1110 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1119 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VersionDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (3)].sval)), "utf-8" ); } break; - case 12: + case 14: -/* Line 678 of lalr1.cc */ -#line 1115 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1124 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VersionDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(6) - (3)].sval)), SYMTAB((yysemantic_stack_[(6) - (5)].sval)) ); } break; - case 13: + case 15: -/* Line 678 of lalr1.cc */ -#line 1123 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1132 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { Prolog* prolog = new Prolog(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (1)].node)), NULL); @@ -3102,10 +3154,10 @@ } break; - case 14: + case 16: -/* Line 678 of lalr1.cc */ -#line 1130 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1139 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { Prolog* prolog = new Prolog(LOC((yyloc)), NULL, static_cast((yysemantic_stack_[(3) - (1)].node))); @@ -3113,10 +3165,10 @@ } break; - case 15: + case 17: -/* Line 678 of lalr1.cc */ -#line 1137 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1146 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { Prolog* prolog = new Prolog(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (1)].node)), @@ -3126,19 +3178,19 @@ } break; - case 16: + case 18: -/* Line 678 of lalr1.cc */ -#line 1146 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1155 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new MainModule( LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].expr)), NULL ); } break; - case 17: + case 19: -/* Line 678 of lalr1.cc */ -#line 1153 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1162 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].expr); // to prevent the Bison warning (yylocation_stack_[(3) - (1)]).step(); @@ -3147,10 +3199,10 @@ } break; - case 18: + case 20: -/* Line 678 of lalr1.cc */ -#line 1161 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1170 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].expr); // to prevent the Bison warning (yylocation_stack_[(3) - (1)]).step(); @@ -3159,10 +3211,10 @@ } break; - case 19: + case 21: -/* Line 678 of lalr1.cc */ -#line 1169 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1178 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(5) - (1)].node); (yyval.node) = (yysemantic_stack_[(5) - (3)].node); (yyval.node) = (yysemantic_stack_[(5) - (5)].expr); // to prevent the Bison warning (yylocation_stack_[(5) - (3)]).step(); @@ -3171,10 +3223,10 @@ } break; - case 20: + case 22: -/* Line 678 of lalr1.cc */ -#line 1177 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1186 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(5) - (1)].node); (yyval.node) = (yysemantic_stack_[(5) - (3)].node); (yyval.node) = (yysemantic_stack_[(5) - (5)].expr); // to prevent the Bison warning (yylocation_stack_[(5) - (1)]).step(); @@ -3183,19 +3235,19 @@ } break; - case 21: + case 23: -/* Line 678 of lalr1.cc */ -#line 1188 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1197 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new LibraryModule(LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].node)), NULL); } break; - case 22: + case 24: -/* Line 678 of lalr1.cc */ -#line 1193 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1202 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { Prolog* prolog = new Prolog(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (2)].node)), NULL); @@ -3203,10 +3255,10 @@ } break; - case 23: + case 25: -/* Line 678 of lalr1.cc */ -#line 1200 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1209 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { Prolog* prolog = new Prolog(LOC((yyloc)), NULL, static_cast((yysemantic_stack_[(3) - (2)].node))); @@ -3214,10 +3266,10 @@ } break; - case 24: + case 26: -/* Line 678 of lalr1.cc */ -#line 1207 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1216 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { Prolog* prolog = new Prolog(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (2)].node)), @@ -3227,10 +3279,10 @@ } break; - case 25: + case 27: -/* Line 678 of lalr1.cc */ -#line 1219 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1228 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ModuleDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(6) - (3)].sval)), SYMTAB((yysemantic_stack_[(6) - (5)].sval)) ); @@ -3238,10 +3290,10 @@ } break; - case 26: + case 28: -/* Line 678 of lalr1.cc */ -#line 1229 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1238 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { SIND_DeclList *sdl = new SIND_DeclList( LOC((yyloc)) ); sdl->push_back( (yysemantic_stack_[(1) - (1)].node) ); @@ -3249,20 +3301,20 @@ } break; - case 27: + case 29: -/* Line 678 of lalr1.cc */ -#line 1236 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1245 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { ((SIND_DeclList*)(yysemantic_stack_[(3) - (1)].node))->push_back( (yysemantic_stack_[(3) - (3)].node) ); (yyval.node) = (yysemantic_stack_[(3) - (1)].node); } break; - case 28: + case 30: -/* Line 678 of lalr1.cc */ -#line 1243 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1252 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { // error (yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].node); // to prevent the Bison warning @@ -3272,136 +3324,136 @@ } break; - case 42: + case 44: -/* Line 678 of lalr1.cc */ -#line 1278 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1287 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new BoundarySpaceDecl(LOC((yyloc)), StaticContextConsts::preserve_space); } break; - case 43: + case 45: -/* Line 678 of lalr1.cc */ -#line 1283 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1292 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new BoundarySpaceDecl(LOC((yyloc)), StaticContextConsts::strip_space); } break; - case 44: + case 46: -/* Line 678 of lalr1.cc */ -#line 1291 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1300 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DefaultCollationDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (4)].sval)) ); } break; - case 45: + case 47: -/* Line 678 of lalr1.cc */ -#line 1299 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1308 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new BaseURIDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (3)].sval)) ); } break; - case 46: + case 48: -/* Line 678 of lalr1.cc */ -#line 1307 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1316 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ConstructionDecl(LOC((yyloc)), StaticContextConsts::cons_preserve); } break; - case 47: + case 49: -/* Line 678 of lalr1.cc */ -#line 1312 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1321 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ConstructionDecl(LOC((yyloc)), StaticContextConsts::cons_strip); } break; - case 48: + case 50: -/* Line 678 of lalr1.cc */ -#line 1320 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1329 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderingModeDecl(LOC((yyloc)), StaticContextConsts::ordered); } break; - case 49: + case 51: -/* Line 678 of lalr1.cc */ -#line 1325 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1334 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderingModeDecl(LOC((yyloc)), StaticContextConsts::unordered); } break; - case 50: + case 52: -/* Line 678 of lalr1.cc */ -#line 1333 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1342 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new EmptyOrderDecl(LOC((yyloc)), StaticContextConsts::empty_greatest); } break; - case 51: + case 53: -/* Line 678 of lalr1.cc */ -#line 1338 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1347 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new EmptyOrderDecl(LOC((yyloc)), StaticContextConsts::empty_least); } break; - case 52: + case 54: -/* Line 678 of lalr1.cc */ -#line 1346 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1355 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CopyNamespacesDecl(LOC((yyloc)), true, true); } break; - case 53: + case 55: -/* Line 678 of lalr1.cc */ -#line 1351 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1360 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CopyNamespacesDecl(LOC((yyloc)), true, false); } break; - case 54: + case 56: -/* Line 678 of lalr1.cc */ -#line 1356 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1365 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CopyNamespacesDecl(LOC((yyloc)), false, true); } break; - case 55: + case 57: -/* Line 678 of lalr1.cc */ -#line 1361 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1370 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CopyNamespacesDecl(LOC((yyloc)), false, false); } break; - case 58: + case 60: -/* Line 678 of lalr1.cc */ -#line 1374 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1383 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yyval.node); // to prevent the Bison warning error((yylocation_stack_[(3) - (2)]), "syntax error, \"import\" should be followed by either \"schema\" or \"module\"."); @@ -3409,19 +3461,19 @@ } break; - case 59: + case 61: -/* Line 678 of lalr1.cc */ -#line 1384 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1393 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaImport( LOC((yyloc)), NULL, SYMTAB((yysemantic_stack_[(3) - (3)].sval)), NULL ); } break; - case 60: + case 62: -/* Line 678 of lalr1.cc */ -#line 1389 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1398 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaImport(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (3)].node)), @@ -3430,10 +3482,10 @@ } break; - case 61: + case 63: -/* Line 678 of lalr1.cc */ -#line 1397 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1406 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaImport(LOC((yyloc)), NULL, @@ -3442,10 +3494,10 @@ } break; - case 62: + case 64: -/* Line 678 of lalr1.cc */ -#line 1405 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1414 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaImport(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(6) - (3)].node)), @@ -3454,10 +3506,10 @@ } break; - case 63: + case 65: -/* Line 678 of lalr1.cc */ -#line 1416 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1425 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { URILiteralList *ull = new URILiteralList( LOC((yyloc))); ull->push_back( SYMTAB((yysemantic_stack_[(1) - (1)].sval)) ); @@ -3465,10 +3517,10 @@ } break; - case 64: + case 66: -/* Line 678 of lalr1.cc */ -#line 1423 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1432 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( URILiteralList *ull = dynamic_cast((yysemantic_stack_[(3) - (1)].node)) ) ull->push_back( SYMTAB((yysemantic_stack_[(3) - (3)].sval)) ); @@ -3477,28 +3529,28 @@ } break; - case 65: + case 67: -/* Line 678 of lalr1.cc */ -#line 1434 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1443 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaPrefix( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (2)].sval)) ); } break; - case 66: + case 68: -/* Line 678 of lalr1.cc */ -#line 1439 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1448 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaPrefix( LOC((yyloc)), true ); } break; - case 67: + case 69: -/* Line 678 of lalr1.cc */ -#line 1447 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1456 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ModuleImport(LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (3)].sval)), NULL); @@ -3506,10 +3558,10 @@ } break; - case 68: + case 70: -/* Line 678 of lalr1.cc */ -#line 1454 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1463 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ModuleImport(LOC((yyloc)), SYMTAB((yysemantic_stack_[(6) - (4)].sval)), SYMTAB((yysemantic_stack_[(6) - (6)].sval)), NULL); @@ -3517,10 +3569,10 @@ } break; - case 69: + case 71: -/* Line 678 of lalr1.cc */ -#line 1461 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1470 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ModuleImport(LOC((yyloc)), SYMTAB((yysemantic_stack_[(5) - (3)].sval)), @@ -3530,10 +3582,10 @@ } break; - case 70: + case 72: -/* Line 678 of lalr1.cc */ -#line 1470 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1479 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ModuleImport(LOC((yyloc)), SYMTAB((yysemantic_stack_[(8) - (4)].sval)), @@ -3544,19 +3596,19 @@ } break; - case 71: + case 73: -/* Line 678 of lalr1.cc */ -#line 1483 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1492 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new NamespaceDecl( LOC((yyloc)), SYMTAB((yysemantic_stack_[(5) - (3)].sval)), SYMTAB((yysemantic_stack_[(5) - (5)].sval)) ); } break; - case 72: + case 74: -/* Line 678 of lalr1.cc */ -#line 1491 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1500 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DefaultNamespaceDecl(LOC((yyloc)), ParseConstants::ns_element_default, @@ -3564,10 +3616,10 @@ } break; - case 73: + case 75: -/* Line 678 of lalr1.cc */ -#line 1498 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1507 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DefaultNamespaceDecl(LOC((yyloc)), ParseConstants::ns_function_default, @@ -3575,10 +3627,10 @@ } break; - case 74: + case 76: -/* Line 678 of lalr1.cc */ -#line 1508 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1517 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { VFO_DeclList *vdl = new VFO_DeclList( LOC((yyloc))); vdl->push_back( (yysemantic_stack_[(1) - (1)].node) ); @@ -3586,20 +3638,20 @@ } break; - case 75: + case 77: -/* Line 678 of lalr1.cc */ -#line 1515 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1524 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { ((VFO_DeclList*)(yysemantic_stack_[(3) - (1)].node))->push_back( (yysemantic_stack_[(3) - (3)].node) ); (yyval.node) = (yysemantic_stack_[(3) - (1)].node); } break; - case 76: + case 78: -/* Line 678 of lalr1.cc */ -#line 1522 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1531 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (1)].node); (yyval.node) = (yysemantic_stack_[(3) - (3)].node); // to prevent the Bison warning (yylocation_stack_[(3) - (1)]).step(); @@ -3608,30 +3660,30 @@ } break; - case 85: + case 87: -/* Line 678 of lalr1.cc */ -#line 1545 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1554 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DecimalFormatNode(LOC((yyloc)), (yysemantic_stack_[(4) - (4)].vstrpair)); delete (yysemantic_stack_[(4) - (4)].vstrpair); } break; - case 86: + case 88: -/* Line 678 of lalr1.cc */ -#line 1551 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1560 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DecimalFormatNode(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (3)].expr)), (yysemantic_stack_[(4) - (4)].vstrpair)); delete (yysemantic_stack_[(4) - (4)].vstrpair); } break; - case 87: + case 89: -/* Line 678 of lalr1.cc */ -#line 1560 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1569 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.vstrpair) = new vector(); (yyval.vstrpair)->push_back( *(yysemantic_stack_[(1) - (1)].strpair) ); @@ -3639,10 +3691,10 @@ } break; - case 88: + case 90: -/* Line 678 of lalr1.cc */ -#line 1567 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1576 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yysemantic_stack_[(2) - (1)].vstrpair)->push_back( *(yysemantic_stack_[(2) - (2)].strpair) ); delete (yysemantic_stack_[(2) - (2)].strpair); @@ -3650,10 +3702,10 @@ } break; - case 89: + case 91: -/* Line 678 of lalr1.cc */ -#line 1577 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1586 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { StringLiteral *sl = static_cast((yysemantic_stack_[(3) - (3)].expr)); (yyval.strpair) = new string_pair_t( (yysemantic_stack_[(3) - (1)].strval), sl->get_strval().str() ); @@ -3661,107 +3713,107 @@ } break; - case 90: + case 92: -/* Line 678 of lalr1.cc */ -#line 1586 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1595 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "decimal-separator"; } break; - case 91: + case 93: -/* Line 678 of lalr1.cc */ -#line 1587 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1596 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "digit"; } break; - case 92: + case 94: -/* Line 678 of lalr1.cc */ -#line 1588 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1597 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "grouping-separator"; } break; - case 93: + case 95: -/* Line 678 of lalr1.cc */ -#line 1589 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1598 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "infinty"; } break; - case 94: + case 96: -/* Line 678 of lalr1.cc */ -#line 1590 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1599 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "minus-sign"; } break; - case 95: + case 97: -/* Line 678 of lalr1.cc */ -#line 1591 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1600 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "NaN"; } break; - case 96: + case 98: -/* Line 678 of lalr1.cc */ -#line 1592 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1601 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "pattern-separator"; } break; - case 97: + case 99: -/* Line 678 of lalr1.cc */ -#line 1593 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1602 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "percent"; } break; - case 98: + case 100: -/* Line 678 of lalr1.cc */ -#line 1594 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1603 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "per-mille"; } break; - case 99: + case 101: -/* Line 678 of lalr1.cc */ -#line 1595 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1604 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = "zero-digit"; } break; - case 100: + case 102: -/* Line 678 of lalr1.cc */ -#line 1601 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1610 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OptionDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (3)].expr)), SYMTAB((yysemantic_stack_[(4) - (4)].sval))); } break; - case 101: + case 103: -/* Line 678 of lalr1.cc */ -#line 1609 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1618 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTOptionDecl( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (3)].node)) ); } break; - case 102: + case 104: -/* Line 678 of lalr1.cc */ -#line 1617 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1626 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(4) - (4)].node); } break; - case 103: + case 105: -/* Line 678 of lalr1.cc */ -#line 1625 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1634 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CtxItemDecl* d = dynamic_cast((yysemantic_stack_[(3) - (3)].node)); d->theType = (yysemantic_stack_[(3) - (2)].node); @@ -3769,19 +3821,19 @@ } break; - case 104: + case 106: -/* Line 678 of lalr1.cc */ -#line 1632 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1641 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 105: + case 107: -/* Line 678 of lalr1.cc */ -#line 1640 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1649 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CtxItemDecl* d = dynamic_cast((yysemantic_stack_[(1) - (1)].node)); d->theIsExternal = false; @@ -3789,37 +3841,37 @@ } break; - case 106: + case 108: -/* Line 678 of lalr1.cc */ -#line 1647 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1656 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CtxItemDecl(LOC((yyloc)), NULL); } break; - case 107: + case 109: -/* Line 678 of lalr1.cc */ -#line 1652 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1661 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(2) - (2)].node); } break; - case 108: + case 110: -/* Line 678 of lalr1.cc */ -#line 1660 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1669 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CtxItemDecl(LOC((yyloc)), (yysemantic_stack_[(2) - (2)].expr)); } break; - case 109: + case 111: -/* Line 678 of lalr1.cc */ -#line 1668 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1677 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { std::auto_ptr nt(dynamic_cast((yysemantic_stack_[(4) - (2)].varnametype))); @@ -3834,10 +3886,10 @@ } break; - case 110: + case 112: -/* Line 678 of lalr1.cc */ -#line 1682 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1691 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { std::auto_ptr nt(dynamic_cast((yysemantic_stack_[(3) - (2)].varnametype))); @@ -3852,10 +3904,10 @@ } break; - case 111: + case 113: -/* Line 678 of lalr1.cc */ -#line 1696 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1705 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { std::auto_ptr nt(dynamic_cast((yysemantic_stack_[(5) - (2)].varnametype))); @@ -3870,19 +3922,19 @@ } break; - case 112: + case 114: -/* Line 678 of lalr1.cc */ -#line 1713 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1722 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.varnametype) = new VarNameAndType(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (3)].expr)), NULL, NULL); } break; - case 113: + case 115: -/* Line 678 of lalr1.cc */ -#line 1718 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1727 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.varnametype) = new VarNameAndType(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (3)].expr)), @@ -3891,10 +3943,10 @@ } break; - case 114: + case 116: -/* Line 678 of lalr1.cc */ -#line 1726 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1735 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.varnametype) = new VarNameAndType(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (4)].expr)), @@ -3903,10 +3955,10 @@ } break; - case 115: + case 117: -/* Line 678 of lalr1.cc */ -#line 1734 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1743 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.varnametype) = new VarNameAndType(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (4)].expr)), @@ -3915,38 +3967,38 @@ } break; - case 116: + case 118: -/* Line 678 of lalr1.cc */ -#line 1745 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1754 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnnotationListParsenode(LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].node))); } break; - case 117: + case 119: -/* Line 678 of lalr1.cc */ -#line 1750 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1759 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { static_cast((yysemantic_stack_[(2) - (1)].node))->push_back(static_cast((yysemantic_stack_[(2) - (2)].node))); (yyval.node) = (yysemantic_stack_[(2) - (1)].node); } break; - case 118: + case 120: -/* Line 678 of lalr1.cc */ -#line 1759 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1768 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnnotationParsenode(LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval))), NULL); } break; - case 119: + case 121: -/* Line 678 of lalr1.cc */ -#line 1764 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1773 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnnotationParsenode(LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (1)].sval))), @@ -3954,19 +4006,19 @@ } break; - case 120: + case 122: -/* Line 678 of lalr1.cc */ -#line 1771 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1780 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnnotationParsenode(LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)), true), NULL); } break; - case 121: + case 123: -/* Line 678 of lalr1.cc */ -#line 1776 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1785 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnnotationParsenode(LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (1)].sval)), true), @@ -3974,39 +4026,39 @@ } break; - case 122: + case 124: -/* Line 678 of lalr1.cc */ -#line 1786 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1795 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnnotationLiteralListParsenode(LOC((yyloc)), (yysemantic_stack_[(1) - (1)].expr)); } break; - case 123: + case 125: -/* Line 678 of lalr1.cc */ -#line 1791 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1800 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { static_cast((yysemantic_stack_[(3) - (1)].node))->push_back((yysemantic_stack_[(3) - (3)].expr)); (yyval.node) = (yysemantic_stack_[(3) - (1)].node); } break; - case 124: + case 126: -/* Line 678 of lalr1.cc */ -#line 1800 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1809 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { static_cast((yysemantic_stack_[(2) - (2)].node))->setComment( SYMTAB((yysemantic_stack_[(2) - (1)].sval)) ); (yyval.node) = (yysemantic_stack_[(2) - (2)].node); } break; - case 125: + case 127: -/* Line 678 of lalr1.cc */ -#line 1806 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1815 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FunctionDecl* fdecl = static_cast((yysemantic_stack_[(3) - (3)].node)); @@ -4017,28 +4069,28 @@ } break; - case 126: + case 128: -/* Line 678 of lalr1.cc */ -#line 1819 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1828 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 127: + case 129: -/* Line 678 of lalr1.cc */ -#line 1824 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1833 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 128: + case 130: -/* Line 678 of lalr1.cc */ -#line 1832 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1841 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FunctionDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (2)].expr)), @@ -4051,10 +4103,10 @@ } break; - case 129: + case 131: -/* Line 678 of lalr1.cc */ -#line 1843 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1852 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FunctionDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(4) - (2)].expr)), @@ -4067,10 +4119,10 @@ } break; - case 130: + case 132: -/* Line 678 of lalr1.cc */ -#line 1858 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1867 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FunctionDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(5) - (3)].expr)), @@ -4083,10 +4135,10 @@ } break; - case 131: + case 133: -/* Line 678 of lalr1.cc */ -#line 1870 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1879 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FunctionDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (3)].expr)), @@ -4099,46 +4151,46 @@ } break; - case 132: + case 134: -/* Line 678 of lalr1.cc */ -#line 1885 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1894 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.fnsig) = new FunctionSig(NULL); } break; - case 133: + case 135: -/* Line 678 of lalr1.cc */ -#line 1890 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1899 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.fnsig) = new FunctionSig(dynamic_cast((yysemantic_stack_[(3) - (2)].node))); } break; - case 134: + case 136: -/* Line 678 of lalr1.cc */ -#line 1895 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1904 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.fnsig) = new FunctionSig(NULL, dynamic_cast((yysemantic_stack_[(4) - (4)].node))); } break; - case 135: + case 137: -/* Line 678 of lalr1.cc */ -#line 1900 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1909 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.fnsig) = new FunctionSig(dynamic_cast((yysemantic_stack_[(5) - (2)].node)), dynamic_cast((yysemantic_stack_[(5) - (5)].node))); } break; - case 136: + case 138: -/* Line 678 of lalr1.cc */ -#line 1908 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1917 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { ParamList *pl = new ParamList( LOC((yyloc)) ); pl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -4146,10 +4198,10 @@ } break; - case 137: + case 139: -/* Line 678 of lalr1.cc */ -#line 1915 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1924 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( ParamList *pl = dynamic_cast((yysemantic_stack_[(3) - (1)].node)) ) pl->push_back( dynamic_cast((yysemantic_stack_[(3) - (3)].node)) ); @@ -4158,19 +4210,19 @@ } break; - case 138: + case 140: -/* Line 678 of lalr1.cc */ -#line 1926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1935 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Param(LOC((yyloc)), static_cast((yysemantic_stack_[(2) - (2)].expr)), NULL); } break; - case 139: + case 141: -/* Line 678 of lalr1.cc */ -#line 1931 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1940 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Param(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (2)].expr)), @@ -4178,10 +4230,10 @@ } break; - case 140: + case 142: -/* Line 678 of lalr1.cc */ -#line 1941 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1950 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CollectionDecl( LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (3)].expr)), @@ -4192,10 +4244,10 @@ } break; - case 141: + case 143: -/* Line 678 of lalr1.cc */ -#line 1950 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1959 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CollectionDecl( LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (3)].expr)), @@ -4206,10 +4258,10 @@ } break; - case 142: + case 144: -/* Line 678 of lalr1.cc */ -#line 1959 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1968 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CollectionDecl( LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (4)].expr)), @@ -4220,10 +4272,10 @@ } break; - case 143: + case 145: -/* Line 678 of lalr1.cc */ -#line 1968 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1977 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CollectionDecl( LOC((yyloc)), static_cast((yysemantic_stack_[(6) - (4)].expr)), @@ -4234,19 +4286,19 @@ } break; - case 144: + case 146: -/* Line 678 of lalr1.cc */ -#line 1980 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1989 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = static_cast(new SequenceType(LOC((yyloc)), (yysemantic_stack_[(1) - (1)].node), NULL)); } break; - case 145: + case 147: -/* Line 678 of lalr1.cc */ -#line 1984 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1993 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = static_cast(new SequenceType(LOC((yyloc)), (yysemantic_stack_[(2) - (1)].node), @@ -4254,19 +4306,19 @@ } break; - case 146: + case 148: -/* Line 678 of lalr1.cc */ -#line 1990 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 1999 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = static_cast(new SequenceType(LOC((yyloc)), (yysemantic_stack_[(1) - (1)].node), NULL)); } break; - case 147: + case 149: -/* Line 678 of lalr1.cc */ -#line 1994 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2003 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = static_cast(new SequenceType(LOC((yyloc)), (yysemantic_stack_[(2) - (1)].node), @@ -4275,10 +4327,10 @@ } break; - case 148: + case 150: -/* Line 678 of lalr1.cc */ -#line 2004 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2013 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AST_IndexDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(8) - (3)].expr)), @@ -4290,10 +4342,10 @@ } break; - case 149: + case 151: -/* Line 678 of lalr1.cc */ -#line 2014 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2023 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AST_IndexDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(9) - (4)].expr)), @@ -4305,10 +4357,10 @@ } break; - case 150: + case 152: -/* Line 678 of lalr1.cc */ -#line 2027 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2036 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { IndexKeyList* keyList = new IndexKeyList(LOC((yyloc))); keyList->addKeySpec(dynamic_cast((yysemantic_stack_[(1) - (1)].node))); @@ -4316,29 +4368,29 @@ } break; - case 151: + case 153: -/* Line 678 of lalr1.cc */ -#line 2033 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2042 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { dynamic_cast((yysemantic_stack_[(3) - (1)].node))->addKeySpec(dynamic_cast((yysemantic_stack_[(3) - (3)].node))); (yyval.node) = (yysemantic_stack_[(3) - (1)].node); } break; - case 152: + case 154: -/* Line 678 of lalr1.cc */ -#line 2042 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2051 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new IndexKeySpec(LOC((yyloc)), (yysemantic_stack_[(1) - (1)].expr), NULL, NULL); } break; - case 153: + case 155: -/* Line 678 of lalr1.cc */ -#line 2047 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2056 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new IndexKeySpec(LOC((yyloc)), (yysemantic_stack_[(2) - (1)].expr), @@ -4347,10 +4399,10 @@ } break; - case 154: + case 156: -/* Line 678 of lalr1.cc */ -#line 2054 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2063 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new IndexKeySpec(LOC((yyloc)), (yysemantic_stack_[(2) - (1)].expr), @@ -4359,10 +4411,10 @@ } break; - case 155: + case 157: -/* Line 678 of lalr1.cc */ -#line 2061 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2070 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new IndexKeySpec(LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), @@ -4371,10 +4423,10 @@ } break; - case 156: + case 158: -/* Line 678 of lalr1.cc */ -#line 2073 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2082 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ICCollSimpleCheck(LOC((yyloc)), static_cast((yysemantic_stack_[(11) - (4)].expr)), @@ -4384,10 +4436,10 @@ } break; - case 157: + case 159: -/* Line 678 of lalr1.cc */ -#line 2083 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2092 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ICCollUniqueKeyCheck(LOC((yyloc)), static_cast((yysemantic_stack_[(14) - (4)].expr)), @@ -4397,10 +4449,10 @@ } break; - case 158: + case 160: -/* Line 678 of lalr1.cc */ -#line 2093 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2102 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ICCollForeachNode(LOC((yyloc)), static_cast((yysemantic_stack_[(13) - (4)].expr)), @@ -4410,10 +4462,10 @@ } break; - case 159: + case 161: -/* Line 678 of lalr1.cc */ -#line 2104 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2113 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ICForeignKey( LOC((yyloc)), static_cast((yysemantic_stack_[(22) - (4)].expr)), @@ -4426,14 +4478,14 @@ } break; - case 160: + case 162: -/* Line 678 of lalr1.cc */ -#line 2120 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2129 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ((yysemantic_stack_[(1) - (1)].expr) == NULL) { - error((yylocation_stack_[(1) - (1)]), "syntax error, unexpected end of file, the query should not be empty"); + error((yylocation_stack_[(1) - (1)]), "syntax error, unexpected end of file, the query body should not be empty"); YYERROR; } @@ -4447,73 +4499,73 @@ } break; - case 161: + case 163: -/* Line 678 of lalr1.cc */ -#line 2140 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2149 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 162: + case 164: -/* Line 678 of lalr1.cc */ -#line 2144 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2153 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 163: + case 165: -/* Line 678 of lalr1.cc */ -#line 2148 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2157 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = NULL; } break; - case 164: + case 166: -/* Line 678 of lalr1.cc */ -#line 2156 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2165 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 165: + case 167: -/* Line 678 of lalr1.cc */ -#line 2160 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2169 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 166: + case 168: -/* Line 678 of lalr1.cc */ -#line 2164 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2173 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new BlockBody(LOC((yyloc))); } break; - case 167: + case 169: -/* Line 678 of lalr1.cc */ -#line 2172 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2181 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 168: + case 170: -/* Line 678 of lalr1.cc */ -#line 2177 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2186 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { BlockBody* blk = static_cast((yysemantic_stack_[(2) - (1)].expr)); @@ -4523,10 +4575,10 @@ } break; - case 169: + case 171: -/* Line 678 of lalr1.cc */ -#line 2189 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2198 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { BlockBody* blk = new BlockBody(LOC((yyloc))); blk->add((yysemantic_stack_[(1) - (1)].expr)); @@ -4534,10 +4586,10 @@ } break; - case 170: + case 172: -/* Line 678 of lalr1.cc */ -#line 2196 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2205 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { BlockBody* blk = static_cast((yysemantic_stack_[(2) - (1)].expr)); @@ -4547,28 +4599,44 @@ } break; - case 183: + case 173: + +/* Line 690 of lalr1.cc */ +#line 2215 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { + (yyval.expr) = (yysemantic_stack_[(4) - (1)].expr); // to prevent the Bison warning + (yyval.expr) = (yysemantic_stack_[(4) - (2)].expr); // to prevent the Bison warning + (yyval.expr) = (yysemantic_stack_[(4) - (4)].expr); // to prevent the Bison warning + error((yylocation_stack_[(4) - (3)]), "syntax error, unexpected statement (missing semicolon \";\" between statements?)"); + delete (yysemantic_stack_[(4) - (1)].expr); // these need to be deleted here because the parser deallocator will skip them + delete (yysemantic_stack_[(4) - (2)].expr); + delete (yysemantic_stack_[(4) - (4)].expr); + YYERROR; + } + break; + + case 186: -/* Line 678 of lalr1.cc */ -#line 2225 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2247 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(3) - (2)].expr); } break; - case 184: + case 187: -/* Line 678 of lalr1.cc */ -#line 2230 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2252 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new BlockBody(LOC((yyloc))); } break; - case 185: + case 188: -/* Line 678 of lalr1.cc */ -#line 2238 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2260 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if (dynamic_cast((yysemantic_stack_[(3) - (2)].expr)) == NULL) { @@ -4583,28 +4651,28 @@ } break; - case 186: + case 189: -/* Line 678 of lalr1.cc */ -#line 2255 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2277 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(3) - (2)].expr); } break; - case 187: + case 190: -/* Line 678 of lalr1.cc */ -#line 2263 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2285 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(2) - (1)].expr); } break; - case 188: + case 191: -/* Line 678 of lalr1.cc */ -#line 2271 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2293 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { VarDeclStmt* vdecl = static_cast((yysemantic_stack_[(3) - (1)].expr)); vdecl->add((yysemantic_stack_[(3) - (3)].node)); @@ -4612,10 +4680,10 @@ } break; - case 189: + case 192: -/* Line 678 of lalr1.cc */ -#line 2278 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2300 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { VarDeclStmt* vdecl = new VarDeclStmt(LOC((yyloc)), NULL); vdecl->add((yysemantic_stack_[(2) - (2)].node)); @@ -4623,10 +4691,10 @@ } break; - case 190: + case 193: -/* Line 678 of lalr1.cc */ -#line 2285 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2307 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { VarDeclStmt* vdecl = new VarDeclStmt(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (1)].node))); @@ -4635,10 +4703,10 @@ } break; - case 191: + case 194: -/* Line 678 of lalr1.cc */ -#line 2296 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2318 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { LocalVarDecl* vd = new LocalVarDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(2) - (2)].expr)), @@ -4649,10 +4717,10 @@ } break; - case 192: + case 195: -/* Line 678 of lalr1.cc */ -#line 2305 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2327 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { LocalVarDecl* vd = new LocalVarDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (2)].expr)), @@ -4663,10 +4731,10 @@ } break; - case 193: + case 196: -/* Line 678 of lalr1.cc */ -#line 2314 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2336 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { LocalVarDecl* vd = new LocalVarDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (2)].expr)), @@ -4677,10 +4745,10 @@ } break; - case 194: + case 197: -/* Line 678 of lalr1.cc */ -#line 2323 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2345 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { LocalVarDecl* vd = new LocalVarDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (2)].expr)), @@ -4691,37 +4759,37 @@ } break; - case 195: + case 198: -/* Line 678 of lalr1.cc */ -#line 2336 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2358 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AssignExpr(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (2)].expr)), (yysemantic_stack_[(5) - (4)].expr)); } break; - case 196: + case 199: -/* Line 678 of lalr1.cc */ -#line 2344 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2366 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ApplyExpr(LOC((yyloc)), (yysemantic_stack_[(2) - (1)].expr)); } break; - case 197: + case 200: -/* Line 678 of lalr1.cc */ -#line 2352 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2374 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ExitExpr(LOC((yyloc)), (yysemantic_stack_[(4) - (3)].expr)); } break; - case 198: + case 201: -/* Line 678 of lalr1.cc */ -#line 2360 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2382 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { BlockBody* bb = dynamic_cast((yysemantic_stack_[(5) - (5)].expr)); if (bb == NULL) @@ -4734,28 +4802,28 @@ } break; - case 199: + case 202: -/* Line 678 of lalr1.cc */ -#line 2375 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2397 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new FlowCtlStatement(LOC((yyloc)), FlowCtlStatement::BREAK); } break; - case 200: + case 203: -/* Line 678 of lalr1.cc */ -#line 2380 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2402 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new FlowCtlStatement( LOC((yyloc)), FlowCtlStatement::CONTINUE ); } break; - case 201: + case 204: -/* Line 678 of lalr1.cc */ -#line 2388 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2410 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { ReturnExpr* re = dynamic_cast((yysemantic_stack_[(2) - (2)].expr)); (yyval.expr) = new FLWORExpr(LOC((yyloc)), @@ -4767,10 +4835,10 @@ } break; - case 202: + case 205: -/* Line 678 of lalr1.cc */ -#line 2402 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2424 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { exprnode* retExpr = (yysemantic_stack_[(2) - (2)].expr); @@ -4785,10 +4853,10 @@ } break; - case 203: + case 206: -/* Line 678 of lalr1.cc */ -#line 2419 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2441 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { exprnode* thenExpr = (yysemantic_stack_[(8) - (6)].expr); exprnode* elseExpr = (yysemantic_stack_[(8) - (8)].expr); @@ -4811,19 +4879,19 @@ } break; - case 204: + case 207: -/* Line 678 of lalr1.cc */ -#line 2444 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2466 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new TryExpr(LOC((yyloc)), (yysemantic_stack_[(3) - (2)].expr), (yysemantic_stack_[(3) - (3)].expr)); } break; - case 205: + case 208: -/* Line 678 of lalr1.cc */ -#line 2452 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2474 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CatchListExpr* cle = new CatchListExpr( LOC((yyloc)) ); cle->push_back( static_cast((yysemantic_stack_[(1) - (1)].expr)) ); @@ -4831,10 +4899,10 @@ } break; - case 206: + case 209: -/* Line 678 of lalr1.cc */ -#line 2459 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2481 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CatchListExpr *cle = dynamic_cast((yysemantic_stack_[(2) - (1)].expr)); if ( cle ) @@ -4843,29 +4911,29 @@ } break; - case 207: + case 210: -/* Line 678 of lalr1.cc */ -#line 2470 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2492 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CatchExpr(LOC((yyloc)), *(yysemantic_stack_[(3) - (2)].name_test_list), (yysemantic_stack_[(3) - (3)].expr)); delete (yysemantic_stack_[(3) - (2)].name_test_list); } break; - case 208: + case 211: -/* Line 678 of lalr1.cc */ -#line 2480 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2502 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 209: + case 212: -/* Line 678 of lalr1.cc */ -#line 2485 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2507 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { Expr* expr = dynamic_cast((yysemantic_stack_[(3) - (1)].expr)); if ( !expr ) @@ -4878,38 +4946,28 @@ } break; - case 210: - -/* Line 678 of lalr1.cc */ -#line 2497 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" - { - (yyval.expr) = (yysemantic_stack_[(4) - (1)].expr); // to prevent the Bison warning - (yyval.expr) = (yysemantic_stack_[(4) - (3)].expr); // to prevent the Bison warning - error((yylocation_stack_[(4) - (2)]), "syntax error, unexpected ExprSingle (missing comma \",\" between expressions?)"); - delete (yysemantic_stack_[(4) - (1)].expr); // these need to be deleted here because the parser deallocator will skip them - delete (yysemantic_stack_[(4) - (3)].expr); - YYERROR; - } - break; + case 213: - case 211: - -/* Line 678 of lalr1.cc */ -#line 2506 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2520 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { - // This rule will never be reached, as the ERROR rule will stop the parser, - // but it is nevertheless needed to fix a testcase with an unterminated comment which - // would otherwise cycle indefinitely (yyval.expr) = (yysemantic_stack_[(3) - (1)].expr); // to prevent the Bison warning (yyval.expr) = (yysemantic_stack_[(3) - (3)].expr); // to prevent the Bison warning + // Heuristics to improve the error message: if the $1 Expr is a QName (which in turn gets + // promoted to a PathExpr), chances are that it's not a missing comma, so don't modify + // the error message. + if (dynamic_cast((yysemantic_stack_[(3) - (1)].expr)) == NULL) + error((yylocation_stack_[(3) - (2)]), "syntax error, unexpected expression (missing comma \",\" between expressions?)"); + delete (yysemantic_stack_[(3) - (1)].expr); // these need to be deleted here because the parser deallocator will skip them + delete (yysemantic_stack_[(3) - (3)].expr); YYERROR; } break; - case 230: + case 232: -/* Line 678 of lalr1.cc */ -#line 2549 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2567 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { ReturnExpr *re = dynamic_cast((yysemantic_stack_[(2) - (2)].expr)); (yyval.expr) = new FLWORExpr(LOC((yyloc)), @@ -4921,64 +4979,64 @@ } break; - case 231: + case 233: -/* Line 678 of lalr1.cc */ -#line 2563 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2581 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ReturnExpr( LOC((yyloc)), (yysemantic_stack_[(2) - (2)].expr) ); } break; - case 232: + case 234: -/* Line 678 of lalr1.cc */ -#line 2571 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2589 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = parser::the_sliding; } break; - case 233: + case 235: -/* Line 678 of lalr1.cc */ -#line 2576 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2594 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = parser::the_tumbling; } break; - case 234: + case 236: -/* Line 678 of lalr1.cc */ -#line 2584 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2602 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = parser::the_start; } break; - case 235: + case 237: -/* Line 678 of lalr1.cc */ -#line 2589 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2607 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = parser::the_end; } break; - case 236: + case 238: -/* Line 678 of lalr1.cc */ -#line 2594 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2612 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.strval) = parser::the_only_end; } break; - case 237: + case 239: -/* Line 678 of lalr1.cc */ -#line 2602 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2620 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FLWORWinCond(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (2)].node)), @@ -4988,10 +5046,10 @@ } break; - case 238: + case 240: -/* Line 678 of lalr1.cc */ -#line 2611 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2629 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FLWORWinCond(LOC((yyloc)), NULL, @@ -5001,10 +5059,10 @@ } break; - case 239: + case 241: -/* Line 678 of lalr1.cc */ -#line 2623 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2641 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowClause (LOC ((yyloc)), ((yysemantic_stack_[(5) - (2)].strval) == parser::the_tumbling ? @@ -5016,10 +5074,10 @@ } break; - case 240: + case 242: -/* Line 678 of lalr1.cc */ -#line 2633 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2651 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowClause (LOC ((yyloc)), ((yysemantic_stack_[(4) - (2)].strval) == parser::the_tumbling ? @@ -5030,19 +5088,19 @@ } break; - case 241: + case 243: -/* Line 678 of lalr1.cc */ -#line 2646 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2664 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CountClause(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (3)].expr))); } break; - case 250: + case 252: -/* Line 678 of lalr1.cc */ -#line 2670 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2688 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FLWORClauseList *fcl = new FLWORClauseList( LOC((yyloc)) ); fcl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -5050,10 +5108,10 @@ } break; - case 251: + case 253: -/* Line 678 of lalr1.cc */ -#line 2677 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2695 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FLWORClauseList *fcl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); fcl->push_back( dynamic_cast((yysemantic_stack_[(2) - (2)].node)) ); @@ -5061,32 +5119,32 @@ } break; - case 252: + case 254: -/* Line 678 of lalr1.cc */ -#line 2687 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2705 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForClause(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (3)].node))); } break; - case 253: + case 255: -/* Line 678 of lalr1.cc */ -#line 2693 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2711 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (3)].node); // to prevent the Bison warning - error((yylocation_stack_[(3) - (2)]), "syntax error, unexpected QName \"" + error((yylocation_stack_[(3) - (2)]), "syntax error, unexpected qualified name \"" + static_cast((yysemantic_stack_[(3) - (3)].node))->operator[](0)->get_var_name()->get_qname().str() + "\" (missing \"$\" sign?)"); delete (yysemantic_stack_[(3) - (3)].node); YYERROR; } break; - case 254: + case 256: -/* Line 678 of lalr1.cc */ -#line 2702 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2720 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; // to prevent the Bison warning error((yylocation_stack_[(2) - (2)]), ""); // the error message is already set in the driver's parseError member @@ -5094,10 +5152,10 @@ } break; - case 255: + case 257: -/* Line 678 of lalr1.cc */ -#line 2712 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2730 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { VarInDeclList* vdl = new VarInDeclList( LOC((yyloc)) ); vdl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -5105,10 +5163,10 @@ } break; - case 256: + case 258: -/* Line 678 of lalr1.cc */ -#line 2719 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2737 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( VarInDeclList* vdl = dynamic_cast((yysemantic_stack_[(4) - (1)].node)) ) vdl->push_back( dynamic_cast((yysemantic_stack_[(4) - (4)].node)) ); @@ -5116,10 +5174,10 @@ } break; - case 257: + case 259: -/* Line 678 of lalr1.cc */ -#line 2727 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2745 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (1)].node); // to prevent the Bison warning error((yylocation_stack_[(3) - (3)]), "syntax error, unexpected QName \"" @@ -5129,10 +5187,10 @@ } break; - case 258: + case 260: -/* Line 678 of lalr1.cc */ -#line 2739 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2757 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (1)].expr)), @@ -5144,10 +5202,10 @@ } break; - case 259: + case 261: -/* Line 678 of lalr1.cc */ -#line 2749 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2767 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (1)].expr)), @@ -5159,10 +5217,10 @@ } break; - case 260: + case 262: -/* Line 678 of lalr1.cc */ -#line 2759 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2777 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (1)].expr)), @@ -5174,10 +5232,10 @@ } break; - case 261: + case 263: -/* Line 678 of lalr1.cc */ -#line 2769 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2787 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(6) - (1)].expr)), @@ -5189,10 +5247,10 @@ } break; - case 262: + case 264: -/* Line 678 of lalr1.cc */ -#line 2779 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2797 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (1)].expr)), @@ -5204,10 +5262,10 @@ } break; - case 263: + case 265: -/* Line 678 of lalr1.cc */ -#line 2789 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2807 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(6) - (1)].expr)), @@ -5219,10 +5277,10 @@ } break; - case 264: + case 266: -/* Line 678 of lalr1.cc */ -#line 2799 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2817 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (1)].expr)), @@ -5234,10 +5292,10 @@ } break; - case 265: + case 267: -/* Line 678 of lalr1.cc */ -#line 2809 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2827 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(7) - (1)].expr)), @@ -5249,10 +5307,10 @@ } break; - case 266: + case 268: -/* Line 678 of lalr1.cc */ -#line 2820 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2838 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (1)].expr)), @@ -5263,10 +5321,10 @@ } break; - case 267: + case 269: -/* Line 678 of lalr1.cc */ -#line 2829 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2847 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (1)].expr)), @@ -5278,10 +5336,10 @@ } break; - case 268: + case 270: -/* Line 678 of lalr1.cc */ -#line 2839 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2857 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(5) - (1)].expr)), @@ -5293,10 +5351,10 @@ } break; - case 269: + case 271: -/* Line 678 of lalr1.cc */ -#line 2849 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2867 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarInDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(6) - (1)].expr)), @@ -5308,37 +5366,37 @@ } break; - case 270: + case 272: -/* Line 678 of lalr1.cc */ -#line 2865 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2883 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new PositionalVar(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (3)].expr))); } break; - case 271: + case 273: -/* Line 678 of lalr1.cc */ -#line 2874 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2892 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTScoreVar(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (3)].expr))); } break; - case 272: + case 274: -/* Line 678 of lalr1.cc */ -#line 2883 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2901 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new LetClause( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(2) - (2)].node)) ); } break; - case 273: + case 275: -/* Line 678 of lalr1.cc */ -#line 2891 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2909 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { VarGetsDeclList *vgdl = new VarGetsDeclList( LOC((yyloc)) ); vgdl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -5346,10 +5404,10 @@ } break; - case 274: + case 276: -/* Line 678 of lalr1.cc */ -#line 2897 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2915 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if( VarGetsDeclList *vgdl = dynamic_cast((yysemantic_stack_[(3) - (1)].node)) ) vgdl->push_back( dynamic_cast((yysemantic_stack_[(3) - (3)].node)) ); @@ -5357,10 +5415,10 @@ } break; - case 275: + case 277: -/* Line 678 of lalr1.cc */ -#line 2909 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2927 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarGetsDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(4) - (2)].expr)), @@ -5370,10 +5428,10 @@ } break; - case 276: + case 278: -/* Line 678 of lalr1.cc */ -#line 2917 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2935 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarGetsDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(5) - (2)].expr)), @@ -5383,10 +5441,10 @@ } break; - case 277: + case 279: -/* Line 678 of lalr1.cc */ -#line 2927 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2945 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarGetsDecl(LOC ((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (1)].node))->get_var_name(), @@ -5396,10 +5454,10 @@ } break; - case 278: + case 280: -/* Line 678 of lalr1.cc */ -#line 2935 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2953 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new VarGetsDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(6) - (2)].expr)), @@ -5409,10 +5467,10 @@ } break; - case 279: + case 281: -/* Line 678 of lalr1.cc */ -#line 2947 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2965 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowVarDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(4) - (2)].expr)), @@ -5420,10 +5478,10 @@ } break; - case 280: + case 282: -/* Line 678 of lalr1.cc */ -#line 2953 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2971 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowVarDecl(LOC ((yyloc)), static_cast((yysemantic_stack_[(5) - (2)].expr)), @@ -5432,93 +5490,93 @@ } break; - case 282: + case 284: -/* Line 678 of lalr1.cc */ -#line 2966 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2984 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowVars(LOC((yyloc)), NULL, static_cast((yysemantic_stack_[(2) - (2)].expr)), NULL, NULL); } break; - case 283: + case 285: -/* Line 678 of lalr1.cc */ -#line 2970 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2988 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (3)].node); dynamic_cast((yyval.node))->set_curr(static_cast((yysemantic_stack_[(3) - (2)].expr))); } break; - case 284: + case 286: -/* Line 678 of lalr1.cc */ -#line 2978 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 2996 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowVars(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)), NULL, NULL, NULL); } break; - case 285: + case 287: -/* Line 678 of lalr1.cc */ -#line 2982 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3000 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(2) - (2)].node); dynamic_cast((yyval.node))->set_posvar(dynamic_cast((yysemantic_stack_[(2) - (1)].node))); } break; - case 287: + case 289: -/* Line 678 of lalr1.cc */ -#line 2991 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3009 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowVars(LOC((yyloc)), NULL, NULL, static_cast((yysemantic_stack_[(6) - (3)].expr)), static_cast((yysemantic_stack_[(6) - (6)].expr))); } break; - case 288: + case 290: -/* Line 678 of lalr1.cc */ -#line 2995 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3013 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowVars(LOC((yyloc)), NULL, NULL, NULL, static_cast((yysemantic_stack_[(3) - (3)].expr))); } break; - case 289: + case 291: -/* Line 678 of lalr1.cc */ -#line 2999 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3017 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WindowVars(LOC((yyloc)), NULL, NULL, static_cast((yysemantic_stack_[(3) - (3)].expr)), NULL); } break; - case 290: + case 292: -/* Line 678 of lalr1.cc */ -#line 3009 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3027 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new WhereClause(LOC ((yyloc)), (yysemantic_stack_[(2) - (2)].expr)); } break; - case 291: + case 293: -/* Line 678 of lalr1.cc */ -#line 3017 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3035 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupByClause(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (3)].node))); } break; - case 292: + case 294: -/* Line 678 of lalr1.cc */ -#line 3024 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3042 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { GroupSpecList* gsl = new GroupSpecList(LOC((yyloc))); gsl->push_back(static_cast((yysemantic_stack_[(1) - (1)].node))); @@ -5526,10 +5584,10 @@ } break; - case 293: + case 295: -/* Line 678 of lalr1.cc */ -#line 3030 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3048 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { GroupSpecList* gsl = static_cast((yysemantic_stack_[(3) - (1)].node)); gsl->push_back(static_cast((yysemantic_stack_[(3) - (3)].node))); @@ -5537,28 +5595,28 @@ } break; - case 294: + case 296: -/* Line 678 of lalr1.cc */ -#line 3040 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3058 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupSpec(LOC((yyloc)), static_cast((yysemantic_stack_[(2) - (2)].expr)), NULL, NULL, NULL); } break; - case 295: + case 297: -/* Line 678 of lalr1.cc */ -#line 3044 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3062 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupSpec(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (2)].expr)), NULL, (yysemantic_stack_[(4) - (4)].expr), NULL); } break; - case 296: + case 298: -/* Line 678 of lalr1.cc */ -#line 3048 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3066 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupSpec(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (2)].expr)), @@ -5568,10 +5626,10 @@ } break; - case 297: + case 299: -/* Line 678 of lalr1.cc */ -#line 3056 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3074 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupSpec(LOC((yyloc)), static_cast((yysemantic_stack_[(6) - (2)].expr)), @@ -5581,10 +5639,10 @@ } break; - case 298: + case 300: -/* Line 678 of lalr1.cc */ -#line 3064 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3082 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupSpec(LOC((yyloc)), static_cast((yysemantic_stack_[(5) - (2)].expr)), @@ -5594,10 +5652,10 @@ } break; - case 299: + case 301: -/* Line 678 of lalr1.cc */ -#line 3072 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3090 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupSpec(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (2)].expr)), @@ -5607,19 +5665,19 @@ } break; - case 300: + case 302: -/* Line 678 of lalr1.cc */ -#line 3084 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3102 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new GroupCollationSpec( LOC((yyloc)), SYMTAB((yysemantic_stack_[(2) - (2)].sval)) ); } break; - case 301: + case 303: -/* Line 678 of lalr1.cc */ -#line 3092 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3110 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderByClause( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (3)].node)) @@ -5627,10 +5685,10 @@ } break; - case 302: + case 304: -/* Line 678 of lalr1.cc */ -#line 3098 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3116 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderByClause( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (4)].node)), true @@ -5638,10 +5696,10 @@ } break; - case 303: + case 305: -/* Line 678 of lalr1.cc */ -#line 3108 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3126 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { OrderSpecList *osl = new OrderSpecList( LOC((yyloc)) ); osl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -5649,10 +5707,10 @@ } break; - case 304: + case 306: -/* Line 678 of lalr1.cc */ -#line 3114 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3132 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( OrderSpecList* osl = dynamic_cast((yysemantic_stack_[(3) - (1)].node)) ) osl->push_back( dynamic_cast((yysemantic_stack_[(3) - (3)].node)) ); @@ -5660,19 +5718,19 @@ } break; - case 305: + case 307: -/* Line 678 of lalr1.cc */ -#line 3124 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3142 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderSpec( LOC((yyloc)), (yysemantic_stack_[(1) - (1)].expr), NULL ); } break; - case 306: + case 308: -/* Line 678 of lalr1.cc */ -#line 3128 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3146 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderSpec( LOC((yyloc)), (yysemantic_stack_[(2) - (1)].expr), dynamic_cast((yysemantic_stack_[(2) - (2)].node)) @@ -5680,10 +5738,10 @@ } break; - case 307: + case 309: -/* Line 678 of lalr1.cc */ -#line 3138 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3156 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderModifierPN( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)), NULL, NULL @@ -5691,10 +5749,10 @@ } break; - case 308: + case 310: -/* Line 678 of lalr1.cc */ -#line 3144 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3162 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderModifierPN( LOC((yyloc)), NULL, dynamic_cast((yysemantic_stack_[(1) - (1)].node)), NULL @@ -5702,10 +5760,10 @@ } break; - case 309: + case 311: -/* Line 678 of lalr1.cc */ -#line 3150 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3168 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderModifierPN( LOC((yyloc)), NULL, NULL, dynamic_cast((yysemantic_stack_[(1) - (1)].node)) @@ -5713,10 +5771,10 @@ } break; - case 310: + case 312: -/* Line 678 of lalr1.cc */ -#line 3156 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3174 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderModifierPN( LOC((yyloc)), @@ -5727,10 +5785,10 @@ } break; - case 311: + case 313: -/* Line 678 of lalr1.cc */ -#line 3165 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3183 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderModifierPN( LOC((yyloc)), @@ -5741,10 +5799,10 @@ } break; - case 312: + case 314: -/* Line 678 of lalr1.cc */ -#line 3174 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3192 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderModifierPN( LOC((yyloc)), @@ -5755,10 +5813,10 @@ } break; - case 313: + case 315: -/* Line 678 of lalr1.cc */ -#line 3183 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3201 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderModifierPN( LOC((yyloc)), @@ -5769,28 +5827,28 @@ } break; - case 314: + case 316: -/* Line 678 of lalr1.cc */ -#line 3196 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3214 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderDirSpec( LOC((yyloc)), ParseConstants::dir_ascending ); } break; - case 315: + case 317: -/* Line 678 of lalr1.cc */ -#line 3200 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3218 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderDirSpec( LOC((yyloc)), ParseConstants::dir_descending ); } break; - case 316: + case 318: -/* Line 678 of lalr1.cc */ -#line 3208 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3226 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderEmptySpec( LOC((yyloc)), StaticContextConsts::empty_greatest @@ -5798,10 +5856,10 @@ } break; - case 317: + case 319: -/* Line 678 of lalr1.cc */ -#line 3214 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3232 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderEmptySpec( LOC((yyloc)), StaticContextConsts::empty_least @@ -5809,19 +5867,19 @@ } break; - case 318: + case 320: -/* Line 678 of lalr1.cc */ -#line 3224 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3242 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OrderCollationSpec( LOC((yyloc)), SYMTAB((yysemantic_stack_[(2) - (2)].sval)) ); } break; - case 319: + case 321: -/* Line 678 of lalr1.cc */ -#line 3232 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3250 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QuantifiedExpr( LOC((yyloc)), @@ -5832,10 +5890,10 @@ } break; - case 320: + case 322: -/* Line 678 of lalr1.cc */ -#line 3241 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3259 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QuantifiedExpr( LOC((yyloc)), @@ -5846,10 +5904,10 @@ } break; - case 321: + case 323: -/* Line 678 of lalr1.cc */ -#line 3254 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3272 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { QVarInDeclList *qvidl = new QVarInDeclList( LOC((yyloc)) ); qvidl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -5858,10 +5916,10 @@ } break; - case 322: + case 324: -/* Line 678 of lalr1.cc */ -#line 3261 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3279 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { QVarInDeclList *qvidl = dynamic_cast((yysemantic_stack_[(4) - (1)].node)); qvidl->push_back( dynamic_cast((yysemantic_stack_[(4) - (4)].node)) ); @@ -5869,19 +5927,19 @@ } break; - case 323: + case 325: -/* Line 678 of lalr1.cc */ -#line 3273 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3291 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new QVarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (1)].expr)), (yysemantic_stack_[(3) - (3)].expr)); } break; - case 324: + case 326: -/* Line 678 of lalr1.cc */ -#line 3277 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3295 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new QVarInDecl(LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (1)].expr)), @@ -5890,19 +5948,19 @@ } break; - case 325: + case 327: -/* Line 678 of lalr1.cc */ -#line 3289 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3307 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new SwitchExpr(LOC((yyloc)), (yysemantic_stack_[(8) - (3)].expr), static_cast((yysemantic_stack_[(8) - (5)].node)), (yysemantic_stack_[(8) - (8)].expr)); } break; - case 326: + case 328: -/* Line 678 of lalr1.cc */ -#line 3296 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3314 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { SwitchCaseClauseList* scc_list_p = new SwitchCaseClauseList(LOC((yyloc))); scc_list_p->push_back(static_cast((yysemantic_stack_[(1) - (1)].node))); @@ -5910,10 +5968,10 @@ } break; - case 327: + case 329: -/* Line 678 of lalr1.cc */ -#line 3302 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3320 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { SwitchCaseClauseList* scc_list_p = static_cast((yysemantic_stack_[(2) - (1)].node)); scc_list_p->push_back(static_cast((yysemantic_stack_[(2) - (2)].node))); @@ -5921,19 +5979,19 @@ } break; - case 328: + case 330: -/* Line 678 of lalr1.cc */ -#line 3311 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3329 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SwitchCaseClause(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (1)].node)), (yysemantic_stack_[(3) - (3)].expr)); } break; - case 329: + case 331: -/* Line 678 of lalr1.cc */ -#line 3318 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3336 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { SwitchCaseOperandList* sco_list_p = new SwitchCaseOperandList(LOC((yyloc))); sco_list_p->push_back((yysemantic_stack_[(2) - (2)].expr)); @@ -5941,10 +5999,10 @@ } break; - case 330: + case 332: -/* Line 678 of lalr1.cc */ -#line 3324 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3342 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { SwitchCaseOperandList* sco_list_p = static_cast((yysemantic_stack_[(3) - (1)].node)); sco_list_p->push_back((yysemantic_stack_[(3) - (3)].expr)); @@ -5952,19 +6010,19 @@ } break; - case 331: + case 333: -/* Line 678 of lalr1.cc */ -#line 3335 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3353 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new SwitchExpr(LOC((yyloc)), (yysemantic_stack_[(8) - (3)].expr), static_cast((yysemantic_stack_[(8) - (5)].node)), (yysemantic_stack_[(8) - (8)].expr)); } break; - case 332: + case 334: -/* Line 678 of lalr1.cc */ -#line 3342 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3360 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { SwitchCaseClauseList* scc_list_p = new SwitchCaseClauseList(LOC((yyloc))); scc_list_p->push_back(static_cast((yysemantic_stack_[(1) - (1)].node))); @@ -5972,10 +6030,10 @@ } break; - case 333: + case 335: -/* Line 678 of lalr1.cc */ -#line 3348 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3366 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { SwitchCaseClauseList* scc_list_p = static_cast((yysemantic_stack_[(2) - (1)].node)); scc_list_p->push_back(static_cast((yysemantic_stack_[(2) - (2)].node))); @@ -5983,19 +6041,19 @@ } break; - case 334: + case 336: -/* Line 678 of lalr1.cc */ -#line 3357 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3375 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SwitchCaseClause(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (1)].node)), (yysemantic_stack_[(3) - (3)].expr)); } break; - case 335: + case 337: -/* Line 678 of lalr1.cc */ -#line 3366 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3384 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new TypeswitchExpr(LOC((yyloc)), (yysemantic_stack_[(8) - (3)].expr), @@ -6004,10 +6062,10 @@ } break; - case 336: + case 338: -/* Line 678 of lalr1.cc */ -#line 3373 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3391 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new TypeswitchExpr(LOC ((yyloc)), (yysemantic_stack_[(10) - (3)].expr), @@ -6017,10 +6075,10 @@ } break; - case 337: + case 339: -/* Line 678 of lalr1.cc */ -#line 3384 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3402 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new TypeswitchExpr(LOC((yyloc)), (yysemantic_stack_[(8) - (3)].expr), @@ -6029,10 +6087,10 @@ } break; - case 338: + case 340: -/* Line 678 of lalr1.cc */ -#line 3391 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3409 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new TypeswitchExpr(LOC ((yyloc)), (yysemantic_stack_[(10) - (3)].expr), @@ -6042,10 +6100,10 @@ } break; - case 339: + case 341: -/* Line 678 of lalr1.cc */ -#line 3403 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3421 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CaseClauseList* cc_list_p = new CaseClauseList(LOC ((yyloc))); cc_list_p->push_back(dynamic_cast((yysemantic_stack_[(1) - (1)].node))); @@ -6053,10 +6111,10 @@ } break; - case 340: + case 342: -/* Line 678 of lalr1.cc */ -#line 3409 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3427 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CaseClauseList* cc_list_p = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); cc_list_p->push_back(dynamic_cast((yysemantic_stack_[(2) - (2)].node))); @@ -6064,10 +6122,10 @@ } break; - case 341: + case 343: -/* Line 678 of lalr1.cc */ -#line 3421 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3439 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CaseClause(LOC ((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (2)].node)), @@ -6075,10 +6133,10 @@ } break; - case 342: + case 344: -/* Line 678 of lalr1.cc */ -#line 3427 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3445 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CaseClause(LOC ((yyloc)), static_cast((yysemantic_stack_[(7) - (3)].expr)), @@ -6087,10 +6145,10 @@ } break; - case 343: + case 345: -/* Line 678 of lalr1.cc */ -#line 3438 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3456 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CaseClauseList* cc_list_p = new CaseClauseList(LOC ((yyloc))); cc_list_p->push_back(dynamic_cast((yysemantic_stack_[(1) - (1)].node))); @@ -6098,10 +6156,10 @@ } break; - case 344: + case 346: -/* Line 678 of lalr1.cc */ -#line 3444 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3462 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CaseClauseList* cc_list_p = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); cc_list_p->push_back(dynamic_cast((yysemantic_stack_[(2) - (2)].node))); @@ -6109,10 +6167,10 @@ } break; - case 345: + case 347: -/* Line 678 of lalr1.cc */ -#line 3455 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3473 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CaseClause(LOC ((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (2)].node)), @@ -6120,10 +6178,10 @@ } break; - case 346: + case 348: -/* Line 678 of lalr1.cc */ -#line 3461 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3479 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CaseClause(LOC ((yyloc)), static_cast((yysemantic_stack_[(7) - (3)].expr)), @@ -6132,64 +6190,64 @@ } break; - case 347: + case 349: -/* Line 678 of lalr1.cc */ -#line 3472 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3490 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new IfExpr(LOC ((yyloc)), (yysemantic_stack_[(8) - (3)].expr), (yysemantic_stack_[(8) - (6)].expr), (yysemantic_stack_[(8) - (8)].expr)); } break; - case 348: + case 350: -/* Line 678 of lalr1.cc */ -#line 3481 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3499 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 349: + case 351: -/* Line 678 of lalr1.cc */ -#line 3485 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3503 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new OrExpr( LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 350: + case 352: -/* Line 678 of lalr1.cc */ -#line 3494 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3512 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 351: + case 353: -/* Line 678 of lalr1.cc */ -#line 3498 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3516 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AndExpr( LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 352: + case 354: -/* Line 678 of lalr1.cc */ -#line 3506 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3524 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 353: + case 355: -/* Line 678 of lalr1.cc */ -#line 3510 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3528 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { /* ::= "eq" | "ne" | "lt" | "le" | "gt" | "ge" */ (yyval.expr) = new ComparisonExpr( @@ -6201,10 +6259,10 @@ } break; - case 354: + case 356: -/* Line 678 of lalr1.cc */ -#line 3520 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3538 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { /* ::= "is" | "<<" | ">>" */ (yyval.expr) = new ComparisonExpr( @@ -6213,10 +6271,10 @@ } break; - case 355: + case 357: -/* Line 678 of lalr1.cc */ -#line 3527 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3545 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ComparisonExpr( LOC((yyloc)), @@ -6227,10 +6285,10 @@ } break; - case 356: + case 358: -/* Line 678 of lalr1.cc */ -#line 3536 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3554 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ComparisonExpr( LOC((yyloc)), @@ -6241,20 +6299,20 @@ } break; - case 357: + case 359: -/* Line 678 of lalr1.cc */ -#line 3545 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3563 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { /* this call is needed */ driver.lexer->interpretAsLessThan(); } break; - case 358: + case 360: -/* Line 678 of lalr1.cc */ -#line 3550 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3568 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ComparisonExpr( LOC((yyloc)), @@ -6265,10 +6323,10 @@ } break; - case 359: + case 361: -/* Line 678 of lalr1.cc */ -#line 3559 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3577 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ComparisonExpr( LOC((yyloc)), @@ -6279,10 +6337,10 @@ } break; - case 360: + case 362: -/* Line 678 of lalr1.cc */ -#line 3568 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3586 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ComparisonExpr( LOC((yyloc)), @@ -6293,10 +6351,10 @@ } break; - case 361: + case 363: -/* Line 678 of lalr1.cc */ -#line 3577 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3595 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ComparisonExpr( LOC((yyloc)), @@ -6307,19 +6365,19 @@ } break; - case 362: + case 364: -/* Line 678 of lalr1.cc */ -#line 3590 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3608 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 363: + case 365: -/* Line 678 of lalr1.cc */ -#line 3594 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3612 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new FTContainsExpr( LOC((yyloc)), @@ -6330,100 +6388,100 @@ } break; - case 364: + case 366: -/* Line 678 of lalr1.cc */ -#line 3606 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3624 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 365: + case 367: -/* Line 678 of lalr1.cc */ -#line 3610 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3628 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new StringConcatExpr(LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr)); } break; - case 366: + case 368: -/* Line 678 of lalr1.cc */ -#line 3617 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3635 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; } break; - case 367: + case 369: -/* Line 678 of lalr1.cc */ -#line 3621 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3639 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 368: + case 370: -/* Line 678 of lalr1.cc */ -#line 3628 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3646 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 369: + case 371: -/* Line 678 of lalr1.cc */ -#line 3632 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3650 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new RangeExpr( LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 370: + case 372: -/* Line 678 of lalr1.cc */ -#line 3641 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3659 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 371: + case 373: -/* Line 678 of lalr1.cc */ -#line 3645 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3663 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AdditiveExpr( LOC((yyloc)), ParseConstants::op_plus, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 372: + case 374: -/* Line 678 of lalr1.cc */ -#line 3649 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3667 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AdditiveExpr( LOC((yyloc)), ParseConstants::op_minus, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 373: + case 375: -/* Line 678 of lalr1.cc */ -#line 3657 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3675 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 374: + case 376: -/* Line 678 of lalr1.cc */ -#line 3661 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3679 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new MultiplicativeExpr( LOC((yyloc)), ParseConstants::op_mul, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) @@ -6431,10 +6489,10 @@ } break; - case 375: + case 377: -/* Line 678 of lalr1.cc */ -#line 3667 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3685 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new MultiplicativeExpr( LOC((yyloc)), ParseConstants::op_div, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) @@ -6442,10 +6500,10 @@ } break; - case 376: + case 378: -/* Line 678 of lalr1.cc */ -#line 3673 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3691 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new MultiplicativeExpr( LOC((yyloc)), ParseConstants::op_idiv, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) @@ -6453,10 +6511,10 @@ } break; - case 377: + case 379: -/* Line 678 of lalr1.cc */ -#line 3679 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3697 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new MultiplicativeExpr( LOC((yyloc)), ParseConstants::op_mod, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) @@ -6464,46 +6522,46 @@ } break; - case 378: + case 380: -/* Line 678 of lalr1.cc */ -#line 3689 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3707 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 379: + case 381: -/* Line 678 of lalr1.cc */ -#line 3693 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3711 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new UnionExpr( LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 380: + case 382: -/* Line 678 of lalr1.cc */ -#line 3697 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3715 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new UnionExpr( LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 381: + case 383: -/* Line 678 of lalr1.cc */ -#line 3705 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3723 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 382: + case 384: -/* Line 678 of lalr1.cc */ -#line 3709 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3727 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new IntersectExceptExpr( LOC((yyloc)), ParseConstants::op_intersect, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) @@ -6511,10 +6569,10 @@ } break; - case 383: + case 385: -/* Line 678 of lalr1.cc */ -#line 3715 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3733 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new IntersectExceptExpr( LOC((yyloc)), ParseConstants::op_except, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr) @@ -6522,19 +6580,19 @@ } break; - case 384: + case 386: -/* Line 678 of lalr1.cc */ -#line 3725 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3743 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 385: + case 387: -/* Line 678 of lalr1.cc */ -#line 3729 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3747 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InstanceofExpr( LOC((yyloc)), (yysemantic_stack_[(4) - (1)].expr), dynamic_cast((yysemantic_stack_[(4) - (4)].node)) @@ -6542,19 +6600,19 @@ } break; - case 386: + case 388: -/* Line 678 of lalr1.cc */ -#line 3739 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3757 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 387: + case 389: -/* Line 678 of lalr1.cc */ -#line 3743 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3761 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new TreatExpr( LOC((yyloc)), (yysemantic_stack_[(4) - (1)].expr), dynamic_cast((yysemantic_stack_[(4) - (4)].node)) @@ -6562,19 +6620,19 @@ } break; - case 388: + case 390: -/* Line 678 of lalr1.cc */ -#line 3753 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3771 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 389: + case 391: -/* Line 678 of lalr1.cc */ -#line 3757 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3775 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CastableExpr( LOC((yyloc)), (yysemantic_stack_[(4) - (1)].expr), dynamic_cast((yysemantic_stack_[(4) - (4)].node)) @@ -6582,19 +6640,19 @@ } break; - case 390: + case 392: -/* Line 678 of lalr1.cc */ -#line 3767 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3785 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 391: + case 393: -/* Line 678 of lalr1.cc */ -#line 3771 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3789 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CastExpr( LOC((yyloc)), (yysemantic_stack_[(4) - (1)].expr), dynamic_cast((yysemantic_stack_[(4) - (4)].node)) @@ -6602,55 +6660,73 @@ } break; - case 392: + case 394: + +/* Line 690 of lalr1.cc */ +#line 3799 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { + (yyval.node) = new SingleType(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)), false); + } + break; + + case 395: -/* Line 678 of lalr1.cc */ -#line 3781 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3803 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { + (yyval.node) = new SingleType(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(2) - (1)].node)), true); + } + break; + + case 396: + +/* Line 690 of lalr1.cc */ +#line 3812 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 393: + case 397: -/* Line 678 of lalr1.cc */ -#line 3785 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3816 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new UnaryExpr( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(2) - (1)].node)), (yysemantic_stack_[(2) - (2)].expr) ); } break; - case 394: + case 398: -/* Line 678 of lalr1.cc */ -#line 3793 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3824 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SignList( LOC((yyloc)), true ); } break; - case 395: + case 399: -/* Line 678 of lalr1.cc */ -#line 3797 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3828 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SignList( LOC((yyloc)), false ); } break; - case 396: + case 400: -/* Line 678 of lalr1.cc */ -#line 3801 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3832 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(2) - (1)].node); } break; - case 397: + case 401: -/* Line 678 of lalr1.cc */ -#line 3805 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3836 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( SignList *sl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)) ) sl->negate(); @@ -6658,163 +6734,163 @@ } break; - case 398: + case 402: -/* Line 678 of lalr1.cc */ -#line 3815 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3846 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 399: + case 403: -/* Line 678 of lalr1.cc */ -#line 3819 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3850 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 400: + case 404: -/* Line 678 of lalr1.cc */ -#line 3823 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3854 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 401: + case 405: -/* Line 678 of lalr1.cc */ -#line 3830 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3861 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 402: + case 406: -/* Line 678 of lalr1.cc */ -#line 3835 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3866 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new SimpleMapExpr(LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr)); } break; - case 403: + case 407: -/* Line 678 of lalr1.cc */ -#line 3843 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3874 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ValueComp( LOC((yyloc)), ParseConstants::op_val_eq ); } break; - case 404: + case 408: -/* Line 678 of lalr1.cc */ -#line 3847 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3878 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ValueComp( LOC((yyloc)), ParseConstants::op_val_ne ); } break; - case 405: + case 409: -/* Line 678 of lalr1.cc */ -#line 3851 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3882 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ValueComp( LOC((yyloc)), ParseConstants::op_val_lt ); } break; - case 406: + case 410: -/* Line 678 of lalr1.cc */ -#line 3855 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3886 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ValueComp( LOC((yyloc)), ParseConstants::op_val_le ); } break; - case 407: + case 411: -/* Line 678 of lalr1.cc */ -#line 3859 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3890 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ValueComp( LOC((yyloc)), ParseConstants::op_val_gt ); } break; - case 408: + case 412: -/* Line 678 of lalr1.cc */ -#line 3863 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3894 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ValueComp( LOC((yyloc)), ParseConstants::op_val_ge ); } break; - case 409: + case 413: -/* Line 678 of lalr1.cc */ -#line 3871 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3902 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new NodeComp( LOC((yyloc)), ParseConstants::op_is ); } break; - case 410: + case 414: -/* Line 678 of lalr1.cc */ -#line 3875 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3906 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new NodeComp( LOC((yyloc)), ParseConstants::op_precedes ); } break; - case 411: + case 415: -/* Line 678 of lalr1.cc */ -#line 3879 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3910 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new NodeComp( LOC((yyloc)), ParseConstants::op_follows ); } break; - case 412: + case 416: -/* Line 678 of lalr1.cc */ -#line 3887 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3918 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ValidateExpr( LOC((yyloc)), "strict", (yysemantic_stack_[(4) - (3)].expr) ); } break; - case 413: + case 417: -/* Line 678 of lalr1.cc */ -#line 3891 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ValidateExpr( LOC((yyloc)), "lax", (yysemantic_stack_[(5) - (4)].expr) ); } break; - case 414: + case 418: -/* Line 678 of lalr1.cc */ -#line 3895 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3926 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ValidateExpr( LOC((yyloc)), "strict", (yysemantic_stack_[(5) - (4)].expr) ); } break; - case 415: + case 419: -/* Line 678 of lalr1.cc */ -#line 3899 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3930 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ValidateExpr( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(6) - (3)].node))->get_name(), (yysemantic_stack_[(6) - (5)].expr) @@ -6823,10 +6899,10 @@ } break; - case 416: + case 420: -/* Line 678 of lalr1.cc */ -#line 3910 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3941 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ExtensionExpr( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (1)].node)), NULL @@ -6834,10 +6910,10 @@ } break; - case 417: + case 421: -/* Line 678 of lalr1.cc */ -#line 3916 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3947 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ExtensionExpr( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (1)].node)), (yysemantic_stack_[(4) - (3)].expr) @@ -6845,10 +6921,10 @@ } break; - case 418: + case 422: -/* Line 678 of lalr1.cc */ -#line 3926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3957 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { PragmaList *pl = new PragmaList( LOC((yyloc)) ); pl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -6856,10 +6932,10 @@ } break; - case 419: + case 423: -/* Line 678 of lalr1.cc */ -#line 3932 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3963 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( PragmaList *pl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)) ) pl->push_back( dynamic_cast((yysemantic_stack_[(2) - (2)].node)) ); @@ -6867,46 +6943,46 @@ } break; - case 420: + case 424: -/* Line 678 of lalr1.cc */ -#line 3942 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3973 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Pragma( LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (2)].expr)), SYMTAB((yysemantic_stack_[(3) - (3)].sval)) ); } break; - case 421: + case 425: -/* Line 678 of lalr1.cc */ -#line 3946 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3977 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Pragma( LOC((yyloc)), new QName( LOC((yyloc)), SYMTAB((yysemantic_stack_[(2) - (2)].sval)) ), "" ); } break; - case 422: + case 426: -/* Line 678 of lalr1.cc */ -#line 3950 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 3981 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Pragma( LOC((yyloc)), new QName( LOC((yyloc)), SYMTAB((yysemantic_stack_[(2) - (2)].sval)), true ), "" ); } break; - case 423: + case 427: -/* Line 678 of lalr1.cc */ -#line 3988 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4019 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new PathExpr(LOC((yyloc)), ParseConstants::path_leading_lone_slash, NULL); } break; - case 424: + case 428: -/* Line 678 of lalr1.cc */ -#line 3992 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4023 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { RelativePathExpr* rpe; @@ -6918,10 +6994,10 @@ } break; - case 425: + case 429: -/* Line 678 of lalr1.cc */ -#line 4002 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4033 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { RelativePathExpr* rpe; @@ -6933,10 +7009,10 @@ } break; - case 426: + case 430: -/* Line 678 of lalr1.cc */ -#line 4012 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4043 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { RelativePathExpr* rpe = dynamic_cast((yysemantic_stack_[(1) - (1)].expr)); (yyval.expr) = (!rpe ? @@ -6945,19 +7021,19 @@ } break; - case 427: + case 431: -/* Line 678 of lalr1.cc */ -#line 4025 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4056 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = NULL; } break; - case 428: + case 432: -/* Line 678 of lalr1.cc */ -#line 4034 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4065 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { AxisStep* as = dynamic_cast((yysemantic_stack_[(1) - (1)].expr)); (yyval.expr) = (as ? @@ -6969,46 +7045,46 @@ } break; - case 429: + case 433: -/* Line 678 of lalr1.cc */ -#line 4044 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4075 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new RelativePathExpr(LOC((yyloc)), ParseConstants::st_slash, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr), false); } break; - case 430: + case 434: -/* Line 678 of lalr1.cc */ -#line 4048 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4079 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new RelativePathExpr(LOC((yyloc)), ParseConstants::st_slashslash, (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr), false); } break; - case 431: + case 435: -/* Line 678 of lalr1.cc */ -#line 4057 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4088 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 432: + case 436: -/* Line 678 of lalr1.cc */ -#line 4061 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4092 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 433: + case 437: -/* Line 678 of lalr1.cc */ -#line 4070 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4101 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AxisStep( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)), NULL @@ -7016,10 +7092,10 @@ } break; - case 434: + case 438: -/* Line 678 of lalr1.cc */ -#line 4076 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4107 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AxisStep( LOC((yyloc)), @@ -7029,10 +7105,10 @@ } break; - case 435: + case 439: -/* Line 678 of lalr1.cc */ -#line 4084 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4115 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AxisStep( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)), NULL @@ -7040,10 +7116,10 @@ } break; - case 436: + case 440: -/* Line 678 of lalr1.cc */ -#line 4090 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4121 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new AxisStep( LOC((yyloc)), @@ -7053,10 +7129,10 @@ } break; - case 437: + case 441: -/* Line 678 of lalr1.cc */ -#line 4102 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4133 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardStep( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(2) - (1)].node)), (yysemantic_stack_[(2) - (2)].node) @@ -7064,10 +7140,10 @@ } break; - case 438: + case 442: -/* Line 678 of lalr1.cc */ -#line 4108 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4139 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardStep( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)) @@ -7075,46 +7151,46 @@ } break; - case 439: + case 443: -/* Line 678 of lalr1.cc */ -#line 4118 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4149 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardAxis( LOC((yyloc)), ParseConstants::axis_child ); } break; - case 440: + case 444: -/* Line 678 of lalr1.cc */ -#line 4122 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4153 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardAxis( LOC((yyloc)), ParseConstants::axis_descendant); } break; - case 441: + case 445: -/* Line 678 of lalr1.cc */ -#line 4126 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4157 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardAxis( LOC((yyloc)), ParseConstants::axis_attribute ); } break; - case 442: + case 446: -/* Line 678 of lalr1.cc */ -#line 4130 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4161 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardAxis( LOC((yyloc)), ParseConstants::axis_self ); } break; - case 443: + case 447: -/* Line 678 of lalr1.cc */ -#line 4134 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4165 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardAxis( LOC((yyloc)), ParseConstants::axis_descendant_or_self @@ -7122,10 +7198,10 @@ } break; - case 444: + case 448: -/* Line 678 of lalr1.cc */ -#line 4140 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4171 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardAxis( LOC((yyloc)), ParseConstants::axis_following_sibling @@ -7133,46 +7209,46 @@ } break; - case 445: + case 449: -/* Line 678 of lalr1.cc */ -#line 4146 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4177 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ForwardAxis( LOC((yyloc)), ParseConstants::axis_following ); } break; - case 446: + case 450: -/* Line 678 of lalr1.cc */ -#line 4154 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4185 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AbbrevForwardStep( LOC((yyloc)), (yysemantic_stack_[(1) - (1)].node), false ); } break; - case 447: + case 451: -/* Line 678 of lalr1.cc */ -#line 4158 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4189 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AbbrevForwardStep( LOC((yyloc)), (yysemantic_stack_[(2) - (2)].node), true ); } break; - case 448: + case 452: -/* Line 678 of lalr1.cc */ -#line 4166 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4197 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ReverseStep( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(2) - (1)].node)), (yysemantic_stack_[(2) - (2)].node) ); } break; - case 449: + case 453: -/* Line 678 of lalr1.cc */ -#line 4170 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4201 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { ReverseAxis *ra = new ReverseAxis( LOC((yyloc)), ParseConstants::axis_parent @@ -7181,28 +7257,28 @@ } break; - case 450: + case 454: -/* Line 678 of lalr1.cc */ -#line 4181 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4212 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ReverseAxis( LOC((yyloc)), ParseConstants::axis_parent ); } break; - case 451: + case 455: -/* Line 678 of lalr1.cc */ -#line 4185 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4216 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ReverseAxis( LOC((yyloc)), ParseConstants::axis_ancestor ); } break; - case 452: + case 456: -/* Line 678 of lalr1.cc */ -#line 4189 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4220 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ReverseAxis( LOC((yyloc)), ParseConstants::axis_preceding_sibling @@ -7210,19 +7286,19 @@ } break; - case 453: + case 457: -/* Line 678 of lalr1.cc */ -#line 4195 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4226 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ReverseAxis( LOC((yyloc)), ParseConstants::axis_preceding ); } break; - case 454: + case 458: -/* Line 678 of lalr1.cc */ -#line 4199 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4230 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ReverseAxis( LOC((yyloc)), ParseConstants::axis_ancestor_or_self @@ -7230,118 +7306,118 @@ } break; - case 455: + case 459: -/* Line 678 of lalr1.cc */ -#line 4213 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4244 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 456: + case 460: -/* Line 678 of lalr1.cc */ -#line 4217 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4248 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 457: + case 461: -/* Line 678 of lalr1.cc */ -#line 4225 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4256 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new NameTest( LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].expr)) ); } break; - case 458: + case 462: -/* Line 678 of lalr1.cc */ -#line 4229 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4260 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new NameTest( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); } break; - case 459: + case 463: -/* Line 678 of lalr1.cc */ -#line 4239 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4270 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Wildcard(LOC((yyloc)), "", "", ParseConstants::wild_all, false); } break; - case 460: + case 464: -/* Line 678 of lalr1.cc */ -#line 4243 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4274 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Wildcard(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)), "", ParseConstants::wild_elem, false); } break; - case 461: + case 465: -/* Line 678 of lalr1.cc */ -#line 4247 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4278 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Wildcard(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)), "", ParseConstants::wild_elem, true); } break; - case 462: + case 466: -/* Line 678 of lalr1.cc */ -#line 4251 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4282 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new Wildcard(LOC((yyloc)), "", SYMTAB((yysemantic_stack_[(1) - (1)].sval)), ParseConstants::wild_prefix, false); } break; - case 463: + case 467: -/* Line 678 of lalr1.cc */ -#line 4260 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4291 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 464: + case 468: -/* Line 678 of lalr1.cc */ -#line 4264 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4295 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new FilterExpr(LOC((yyloc)), (yysemantic_stack_[(2) - (1)].expr), dynamic_cast((yysemantic_stack_[(2) - (2)].node))); } break; - case 465: + case 469: -/* Line 678 of lalr1.cc */ -#line 4268 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4299 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DynamicFunctionInvocation(LOC ((yyloc)), (yysemantic_stack_[(3) - (1)].expr)); } break; - case 466: + case 470: -/* Line 678 of lalr1.cc */ -#line 4272 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4303 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DynamicFunctionInvocation(LOC ((yyloc)), (yysemantic_stack_[(4) - (1)].expr), dynamic_cast((yysemantic_stack_[(4) - (3)].node))); } break; - case 467: + case 471: -/* Line 678 of lalr1.cc */ -#line 4280 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4311 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { PredicateList *pl = new PredicateList( LOC((yyloc)) ); pl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].expr)) ); @@ -7349,10 +7425,10 @@ } break; - case 468: + case 472: -/* Line 678 of lalr1.cc */ -#line 4286 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4317 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( PredicateList *pl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)) ) pl->push_back( dynamic_cast((yysemantic_stack_[(2) - (2)].expr)) ); @@ -7360,163 +7436,163 @@ } break; - case 469: + case 473: -/* Line 678 of lalr1.cc */ -#line 4296 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4327 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(3) - (2)].expr); } break; - case 470: + case 474: -/* Line 678 of lalr1.cc */ -#line 4304 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4335 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 471: + case 475: -/* Line 678 of lalr1.cc */ -#line 4308 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4339 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 472: + case 476: -/* Line 678 of lalr1.cc */ -#line 4312 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4343 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 473: + case 477: -/* Line 678 of lalr1.cc */ -#line 4316 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4347 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 474: + case 478: -/* Line 678 of lalr1.cc */ -#line 4320 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4351 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 475: + case 479: -/* Line 678 of lalr1.cc */ -#line 4324 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4355 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 476: + case 480: -/* Line 678 of lalr1.cc */ -#line 4328 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4359 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 477: + case 481: -/* Line 678 of lalr1.cc */ -#line 4332 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4363 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 478: + case 482: -/* Line 678 of lalr1.cc */ -#line 4336 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4367 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 479: + case 483: -/* Line 678 of lalr1.cc */ -#line 4340 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4371 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 480: + case 484: -/* Line 678 of lalr1.cc */ -#line 4345 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4376 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 481: + case 485: -/* Line 678 of lalr1.cc */ -#line 4349 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4380 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 482: + case 486: -/* Line 678 of lalr1.cc */ -#line 4353 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4384 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 483: + case 487: -/* Line 678 of lalr1.cc */ -#line 4357 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4388 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 484: + case 488: -/* Line 678 of lalr1.cc */ -#line 4365 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4396 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 485: + case 489: -/* Line 678 of lalr1.cc */ -#line 4369 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4400 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 486: + case 490: -/* Line 678 of lalr1.cc */ -#line 4377 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4408 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = NumericLiteral::new_literal( LOC((yyloc)), ParseConstants::num_decimal, *(yysemantic_stack_[(1) - (1)].decval) @@ -7525,10 +7601,10 @@ } break; - case 487: + case 491: -/* Line 678 of lalr1.cc */ -#line 4384 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4415 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = NumericLiteral::new_literal( LOC((yyloc)), ParseConstants::num_integer, *(yysemantic_stack_[(1) - (1)].ival) @@ -7537,10 +7613,10 @@ } break; - case 488: + case 492: -/* Line 678 of lalr1.cc */ -#line 4391 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4422 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = NumericLiteral::new_literal( LOC((yyloc)), ParseConstants::num_double, *(yysemantic_stack_[(1) - (1)].dval) @@ -7549,73 +7625,73 @@ } break; - case 489: + case 493: -/* Line 678 of lalr1.cc */ -#line 4402 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4433 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new VarRef(LOC((yyloc)), static_cast((yysemantic_stack_[(2) - (2)].expr))); } break; - case 490: + case 494: -/* Line 678 of lalr1.cc */ -#line 4410 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4441 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ParenthesizedExpr( LOC((yyloc)), NULL); } break; - case 491: + case 495: -/* Line 678 of lalr1.cc */ -#line 4414 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4445 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ParenthesizedExpr( LOC((yyloc)), (yysemantic_stack_[(3) - (2)].expr) ); } break; - case 492: + case 496: -/* Line 678 of lalr1.cc */ -#line 4422 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4453 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ContextItemExpr( LOC((yyloc)) ); } break; - case 493: + case 497: -/* Line 678 of lalr1.cc */ -#line 4430 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4461 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new OrderedExpr( LOC((yyloc)), (yysemantic_stack_[(4) - (3)].expr) ); } break; - case 494: + case 498: -/* Line 678 of lalr1.cc */ -#line 4438 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4469 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new UnorderedExpr( LOC((yyloc)), (yysemantic_stack_[(4) - (3)].expr) ); } break; - case 495: + case 499: -/* Line 678 of lalr1.cc */ -#line 4492 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4523 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new FunctionCall( LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (1)].expr)), NULL ); } break; - case 496: + case 500: -/* Line 678 of lalr1.cc */ -#line 4496 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4527 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new FunctionCall( LOC((yyloc)), @@ -7625,10 +7701,10 @@ } break; - case 497: + case 501: -/* Line 678 of lalr1.cc */ -#line 4509 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4540 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { ArgList *al = new ArgList( LOC((yyloc)) ); al->push_back( (yysemantic_stack_[(1) - (1)].expr) ); @@ -7636,10 +7712,10 @@ } break; - case 498: + case 502: -/* Line 678 of lalr1.cc */ -#line 4515 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4546 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( ArgList *al = dynamic_cast((yysemantic_stack_[(3) - (1)].node)) ) al->push_back( (yysemantic_stack_[(3) - (3)].expr) ); @@ -7647,55 +7723,55 @@ } break; - case 499: + case 503: -/* Line 678 of lalr1.cc */ -#line 4525 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4556 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 500: + case 504: -/* Line 678 of lalr1.cc */ -#line 4529 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4560 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 501: + case 505: -/* Line 678 of lalr1.cc */ -#line 4537 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4568 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 502: + case 506: -/* Line 678 of lalr1.cc */ -#line 4541 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4572 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 503: + case 507: -/* Line 678 of lalr1.cc */ -#line 4545 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4576 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 504: + case 508: -/* Line 678 of lalr1.cc */ -#line 4553 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4584 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirElemConstructor( LOC((yyloc)), @@ -7707,10 +7783,10 @@ } break; - case 505: + case 509: -/* Line 678 of lalr1.cc */ -#line 4563 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4594 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirElemConstructor( LOC((yyloc)), @@ -7722,10 +7798,10 @@ } break; - case 506: + case 510: -/* Line 678 of lalr1.cc */ -#line 4573 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4604 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if (static_cast((yysemantic_stack_[(8) - (2)].expr))->get_qname() != static_cast((yysemantic_stack_[(8) - (6)].expr))->get_qname()) { @@ -7744,10 +7820,10 @@ } break; - case 507: + case 511: -/* Line 678 of lalr1.cc */ -#line 4590 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4621 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if (static_cast((yysemantic_stack_[(9) - (2)].expr))->get_qname() != static_cast((yysemantic_stack_[(9) - (7)].expr))->get_qname()) { @@ -7766,10 +7842,10 @@ } break; - case 508: + case 512: -/* Line 678 of lalr1.cc */ -#line 4607 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4638 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if (static_cast((yysemantic_stack_[(9) - (2)].expr))->get_qname() != static_cast((yysemantic_stack_[(9) - (7)].expr))->get_qname()) { @@ -7788,10 +7864,10 @@ } break; - case 509: + case 513: -/* Line 678 of lalr1.cc */ -#line 4624 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4655 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if (static_cast((yysemantic_stack_[(10) - (2)].expr))->get_qname() != static_cast((yysemantic_stack_[(10) - (8)].expr))->get_qname()) { @@ -7810,10 +7886,10 @@ } break; - case 510: + case 514: -/* Line 678 of lalr1.cc */ -#line 4646 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4677 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { DirElemContentList *decl = new DirElemContentList( LOC((yyloc)) ); decl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].expr)) ); @@ -7821,10 +7897,10 @@ } break; - case 511: + case 515: -/* Line 678 of lalr1.cc */ -#line 4652 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4683 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { DirElemContentList *decl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); if ( decl ) @@ -7833,10 +7909,10 @@ } break; - case 512: + case 516: -/* Line 678 of lalr1.cc */ -#line 4663 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4694 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { DirAttributeList *dal = new DirAttributeList( LOC((yyloc)) ); dal->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -7844,10 +7920,10 @@ } break; - case 513: + case 517: -/* Line 678 of lalr1.cc */ -#line 4669 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4700 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { DirAttributeList *dal = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); if ( dal ) @@ -7856,10 +7932,10 @@ } break; - case 514: + case 518: -/* Line 678 of lalr1.cc */ -#line 4680 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4711 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DirAttr( LOC((yyloc)), @@ -7869,48 +7945,48 @@ } break; - case 517: + case 521: -/* Line 678 of lalr1.cc */ -#line 4697 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4728 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DirAttributeValue( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (2)].node))); } break; - case 518: + case 522: -/* Line 678 of lalr1.cc */ -#line 4702 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4733 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DirAttributeValue( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (2)].node))); } break; - case 519: + case 523: -/* Line 678 of lalr1.cc */ -#line 4711 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4742 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new QuoteAttrContentList( LOC((yyloc)) ); } break; - case 520: + case 524: -/* Line 678 of lalr1.cc */ -#line 4715 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4746 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 521: + case 525: -/* Line 678 of lalr1.cc */ -#line 4722 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4753 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { QuoteAttrContentList *qacl = new QuoteAttrContentList( LOC((yyloc)) ); qacl->push_back( new QuoteAttrValueContent( LOC((yyloc)), "\"" ) ); @@ -7918,10 +7994,10 @@ } break; - case 522: + case 526: -/* Line 678 of lalr1.cc */ -#line 4728 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4759 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { QuoteAttrContentList *qacl = new QuoteAttrContentList( LOC((yyloc)) ); qacl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -7929,10 +8005,10 @@ } break; - case 523: + case 527: -/* Line 678 of lalr1.cc */ -#line 4734 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4765 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { QuoteAttrContentList *qacl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); @@ -7942,10 +8018,10 @@ } break; - case 524: + case 528: -/* Line 678 of lalr1.cc */ -#line 4742 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4773 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { QuoteAttrContentList *qacl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); @@ -7955,28 +8031,28 @@ } break; - case 525: + case 529: -/* Line 678 of lalr1.cc */ -#line 4754 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4785 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AposAttrContentList( LOC((yyloc)) ); } break; - case 526: + case 530: -/* Line 678 of lalr1.cc */ -#line 4758 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4789 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 527: + case 531: -/* Line 678 of lalr1.cc */ -#line 4765 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4796 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { AposAttrContentList *aacl = new AposAttrContentList( LOC((yyloc)) ); aacl->push_back( new AposAttrValueContent( LOC((yyloc)),"'") ); @@ -7984,10 +8060,10 @@ } break; - case 528: + case 532: -/* Line 678 of lalr1.cc */ -#line 4771 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4802 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { AposAttrContentList *aacl = new AposAttrContentList( LOC((yyloc)) ); aacl->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -7995,10 +8071,10 @@ } break; - case 529: + case 533: -/* Line 678 of lalr1.cc */ -#line 4777 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4808 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { AposAttrContentList *aacl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); if (aacl) @@ -8007,10 +8083,10 @@ } break; - case 530: + case 534: -/* Line 678 of lalr1.cc */ -#line 4784 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4815 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { AposAttrContentList *aacl = dynamic_cast((yysemantic_stack_[(2) - (1)].node)); if ( aacl ) @@ -8019,19 +8095,19 @@ } break; - case 531: + case 535: -/* Line 678 of lalr1.cc */ -#line 4795 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4826 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new QuoteAttrValueContent( LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)) ); } break; - case 532: + case 536: -/* Line 678 of lalr1.cc */ -#line 4799 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4830 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new QuoteAttrValueContent( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].expr)) @@ -8039,19 +8115,19 @@ } break; - case 533: + case 537: -/* Line 678 of lalr1.cc */ -#line 4809 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4840 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AposAttrValueContent( LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)) ); } break; - case 534: + case 538: -/* Line 678 of lalr1.cc */ -#line 4813 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4844 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AposAttrValueContent( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].expr)) @@ -8059,48 +8135,48 @@ } break; - case 535: + case 539: -/* Line 678 of lalr1.cc */ -#line 4823 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4854 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirElemContent( LOC((yyloc)), (yysemantic_stack_[(1) - (1)].expr) ); } break; - case 536: + case 540: -/* Line 678 of lalr1.cc */ -#line 4827 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4858 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirElemContent( LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)) ); } break; - case 537: + case 541: -/* Line 678 of lalr1.cc */ -#line 4831 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4862 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { rchandle cdata_h = dynamic_cast((yysemantic_stack_[(1) - (1)].expr)); (yyval.expr) = new DirElemContent( LOC((yyloc)), cdata_h ); } break; - case 538: + case 542: -/* Line 678 of lalr1.cc */ -#line 4836 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4867 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { rchandle cont_h = dynamic_cast((yysemantic_stack_[(1) - (1)].expr)); (yyval.expr) = new DirElemContent( LOC((yyloc)), cont_h ); } break; - case 539: + case 543: -/* Line 678 of lalr1.cc */ -#line 4845 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4876 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CommonContent( LOC((yyloc)), ParseConstants::cont_charref, SYMTAB((yysemantic_stack_[(1) - (1)].sval)) @@ -8108,10 +8184,10 @@ } break; - case 540: + case 544: -/* Line 678 of lalr1.cc */ -#line 4851 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4882 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CommonContent( LOC((yyloc)), ParseConstants::cont_escape_lbrace @@ -8119,10 +8195,10 @@ } break; - case 541: + case 545: -/* Line 678 of lalr1.cc */ -#line 4857 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4888 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CommonContent( LOC((yyloc)), ParseConstants::cont_escape_rbrace @@ -8130,257 +8206,235 @@ } break; - case 542: + case 546: -/* Line 678 of lalr1.cc */ -#line 4863 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4894 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CommonContent(LOC((yyloc)), new EnclosedExpr(LOC((yyloc)), (yysemantic_stack_[(3) - (2)].expr))); } break; - case 543: + case 547: -/* Line 678 of lalr1.cc */ -#line 4871 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4902 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirCommentConstructor( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (2)].sval)) ); } break; - case 544: + case 548: -/* Line 678 of lalr1.cc */ -#line 4876 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4907 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirCommentConstructor( LOC((yyloc)), "" ); } break; - case 545: + case 549: -/* Line 678 of lalr1.cc */ -#line 4884 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4915 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirPIConstructor( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (2)].sval)) ); } break; - case 546: + case 550: -/* Line 678 of lalr1.cc */ -#line 4889 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4920 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DirPIConstructor( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (2)].sval)), SYMTAB((yysemantic_stack_[(3) - (3)].sval)) ); } break; - case 547: + case 551: -/* Line 678 of lalr1.cc */ -#line 4897 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CDataSection( LOC((yyloc)),SYMTAB((yysemantic_stack_[(2) - (2)].sval)) ); } break; - case 548: + case 552: -/* Line 678 of lalr1.cc */ -#line 4905 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4936 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 549: + case 553: -/* Line 678 of lalr1.cc */ -#line 4910 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4941 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 550: + case 554: -/* Line 678 of lalr1.cc */ -#line 4915 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4946 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 551: + case 555: -/* Line 678 of lalr1.cc */ -#line 4920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4951 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 552: + case 556: -/* Line 678 of lalr1.cc */ -#line 4925 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4956 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 553: + case 557: -/* Line 678 of lalr1.cc */ -#line 4930 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4961 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 554: + case 558: -/* Line 678 of lalr1.cc */ -#line 4939 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4970 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompDocConstructor( LOC((yyloc)), (yysemantic_stack_[(4) - (3)].expr) ); } break; - case 555: + case 559: -/* Line 678 of lalr1.cc */ -#line 4947 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4978 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompElemConstructor(LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (1)].sval))), (yysemantic_stack_[(3) - (2)].expr)); } break; - case 556: + case 560: -/* Line 678 of lalr1.cc */ -#line 4951 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4982 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompElemConstructor( LOC((yyloc)), (yysemantic_stack_[(7) - (3)].expr), (yysemantic_stack_[(7) - (6)].expr) ); } break; - case 557: + case 561: -/* Line 678 of lalr1.cc */ -#line 4968 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 4999 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompAttrConstructor( LOC((yyloc)), new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (1)].sval))), (yysemantic_stack_[(3) - (2)].expr) ); } break; - case 558: + case 562: -/* Line 678 of lalr1.cc */ -#line 4972 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5003 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompAttrConstructor( LOC((yyloc)), (yysemantic_stack_[(7) - (3)].expr), (yysemantic_stack_[(7) - (6)].expr) ); } break; - case 559: + case 563: -/* Line 678 of lalr1.cc */ -#line 4980 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5011 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompTextConstructor( LOC((yyloc)), (yysemantic_stack_[(4) - (3)].expr) ); } break; - case 560: + case 564: -/* Line 678 of lalr1.cc */ -#line 4988 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5019 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompCommentConstructor( LOC((yyloc)), (yysemantic_stack_[(4) - (3)].expr) ); } break; - case 561: + case 565: -/* Line 678 of lalr1.cc */ -#line 4996 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5027 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompPIConstructor( LOC((yyloc)), SYMTAB((yysemantic_stack_[(3) - (1)].sval)), (yysemantic_stack_[(3) - (2)].expr) ); } break; - case 562: + case 566: -/* Line 678 of lalr1.cc */ -#line 5000 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5031 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CompPIConstructor( LOC((yyloc)), (yysemantic_stack_[(7) - (3)].expr), (yysemantic_stack_[(7) - (6)].expr) ); } break; - case 563: + case 567: -/* Line 678 of lalr1.cc */ -#line 5008 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5039 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { - (yyval.node) = new SingleType( - LOC((yyloc)), dynamic_cast((yysemantic_stack_[(1) - (1)].node)), false - ); - } + (yyval.node) = (yysemantic_stack_[(2) - (2)].node); + } break; - case 564: - -/* Line 678 of lalr1.cc */ -#line 5014 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" - { - (yyval.node) = new SingleType( - LOC((yyloc)), dynamic_cast((yysemantic_stack_[(2) - (1)].node)), true - ); - } - break; - - case 565: - -/* Line 678 of lalr1.cc */ -#line 5024 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" - { - (yyval.node) = (yysemantic_stack_[(2) - (2)].node); - } - break; - - case 566: + case 568: -/* Line 678 of lalr1.cc */ -#line 5032 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5047 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SequenceType( LOC((yyloc)), (yysemantic_stack_[(1) - (1)].node), NULL ); } break; - case 567: + case 569: -/* Line 678 of lalr1.cc */ -#line 5036 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5051 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SequenceType(LOC((yyloc)), (yysemantic_stack_[(2) - (1)].node), dynamic_cast((yysemantic_stack_[(2) - (2)].node))); } break; - case 568: + case 570: -/* Line 678 of lalr1.cc */ -#line 5040 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5055 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SequenceType( LOC((yyloc)), NULL, NULL ); } break; - case 569: + case 571: -/* Line 678 of lalr1.cc */ -#line 5075 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5090 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OccurrenceIndicator( LOC((yyloc)), ParseConstants::occurs_optionally @@ -8388,10 +8442,10 @@ } break; - case 570: + case 572: -/* Line 678 of lalr1.cc */ -#line 5081 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5096 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OccurrenceIndicator( LOC((yyloc)), ParseConstants::occurs_zero_or_more @@ -8399,10 +8453,10 @@ } break; - case 571: + case 573: -/* Line 678 of lalr1.cc */ -#line 5087 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5102 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new OccurrenceIndicator( LOC((yyloc)), ParseConstants::occurs_one_or_more @@ -8410,73 +8464,73 @@ } break; - case 572: + case 574: -/* Line 678 of lalr1.cc */ -#line 5097 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5112 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 573: + case 575: -/* Line 678 of lalr1.cc */ -#line 5101 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5116 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 574: + case 576: -/* Line 678 of lalr1.cc */ -#line 5105 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5120 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ItemType( LOC((yyloc)), true ); } break; - case 575: + case 577: -/* Line 678 of lalr1.cc */ -#line 5109 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5124 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new StructuredItemType(LOC((yyloc))); } break; - case 576: + case 578: -/* Line 678 of lalr1.cc */ -#line 5113 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5128 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 577: + case 579: -/* Line 678 of lalr1.cc */ -#line 5117 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5132 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 578: + case 580: -/* Line 678 of lalr1.cc */ -#line 5121 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5136 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 579: + case 581: -/* Line 678 of lalr1.cc */ -#line 5128 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5143 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { TypeList* aTypeList = new TypeList(LOC ((yyloc))); aTypeList->push_back(dynamic_cast((yysemantic_stack_[(1) - (1)].node))); @@ -8484,10 +8538,10 @@ } break; - case 580: + case 582: -/* Line 678 of lalr1.cc */ -#line 5134 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5149 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { TypeList* aTypeList = dynamic_cast((yysemantic_stack_[(3) - (1)].node)); aTypeList->push_back(dynamic_cast((yysemantic_stack_[(3) - (3)].node))); @@ -8495,127 +8549,136 @@ } break; - case 581: + case 583: -/* Line 678 of lalr1.cc */ -#line 5144 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5159 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { - (yyval.node) = new AtomicType( LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].expr)) ); - } + (yyval.node) = new AtomicType( LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].expr)) ); + } break; - case 582: + case 584: + +/* Line 690 of lalr1.cc */ +#line 5167 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" + { + (yyval.node) = new SimpleType( LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].expr)) ); + } + break; + + case 585: -/* Line 678 of lalr1.cc */ -#line 5152 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5175 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 583: + case 586: -/* Line 678 of lalr1.cc */ -#line 5156 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5179 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 584: + case 587: -/* Line 678 of lalr1.cc */ -#line 5160 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5183 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 585: + case 588: -/* Line 678 of lalr1.cc */ -#line 5164 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5187 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 586: + case 589: -/* Line 678 of lalr1.cc */ -#line 5168 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5191 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 587: + case 590: -/* Line 678 of lalr1.cc */ -#line 5172 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5195 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 588: + case 591: -/* Line 678 of lalr1.cc */ -#line 5176 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5199 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 589: + case 592: -/* Line 678 of lalr1.cc */ -#line 5180 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5203 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 590: + case 593: -/* Line 678 of lalr1.cc */ -#line 5184 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5207 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 591: + case 594: -/* Line 678 of lalr1.cc */ -#line 5192 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5215 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnyKindTest( LOC((yyloc)) ); } break; - case 592: + case 595: -/* Line 678 of lalr1.cc */ -#line 5200 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5223 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DocumentTest( LOC((yyloc)) ); } break; - case 593: + case 596: -/* Line 678 of lalr1.cc */ -#line 5204 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5227 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DocumentTest( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (3)].node)) ); } break; - case 594: + case 597: -/* Line 678 of lalr1.cc */ -#line 5208 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5231 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new DocumentTest( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (3)].node)) @@ -8623,64 +8686,64 @@ } break; - case 595: + case 598: -/* Line 678 of lalr1.cc */ -#line 5218 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5241 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new TextTest( LOC((yyloc)) ); } break; - case 596: + case 599: -/* Line 678 of lalr1.cc */ -#line 5226 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5249 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new CommentTest( LOC((yyloc))); } break; - case 597: + case 600: -/* Line 678 of lalr1.cc */ -#line 5234 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5257 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new PITest( LOC((yyloc)), "" ); } break; - case 598: + case 601: -/* Line 678 of lalr1.cc */ -#line 5238 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5261 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new PITest( LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (3)].sval)) ); } break; - case 599: + case 602: -/* Line 678 of lalr1.cc */ -#line 5242 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5265 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new PITest( LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (3)].sval)) ); } break; - case 600: + case 603: -/* Line 678 of lalr1.cc */ -#line 5250 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5273 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AttributeTest( LOC((yyloc)), NULL, NULL ); } break; - case 601: + case 604: -/* Line 678 of lalr1.cc */ -#line 5254 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5277 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AttributeTest( LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (3)].expr)), NULL @@ -8688,10 +8751,10 @@ } break; - case 602: + case 605: -/* Line 678 of lalr1.cc */ -#line 5260 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5283 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AttributeTest( LOC((yyloc)), static_cast((yysemantic_stack_[(6) - (3)].expr)), dynamic_cast((yysemantic_stack_[(6) - (5)].node)) @@ -8699,19 +8762,19 @@ } break; - case 603: + case 606: -/* Line 678 of lalr1.cc */ -#line 5266 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5289 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AttributeTest( LOC((yyloc)), NULL, NULL ); } break; - case 604: + case 607: -/* Line 678 of lalr1.cc */ -#line 5270 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5293 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AttributeTest( LOC((yyloc)), NULL, dynamic_cast((yysemantic_stack_[(6) - (5)].node)) @@ -8719,28 +8782,28 @@ } break; - case 605: + case 608: -/* Line 678 of lalr1.cc */ -#line 5280 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5303 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaAttributeTest( LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (3)].expr)) ); } break; - case 606: + case 609: -/* Line 678 of lalr1.cc */ -#line 5288 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5311 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ElementTest( LOC((yyloc)), NULL, NULL, true ); } break; - case 607: + case 610: -/* Line 678 of lalr1.cc */ -#line 5292 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5315 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ElementTest( LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (3)].expr)), NULL, true @@ -8748,10 +8811,10 @@ } break; - case 608: + case 611: -/* Line 678 of lalr1.cc */ -#line 5298 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5321 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ElementTest( LOC((yyloc)), @@ -8762,10 +8825,10 @@ } break; - case 609: + case 612: -/* Line 678 of lalr1.cc */ -#line 5307 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5330 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ElementTest( LOC((yyloc)), @@ -8776,10 +8839,10 @@ } break; - case 610: + case 613: -/* Line 678 of lalr1.cc */ -#line 5316 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5339 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ElementTest( LOC((yyloc)), NULL, NULL, true @@ -8787,10 +8850,10 @@ } break; - case 611: + case 614: -/* Line 678 of lalr1.cc */ -#line 5322 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5345 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ElementTest( LOC((yyloc)), NULL, dynamic_cast((yysemantic_stack_[(6) - (5)].node)), false @@ -8798,10 +8861,10 @@ } break; - case 612: + case 615: -/* Line 678 of lalr1.cc */ -#line 5328 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5351 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new ElementTest( LOC((yyloc)), NULL, dynamic_cast((yysemantic_stack_[(6) - (5)].node)), true @@ -8809,73 +8872,73 @@ } break; - case 613: + case 616: -/* Line 678 of lalr1.cc */ -#line 5338 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5361 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new SchemaElementTest( LOC((yyloc)), static_cast((yysemantic_stack_[(4) - (3)].expr)) ); } break; - case 614: + case 617: -/* Line 678 of lalr1.cc */ -#line 5355 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5378 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new TypeName( LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].expr)) ); } break; - case 615: + case 618: -/* Line 678 of lalr1.cc */ -#line 5362 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5385 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new TypeName( LOC((yyloc)), static_cast((yysemantic_stack_[(2) - (1)].expr)), true ); } break; - case 616: + case 619: -/* Line 678 of lalr1.cc */ -#line 5377 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5400 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new StringLiteral( LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)) ); } break; - case 617: + case 620: -/* Line 678 of lalr1.cc */ -#line 5413 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5436 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 618: + case 621: -/* Line 678 of lalr1.cc */ -#line 5417 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5440 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(1) - (1)].expr); } break; - case 619: + case 622: -/* Line 678 of lalr1.cc */ -#line 5425 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5448 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new LiteralFunctionItem(LOC ((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (1)].expr)), (yysemantic_stack_[(3) - (3)].ival)); } break; - case 620: + case 623: -/* Line 678 of lalr1.cc */ -#line 5433 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5456 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InlineFunction(LOC((yyloc)), &*(yysemantic_stack_[(3) - (2)].fnsig)->theParams, @@ -8885,46 +8948,46 @@ } break; - case 621: + case 624: -/* Line 678 of lalr1.cc */ -#line 5445 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5468 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 622: + case 625: -/* Line 678 of lalr1.cc */ -#line 5449 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5472 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 623: + case 626: -/* Line 678 of lalr1.cc */ -#line 5457 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5480 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new AnyFunctionTest(LOC((yyloc))); } break; - case 624: + case 627: -/* Line 678 of lalr1.cc */ -#line 5465 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5488 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new TypedFunctionTest(LOC ((yyloc)), dynamic_cast((yysemantic_stack_[(5) - (5)].node))); } break; - case 625: + case 628: -/* Line 678 of lalr1.cc */ -#line 5469 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5492 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new TypedFunctionTest(LOC ((yyloc)), dynamic_cast((yysemantic_stack_[(6) - (3)].node)), @@ -8932,19 +8995,19 @@ } break; - case 626: + case 629: -/* Line 678 of lalr1.cc */ -#line 5480 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5503 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (2)].node); } break; - case 627: + case 630: -/* Line 678 of lalr1.cc */ -#line 5497 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5520 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new RevalidationDecl( LOC((yyloc)), StaticContextConsts::strict_validation @@ -8952,10 +9015,10 @@ } break; - case 628: + case 631: -/* Line 678 of lalr1.cc */ -#line 5503 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5526 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new RevalidationDecl( LOC((yyloc)), StaticContextConsts::lax_validation @@ -8963,10 +9026,10 @@ } break; - case 629: + case 632: -/* Line 678 of lalr1.cc */ -#line 5509 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5532 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new RevalidationDecl( LOC((yyloc)), StaticContextConsts::skip_validation @@ -8974,19 +9037,19 @@ } break; - case 630: + case 633: -/* Line 678 of lalr1.cc */ -#line 5519 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5542 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC((yyloc)), store::UpdateConsts::INTO, (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) ); } break; - case 631: + case 634: -/* Line 678 of lalr1.cc */ -#line 5523 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5546 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC((yyloc)), store::UpdateConsts::AS_FIRST_INTO, (yysemantic_stack_[(7) - (3)].expr), (yysemantic_stack_[(7) - (7)].expr) @@ -8994,10 +9057,10 @@ } break; - case 632: + case 635: -/* Line 678 of lalr1.cc */ -#line 5529 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5552 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC((yyloc)), store::UpdateConsts::AS_LAST_INTO, (yysemantic_stack_[(7) - (3)].expr), (yysemantic_stack_[(7) - (7)].expr) @@ -9005,19 +9068,19 @@ } break; - case 633: + case 636: -/* Line 678 of lalr1.cc */ -#line 5535 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5558 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC((yyloc)), store::UpdateConsts::AFTER, (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) ); } break; - case 634: + case 637: -/* Line 678 of lalr1.cc */ -#line 5539 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5562 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC ((yyloc)), store::UpdateConsts::BEFORE, (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) @@ -9025,19 +9088,19 @@ } break; - case 635: + case 638: -/* Line 678 of lalr1.cc */ -#line 5545 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5568 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC((yyloc)), store::UpdateConsts::INTO, (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) ); } break; - case 636: + case 639: -/* Line 678 of lalr1.cc */ -#line 5549 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5572 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC((yyloc)), store::UpdateConsts::AS_FIRST_INTO, (yysemantic_stack_[(7) - (3)].expr), (yysemantic_stack_[(7) - (7)].expr) @@ -9045,10 +9108,10 @@ } break; - case 637: + case 640: -/* Line 678 of lalr1.cc */ -#line 5555 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5578 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC((yyloc)), store::UpdateConsts::AS_LAST_INTO, (yysemantic_stack_[(7) - (3)].expr), (yysemantic_stack_[(7) - (7)].expr) @@ -9056,10 +9119,10 @@ } break; - case 638: + case 641: -/* Line 678 of lalr1.cc */ -#line 5561 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5584 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC ((yyloc)), @@ -9068,10 +9131,10 @@ } break; - case 639: + case 642: -/* Line 678 of lalr1.cc */ -#line 5568 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5591 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new InsertExpr( LOC ((yyloc)), store::UpdateConsts::BEFORE, (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) @@ -9079,28 +9142,28 @@ } break; - case 640: + case 643: -/* Line 678 of lalr1.cc */ -#line 5578 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5601 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DeleteExpr( LOC ((yyloc)), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 641: + case 644: -/* Line 678 of lalr1.cc */ -#line 5583 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5606 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new DeleteExpr( LOC ((yyloc)), (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 642: + case 645: -/* Line 678 of lalr1.cc */ -#line 5591 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5614 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ReplaceExpr( LOC((yyloc)), store::UpdateConsts::NODE, (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) @@ -9108,10 +9171,10 @@ } break; - case 643: + case 646: -/* Line 678 of lalr1.cc */ -#line 5597 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5620 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new ReplaceExpr( LOC((yyloc)), store::UpdateConsts::VALUE_OF_NODE, (yysemantic_stack_[(7) - (5)].expr), (yysemantic_stack_[(7) - (7)].expr) @@ -9119,29 +9182,29 @@ } break; - case 644: + case 647: -/* Line 678 of lalr1.cc */ -#line 5607 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5630 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new RenameExpr( LOC ((yyloc)), (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) ); } break; - case 645: + case 648: -/* Line 678 of lalr1.cc */ -#line 5629 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5652 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CopyVarList *cvl = dynamic_cast((yysemantic_stack_[(7) - (3)].expr)); (yyval.expr) = new TransformExpr( LOC((yyloc)), cvl, (yysemantic_stack_[(7) - (5)].expr), (yysemantic_stack_[(7) - (7)].expr) ); } break; - case 646: + case 649: -/* Line 678 of lalr1.cc */ -#line 5638 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5661 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CopyVarList* lList = new CopyVarList(LOC((yyloc))); lList->push_back (dynamic_cast ((yysemantic_stack_[(1) - (1)].expr))); @@ -9149,10 +9212,10 @@ } break; - case 647: + case 650: -/* Line 678 of lalr1.cc */ -#line 5644 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5667 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CopyVarList* lList = dynamic_cast((yysemantic_stack_[(4) - (1)].expr)); VarBinding* lBinding = dynamic_cast((yysemantic_stack_[(4) - (4)].expr)); @@ -9161,28 +9224,28 @@ } break; - case 648: + case 651: -/* Line 678 of lalr1.cc */ -#line 5657 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5680 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new VarBinding(LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (1)].expr)), (yysemantic_stack_[(3) - (3)].expr)); } break; - case 649: + case 652: -/* Line 678 of lalr1.cc */ -#line 5671 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5694 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new TryExpr( LOC((yyloc)), (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr) ); } break; - case 650: + case 653: -/* Line 678 of lalr1.cc */ -#line 5678 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5701 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CatchListExpr *cle = new CatchListExpr( LOC((yyloc)) ); cle->push_back( static_cast((yysemantic_stack_[(1) - (1)].expr)) ); @@ -9190,10 +9253,10 @@ } break; - case 651: + case 654: -/* Line 678 of lalr1.cc */ -#line 5684 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5707 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CatchListExpr *cle = dynamic_cast((yysemantic_stack_[(2) - (1)].expr)); if ( cle ) @@ -9202,29 +9265,29 @@ } break; - case 652: + case 655: -/* Line 678 of lalr1.cc */ -#line 5694 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5717 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new CatchExpr(LOC((yyloc)), *(yysemantic_stack_[(3) - (2)].name_test_list), (yysemantic_stack_[(3) - (3)].expr)); delete (yysemantic_stack_[(3) - (2)].name_test_list); } break; - case 653: + case 656: -/* Line 678 of lalr1.cc */ -#line 5703 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5726 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = (yysemantic_stack_[(3) - (2)].expr); } break; - case 654: + case 657: -/* Line 678 of lalr1.cc */ -#line 5711 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5734 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CatchExpr::NameTestList *ntl = new CatchExpr::NameTestList; ntl->push_back( static_cast((yysemantic_stack_[(1) - (1)].node)) ); @@ -9232,10 +9295,10 @@ } break; - case 655: + case 658: -/* Line 678 of lalr1.cc */ -#line 5717 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5740 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { CatchExpr::NameTestList *ntl = static_cast((yysemantic_stack_[(3) - (1)].name_test_list)); @@ -9244,121 +9307,121 @@ } break; - case 656: + case 659: -/* Line 678 of lalr1.cc */ -#line 5735 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5758 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTSelection( LOC((yyloc)), (yysemantic_stack_[(2) - (1)].node), (yysemantic_stack_[(2) - (2)].pos_filter_list) ); delete (yysemantic_stack_[(2) - (2)].pos_filter_list); } break; - case 657: + case 660: -/* Line 678 of lalr1.cc */ -#line 5743 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5766 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.pos_filter_list) = NULL; } break; - case 658: + case 661: -/* Line 678 of lalr1.cc */ -#line 5747 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5770 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.pos_filter_list) = (yysemantic_stack_[(1) - (1)].pos_filter_list); } break; - case 659: + case 662: -/* Line 678 of lalr1.cc */ -#line 5754 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5777 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.pos_filter_list) = new FTSelection::pos_filter_list_t; (yyval.pos_filter_list)->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); } break; - case 660: + case 663: -/* Line 678 of lalr1.cc */ -#line 5759 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5782 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yysemantic_stack_[(2) - (1)].pos_filter_list)->push_back( dynamic_cast((yysemantic_stack_[(2) - (2)].node)) ); (yyval.pos_filter_list) = (yysemantic_stack_[(2) - (1)].pos_filter_list); } break; - case 661: + case 664: -/* Line 678 of lalr1.cc */ -#line 5767 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5790 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 662: + case 665: -/* Line 678 of lalr1.cc */ -#line 5771 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5794 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTOr( LOC((yyloc)), (yysemantic_stack_[(3) - (1)].node), (yysemantic_stack_[(3) - (3)].node) ); } break; - case 663: + case 666: -/* Line 678 of lalr1.cc */ -#line 5778 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5801 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 664: + case 667: -/* Line 678 of lalr1.cc */ -#line 5782 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5805 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTAnd( LOC((yyloc)), (yysemantic_stack_[(3) - (1)].node), (yysemantic_stack_[(3) - (3)].node) ); } break; - case 665: + case 668: -/* Line 678 of lalr1.cc */ -#line 5789 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5812 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 666: + case 669: -/* Line 678 of lalr1.cc */ -#line 5793 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5816 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTMildNot( LOC((yyloc)), (yysemantic_stack_[(4) - (1)].node), (yysemantic_stack_[(4) - (4)].node) ); } break; - case 667: + case 670: -/* Line 678 of lalr1.cc */ -#line 5800 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5823 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 668: + case 671: -/* Line 678 of lalr1.cc */ -#line 5804 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5827 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTUnaryNot( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(2) - (2)].node)) @@ -9366,10 +9429,10 @@ } break; - case 669: + case 672: -/* Line 678 of lalr1.cc */ -#line 5813 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5836 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTPrimaryWithOptions( LOC((yyloc)), @@ -9380,55 +9443,55 @@ } break; - case 670: + case 673: -/* Line 678 of lalr1.cc */ -#line 5825 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5848 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; } break; - case 671: + case 674: -/* Line 678 of lalr1.cc */ -#line 5829 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5852 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 672: + case 675: -/* Line 678 of lalr1.cc */ -#line 5836 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5859 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; } break; - case 673: + case 676: -/* Line 678 of lalr1.cc */ -#line 5840 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5863 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 674: + case 677: -/* Line 678 of lalr1.cc */ -#line 5848 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5871 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWeight( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(4) - (3)].expr)) ); } break; - case 675: + case 678: -/* Line 678 of lalr1.cc */ -#line 5856 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5879 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWordsTimes( LOC((yyloc)), @@ -9438,46 +9501,46 @@ } break; - case 676: + case 679: -/* Line 678 of lalr1.cc */ -#line 5864 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5887 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(3) - (2)].node); } break; - case 677: + case 680: -/* Line 678 of lalr1.cc */ -#line 5868 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5891 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 678: + case 681: -/* Line 678 of lalr1.cc */ -#line 5875 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5898 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; } break; - case 679: + case 682: -/* Line 678 of lalr1.cc */ -#line 5879 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5902 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 680: + case 683: -/* Line 678 of lalr1.cc */ -#line 5887 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5910 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTExtensionSelection( LOC((yyloc)), @@ -9487,28 +9550,28 @@ } break; - case 681: + case 684: -/* Line 678 of lalr1.cc */ -#line 5898 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5921 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; } break; - case 682: + case 685: -/* Line 678 of lalr1.cc */ -#line 5902 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 683: + case 686: -/* Line 678 of lalr1.cc */ -#line 5910 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5933 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWords( LOC((yyloc)), @@ -9518,10 +9581,10 @@ } break; - case 684: + case 687: -/* Line 678 of lalr1.cc */ -#line 5922 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5945 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWordsValue( LOC((yyloc)), static_cast((yysemantic_stack_[(1) - (1)].expr)), NULL @@ -9529,10 +9592,10 @@ } break; - case 685: + case 688: -/* Line 678 of lalr1.cc */ -#line 5928 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5951 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWordsValue( LOC((yyloc)), NULL, dynamic_cast((yysemantic_stack_[(3) - (2)].expr)) @@ -9540,145 +9603,145 @@ } break; - case 686: + case 689: -/* Line 678 of lalr1.cc */ -#line 5937 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5960 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTAnyallOption( LOC((yyloc)), ft_anyall_mode::any ); } break; - case 687: + case 690: -/* Line 678 of lalr1.cc */ -#line 5941 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5964 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 688: + case 691: -/* Line 678 of lalr1.cc */ -#line 5949 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5972 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTAnyallOption( LOC((yyloc)), (yysemantic_stack_[(2) - (2)].ft_anyall_value) ); } break; - case 689: + case 692: -/* Line 678 of lalr1.cc */ -#line 5953 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5976 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTAnyallOption( LOC((yyloc)), (yysemantic_stack_[(2) - (2)].ft_anyall_value) ); } break; - case 690: + case 693: -/* Line 678 of lalr1.cc */ -#line 5957 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5980 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTAnyallOption( LOC((yyloc)), ft_anyall_mode::phrase ); } break; - case 691: + case 694: -/* Line 678 of lalr1.cc */ -#line 5964 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5987 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.ft_anyall_value) = ft_anyall_mode::any; } break; - case 692: + case 695: -/* Line 678 of lalr1.cc */ -#line 5968 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5991 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.ft_anyall_value) = ft_anyall_mode::any_word; } break; - case 693: + case 696: -/* Line 678 of lalr1.cc */ -#line 5975 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 5998 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.ft_anyall_value) = ft_anyall_mode::all; } break; - case 694: + case 697: -/* Line 678 of lalr1.cc */ -#line 5979 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6002 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.ft_anyall_value) = ft_anyall_mode::all_words; } break; - case 695: + case 698: -/* Line 678 of lalr1.cc */ -#line 5987 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6010 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 696: + case 699: -/* Line 678 of lalr1.cc */ -#line 5991 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6014 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 697: + case 700: -/* Line 678 of lalr1.cc */ -#line 5995 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6018 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 698: + case 701: -/* Line 678 of lalr1.cc */ -#line 5999 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6022 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 699: + case 702: -/* Line 678 of lalr1.cc */ -#line 6003 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6026 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 700: + case 703: -/* Line 678 of lalr1.cc */ -#line 6011 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6034 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTOrder( LOC((yyloc)) ); } break; - case 701: + case 704: -/* Line 678 of lalr1.cc */ -#line 6019 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6042 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWindow( LOC((yyloc)), @@ -9688,10 +9751,10 @@ } break; - case 702: + case 705: -/* Line 678 of lalr1.cc */ -#line 6031 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6054 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTDistance( LOC((yyloc)), @@ -9701,37 +9764,37 @@ } break; - case 703: + case 706: -/* Line 678 of lalr1.cc */ -#line 6043 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6066 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTUnit( LOC((yyloc)), ft_unit::words ); } break; - case 704: + case 707: -/* Line 678 of lalr1.cc */ -#line 6047 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6070 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTUnit( LOC((yyloc)), ft_unit::sentences ); } break; - case 705: + case 708: -/* Line 678 of lalr1.cc */ -#line 6051 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6074 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTUnit( LOC((yyloc)), ft_unit::paragraphs ); } break; - case 706: + case 709: -/* Line 678 of lalr1.cc */ -#line 6059 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6082 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FTMatchOptions *mo = new FTMatchOptions( LOC((yyloc)) ); mo->push_back( dynamic_cast((yysemantic_stack_[(2) - (2)].node)) ); @@ -9739,10 +9802,10 @@ } break; - case 707: + case 710: -/* Line 678 of lalr1.cc */ -#line 6065 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6088 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FTMatchOptions *mo = dynamic_cast((yysemantic_stack_[(3) - (1)].node)); mo->push_back( dynamic_cast((yysemantic_stack_[(3) - (3)].node)) ); @@ -9750,118 +9813,118 @@ } break; - case 708: + case 711: -/* Line 678 of lalr1.cc */ -#line 6075 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6098 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 709: + case 712: -/* Line 678 of lalr1.cc */ -#line 6079 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6102 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 710: + case 713: -/* Line 678 of lalr1.cc */ -#line 6083 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6106 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 711: + case 714: -/* Line 678 of lalr1.cc */ -#line 6087 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6110 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 712: + case 715: -/* Line 678 of lalr1.cc */ -#line 6091 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6114 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 713: + case 716: -/* Line 678 of lalr1.cc */ -#line 6095 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6118 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 714: + case 717: -/* Line 678 of lalr1.cc */ -#line 6099 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6122 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 715: + case 718: -/* Line 678 of lalr1.cc */ -#line 6103 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6126 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 716: + case 719: -/* Line 678 of lalr1.cc */ -#line 6111 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6134 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTCaseOption( LOC((yyloc)), ft_case_mode::sensitive ); } break; - case 717: + case 720: -/* Line 678 of lalr1.cc */ -#line 6115 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6138 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTCaseOption( LOC((yyloc)), ft_case_mode::insensitive ); } break; - case 718: + case 721: -/* Line 678 of lalr1.cc */ -#line 6119 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6142 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTCaseOption( LOC((yyloc)), ft_case_mode::lower ); } break; - case 719: + case 722: -/* Line 678 of lalr1.cc */ -#line 6123 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6146 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTCaseOption( LOC((yyloc)), ft_case_mode::upper ); } break; - case 720: + case 723: -/* Line 678 of lalr1.cc */ -#line 6131 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6154 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTDiacriticsOption( LOC((yyloc)), ft_diacritics_mode::sensitive @@ -9869,10 +9932,10 @@ } break; - case 721: + case 724: -/* Line 678 of lalr1.cc */ -#line 6137 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6160 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTDiacriticsOption( LOC((yyloc)), ft_diacritics_mode::insensitive @@ -9880,10 +9943,10 @@ } break; - case 722: + case 725: -/* Line 678 of lalr1.cc */ -#line 6147 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6170 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTExtensionOption( LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (2)].expr)), SYMTAB((yysemantic_stack_[(3) - (3)].sval)) @@ -9891,28 +9954,28 @@ } break; - case 723: + case 726: -/* Line 678 of lalr1.cc */ -#line 6157 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6180 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStemOption( LOC((yyloc)), ft_stem_mode::stemming ); } break; - case 724: + case 727: -/* Line 678 of lalr1.cc */ -#line 6161 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6184 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStemOption( LOC((yyloc)), ft_stem_mode::no_stemming ); } break; - case 725: + case 728: -/* Line 678 of lalr1.cc */ -#line 6169 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6192 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FTThesaurusOption::thesaurus_id_list_t *til = NULL; if ( (yysemantic_stack_[(2) - (2)].node) ) { @@ -9924,10 +9987,10 @@ } break; - case 726: + case 729: -/* Line 678 of lalr1.cc */ -#line 6179 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6202 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FTThesaurusOption::thesaurus_id_list_t *til = (yysemantic_stack_[(5) - (4)].thesaurus_id_list); if ( (yysemantic_stack_[(5) - (3)].node) ) { @@ -9940,75 +10003,75 @@ } break; - case 727: + case 730: -/* Line 678 of lalr1.cc */ -#line 6190 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6213 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTThesaurusOption( LOC((yyloc)), NULL, false, true ); } break; - case 728: + case 731: -/* Line 678 of lalr1.cc */ -#line 6197 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6220 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 729: + case 732: -/* Line 678 of lalr1.cc */ -#line 6201 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6224 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; } break; - case 730: + case 733: -/* Line 678 of lalr1.cc */ -#line 6208 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6231 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.thesaurus_id_list) = NULL; } break; - case 731: + case 734: -/* Line 678 of lalr1.cc */ -#line 6212 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6235 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.thesaurus_id_list) = (yysemantic_stack_[(2) - (2)].thesaurus_id_list); } break; - case 732: + case 735: -/* Line 678 of lalr1.cc */ -#line 6219 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6242 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.thesaurus_id_list) = new FTThesaurusOption::thesaurus_id_list_t; (yyval.thesaurus_id_list)->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); } break; - case 733: + case 736: -/* Line 678 of lalr1.cc */ -#line 6224 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6247 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yysemantic_stack_[(3) - (1)].thesaurus_id_list)->push_back( dynamic_cast((yysemantic_stack_[(3) - (3)].node)) ); (yyval.thesaurus_id_list) = (yysemantic_stack_[(3) - (1)].thesaurus_id_list); } break; - case 734: + case 737: -/* Line 678 of lalr1.cc */ -#line 6233 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6256 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTThesaurusID( LOC((yyloc)), SYMTAB((yysemantic_stack_[(4) - (2)].sval)), SYMTAB((yysemantic_stack_[(4) - (3)].sval)), dynamic_cast((yysemantic_stack_[(4) - (4)].node)) @@ -10016,46 +10079,46 @@ } break; - case 735: + case 738: -/* Line 678 of lalr1.cc */ -#line 6242 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6265 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.sval) = 0; } break; - case 736: + case 739: -/* Line 678 of lalr1.cc */ -#line 6246 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6269 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.sval) = (yysemantic_stack_[(2) - (2)].sval); } break; - case 737: + case 740: -/* Line 678 of lalr1.cc */ -#line 6253 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6276 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = NULL; } break; - case 738: + case 741: -/* Line 678 of lalr1.cc */ -#line 6257 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6280 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(2) - (1)].node); } break; - case 739: + case 742: -/* Line 678 of lalr1.cc */ -#line 6265 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6288 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStopWordOption( LOC((yyloc)), @@ -10066,10 +10129,10 @@ } break; - case 740: + case 743: -/* Line 678 of lalr1.cc */ -#line 6274 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6297 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStopWordOption( LOC((yyloc)), NULL, (yysemantic_stack_[(4) - (4)].incl_excl_list), ft_stop_words_mode::with_default @@ -10078,10 +10141,10 @@ } break; - case 741: + case 744: -/* Line 678 of lalr1.cc */ -#line 6281 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6304 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStopWordOption( LOC((yyloc)), NULL, NULL, ft_stop_words_mode::without @@ -10089,28 +10152,28 @@ } break; - case 742: + case 745: -/* Line 678 of lalr1.cc */ -#line 6291 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6314 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStopWords( LOC((yyloc)), SYMTAB((yysemantic_stack_[(2) - (2)].sval)), NULL ); } break; - case 743: + case 746: -/* Line 678 of lalr1.cc */ -#line 6295 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6318 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStopWords( LOC((yyloc)), "", (yysemantic_stack_[(3) - (2)].strlist) ); } break; - case 744: + case 747: -/* Line 678 of lalr1.cc */ -#line 6302 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6325 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { string_list_t *sl = new string_list_t; sl->push_back( SYMTAB((yysemantic_stack_[(1) - (1)].sval)) ); @@ -10118,10 +10181,10 @@ } break; - case 745: + case 748: -/* Line 678 of lalr1.cc */ -#line 6308 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6331 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { if ( (yysemantic_stack_[(3) - (1)].strlist) ) (yysemantic_stack_[(3) - (1)].strlist)->push_back( SYMTAB((yysemantic_stack_[(3) - (3)].sval)) ); @@ -10129,38 +10192,38 @@ } break; - case 746: + case 749: -/* Line 678 of lalr1.cc */ -#line 6317 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6340 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.incl_excl_list) = NULL; } break; - case 747: + case 750: -/* Line 678 of lalr1.cc */ -#line 6321 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6344 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.incl_excl_list) = (yysemantic_stack_[(1) - (1)].incl_excl_list); } break; - case 748: + case 751: -/* Line 678 of lalr1.cc */ -#line 6328 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6351 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.incl_excl_list) = new FTStopWordOption::incl_excl_list_t; (yyval.incl_excl_list)->push_back( dynamic_cast((yysemantic_stack_[(1) - (1)].node)) ); } break; - case 749: + case 752: -/* Line 678 of lalr1.cc */ -#line 6333 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6356 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { FTStopWordOption::incl_excl_list_t *iel = (yysemantic_stack_[(2) - (1)].incl_excl_list); if ( !iel ) @@ -10170,10 +10233,10 @@ } break; - case 750: + case 753: -/* Line 678 of lalr1.cc */ -#line 6345 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6368 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStopWordsInclExcl( LOC((yyloc)), @@ -10183,10 +10246,10 @@ } break; - case 751: + case 754: -/* Line 678 of lalr1.cc */ -#line 6353 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6376 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTStopWordsInclExcl( LOC((yyloc)), @@ -10196,109 +10259,109 @@ } break; - case 752: + case 755: -/* Line 678 of lalr1.cc */ -#line 6365 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6388 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTLanguageOption( LOC((yyloc)), SYMTAB((yysemantic_stack_[(2) - (2)].sval)) ); } break; - case 753: + case 756: -/* Line 678 of lalr1.cc */ -#line 6373 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6396 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWildCardOption( LOC((yyloc)), ft_wild_card_mode::with ); } break; - case 754: + case 757: -/* Line 678 of lalr1.cc */ -#line 6377 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6400 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTWildCardOption( LOC((yyloc)), ft_wild_card_mode::without ); } break; - case 755: + case 758: -/* Line 678 of lalr1.cc */ -#line 6385 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6408 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTContent( LOC((yyloc)), ft_content_mode::at_start ); } break; - case 756: + case 759: -/* Line 678 of lalr1.cc */ -#line 6389 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6412 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTContent( LOC((yyloc)), ft_content_mode::at_end ); } break; - case 757: + case 760: -/* Line 678 of lalr1.cc */ -#line 6393 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6416 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTContent( LOC((yyloc)), ft_content_mode::entire ); } break; - case 758: + case 761: -/* Line 678 of lalr1.cc */ -#line 6401 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6424 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTTimes( LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (2)].node)) ); } break; - case 759: + case 762: -/* Line 678 of lalr1.cc */ -#line 6409 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6432 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTRange( LOC((yyloc)), ft_range_mode::exactly, (yysemantic_stack_[(2) - (2)].expr) ); } break; - case 760: + case 763: -/* Line 678 of lalr1.cc */ -#line 6413 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6436 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTRange( LOC((yyloc)), ft_range_mode::at_least, (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 761: + case 764: -/* Line 678 of lalr1.cc */ -#line 6417 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6440 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTRange( LOC((yyloc)), ft_range_mode::at_most, (yysemantic_stack_[(3) - (3)].expr) ); } break; - case 762: + case 765: -/* Line 678 of lalr1.cc */ -#line 6421 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6444 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTRange( LOC((yyloc)), ft_range_mode::from_to, (yysemantic_stack_[(4) - (2)].expr), (yysemantic_stack_[(4) - (4)].expr) ); } break; - case 763: + case 766: -/* Line 678 of lalr1.cc */ -#line 6429 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6452 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTScope( LOC((yyloc)), @@ -10308,10 +10371,10 @@ } break; - case 764: + case 767: -/* Line 678 of lalr1.cc */ -#line 6437 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6460 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTScope( LOC((yyloc)), @@ -10321,105 +10384,105 @@ } break; - case 765: + case 768: -/* Line 678 of lalr1.cc */ -#line 6449 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6472 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTBigUnit( LOC((yyloc)), ft_big_unit::sentence ); } break; - case 766: + case 769: -/* Line 678 of lalr1.cc */ -#line 6453 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6476 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTBigUnit( LOC((yyloc)), ft_big_unit::paragraph ); } break; - case 767: + case 770: -/* Line 678 of lalr1.cc */ -#line 6461 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6484 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new FTIgnoreOption( LOC((yyloc)), static_cast((yysemantic_stack_[(3) - (3)].expr)) ); } break; - case 768: + case 771: -/* Line 678 of lalr1.cc */ -#line 6475 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6498 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new JSONArrayConstructor( LOC((yyloc)), NULL ); } break; - case 769: + case 772: -/* Line 678 of lalr1.cc */ -#line 6479 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6502 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new JSONArrayConstructor( LOC((yyloc)), (yysemantic_stack_[(3) - (2)].expr) ); } break; - case 770: + case 773: -/* Line 678 of lalr1.cc */ -#line 6486 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6509 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { // TODO: fill in with the correct constructor (yyval.expr) = new JSONObjectConstructor(LOC((yyloc)), NULL, false); } break; - case 771: + case 774: -/* Line 678 of lalr1.cc */ -#line 6491 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6514 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { // TODO: fill in with the correct constructor (yyval.expr) = new JSONObjectConstructor(LOC((yyloc)), (yysemantic_stack_[(3) - (2)].expr), false); } break; - case 772: + case 775: -/* Line 678 of lalr1.cc */ -#line 6499 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6522 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { // TODO: fill in with the correct constructor (yyval.expr) = new JSONObjectConstructor(LOC((yyloc)), NULL, true); } break; - case 773: + case 776: -/* Line 678 of lalr1.cc */ -#line 6504 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6527 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { // TODO: fill in with the correct constructor (yyval.expr) = new JSONObjectConstructor(LOC((yyloc)), (yysemantic_stack_[(3) - (2)].expr), true); } break; - case 774: + case 777: -/* Line 678 of lalr1.cc */ -#line 6513 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6536 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new JSONDirectObjectConstructor(LOC((yyloc)), dynamic_cast((yysemantic_stack_[(3) - (2)].node))); } break; - case 775: + case 778: -/* Line 678 of lalr1.cc */ -#line 6521 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6544 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { JSONPairList* jpl = new JSONPairList(LOC((yyloc))); jpl->push_back(new JSONPairConstructor(LOC((yyloc)), (yysemantic_stack_[(3) - (1)].expr), (yysemantic_stack_[(3) - (3)].expr))); @@ -10427,10 +10490,10 @@ } break; - case 776: + case 779: -/* Line 678 of lalr1.cc */ -#line 6527 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6550 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { JSONPairList* jpl = dynamic_cast((yysemantic_stack_[(5) - (1)].node)); assert(jpl); @@ -10439,10 +10502,10 @@ } break; - case 777: + case 780: -/* Line 678 of lalr1.cc */ -#line 6537 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6560 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new JSONObjectInsertExpr(LOC((yyloc)), (yysemantic_stack_[(5) - (3)].expr), @@ -10450,10 +10513,10 @@ } break; - case 778: + case 781: -/* Line 678 of lalr1.cc */ -#line 6543 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6566 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { JSONPairList* jpl = dynamic_cast((yysemantic_stack_[(5) - (3)].node)); (yyval.expr) = new JSONObjectInsertExpr( @@ -10465,28 +10528,28 @@ } break; - case 779: + case 782: -/* Line 678 of lalr1.cc */ -#line 6553 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6576 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new JSONArrayInsertExpr(LOC((yyloc)), (yysemantic_stack_[(8) - (3)].expr), (yysemantic_stack_[(8) - (5)].expr), (yysemantic_stack_[(8) - (8)].expr)); } break; - case 780: + case 783: -/* Line 678 of lalr1.cc */ -#line 6560 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6583 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new JSONArrayAppendExpr(LOC((yyloc)), (yysemantic_stack_[(5) - (3)].expr), (yysemantic_stack_[(5) - (5)].expr)); } break; - case 781: + case 784: -/* Line 678 of lalr1.cc */ -#line 6567 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6590 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { rchandle lDynamicFunctionInvocation = dynamic_cast((yysemantic_stack_[(3) - (3)].expr)); @@ -10510,10 +10573,10 @@ } break; - case 782: + case 785: -/* Line 678 of lalr1.cc */ -#line 6592 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6615 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { rchandle lDynamicFunctionInvocation = dynamic_cast((yysemantic_stack_[(5) - (3)].expr)); @@ -10540,10 +10603,10 @@ } break; - case 783: + case 786: -/* Line 678 of lalr1.cc */ -#line 6620 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6643 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { rchandle lDynamicFunctionInvocation = dynamic_cast((yysemantic_stack_[(7) - (5)].expr)); @@ -10570,64 +10633,64 @@ } break; - case 784: + case 787: -/* Line 678 of lalr1.cc */ -#line 6648 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6671 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 785: + case 788: -/* Line 678 of lalr1.cc */ -#line 6652 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6675 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 786: + case 789: -/* Line 678 of lalr1.cc */ -#line 6656 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6679 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = (yysemantic_stack_[(1) - (1)].node); } break; - case 787: + case 790: -/* Line 678 of lalr1.cc */ -#line 6663 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6686 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new JSON_Test(LOC((yyloc)), store::StoreConsts::jsonItem); } break; - case 788: + case 791: -/* Line 678 of lalr1.cc */ -#line 6670 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6693 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new JSON_Test(LOC((yyloc)), store::StoreConsts::jsonObject); } break; - case 789: + case 792: -/* Line 678 of lalr1.cc */ -#line 6677 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6700 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.node) = new JSON_Test(LOC((yyloc)), store::StoreConsts::jsonArray); } break; - case 792: + case 795: -/* Line 678 of lalr1.cc */ -#line 6694 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6717 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { auto_ptr lQName( static_cast((yysemantic_stack_[(1) - (1)].expr)) ); zstring const &tmp = lQName->get_qname(); @@ -10639,1560 +10702,1571 @@ } break; - case 794: + case 797: -/* Line 678 of lalr1.cc */ -#line 6707 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6730 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("attribute"))); } break; - case 795: + case 798: -/* Line 678 of lalr1.cc */ -#line 6708 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6731 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("comment"))); } break; - case 796: + case 799: -/* Line 678 of lalr1.cc */ -#line 6709 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6732 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("document-node"))); } break; - case 797: + case 800: -/* Line 678 of lalr1.cc */ -#line 6710 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6733 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("element"))); } break; - case 798: + case 801: -/* Line 678 of lalr1.cc */ -#line 6711 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6734 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("item"))); } break; - case 799: + case 802: -/* Line 678 of lalr1.cc */ -#line 6712 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6735 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("if"))); } break; - case 800: + case 803: -/* Line 678 of lalr1.cc */ -#line 6713 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6736 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("node"))); } break; - case 801: + case 804: -/* Line 678 of lalr1.cc */ -#line 6714 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6737 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("processing-instruction"))); } break; - case 802: + case 805: -/* Line 678 of lalr1.cc */ -#line 6715 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6738 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("schema-attribute"))); } break; - case 803: + case 806: -/* Line 678 of lalr1.cc */ -#line 6716 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6739 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("schema-element"))); } break; - case 804: + case 807: -/* Line 678 of lalr1.cc */ -#line 6717 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6740 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("text"))); } break; - case 805: + case 808: -/* Line 678 of lalr1.cc */ -#line 6718 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6741 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("typeswitch"))); } break; - case 806: + case 809: -/* Line 678 of lalr1.cc */ -#line 6719 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6742 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("switch"))); } break; - case 807: + case 810: -/* Line 678 of lalr1.cc */ -#line 6720 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6743 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("empty-sequence"))); } break; - case 808: + case 811: -/* Line 678 of lalr1.cc */ -#line 6721 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6744 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("while"))); } break; - case 810: + case 813: -/* Line 678 of lalr1.cc */ -#line 6726 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6749 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval))); } break; - case 811: + case 814: -/* Line 678 of lalr1.cc */ -#line 6727 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6750 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("xquery"))); } break; - case 812: + case 815: -/* Line 678 of lalr1.cc */ -#line 6728 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6751 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("empty"))); } break; - case 813: + case 816: -/* Line 678 of lalr1.cc */ -#line 6729 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6752 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("boundary-space"))); } break; - case 814: + case 817: -/* Line 678 of lalr1.cc */ -#line 6730 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6753 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ft-option"))); } break; - case 815: + case 818: -/* Line 678 of lalr1.cc */ -#line 6731 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6754 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("base-uri"))); } break; - case 816: + case 819: -/* Line 678 of lalr1.cc */ -#line 6732 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6755 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("lax"))); } break; - case 817: + case 820: -/* Line 678 of lalr1.cc */ -#line 6733 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6756 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("strict"))); } break; - case 818: + case 821: -/* Line 678 of lalr1.cc */ -#line 6734 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6757 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("idiv"))); } break; - case 819: + case 822: -/* Line 678 of lalr1.cc */ -#line 6735 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6758 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("document"))); } break; - case 820: + case 823: -/* Line 678 of lalr1.cc */ -#line 6736 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6759 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ftnot"))); } break; - case 821: + case 824: -/* Line 678 of lalr1.cc */ -#line 6737 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6760 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("not"))); } break; - case 822: + case 825: -/* Line 678 of lalr1.cc */ -#line 6738 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6761 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("sensitive"))); } break; - case 823: + case 826: -/* Line 678 of lalr1.cc */ -#line 6739 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6762 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("insensitive"))); } break; - case 824: + case 827: -/* Line 678 of lalr1.cc */ -#line 6740 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6763 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("diacritics"))); } break; - case 825: + case 828: -/* Line 678 of lalr1.cc */ -#line 6741 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6764 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("without"))); } break; - case 826: + case 829: -/* Line 678 of lalr1.cc */ -#line 6742 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6765 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("stemming"))); } break; - case 827: + case 830: -/* Line 678 of lalr1.cc */ -#line 6743 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6766 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("thesaurus"))); } break; - case 828: + case 831: -/* Line 678 of lalr1.cc */ -#line 6744 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6767 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("stop"))); } break; - case 829: + case 832: -/* Line 678 of lalr1.cc */ -#line 6745 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6768 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("wildcards"))); } break; - case 830: + case 833: -/* Line 678 of lalr1.cc */ -#line 6746 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6769 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("entire"))); } break; - case 831: + case 834: -/* Line 678 of lalr1.cc */ -#line 6747 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6770 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("content"))); } break; - case 832: + case 835: -/* Line 678 of lalr1.cc */ -#line 6748 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6771 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("word"))); } break; - case 833: + case 836: -/* Line 678 of lalr1.cc */ -#line 6749 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6772 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("start"))); } break; - case 834: + case 837: -/* Line 678 of lalr1.cc */ -#line 6750 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6773 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("end"))); } break; - case 835: + case 838: -/* Line 678 of lalr1.cc */ -#line 6751 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6774 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("most"))); } break; - case 836: + case 839: -/* Line 678 of lalr1.cc */ -#line 6752 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6775 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("skip"))); } break; - case 837: + case 840: -/* Line 678 of lalr1.cc */ -#line 6753 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6776 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("copy"))); } break; - case 838: + case 841: -/* Line 678 of lalr1.cc */ -#line 6754 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6777 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("general"))); } break; - case 839: + case 842: -/* Line 678 of lalr1.cc */ -#line 6755 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6778 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("value"))); } break; - case 840: + case 843: -/* Line 678 of lalr1.cc */ -#line 6756 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6779 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("eq"))); } break; - case 841: + case 844: -/* Line 678 of lalr1.cc */ -#line 6757 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6780 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ne"))); } break; - case 842: + case 845: -/* Line 678 of lalr1.cc */ -#line 6758 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6781 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("lt"))); } break; - case 843: + case 846: -/* Line 678 of lalr1.cc */ -#line 6759 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6782 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("le"))); } break; - case 844: + case 847: -/* Line 678 of lalr1.cc */ -#line 6760 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6783 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("gt"))); } break; - case 845: + case 848: -/* Line 678 of lalr1.cc */ -#line 6761 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6784 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ge"))); } break; - case 846: + case 849: -/* Line 678 of lalr1.cc */ -#line 6762 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6785 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("at"))); } break; - case 847: + case 850: -/* Line 678 of lalr1.cc */ -#line 6763 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6786 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("context"))); } break; - case 848: + case 851: -/* Line 678 of lalr1.cc */ -#line 6764 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6787 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("variable"))); } break; - case 849: + case 852: -/* Line 678 of lalr1.cc */ -#line 6765 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6788 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("return"))); } break; - case 850: + case 853: -/* Line 678 of lalr1.cc */ -#line 6766 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6789 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("for"))); } break; - case 851: + case 854: -/* Line 678 of lalr1.cc */ -#line 6767 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6790 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("allowing"))); } break; - case 852: + case 855: -/* Line 678 of lalr1.cc */ -#line 6768 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6791 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("sliding"))); } break; - case 853: + case 856: -/* Line 678 of lalr1.cc */ -#line 6769 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6792 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("tumbling"))); } break; - case 854: + case 857: -/* Line 678 of lalr1.cc */ -#line 6770 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6793 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("previous"))); } break; - case 855: + case 858: -/* Line 678 of lalr1.cc */ -#line 6771 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6794 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("next"))); } break; - case 856: + case 859: -/* Line 678 of lalr1.cc */ -#line 6772 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6795 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("only"))); } break; - case 857: + case 860: -/* Line 678 of lalr1.cc */ -#line 6773 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6796 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("when"))); } break; - case 858: + case 861: -/* Line 678 of lalr1.cc */ -#line 6774 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6797 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("count"))); } break; - case 859: + case 862: -/* Line 678 of lalr1.cc */ -#line 6775 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6798 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("in"))); } break; - case 860: + case 863: -/* Line 678 of lalr1.cc */ -#line 6776 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6799 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("let"))); } break; - case 861: + case 864: -/* Line 678 of lalr1.cc */ -#line 6777 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6800 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("where"))); } break; - case 862: + case 865: -/* Line 678 of lalr1.cc */ -#line 6778 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6801 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("by"))); } break; - case 863: + case 866: -/* Line 678 of lalr1.cc */ -#line 6779 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6802 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("group"))); } break; - case 864: + case 867: -/* Line 678 of lalr1.cc */ -#line 6780 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6803 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("order"))); } break; - case 865: + case 868: -/* Line 678 of lalr1.cc */ -#line 6781 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6804 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("stable"))); } break; - case 866: + case 869: -/* Line 678 of lalr1.cc */ -#line 6782 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6805 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ascending"))); } break; - case 867: + case 870: -/* Line 678 of lalr1.cc */ -#line 6783 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6806 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("descending"))); } break; - case 868: + case 871: -/* Line 678 of lalr1.cc */ -#line 6784 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6807 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("greatest"))); } break; - case 869: + case 872: -/* Line 678 of lalr1.cc */ -#line 6785 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6808 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("least"))); } break; - case 870: + case 873: -/* Line 678 of lalr1.cc */ -#line 6786 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6809 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("collation"))); } break; - case 871: + case 874: -/* Line 678 of lalr1.cc */ -#line 6787 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6810 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("some"))); } break; - case 872: + case 875: -/* Line 678 of lalr1.cc */ -#line 6788 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6811 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("every"))); } break; - case 873: + case 876: -/* Line 678 of lalr1.cc */ -#line 6789 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6812 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("satisfies"))); } break; - case 874: + case 877: -/* Line 678 of lalr1.cc */ -#line 6790 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6813 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("case"))); } break; - case 875: + case 878: -/* Line 678 of lalr1.cc */ -#line 6791 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6814 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("as"))); } break; - case 876: + case 879: -/* Line 678 of lalr1.cc */ -#line 6792 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6815 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("then"))); } break; - case 877: + case 880: -/* Line 678 of lalr1.cc */ -#line 6793 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6816 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("else"))); } break; - case 878: + case 881: -/* Line 678 of lalr1.cc */ -#line 6794 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6817 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("or"))); } break; - case 879: + case 882: -/* Line 678 of lalr1.cc */ -#line 6795 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6818 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("and"))); } break; - case 880: + case 883: -/* Line 678 of lalr1.cc */ -#line 6796 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6819 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("instance"))); } break; - case 881: + case 884: -/* Line 678 of lalr1.cc */ -#line 6797 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6820 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("of"))); } break; - case 882: + case 885: -/* Line 678 of lalr1.cc */ -#line 6798 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6821 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("castable"))); } break; - case 883: + case 886: -/* Line 678 of lalr1.cc */ -#line 6799 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6822 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("to"))); } break; - case 884: + case 887: -/* Line 678 of lalr1.cc */ -#line 6800 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6823 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("div"))); } break; - case 885: + case 888: -/* Line 678 of lalr1.cc */ -#line 6801 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6824 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("mod"))); } break; - case 886: + case 889: -/* Line 678 of lalr1.cc */ -#line 6802 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6825 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("union"))); } break; - case 887: + case 890: -/* Line 678 of lalr1.cc */ -#line 6803 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6826 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("intersect"))); } break; - case 888: + case 891: -/* Line 678 of lalr1.cc */ -#line 6804 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6827 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("except"))); } break; - case 889: + case 892: -/* Line 678 of lalr1.cc */ -#line 6805 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6828 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("validate"))); } break; - case 890: + case 893: -/* Line 678 of lalr1.cc */ -#line 6806 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6829 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("type"))); } break; - case 891: + case 894: -/* Line 678 of lalr1.cc */ -#line 6807 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6830 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("cast"))); } break; - case 892: + case 895: -/* Line 678 of lalr1.cc */ -#line 6808 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6831 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("treat"))); } break; - case 893: + case 896: -/* Line 678 of lalr1.cc */ -#line 6809 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6832 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("is"))); } break; - case 894: + case 897: -/* Line 678 of lalr1.cc */ -#line 6810 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6833 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("preserve"))); } break; - case 895: + case 898: -/* Line 678 of lalr1.cc */ -#line 6811 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6834 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("strip"))); } break; - case 896: + case 899: -/* Line 678 of lalr1.cc */ -#line 6812 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6835 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("namespace"))); } break; - case 897: + case 900: -/* Line 678 of lalr1.cc */ -#line 6813 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6836 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("external"))); } break; - case 898: + case 901: -/* Line 678 of lalr1.cc */ -#line 6814 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6837 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("encoding"))); } break; - case 899: + case 902: -/* Line 678 of lalr1.cc */ -#line 6815 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6838 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("no-preserve"))); } break; - case 900: + case 903: -/* Line 678 of lalr1.cc */ -#line 6816 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6839 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("inherit"))); } break; - case 901: + case 904: -/* Line 678 of lalr1.cc */ -#line 6817 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6840 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("no-inherit"))); } break; - case 902: + case 905: -/* Line 678 of lalr1.cc */ -#line 6818 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6841 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("declare"))); } break; - case 903: + case 906: -/* Line 678 of lalr1.cc */ -#line 6819 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6842 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("construction"))); } break; - case 904: + case 907: -/* Line 678 of lalr1.cc */ -#line 6820 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6843 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ordering"))); } break; - case 905: + case 908: -/* Line 678 of lalr1.cc */ -#line 6821 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6844 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("default"))); } break; - case 906: + case 909: -/* Line 678 of lalr1.cc */ -#line 6822 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6845 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("copy-namespaces"))); } break; - case 907: + case 910: -/* Line 678 of lalr1.cc */ -#line 6823 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6846 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("option"))); } break; - case 908: + case 911: -/* Line 678 of lalr1.cc */ -#line 6824 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6847 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("version"))); } break; - case 909: + case 912: -/* Line 678 of lalr1.cc */ -#line 6825 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6848 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("import"))); } break; - case 910: + case 913: -/* Line 678 of lalr1.cc */ -#line 6826 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6849 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("schema"))); } break; - case 911: + case 914: -/* Line 678 of lalr1.cc */ -#line 6827 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6850 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("module"))); } break; - case 912: + case 915: -/* Line 678 of lalr1.cc */ -#line 6828 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6851 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("function"))); } break; - case 913: + case 916: -/* Line 678 of lalr1.cc */ -#line 6829 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6852 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("score"))); } break; - case 914: + case 917: -/* Line 678 of lalr1.cc */ -#line 6830 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6853 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("contains"))); } break; - case 915: + case 918: -/* Line 678 of lalr1.cc */ -#line 6831 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6854 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("weight"))); } break; - case 916: + case 919: -/* Line 678 of lalr1.cc */ -#line 6832 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6855 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("window"))); } break; - case 917: + case 920: -/* Line 678 of lalr1.cc */ -#line 6833 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6856 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("distance"))); } break; - case 918: + case 921: -/* Line 678 of lalr1.cc */ -#line 6834 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6857 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("occurs"))); } break; - case 919: + case 922: -/* Line 678 of lalr1.cc */ -#line 6835 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6858 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("times"))); } break; - case 920: + case 923: -/* Line 678 of lalr1.cc */ -#line 6836 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6859 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("same"))); } break; - case 921: + case 924: -/* Line 678 of lalr1.cc */ -#line 6837 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6860 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("different"))); } break; - case 922: + case 925: -/* Line 678 of lalr1.cc */ -#line 6838 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6861 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("lowercase"))); } break; - case 923: + case 926: -/* Line 678 of lalr1.cc */ -#line 6839 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6862 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("uppercase"))); } break; - case 924: + case 927: -/* Line 678 of lalr1.cc */ -#line 6840 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6863 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("relationship"))); } break; - case 925: + case 928: -/* Line 678 of lalr1.cc */ -#line 6841 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6864 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("levels"))); } break; - case 926: + case 929: -/* Line 678 of lalr1.cc */ -#line 6842 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6865 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("language"))); } break; - case 927: + case 930: -/* Line 678 of lalr1.cc */ -#line 6843 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6866 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("any"))); } break; - case 928: + case 931: -/* Line 678 of lalr1.cc */ -#line 6844 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6867 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("all"))); } break; - case 929: + case 932: -/* Line 678 of lalr1.cc */ -#line 6845 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6868 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("exactly"))); } break; - case 930: + case 933: -/* Line 678 of lalr1.cc */ -#line 6846 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6869 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("from"))); } break; - case 931: + case 934: -/* Line 678 of lalr1.cc */ -#line 6847 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6870 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("words"))); } break; - case 932: + case 935: -/* Line 678 of lalr1.cc */ -#line 6848 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6871 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("sentences"))); } break; - case 933: + case 936: -/* Line 678 of lalr1.cc */ -#line 6849 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6872 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("sentence"))); } break; - case 934: + case 937: -/* Line 678 of lalr1.cc */ -#line 6850 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6873 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("phrase"))); } break; - case 935: + case 938: -/* Line 678 of lalr1.cc */ -#line 6851 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6874 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("paragraph"))); } break; - case 936: + case 939: -/* Line 678 of lalr1.cc */ -#line 6852 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6875 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("paragraphs"))); } break; - case 937: + case 940: -/* Line 678 of lalr1.cc */ -#line 6853 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6876 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("replace"))); } break; - case 938: + case 941: -/* Line 678 of lalr1.cc */ -#line 6854 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6877 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("modify"))); } break; - case 939: + case 942: -/* Line 678 of lalr1.cc */ -#line 6855 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6878 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("first"))); } break; - case 940: + case 943: -/* Line 678 of lalr1.cc */ -#line 6856 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6879 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("insert"))); } break; - case 941: + case 944: -/* Line 678 of lalr1.cc */ -#line 6857 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6880 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("before"))); } break; - case 942: + case 945: -/* Line 678 of lalr1.cc */ -#line 6858 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6881 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("after"))); } break; - case 943: + case 946: -/* Line 678 of lalr1.cc */ -#line 6859 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6882 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("revalidation"))); } break; - case 944: + case 947: -/* Line 678 of lalr1.cc */ -#line 6860 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6883 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("with"))); } break; - case 945: + case 948: -/* Line 678 of lalr1.cc */ -#line 6861 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6884 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("nodes"))); } break; - case 946: + case 949: -/* Line 678 of lalr1.cc */ -#line 6862 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6885 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("rename"))); } break; - case 947: + case 950: -/* Line 678 of lalr1.cc */ -#line 6863 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6886 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("last"))); } break; - case 948: + case 951: -/* Line 678 of lalr1.cc */ -#line 6864 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6887 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("delete"))); } break; - case 949: + case 952: -/* Line 678 of lalr1.cc */ -#line 6865 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6888 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("into"))); } break; - case 950: + case 953: -/* Line 678 of lalr1.cc */ -#line 6866 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6889 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("simple"))); } break; - case 951: + case 954: -/* Line 678 of lalr1.cc */ -#line 6867 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6890 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("sequential"))); } break; - case 952: + case 955: -/* Line 678 of lalr1.cc */ -#line 6868 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6891 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("updating"))); } break; - case 953: + case 956: -/* Line 678 of lalr1.cc */ -#line 6869 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6892 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ordered"))); } break; - case 954: + case 957: -/* Line 678 of lalr1.cc */ -#line 6870 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6893 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("unordered"))); } break; - case 955: + case 958: -/* Line 678 of lalr1.cc */ -#line 6871 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6894 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("returning"))); } break; - case 956: + case 959: -/* Line 678 of lalr1.cc */ -#line 6872 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6895 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("exit"))); } break; - case 957: + case 960: -/* Line 678 of lalr1.cc */ -#line 6873 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6896 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("loop"))); } break; - case 958: + case 961: -/* Line 678 of lalr1.cc */ -#line 6874 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6897 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("break"))); } break; - case 959: + case 962: -/* Line 678 of lalr1.cc */ -#line 6875 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6898 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("continue"))); } break; - case 960: + case 963: -/* Line 678 of lalr1.cc */ -#line 6876 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6899 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("try"))); } break; - case 961: + case 964: -/* Line 678 of lalr1.cc */ -#line 6877 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6900 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("catch"))); } break; - case 962: + case 965: -/* Line 678 of lalr1.cc */ -#line 6878 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6901 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("using"))); } break; - case 963: + case 966: -/* Line 678 of lalr1.cc */ -#line 6879 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6902 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("set"))); } break; - case 964: + case 967: -/* Line 678 of lalr1.cc */ -#line 6880 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6903 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("index"))); } break; - case 965: + case 968: -/* Line 678 of lalr1.cc */ -#line 6881 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6904 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("unique"))); } break; - case 966: + case 969: -/* Line 678 of lalr1.cc */ -#line 6882 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6905 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("non"))); } break; - case 967: + case 970: -/* Line 678 of lalr1.cc */ -#line 6883 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6906 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("on"))); } break; - case 968: + case 971: -/* Line 678 of lalr1.cc */ -#line 6884 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6907 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("range"))); } break; - case 969: + case 972: -/* Line 678 of lalr1.cc */ -#line 6885 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6908 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("equality"))); } break; - case 970: + case 973: -/* Line 678 of lalr1.cc */ -#line 6886 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6909 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("manually"))); } break; - case 971: + case 974: -/* Line 678 of lalr1.cc */ -#line 6887 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6910 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("automatically"))); } break; - case 972: + case 975: -/* Line 678 of lalr1.cc */ -#line 6888 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6911 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("maintained"))); } break; - case 973: + case 976: -/* Line 678 of lalr1.cc */ -#line 6889 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6912 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("decimal-format"))); } break; - case 974: + case 977: -/* Line 678 of lalr1.cc */ -#line 6890 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6913 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("decimal-separator"))); } break; - case 975: + case 978: -/* Line 678 of lalr1.cc */ -#line 6891 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6914 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("grouping-separator"))); } break; - case 976: + case 979: -/* Line 678 of lalr1.cc */ -#line 6892 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6915 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("infinity"))); } break; - case 977: + case 980: -/* Line 678 of lalr1.cc */ -#line 6893 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6916 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("minus-sign"))); } break; - case 978: + case 981: -/* Line 678 of lalr1.cc */ -#line 6894 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6917 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("NaN"))); } break; - case 979: + case 982: -/* Line 678 of lalr1.cc */ -#line 6895 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6918 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("percent"))); } break; - case 980: + case 983: -/* Line 678 of lalr1.cc */ -#line 6896 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6919 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("per-mille"))); } break; - case 981: + case 984: -/* Line 678 of lalr1.cc */ -#line 6897 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6920 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("zero-digit"))); } break; - case 982: + case 985: -/* Line 678 of lalr1.cc */ -#line 6898 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6921 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("digit"))); } break; - case 983: + case 986: -/* Line 678 of lalr1.cc */ -#line 6899 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6922 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("pattern-separator"))); } break; - case 984: + case 987: -/* Line 678 of lalr1.cc */ -#line 6900 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6923 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("collection"))); } break; - case 985: + case 988: -/* Line 678 of lalr1.cc */ -#line 6901 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6924 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("const"))); } break; - case 986: + case 989: -/* Line 678 of lalr1.cc */ -#line 6902 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("append-only"))); } break; - case 987: + case 990: -/* Line 678 of lalr1.cc */ -#line 6903 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6926 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("queue"))); } break; - case 988: + case 991: -/* Line 678 of lalr1.cc */ -#line 6904 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6927 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("mutable"))); } break; - case 989: + case 992: -/* Line 678 of lalr1.cc */ -#line 6905 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("read-only"))); } break; - case 990: + case 993: -/* Line 678 of lalr1.cc */ -#line 6906 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6929 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("integrity"))); } break; - case 991: + case 994: -/* Line 678 of lalr1.cc */ -#line 6907 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6930 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("constraint"))); } break; - case 992: + case 995: -/* Line 678 of lalr1.cc */ -#line 6908 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6931 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("check"))); } break; - case 993: + case 996: -/* Line 678 of lalr1.cc */ -#line 6909 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6932 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("key"))); } break; - case 994: + case 997: -/* Line 678 of lalr1.cc */ -#line 6910 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6933 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("foreach"))); } break; - case 995: + case 998: -/* Line 678 of lalr1.cc */ -#line 6911 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6934 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("foreign"))); } break; - case 996: + case 999: -/* Line 678 of lalr1.cc */ -#line 6912 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6935 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("keys"))); } break; - case 997: + case 1000: -/* Line 678 of lalr1.cc */ -#line 6913 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6936 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ancestor"))); } break; - case 998: + case 1001: -/* Line 678 of lalr1.cc */ -#line 6914 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6937 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("child"))); } break; - case 999: + case 1002: -/* Line 678 of lalr1.cc */ -#line 6915 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6938 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("descendant"))); } break; - case 1000: + case 1003: -/* Line 678 of lalr1.cc */ -#line 6916 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6939 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("parent"))); } break; - case 1001: + case 1004: -/* Line 678 of lalr1.cc */ -#line 6917 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6940 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("preceding"))); } break; - case 1002: + case 1005: -/* Line 678 of lalr1.cc */ -#line 6918 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6941 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("self"))); } break; - case 1003: + case 1006: -/* Line 678 of lalr1.cc */ -#line 6919 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6942 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("following"))); } break; - case 1004: + case 1007: -/* Line 678 of lalr1.cc */ -#line 6920 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6943 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("ancestor-or-self"))); } break; - case 1005: + case 1008: -/* Line 678 of lalr1.cc */ -#line 6921 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6944 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("descendant-or-self"))); } break; - case 1006: + case 1009: -/* Line 678 of lalr1.cc */ -#line 6922 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6945 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("following-sibling"))); } break; - case 1007: + case 1010: -/* Line 678 of lalr1.cc */ -#line 6923 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6946 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("preceding-sibling"))); } break; - case 1008: + case 1011: -/* Line 678 of lalr1.cc */ -#line 6924 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6947 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("json"))); } break; - case 1009: + case 1012: -/* Line 678 of lalr1.cc */ -#line 6925 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6948 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("append"))); } break; - case 1010: + case 1013: -/* Line 678 of lalr1.cc */ -#line 6926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6949 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("position"))); } break; - case 1011: + case 1014: -/* Line 678 of lalr1.cc */ -#line 6927 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6950 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("json-item"))); } break; - case 1012: + case 1015: -/* Line 678 of lalr1.cc */ -#line 6928 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6951 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("array"))); } break; - case 1013: + case 1016: -/* Line 678 of lalr1.cc */ -#line 6929 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6952 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("object"))); } break; - case 1014: + case 1017: -/* Line 678 of lalr1.cc */ -#line 6930 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6953 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB(SYMTAB_PUT("structured-item"))); } break; - case 1015: + case 1018: -/* Line 678 of lalr1.cc */ -#line 6935 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 690 of lalr1.cc */ +#line 6958 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" { (yyval.expr) = new QName(LOC((yyloc)), SYMTAB((yysemantic_stack_[(1) - (1)].sval)), true); } break; -/* Line 678 of lalr1.cc */ -#line 12193 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +/* Line 690 of lalr1.cc */ +#line 12256 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action + invokes YYABORT, YYACCEPT, or YYERROR immediately after altering + yychar. In the case of YYABORT or YYACCEPT, an incorrect + destructor might then be invoked immediately. In the case of + YYERROR, subsequent parser actions might lead to an incorrect + destructor call or verbose syntax error message before the + lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); yypop_ (yylen); @@ -12216,14 +12290,20 @@ | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yytranslate_ (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus_) { ++yynerrs_; + if (yychar == yyempty_) + yytoken = yyempty_; error (yylloc, yysyntax_error_ (yystate, yytoken)); } - yyerror_range[0] = yylloc; + yyerror_range[1] = yylloc; if (yyerrstatus_ == 3) { /* If just tried and failed to reuse lookahead token after an @@ -12258,7 +12338,7 @@ if (false) goto yyerrorlab; - yyerror_range[0] = yylocation_stack_[yylen - 1]; + yyerror_range[1] = yylocation_stack_[yylen - 1]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ yypop_ (yylen); @@ -12275,7 +12355,7 @@ for (;;) { yyn = yypact_[yystate]; - if (yyn != yypact_ninf_) + if (!yy_pact_value_is_default_ (yyn)) { yyn += yyterror_; if (0 <= yyn && yyn <= yylast_ && yycheck_[yyn] == yyterror_) @@ -12290,7 +12370,7 @@ if (yystate_stack_.height () == 1) YYABORT; - yyerror_range[0] = yylocation_stack_[0]; + yyerror_range[1] = yylocation_stack_[0]; yydestruct_ ("Error: popping", yystos_[yystate], &yysemantic_stack_[0], &yylocation_stack_[0]); @@ -12299,10 +12379,10 @@ YY_STACK_PRINT (); } - yyerror_range[1] = yylloc; + yyerror_range[2] = yylloc; // Using YYLLOC is tempting, but would change the location of // the lookahead. YYLOC is available though. - YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); + YYLLOC_DEFAULT (yyloc, yyerror_range, 2); yysemantic_stack_.push (yylval); yylocation_stack_.push (yyloc); @@ -12325,7 +12405,13 @@ yyreturn: if (yychar != yyempty_) - yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc); + { + /* Make sure we have latest lookahead translation. See comments + at user semantic actions for why this is necessary. */ + yytoken = yytranslate_ (yychar); + yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, + &yylloc); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ @@ -12344,914 +12430,908 @@ // Generate an error message. std::string - xquery_parser::yysyntax_error_ (int yystate, int tok) + xquery_parser::yysyntax_error_ (int yystate, int yytoken) { - std::string res; - YYUSE (yystate); -#if YYERROR_VERBOSE - int yyn = yypact_[yystate]; - if (yypact_ninf_ < yyn && yyn <= yylast_) + std::string yyres; + // Number of reported tokens (one for the "unexpected", one per + // "expected"). + size_t yycount = 0; + // Its maximum. + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + // Arguments of yyformat. + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yytoken) is + if this state is a consistent state with a default action. + Thus, detecting the absence of a lookahead is sufficient to + determine that there is no unexpected or expected token to + report. In that case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is + a consistent state with a default action. There might have + been a previous inconsistent state, consistent state with a + non-default action, or user semantic action that manipulated + yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state + merging (from LALR or IELR) and default reductions corrupt the + expected token list. However, the list is correct for + canonical LR with one exception: it will still contain any + token that will not be accepted due to an error action in a + later state. + */ + if (yytoken != yyempty_) { - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = yylast_ - yyn + 1; - int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; - int count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_) - ++count; - - // FIXME: This method of building the message is not compatible - // with internationalization. It should work like yacc.c does it. - // That is, first build a string that looks like this: - // "syntax error, unexpected %s or %s or %s" - // Then, invoke YY_ on this string. - // Finally, use the string as a format to output - // yytname_[tok], etc. - // Until this gets fixed, this message appears in English only. - res = "syntax error, unexpected "; - res += yytnamerr_ (yytname_[tok]); - if (count < 5) - { - count = 0; - for (int x = yyxbegin; x < yyxend; ++x) - if (yycheck_[x + yyn] == x && x != yyterror_) - { - res += (!count++) ? ", expecting " : " or "; - res += yytnamerr_ (yytname_[x]); - } - } + yyarg[yycount++] = yytname_[yytoken]; + int yyn = yypact_[yystate]; + if (!yy_pact_value_is_default_ (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = yylast_ - yyn + 1; + int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_; + for (int yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_ + && !yy_table_value_is_error_ (yytable_[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + break; + } + else + yyarg[yycount++] = yytname_[yyx]; + } + } } - else -#endif - res = YY_("syntax error"); - return res; + + char const* yyformat = 0; + switch (yycount) + { +#define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +#undef YYCASE_ + } + + // Argument number. + size_t yyi = 0; + for (char const* yyp = yyformat; *yyp; ++yyp) + if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount) + { + yyres += yytnamerr_ (yyarg[yyi++]); + ++yyp; + } + else + yyres += *yyp; + return yyres; } /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ - const short int xquery_parser::yypact_ninf_ = -1529; + const short int xquery_parser::yypact_ninf_ = -1503; const short int xquery_parser::yypact_[] = { - 3888, -1529, -1529, -1529, 5752, 5752, 5752, -1529, -1529, 273, - 305, -1529, 911, 395, -1529, -1529, -1529, 758, -1529, -1529, - -1529, 29, 484, 797, 3607, 521, 570, 802, -1529, -3, - -1529, -1529, -1529, -1529, -1529, -1529, 813, -1529, 600, 649, - -1529, -1529, -1529, -1529, 694, -1529, 821, -1529, 676, 738, - -1529, 269, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, 720, 793, -1529, -1529, - -1529, -1529, 745, 11642, -1529, -1529, -1529, 814, -1529, -1529, - -1529, 803, -1529, 818, 824, -1529, -1529, 16029, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, 837, -1529, -1529, 848, - 856, -1529, -1529, -1529, -1529, -1529, -1529, -1529, 4512, 7612, - 7922, 16029, -1529, -1529, -1529, -1529, -1529, -1529, -1529, 829, - -1529, -1529, 864, 12537, -1529, 12840, 867, 883, -1529, -1529, - -1529, 885, -1529, 11022, -1529, -1529, -1529, -1529, -1529, -1529, - 857, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, 137, - 798, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -82, - 879, -78, -1529, -96, -74, -1529, -1529, -1529, -1529, -1529, - -1529, 919, -1529, 800, 801, 807, -1529, -1529, 882, 887, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, 8232, 8542, -1529, 725, -1529, -1529, -1529, - -1529, -1529, 4200, 6062, 1050, -1529, 6372, -1529, -1529, 151, - 83, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, 110, -1529, -1529, -1529, -1529, - -1529, -1529, 415, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, 5752, -1529, -1529, -1529, -1529, 12, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, 243, -1529, 862, -1529, -1529, - -1529, 607, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - 888, 961, -1529, 840, 808, 959, 572, 497, 677, 515, - -1529, 1010, 861, 963, 960, 9782, -1529, 872, -1529, -1529, - 16, -1529, -1529, 11332, -1529, 244, -1529, 913, 11642, -1529, - 913, 11642, -1529, -1529, -1529, 847, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, 923, 914, -1529, - -1529, -1529, -1529, -1529, 890, -1529, 5752, 891, 892, 560, - 560, 1040, 619, 663, 455, 16317, 16029, 493, 1025, 16029, - 925, 962, 427, 12537, 741, 832, 16029, 16029, 775, 376, - 47, -1529, -1529, -1529, 12537, 5752, 894, 5752, 192, 10092, - 13725, 16029, -1529, 806, 809, 16029, 964, 417, 930, 10092, - 1083, 88, 103, 16029, 967, 944, 980, -1529, 10092, 12240, - 16029, 16029, 16029, 5752, 902, 10092, 10092, 16029, 5752, 938, - 939, -1529, -1529, -1529, 10092, 14013, 940, -1529, 942, -1529, - -1529, -1529, -1529, 947, -1529, 948, -1529, -1529, -1529, -1529, - -1529, 950, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - 16029, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, 952, 16029, -1529, -1529, -1529, 916, 4822, - 987, 299, 953, 954, 955, 16029, 5752, -1529, 965, 159, - -1529, 693, -1529, 132, 1066, 10092, -1529, -1529, 172, -1529, - -1529, -1529, 1098, -1529, -1529, -1529, -1529, 10092, 903, -1529, - 1087, 10092, 10092, 13140, 932, 10092, 10092, 10092, 10092, 13140, - 10092, 893, 900, 16029, 943, 949, 10092, 10092, 4512, 889, - -1529, 50, -1529, 39, 10092, 6062, -1529, -1529, -1529, -1529, - -1529, 911, 802, 112, 119, 1129, 6682, 6682, 6992, 6992, - 803, -1529, -1529, 336, 803, -1529, 3286, 10092, 10092, -1529, - 1017, 686, -3, 969, 971, 972, 5752, 10092, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, 10402, 10402, 10402, -1529, - 10402, 10402, -1529, 10402, -1529, 10402, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, 10402, 10402, 1073, 10402, 10402, 10402, 10402, - 10402, 10402, 10402, 10402, 10402, 10402, 10402, 10402, 915, 1051, - 1053, 1054, -1529, -1529, -1529, 10712, 8852, -1529, -1529, 11022, - 11022, 10092, 913, -1529, -1529, 913, -1529, 9162, 913, 995, - 9472, -1529, -1529, -1529, 19, -1529, 293, -1529, -1529, -1529, - -1529, -1529, -1529, 1042, 1043, 521, 1122, -1529, -1529, 16317, - 945, 726, 16029, 992, 997, 945, 1040, 1031, 1027, -1529, - -1529, -1529, 131, 917, 1067, 863, 16029, 1018, 10092, 1047, - 16029, 16029, -1529, 1034, 983, 5752, -1529, 984, 942, 649, - -1529, 982, 986, 282, -1529, 327, 341, 1063, -1529, 43, - -1529, -1529, 1063, 16029, 28, 16029, 1077, 350, -1529, 5752, - -1529, 161, -1529, 12537, 1078, 1130, 12537, 1040, 1080, 450, - 16029, 10092, -3, 361, 990, -1529, 991, 993, 994, 58, - -1529, 76, 998, -1529, 216, 232, 1026, -1529, 999, 5752, - 5752, 391, -1529, 386, 392, 580, 10092, 306, -1529, -1529, - 10092, 10092, -1529, 10092, 10092, 10092, -1529, 10092, -1529, 10092, - -1529, 16029, 1066, -1529, 285, 398, -1529, -1529, -1529, 410, - -1529, 286, -1529, -1529, 1032, 1033, 1035, 1036, 1037, 847, - 923, -1529, 297, 358, 256, 18, 1090, 540, 956, 970, - 966, 7, -1529, 1045, -1529, -1529, 1002, 234, 5132, 431, - 11943, 889, -1529, -1529, -1529, 968, -1529, 151, 659, 1161, - 1161, -1529, -1529, 130, -1529, -1529, 134, -1529, 62, -1529, - -1529, -1529, -1529, -1529, -1529, 1195, -1529, -1529, 16029, 1029, - 10092, 1082, -1529, -1529, -1529, 961, -1529, -1529, -1529, -1529, - -1529, 10402, -1529, -1529, -1529, 73, -1529, 497, 497, 38, - 677, 677, 677, 677, 515, 515, -1529, -1529, 15165, 15165, - 16029, 16029, -1529, -1529, 461, -1529, -1529, 188, -1529, -1529, - -1529, 397, -1529, -1529, 465, 560, -1529, -1529, 23, 323, - 701, -1529, 521, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, 945, -1529, 1070, 15453, 1061, 10092, -1529, - -1529, -1529, 1110, 1040, 1040, 945, -1529, 419, 1040, 682, - 16029, 532, 650, 1178, -1529, -1529, 922, 586, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, 131, - 37, 985, 627, 10092, -1529, 16029, 1115, 912, 1040, -1529, - -1529, -1529, -1529, 1057, 16029, -1529, 16029, -1529, 15741, 1086, - 15165, 1097, 10092, 125, 1069, 65, 78, 973, -1529, -1529, - 601, 28, 1110, 15165, 1099, 1124, 1038, 1021, 1088, 1040, - 1064, 1089, 1127, 1040, 10092, 24, -1529, -1529, -1529, 1072, - -1529, -1529, -1529, -1529, 1108, 10092, 10092, 1084, -1529, 1132, - 1134, 5752, -1529, 1056, 1058, 1076, 16029, -1529, 16029, -1529, - 10092, 1095, 1048, 10092, -1529, 1123, 246, 257, 264, 1211, - -1529, 288, -1529, 210, -1529, -1529, 1218, -1529, 762, 10092, - 10092, 10092, 772, 10092, 10092, 10092, 10092, 10092, 10092, 10092, - 10092, 10092, 13140, 1131, 10092, 10092, -1529, 7302, 1092, 1096, - 1100, 1104, 862, 717, 1006, -1529, -1, -1529, 10092, 139, - 167, 62, 6992, 6992, 6992, 1180, -1529, -1529, 10092, 791, - 1153, -1529, 16029, 1154, -1529, -1529, 10092, 73, 674, 456, - -1529, 977, 26, 1005, 1007, -1529, -1529, 832, -1529, 1001, - 634, 1109, 1113, 15453, 1114, 1117, 1118, 1120, 1121, -1529, - 594, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, 1135, -1529, -1529, -1529, 10092, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, 716, -1529, - 1237, 805, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, 996, -1529, -1529, 1242, -1529, -1529, -1529, -1529, -1529, - 638, 1249, -1529, 567, -1529, -1529, -1529, 940, 484, 947, - 600, 948, 950, 879, 1117, 1118, 1120, -1529, 594, 594, - 10712, 1000, 975, -1529, 1110, 37, 1059, 1102, 5752, 1101, - 1103, 1141, 1111, 1116, 16029, -1529, 80, -1529, 16029, -1529, - 10092, 1142, 10092, 1168, 10092, 223, 1149, 10092, 1157, -1529, - 1182, 1183, 10092, 16029, 886, 1228, -1529, -1529, -1529, -1529, - -1529, -1529, 15165, -1529, 5752, 1040, 1199, -1529, -1529, -1529, - 1040, 1199, -1529, 10092, 1165, 5752, 16029, -1529, -1529, 10092, - 10092, 81, -1529, 44, 628, -1529, 14301, 780, -1529, 796, - -1529, 1125, -1529, -1529, 5752, 1126, 1128, -1529, 10092, -1529, - -1529, 10092, 1112, 1132, 1208, -1529, 1179, -1529, 428, -1529, - -1529, 1305, -1529, -1529, 5752, 16029, -1529, 590, -1529, -1529, - -1529, 1133, 1085, 1091, -1529, -1529, -1529, 1093, 1105, -1529, - -1529, -1529, 1221, -1529, -1529, -1529, -1529, 1106, 302, 16029, - 1139, -1529, -1529, 10092, 10092, 10092, 5442, 7302, 11943, 1006, - -1529, 11943, -1529, -1529, 1161, 474, -1529, -1529, -1529, 1153, - -1529, 1040, -1529, 804, -1529, 71, 1213, -1529, 10092, 608, - 1082, 462, 1143, -1529, 73, 1071, -1529, -1529, -62, -1529, - -89, 193, 1079, 73, -89, 10402, -1529, 270, -1529, -1529, - -1529, -1529, -1529, -1529, 73, 1173, 1046, 917, 193, -1529, - -1529, 1049, 1254, -1529, -1529, -1529, 13437, 1146, 1147, 1150, - 1152, 1155, 1158, 1162, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, 1311, 2, 1312, 2, - 1081, 1241, -1529, -1529, 1174, 16029, 1094, -1529, -1529, 10712, - -1529, 1169, -1529, -1529, -1529, -1529, -1529, -1529, 10092, 1209, - -1529, -1529, 10092, -1529, 534, -1529, 10092, 1212, 10092, -1529, - 10092, 16029, 16029, -1529, 696, -1529, 10092, -1529, 1232, 1234, - 1265, 1040, 1199, -1529, 10092, 1181, -1529, -1529, -1529, 1185, - -1529, 48, 10092, 5752, 1186, 274, -1529, 16029, 1189, 14589, - 425, -1529, 14877, 1191, -1529, -1529, 1196, -1529, -1529, -1529, - -1529, 10092, 799, 1211, 16029, 657, -1529, 1197, 1211, 16029, - -1529, -1529, 10092, 10092, 10092, 10092, 1068, 10092, 10092, -1529, - 10092, 283, 324, 339, 230, -1529, -1529, -1529, -1529, -1529, - 1213, -1529, -1529, -1529, 1040, 10092, -1529, 1222, -1529, -1529, - -1529, -1529, 1198, 10402, -1529, -1529, -1529, -1529, -1529, 373, - 10402, 10402, 564, -1529, 1005, -1529, -48, -1529, 1007, 73, - 1214, -1529, -1529, 1107, -1529, -1529, -1529, -1529, 1275, 1192, - -1529, 496, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - 494, 494, -1529, 2, -1529, -1529, 501, -1529, 1356, 193, - 1290, 1201, 10712, -14, 1119, 1219, -1529, -1529, 10092, -1529, - 10092, 1243, -1529, 10092, -1529, -1529, -1529, 1338, -1529, -1529, - 7302, 10092, 1040, -1529, -1529, -1529, 10092, 10092, -1529, -1529, - -1529, 7302, 7302, 1298, 5752, 16029, 1207, 16029, 10092, 16029, - 1210, 7302, -1529, 489, 30, 1211, 16029, -1529, 1200, 1211, - -1529, -1529, -1529, -1529, 10092, -1529, -1529, -1529, 1202, 1132, - 1134, 10092, -1529, -1529, -1529, 1288, 10092, -1529, 677, 10402, - 10402, 38, 658, -1529, -1529, -1529, -1529, -1529, -1529, 10092, - -1529, 15165, -1529, 15165, 1301, -1529, -1529, -1529, 1369, -1529, - -1529, -1529, 1136, 1292, -1529, -1529, 1295, -1529, 652, 16029, - 1285, 1184, 16029, 10712, -1529, -1529, 10092, -1529, 1286, -1529, - -1529, 1199, -1529, -1529, 15165, -1529, -1529, 1313, 10092, 1224, - -1529, 1314, 7302, -1529, 16029, 664, 712, -1529, 1215, 1211, - -1529, 1216, -1529, 7302, 810, 463, -1529, 1288, 38, 38, - 10402, 464, -1529, -1529, 15165, -1529, -1529, 1290, 10712, -1529, - 1213, 1137, 16029, 1287, 1190, 1295, -1529, 16029, 1225, 15165, - 5752, 15165, 1230, -1529, -1529, 1321, 767, -1529, -1529, -1529, - -1529, 1235, 820, -1529, -1529, -1529, 1220, -1529, 1302, -1529, - -1529, 38, -1529, -1529, -1529, -1529, -1529, 10092, 1138, 16029, - 1303, -1529, 5752, 1233, -1529, -1529, 1236, 10092, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, 16029, -1529, 1140, 1144, 16029, - -1529, -1529, 10092, 7302, 1238, 1148, 10092, 1151, 7302, 10712, - -1529, 10712, -1529, 1226, 1145, 16029, 1203, 1308, 16029, 1156, - 10712, -1529 + 4911, -1503, -1503, -1503, 6465, 6465, 6465, -1503, -1503, 183, + 229, -1503, 799, 279, -1503, -1503, -1503, 815, -1503, -1503, + -1503, 469, 523, 816, 4630, 604, 619, 666, -1503, -18, + -1503, -1503, -1503, -1503, -1503, -1503, 820, -1503, 655, 678, + -1503, -1503, -1503, -1503, 531, -1503, 824, -1503, 708, 712, + -1503, 298, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, 722, 771, -1503, -1503, + -1503, -1503, 616, 12355, -1503, -1503, -1503, 777, -1503, -1503, + -1503, 810, -1503, 818, 870, -1503, -1503, 16742, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, 877, -1503, -1503, 878, + 881, -1503, -1503, -1503, -1503, -1503, -1503, -1503, 5535, 8325, + 8635, 16742, -1503, -1503, -1503, -1503, -1503, -1503, -1503, 863, + -1503, -1503, 895, 13250, -1503, 13553, 896, 898, -1503, -1503, + -1503, 899, -1503, 11735, -1503, -1503, -1503, -1503, -1503, -1503, + 869, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, 68, + 808, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -33, + 871, 219, -1503, -67, 156, -1503, -1503, -1503, -1503, -1503, + -1503, 907, -1503, 785, 788, 789, -1503, -1503, 874, 879, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, 8945, 9255, -1503, 719, -1503, -1503, -1503, + -1503, -1503, 5223, 6775, 1034, -1503, 7085, -1503, -1503, 830, + 94, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, 102, -1503, -1503, -1503, -1503, + -1503, -1503, 83, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, 6465, -1503, -1503, -1503, -1503, -2, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, 179, -1503, 846, -1503, -1503, + -1503, 591, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + 868, 957, -1503, 986, 801, 953, 675, 731, 631, 422, + -1503, 1003, 854, 954, 955, 10495, -1503, 865, -1503, -1503, + 362, -1503, -1503, 12045, -1503, 593, -1503, 909, 12355, -1503, + 909, 12355, -1503, -1503, -1503, 845, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, 916, 908, -1503, + -1503, -1503, -1503, -1503, 882, -1503, 6465, 883, 884, 594, + 594, 1041, 475, 647, -23, 17030, 16742, 333, 1024, 16742, + 921, 956, 694, 13250, 768, 829, 16742, 16742, 772, 724, + 54, -1503, -1503, -1503, 13250, 6465, 890, 6465, 101, 10805, + 14438, 16742, -1503, 794, 795, 16742, 963, 31, 929, 10805, + 1082, 60, 47, 16742, 966, 943, 980, -1503, 10805, 12953, + 16742, 16742, 16742, 6465, 901, 10805, 10805, 16742, 6465, 936, + 937, -1503, -1503, -1503, 10805, 14726, 939, -1503, 940, -1503, + -1503, -1503, -1503, 942, -1503, 944, -1503, -1503, -1503, -1503, + -1503, 945, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + 16742, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, 950, 16742, -1503, -1503, -1503, 915, 5845, + 972, 464, 948, 964, 969, 16742, 6465, -1503, 959, 132, + -1503, 776, -1503, 84, 1071, 10805, -1503, -1503, 66, -1503, + -1503, -1503, 1093, -1503, -1503, -1503, -1503, 10805, 897, -1503, + 1084, 10805, 10805, 13853, 927, 10805, 10805, 10805, 10805, 13853, + 10805, 888, 902, 16742, 941, 946, 10805, 10805, 5535, 889, + -1503, 62, -1503, 58, 10805, 6775, -1503, -1503, -1503, -1503, + -1503, 799, 666, 105, 112, 1130, 7395, 3368, 7705, 3689, + 810, -1503, -1503, 223, 810, -1503, 10805, 4309, -1503, 1017, + 764, -18, 970, 975, 976, 6465, 10805, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, 11115, 11115, 11115, -1503, 11115, + 11115, -1503, 11115, -1503, 11115, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, 11115, 11115, 1069, 11115, 11115, 11115, 11115, 11115, + 11115, 11115, 11115, 11115, 11115, 11115, 11115, 911, 1053, 1055, + 1056, -1503, -1503, -1503, 11425, 9565, -1503, -1503, 11735, 11735, + 10805, 909, -1503, -1503, 909, -1503, 9875, 909, 1002, 10185, + -1503, -1503, -1503, 271, -1503, 342, -1503, -1503, -1503, -1503, + -1503, -1503, 1045, 1046, 604, 1125, -1503, -1503, 17030, 958, + 614, 16742, 995, 996, 958, 1041, 1030, 1026, -1503, -1503, + -1503, 148, 918, 1067, 867, 16742, 1020, 10805, 1049, 16742, + 16742, -1503, 1036, 985, 6465, -1503, 987, 940, 678, -1503, + 983, 988, 125, -1503, 353, 372, 1065, -1503, 61, -1503, + -1503, 1065, 16742, 23, 16742, 1080, 373, -1503, 6465, -1503, + 110, -1503, 13250, 1081, 1131, 13250, 1041, 1083, 115, 16742, + 10805, -18, 235, 991, -1503, 993, 994, 997, 260, -1503, + 346, 998, -1503, 123, 124, 1032, -1503, 999, 6465, 6465, + 244, -1503, 378, 399, 253, 10805, 329, -1503, -1503, 10805, + 10805, -1503, 10805, 10805, 10805, -1503, 10805, -1503, 10805, -1503, + 16742, 1071, -1503, 293, 250, -1503, -1503, -1503, 334, -1503, + 56, -1503, -1503, 1033, 1035, 1042, 1043, 1044, 845, 916, + -1503, 382, 444, 98, 10, 1105, 574, 965, 978, 973, + -13, -1503, 1063, -1503, -1503, 1016, 126, 5845, 343, 12656, + 889, -1503, -1503, -1503, 977, -1503, 830, 152, 1175, 129, + -1503, -1503, 114, -1503, -1503, -1503, 117, -1503, 65, -1503, + -1503, -1503, -1503, -1503, 3999, -1503, -1503, -1503, 16742, 1047, + 10805, 1094, -1503, -1503, -1503, 957, -1503, -1503, -1503, -1503, + -1503, 11115, -1503, -1503, -1503, 57, -1503, 731, 731, 587, + 631, 631, 631, 631, 422, 422, -1503, -1503, 15878, 15878, + 16742, 16742, -1503, -1503, 357, -1503, -1503, 236, -1503, -1503, + -1503, 402, -1503, -1503, 403, 594, -1503, -1503, 613, 626, + 754, -1503, 604, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, 958, -1503, 1086, 16166, 1072, 10805, -1503, + -1503, -1503, 1121, 1041, 1041, 958, -1503, 823, 1041, 677, + 16742, 595, 663, 1187, -1503, -1503, 933, 508, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, 148, + 75, 1000, 649, 10805, -1503, 16742, 1126, 922, 1041, -1503, + -1503, -1503, -1503, 1070, 16742, -1503, 16742, -1503, 16454, 1095, + 15878, 1110, 10805, 80, 1087, 35, 449, 979, -1503, -1503, + 843, 23, 1121, 15878, 1111, 1136, 1051, 1038, 1099, 1041, + 1088, 1108, 1146, 1041, 10805, -52, -1503, -1503, -1503, 1090, + -1503, -1503, -1503, -1503, 1128, 10805, 10805, 1097, -1503, 1147, + 1150, 6465, -1503, 1068, 1073, 1098, 16742, -1503, 16742, -1503, + 10805, 1112, 1066, 10805, -1503, 1132, 131, 137, 151, 1220, + -1503, 453, -1503, 553, -1503, -1503, 1229, -1503, -78, 10805, + 10805, 10805, 770, 10805, 10805, 10805, 10805, 10805, 10805, 10805, + 10805, 10805, 13853, 1144, 10805, 10805, -1503, 8015, 328, 1018, + -1503, -5, -1503, 10805, 122, 159, 65, 7705, 3689, 7705, + 1185, -1503, -1503, 10805, 688, 1158, -1503, 16742, 1159, -1503, + -1503, 10805, 57, 347, 492, -1503, 982, 93, 1011, 1010, + -1503, -1503, 829, -1503, 1005, 466, 1117, 1118, 16166, 1119, + 1120, 1122, 1124, 1127, -1503, 417, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, 1133, + -1503, -1503, -1503, -1503, 10805, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, 760, -1503, 1252, 804, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, 1001, -1503, -1503, + 1253, -1503, -1503, -1503, -1503, -1503, 590, 1255, -1503, 718, + -1503, -1503, -1503, 939, 523, 942, 655, 944, 945, 871, + 1120, 1122, 1124, -1503, 417, 417, 11425, 1004, 1006, -1503, + 1121, 75, 1059, 1103, 6465, 1101, 1102, 1153, 1107, 1113, + 16742, -1503, 322, -1503, 16742, -1503, 10805, 1152, 10805, 1174, + 10805, 215, 1155, 10805, 1156, -1503, 1188, 1189, 10805, 16742, + 900, 1228, -1503, -1503, -1503, -1503, -1503, -1503, 15878, -1503, + 6465, 1041, 1201, -1503, -1503, -1503, 1041, 1201, -1503, 10805, + 1167, 6465, 16742, -1503, -1503, 10805, 10805, 585, -1503, 42, + 803, -1503, 15014, 805, -1503, 819, -1503, 1129, -1503, -1503, + 6465, 1134, 1135, -1503, 10805, -1503, -1503, 10805, 1116, 1147, + 1216, -1503, 1191, -1503, 558, -1503, -1503, 1310, -1503, -1503, + 6465, 16742, -1503, 685, -1503, -1503, -1503, 1137, 1092, 1096, + -1503, -1503, -1503, 1100, 1104, -1503, -1503, -1503, 1223, -1503, + -1503, -1503, -1503, 1089, 341, 16742, 1148, -1503, 1176, 1179, + 1180, 1177, -1503, 846, 825, 12656, 1018, -1503, 6155, 12656, + -1503, -1503, 1175, 476, -1503, -1503, -1503, 1158, -1503, 1041, + -1503, 835, -1503, 643, 1232, -1503, 10805, 540, 1094, 358, + 1157, -1503, 57, 1109, -1503, -1503, 200, -1503, 339, 133, + 1115, 57, 339, 11115, -1503, 158, -1503, -1503, -1503, -1503, + -1503, -1503, 57, 1196, 1064, 918, 133, -1503, -1503, 1061, + 1267, -1503, -1503, -1503, 14150, 1163, 1164, 1165, 1166, 1168, + 1170, 1171, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, 1325, 11, 1331, 11, 1106, 1254, + -1503, -1503, 1193, 16742, 1123, -1503, -1503, 11425, -1503, 1182, + -1503, -1503, -1503, -1503, -1503, -1503, 10805, 1217, -1503, -1503, + 10805, -1503, 484, -1503, 10805, 1221, 10805, -1503, 10805, 16742, + 16742, -1503, 684, -1503, 10805, -1503, 1241, 1243, 1274, 1041, + 1201, -1503, 10805, 1190, -1503, -1503, -1503, 1186, -1503, 288, + 10805, 6465, 1192, 315, -1503, 16742, 1195, 15302, 246, -1503, + 15590, 1197, -1503, -1503, 1198, -1503, -1503, -1503, -1503, 10805, + 821, 1220, 16742, 792, -1503, 1200, 1220, 16742, -1503, -1503, + 10805, 10805, 10805, 10805, 1057, 10805, 10805, -1503, 10805, 10805, + 10805, 10805, 8015, 40, -1503, -1503, -1503, -1503, -1503, 1232, + -1503, -1503, -1503, 1041, 10805, -1503, 1233, -1503, -1503, -1503, + -1503, 1202, 11115, -1503, -1503, -1503, -1503, -1503, 437, 11115, + 11115, 584, -1503, 1011, -1503, 222, -1503, 1010, 57, 1218, + -1503, -1503, 1138, -1503, -1503, -1503, -1503, 1282, 1203, -1503, + 415, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, 432, + 432, -1503, 11, -1503, -1503, 441, -1503, 1350, 133, 1289, + 1204, 11425, -14, 1142, 1219, -1503, -1503, 10805, -1503, 10805, + 1240, -1503, 10805, -1503, -1503, -1503, 1335, -1503, -1503, 8015, + 10805, 1041, -1503, -1503, -1503, 10805, 10805, -1503, -1503, -1503, + 8015, 8015, 1298, 6465, 16742, 1207, 16742, 10805, 16742, 1208, + 8015, -1503, 364, 3, 1220, 16742, -1503, 1199, 1220, -1503, + -1503, -1503, -1503, 10805, -1503, -1503, -1503, 163, 213, 214, + 10805, -1503, -1503, -1503, 1291, 10805, -1503, 631, 11115, 11115, + 587, 728, -1503, -1503, -1503, -1503, -1503, -1503, 10805, -1503, + 15878, -1503, 15878, 1301, -1503, -1503, -1503, 1369, -1503, -1503, + -1503, 1139, 1292, -1503, -1503, 1293, -1503, 493, 16742, 1283, + 1178, 16742, 11425, -1503, -1503, 10805, -1503, 1284, -1503, -1503, + 1201, -1503, -1503, 15878, -1503, -1503, 1311, 10805, 1222, -1503, + 1312, 8015, -1503, 16742, 564, 582, -1503, 1210, 1220, -1503, + 1212, -1503, 1213, 1147, 1150, 360, -1503, 1291, 587, 587, + 11115, 368, -1503, -1503, 15878, -1503, -1503, 1289, 11425, -1503, + 1232, 1140, 16742, 1294, 1194, 1293, -1503, 16742, 1224, 15878, + 6465, 15878, 1227, -1503, -1503, 1321, 576, -1503, -1503, -1503, + -1503, 1234, 656, -1503, -1503, -1503, 1225, -1503, 8015, 822, + -1503, -1503, 587, -1503, -1503, -1503, -1503, -1503, 10805, 1141, + 16742, 1297, -1503, 6465, 1230, -1503, -1503, 1235, 10805, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, 1302, -1503, 1143, 1145, + 16742, -1503, -1503, 10805, 8015, 16742, 1149, 10805, 1151, 1237, + 11425, -1503, 11425, 8015, -1503, 1226, 1154, 16742, 1206, 1306, + 16742, 1160, 11425, -1503 }; - /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE - doesn't specify something else to do. Zero means the default is an - error. */ + /* YYDEFACT[S] -- default reduction number in state S. Performed when + YYTABLE doesn't specify something else to do. Zero means the + default is an error. */ const unsigned short int xquery_parser::yydefact_[] = { - 163, 460, 461, 462, 166, 166, 166, 810, 1015, 118, - 120, 616, 902, 911, 851, 815, 813, 795, 903, 906, - 858, 819, 796, 797, 0, 912, 799, 909, 880, 860, - 835, 855, 856, 907, 904, 854, 801, 910, 802, 803, - 951, 963, 950, 852, 871, 865, 804, 853, 806, 805, - 952, 889, 890, 857, 832, 973, 974, 975, 976, 977, - 978, 979, 980, 981, 982, 983, 997, 1004, 879, 875, - 866, 846, 794, 0, 874, 882, 891, 998, 870, 486, - 847, 848, 905, 999, 1005, 867, 884, 0, 492, 449, - 488, 877, 812, 868, 869, 898, 872, 888, 897, 1003, - 1006, 818, 859, 900, 487, 887, 893, 798, 0, 0, - 0, 0, 395, 885, 896, 901, 899, 878, 864, 953, - 862, 863, 1000, 0, 394, 0, 1001, 1007, 894, 849, - 873, 1002, 427, 0, 459, 895, 876, 883, 892, 886, - 954, 840, 845, 844, 843, 842, 841, 807, 861, 0, - 811, 908, 833, 942, 941, 943, 817, 816, 836, 948, - 800, 940, 945, 946, 937, 839, 881, 939, 949, 947, - 938, 837, 944, 958, 959, 956, 957, 955, 808, 960, - 961, 962, 928, 927, 914, 831, 824, 921, 917, 834, - 830, 929, 930, 820, 821, 814, 823, 926, 925, 922, - 918, 935, 936, 934, 924, 920, 913, 822, 933, 932, - 826, 828, 827, 919, 923, 915, 829, 916, 825, 931, - 984, 985, 986, 987, 988, 989, 965, 966, 964, 970, - 971, 972, 967, 968, 969, 838, 990, 991, 992, 993, - 994, 995, 996, 0, 0, 1008, 1009, 1010, 1013, 1012, - 1011, 1014, 163, 163, 0, 2, 163, 7, 9, 21, - 0, 26, 29, 34, 35, 36, 37, 38, 39, 40, - 30, 56, 57, 31, 32, 0, 74, 77, 78, 33, - 79, 80, 0, 116, 81, 82, 83, 84, 16, 160, - 161, 162, 169, 171, 479, 172, 0, 173, 174, 175, - 176, 177, 178, 179, 182, 0, 208, 217, 212, 244, - 250, 0, 242, 243, 219, 213, 181, 214, 180, 215, - 218, 348, 350, 352, 362, 364, 368, 370, 373, 378, - 381, 384, 386, 388, 390, 0, 392, 399, 398, 400, - 0, 418, 401, 423, 426, 428, 431, 433, 0, 438, - 435, 0, 446, 456, 458, 432, 463, 470, 484, 471, - 472, 473, 476, 477, 474, 475, 499, 501, 502, 503, - 500, 548, 549, 550, 551, 552, 553, 455, 590, 582, - 589, 588, 587, 584, 586, 583, 585, 485, 478, 617, - 618, 41, 220, 221, 223, 222, 224, 216, 481, 482, - 483, 480, 226, 229, 225, 227, 228, 457, 793, 809, - 902, 911, 909, 811, 0, 164, 165, 0, 0, 0, + 165, 464, 465, 466, 168, 168, 168, 813, 1018, 120, + 122, 619, 905, 914, 854, 818, 816, 798, 906, 909, + 861, 822, 799, 800, 0, 915, 802, 912, 883, 863, + 838, 858, 859, 910, 907, 857, 804, 913, 805, 806, + 954, 966, 953, 855, 874, 868, 807, 856, 809, 808, + 955, 892, 893, 860, 835, 976, 977, 978, 979, 980, + 981, 982, 983, 984, 985, 986, 1000, 1007, 882, 878, + 869, 849, 797, 0, 877, 885, 894, 1001, 873, 490, + 850, 851, 908, 1002, 1008, 870, 887, 0, 496, 453, + 492, 880, 815, 871, 872, 901, 875, 891, 900, 1006, + 1009, 821, 862, 903, 491, 890, 896, 801, 0, 0, + 0, 0, 399, 888, 899, 904, 902, 881, 867, 956, + 865, 866, 1003, 0, 398, 0, 1004, 1010, 897, 852, + 876, 1005, 431, 0, 463, 898, 879, 886, 895, 889, + 957, 843, 848, 847, 846, 845, 844, 810, 864, 0, + 814, 911, 836, 945, 944, 946, 820, 819, 839, 951, + 803, 943, 948, 949, 940, 842, 884, 942, 952, 950, + 941, 840, 947, 961, 962, 959, 960, 958, 811, 963, + 964, 965, 931, 930, 917, 834, 827, 924, 920, 837, + 833, 932, 933, 823, 824, 817, 826, 929, 928, 925, + 921, 938, 939, 937, 927, 923, 916, 825, 936, 935, + 829, 831, 830, 922, 926, 918, 832, 919, 828, 934, + 987, 988, 989, 990, 991, 992, 968, 969, 967, 973, + 974, 975, 970, 971, 972, 841, 993, 994, 995, 996, + 997, 998, 999, 0, 0, 1011, 1012, 1013, 1016, 1015, + 1014, 1017, 165, 165, 0, 2, 165, 9, 11, 23, + 0, 28, 31, 36, 37, 38, 39, 40, 41, 42, + 32, 58, 59, 33, 34, 0, 76, 79, 80, 35, + 81, 82, 0, 118, 83, 84, 85, 86, 18, 162, + 163, 164, 171, 174, 483, 175, 0, 176, 177, 178, + 179, 180, 181, 182, 185, 0, 211, 219, 214, 246, + 252, 0, 244, 245, 221, 215, 184, 216, 183, 217, + 220, 350, 352, 354, 364, 366, 370, 372, 375, 380, + 383, 386, 388, 390, 392, 0, 396, 403, 402, 404, + 0, 422, 405, 427, 430, 432, 435, 437, 0, 442, + 439, 0, 450, 460, 462, 436, 467, 474, 488, 475, + 476, 477, 480, 481, 478, 479, 503, 505, 506, 507, + 504, 552, 553, 554, 555, 556, 557, 459, 593, 585, + 592, 591, 590, 587, 589, 586, 588, 489, 482, 620, + 621, 43, 222, 223, 225, 224, 226, 218, 485, 486, + 487, 484, 228, 231, 227, 229, 230, 461, 796, 812, + 905, 914, 912, 814, 0, 166, 167, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 126, 128, 129, 0, 0, 0, 0, 0, 0, + 0, 0, 256, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 274, 275, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 124, 126, 127, 0, 0, 0, 0, 0, 0, - 0, 0, 254, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 272, 273, 0, 0, + 0, 455, 458, 445, 0, 0, 798, 822, 800, 853, + 915, 802, 863, 804, 874, 807, 809, 808, 892, 1000, + 1007, 797, 1001, 851, 1002, 1008, 875, 1006, 1009, 956, + 1003, 1004, 1010, 1005, 957, 951, 943, 949, 940, 840, + 961, 962, 959, 811, 963, 1012, 451, 461, 796, 443, + 0, 192, 444, 447, 798, 799, 800, 804, 805, 806, + 807, 797, 803, 493, 0, 449, 448, 187, 0, 0, + 211, 0, 802, 809, 808, 0, 168, 771, 963, 0, + 219, 0, 494, 0, 519, 0, 454, 794, 0, 795, + 425, 426, 0, 457, 456, 446, 429, 0, 0, 548, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 451, 454, 441, 0, 0, 795, 819, 797, 850, - 912, 799, 860, 801, 871, 804, 806, 805, 889, 997, - 1004, 794, 998, 848, 999, 1005, 872, 1003, 1006, 953, - 1000, 1001, 1007, 1002, 954, 948, 940, 946, 937, 837, - 958, 959, 956, 808, 960, 1009, 447, 457, 793, 439, - 0, 189, 440, 443, 795, 796, 797, 801, 802, 803, - 804, 794, 800, 489, 0, 445, 444, 184, 0, 0, - 208, 0, 799, 806, 805, 0, 166, 768, 960, 0, - 217, 0, 490, 0, 515, 0, 450, 791, 0, 792, - 421, 422, 0, 453, 452, 442, 425, 0, 0, 544, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 773, 0, 775, 0, 0, 165, 3, 4, 1, 10, + 12, 0, 0, 0, 0, 6, 165, 0, 165, 0, + 0, 119, 172, 0, 0, 190, 0, 0, 199, 0, + 0, 0, 0, 0, 0, 0, 0, 204, 232, 251, + 247, 253, 248, 250, 249, 0, 0, 0, 415, 0, + 0, 413, 0, 359, 0, 414, 407, 412, 411, 410, + 409, 408, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 770, 0, 772, 0, 0, 163, 3, 4, 1, 8, - 10, 0, 0, 0, 0, 0, 163, 163, 163, 163, - 0, 117, 170, 0, 0, 187, 0, 0, 0, 196, - 0, 0, 0, 0, 0, 0, 0, 0, 201, 230, - 249, 245, 251, 246, 248, 247, 0, 0, 0, 411, - 0, 0, 409, 0, 357, 0, 410, 403, 408, 407, - 406, 405, 404, 0, 0, 0, 0, 0, 0, 0, + 0, 401, 400, 397, 0, 0, 423, 428, 0, 0, + 0, 438, 471, 441, 440, 452, 0, 468, 0, 0, + 559, 561, 565, 0, 124, 0, 793, 47, 44, 45, + 48, 49, 0, 0, 0, 0, 50, 51, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 630, 631, + 632, 0, 103, 142, 0, 0, 112, 0, 0, 0, + 0, 127, 0, 0, 0, 599, 0, 0, 0, 595, + 0, 0, 0, 609, 0, 0, 255, 257, 0, 234, + 235, 254, 0, 0, 0, 134, 0, 138, 168, 623, + 0, 60, 0, 69, 0, 0, 0, 61, 0, 0, + 0, 0, 0, 0, 600, 0, 0, 0, 0, 323, + 0, 0, 598, 0, 0, 0, 617, 0, 0, 0, + 0, 603, 0, 0, 194, 0, 0, 188, 186, 0, + 0, 777, 0, 0, 0, 493, 0, 772, 0, 495, + 520, 519, 516, 0, 0, 550, 549, 424, 0, 547, + 0, 643, 644, 798, 800, 804, 807, 797, 784, 0, + 594, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 649, 0, 202, 203, 0, 0, 0, 0, 0, + 207, 208, 774, 776, 0, 5, 24, 0, 25, 0, + 7, 29, 0, 15, 8, 30, 0, 19, 905, 77, + 16, 78, 20, 193, 0, 191, 212, 213, 0, 0, + 0, 0, 205, 233, 292, 351, 353, 357, 363, 362, + 361, 0, 358, 355, 356, 0, 367, 374, 373, 371, + 377, 378, 379, 376, 381, 382, 385, 384, 0, 0, + 0, 0, 406, 420, 0, 433, 434, 0, 472, 469, + 501, 0, 622, 499, 0, 0, 121, 123, 0, 0, + 0, 102, 0, 92, 94, 95, 96, 97, 99, 100, + 101, 93, 98, 88, 89, 0, 0, 108, 0, 104, + 106, 107, 114, 0, 0, 87, 46, 0, 0, 0, + 0, 0, 0, 0, 721, 726, 0, 0, 722, 756, + 709, 711, 712, 713, 715, 717, 716, 714, 718, 0, + 0, 0, 0, 0, 111, 0, 144, 0, 0, 564, + 558, 596, 597, 0, 0, 613, 0, 610, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 236, 237, + 0, 242, 140, 0, 0, 135, 0, 0, 0, 0, + 0, 0, 62, 0, 0, 0, 273, 279, 276, 0, + 602, 601, 608, 616, 0, 0, 0, 0, 563, 0, + 0, 0, 416, 0, 0, 0, 0, 606, 0, 604, + 0, 195, 0, 0, 778, 0, 0, 0, 0, 519, + 517, 0, 508, 0, 497, 498, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 397, 396, 393, 0, 0, 419, 424, 0, - 0, 0, 434, 467, 437, 436, 448, 0, 464, 0, - 0, 555, 557, 561, 0, 122, 0, 790, 45, 42, - 43, 46, 47, 0, 0, 0, 0, 48, 49, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 627, - 628, 629, 0, 101, 140, 0, 0, 110, 0, 0, - 0, 0, 125, 0, 0, 0, 596, 0, 0, 0, - 592, 0, 0, 0, 606, 0, 0, 253, 255, 0, - 232, 233, 252, 0, 0, 0, 132, 0, 136, 166, - 620, 0, 58, 0, 67, 0, 0, 0, 59, 0, - 0, 0, 0, 0, 0, 597, 0, 0, 0, 0, - 321, 0, 0, 595, 0, 0, 0, 614, 0, 0, - 0, 0, 600, 0, 0, 191, 0, 0, 185, 183, - 0, 0, 774, 0, 0, 0, 489, 0, 769, 0, - 491, 516, 515, 512, 0, 0, 546, 545, 420, 0, - 543, 0, 640, 641, 795, 797, 801, 804, 794, 781, - 0, 591, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 646, 0, 199, 200, 0, 0, 0, 0, - 0, 204, 205, 771, 773, 0, 5, 22, 0, 23, - 0, 6, 27, 0, 13, 28, 0, 17, 902, 75, - 14, 76, 18, 190, 188, 0, 209, 211, 0, 0, - 0, 0, 202, 231, 290, 349, 351, 355, 361, 360, - 359, 0, 356, 353, 354, 0, 365, 372, 371, 369, - 375, 376, 377, 374, 379, 380, 383, 382, 0, 0, - 0, 0, 402, 416, 0, 429, 430, 0, 468, 465, - 497, 0, 619, 495, 0, 0, 119, 121, 0, 0, - 0, 100, 0, 90, 92, 93, 94, 95, 97, 98, - 99, 91, 96, 86, 87, 0, 0, 106, 0, 102, - 104, 105, 112, 0, 0, 85, 44, 0, 0, 0, - 0, 0, 0, 0, 718, 723, 0, 0, 719, 753, - 706, 708, 709, 710, 712, 714, 713, 711, 715, 0, - 0, 0, 0, 0, 109, 0, 142, 0, 0, 560, - 554, 593, 594, 0, 0, 610, 0, 607, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 234, 235, - 0, 240, 138, 0, 0, 133, 0, 0, 0, 0, - 0, 0, 60, 0, 0, 0, 271, 277, 274, 0, - 599, 598, 605, 613, 0, 0, 0, 0, 559, 0, - 0, 0, 412, 0, 0, 0, 0, 603, 0, 601, - 0, 192, 0, 0, 775, 0, 0, 0, 0, 515, - 513, 0, 504, 0, 493, 494, 0, 11, 0, 0, + 0, 0, 0, 0, 0, 0, 200, 0, 0, 0, + 657, 0, 209, 0, 0, 0, 0, 165, 0, 165, + 0, 173, 243, 0, 307, 303, 305, 0, 293, 294, + 360, 0, 0, 0, 0, 687, 368, 660, 664, 666, + 668, 670, 673, 680, 681, 689, 915, 801, 0, 810, + 1016, 1015, 1014, 1017, 387, 568, 574, 575, 578, 624, + 625, 579, 580, 787, 788, 789, 583, 389, 391, 394, + 584, 393, 421, 473, 0, 470, 500, 125, 56, 57, + 54, 55, 131, 130, 0, 90, 0, 0, 109, 110, + 115, 74, 75, 52, 53, 73, 727, 0, 730, 757, + 0, 720, 719, 724, 723, 755, 0, 0, 732, 0, + 728, 731, 710, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 143, 146, 148, 0, 0, 0, 113, + 116, 0, 0, 0, 168, 0, 0, 617, 0, 0, + 0, 259, 0, 567, 0, 260, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 238, 0, 0, 0, 0, + 286, 0, 283, 288, 241, 141, 136, 139, 0, 189, + 0, 0, 71, 65, 68, 67, 0, 63, 277, 0, + 0, 168, 0, 321, 325, 0, 0, 0, 328, 0, + 0, 334, 0, 0, 341, 0, 345, 0, 418, 417, + 168, 0, 0, 196, 0, 198, 322, 0, 0, 0, + 0, 520, 0, 509, 0, 543, 540, 0, 544, 545, + 0, 0, 539, 0, 514, 542, 541, 0, 0, 0, + 636, 637, 633, 0, 0, 641, 642, 638, 780, 781, + 647, 785, 645, 0, 0, 0, 0, 651, 802, 809, + 808, 963, 201, 0, 0, 0, 652, 653, 0, 0, + 210, 783, 26, 0, 17, 21, 22, 304, 316, 0, + 317, 0, 308, 309, 310, 311, 0, 296, 0, 0, + 0, 671, 684, 0, 365, 369, 0, 703, 0, 0, + 0, 0, 0, 0, 659, 661, 662, 698, 699, 700, + 702, 701, 0, 0, 675, 674, 0, 678, 682, 696, + 694, 693, 686, 690, 0, 0, 0, 0, 0, 0, + 0, 0, 571, 573, 572, 569, 395, 502, 133, 132, + 91, 105, 744, 725, 0, 749, 0, 749, 738, 733, + 147, 149, 0, 0, 0, 117, 145, 0, 27, 0, + 614, 615, 618, 611, 612, 258, 0, 0, 272, 264, + 0, 268, 0, 262, 0, 0, 0, 281, 0, 0, + 0, 240, 284, 287, 0, 137, 0, 0, 70, 0, + 64, 278, 0, 0, 324, 326, 331, 0, 329, 0, + 0, 0, 0, 0, 335, 0, 0, 0, 0, 342, + 0, 0, 346, 419, 0, 607, 605, 197, 779, 0, + 0, 519, 0, 0, 551, 0, 519, 0, 515, 14, + 0, 0, 0, 0, 0, 0, 0, 650, 0, 0, + 0, 0, 0, 0, 654, 658, 320, 318, 319, 312, + 313, 314, 306, 0, 0, 301, 0, 295, 688, 679, + 685, 0, 0, 758, 759, 769, 768, 767, 0, 0, + 0, 0, 760, 665, 766, 0, 663, 667, 0, 0, + 672, 676, 0, 697, 692, 695, 691, 0, 0, 581, + 0, 576, 629, 570, 791, 792, 790, 577, 745, 0, + 0, 743, 750, 751, 747, 0, 742, 0, 740, 0, + 0, 0, 0, 0, 0, 560, 261, 0, 270, 0, + 0, 266, 0, 269, 282, 290, 291, 285, 239, 0, + 0, 0, 66, 280, 566, 0, 0, 332, 336, 330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 197, 0, 799, 806, - 805, 960, 0, 0, 0, 654, 0, 206, 0, 0, - 0, 0, 163, 163, 163, 0, 210, 241, 0, 305, - 301, 303, 0, 291, 292, 358, 0, 0, 0, 0, - 684, 366, 657, 661, 663, 665, 667, 670, 677, 678, - 686, 912, 798, 0, 807, 1013, 1012, 1011, 1014, 385, - 566, 572, 573, 576, 621, 622, 577, 578, 784, 785, - 786, 581, 387, 389, 563, 391, 417, 469, 0, 466, - 496, 123, 54, 55, 52, 53, 129, 128, 0, 88, - 0, 0, 107, 108, 113, 72, 73, 50, 51, 71, - 724, 0, 727, 754, 0, 717, 716, 721, 720, 752, - 0, 0, 729, 0, 725, 728, 707, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 141, 144, 146, - 0, 0, 0, 111, 114, 0, 0, 0, 166, 0, - 0, 614, 0, 0, 0, 257, 0, 565, 0, 258, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 236, - 0, 0, 0, 0, 284, 0, 281, 286, 239, 139, - 134, 137, 0, 186, 0, 0, 69, 63, 66, 65, - 0, 61, 275, 0, 0, 166, 0, 319, 323, 0, - 0, 0, 326, 0, 0, 332, 0, 0, 339, 0, - 343, 0, 414, 413, 166, 0, 0, 193, 0, 195, - 320, 0, 0, 0, 0, 516, 0, 505, 0, 539, - 536, 0, 540, 541, 0, 0, 535, 0, 510, 538, - 537, 0, 0, 0, 633, 634, 630, 0, 0, 638, - 639, 635, 777, 778, 644, 782, 642, 0, 0, 0, - 0, 648, 198, 0, 0, 0, 0, 0, 0, 649, - 650, 0, 207, 780, 24, 0, 15, 19, 20, 302, - 314, 0, 315, 0, 306, 307, 308, 309, 0, 294, - 0, 0, 0, 668, 681, 0, 363, 367, 0, 700, - 0, 0, 0, 0, 0, 0, 656, 658, 659, 695, - 696, 697, 699, 698, 0, 0, 672, 671, 0, 675, - 679, 693, 691, 690, 683, 687, 0, 0, 0, 0, - 0, 0, 0, 0, 569, 571, 570, 567, 564, 498, - 131, 130, 89, 103, 741, 722, 0, 746, 0, 746, - 735, 730, 145, 147, 0, 0, 0, 115, 143, 0, - 25, 0, 611, 612, 615, 608, 609, 256, 0, 0, - 270, 262, 0, 266, 0, 260, 0, 0, 0, 279, - 0, 0, 0, 238, 282, 285, 0, 135, 0, 0, - 68, 0, 62, 276, 0, 0, 322, 324, 329, 0, - 327, 0, 0, 0, 0, 0, 333, 0, 0, 0, - 0, 340, 0, 0, 344, 415, 0, 604, 602, 194, - 776, 0, 0, 515, 0, 0, 547, 0, 515, 0, - 511, 12, 0, 0, 0, 0, 0, 0, 0, 647, - 0, 0, 0, 0, 0, 651, 655, 318, 316, 317, - 310, 311, 312, 304, 0, 0, 299, 0, 293, 685, - 676, 682, 0, 0, 755, 756, 766, 765, 764, 0, - 0, 0, 0, 757, 662, 763, 0, 660, 664, 0, - 0, 669, 673, 0, 694, 689, 692, 688, 0, 0, - 579, 0, 574, 626, 568, 788, 789, 787, 575, 742, - 0, 0, 740, 747, 748, 744, 0, 739, 0, 737, - 0, 0, 0, 0, 0, 0, 556, 259, 0, 268, - 0, 0, 264, 0, 267, 280, 288, 289, 283, 237, - 0, 0, 0, 64, 278, 562, 0, 0, 330, 334, - 328, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 558, 0, 0, 515, 0, 542, 0, 515, - 631, 632, 636, 637, 0, 643, 783, 645, 0, 0, - 0, 0, 652, 313, 300, 295, 0, 680, 767, 0, - 0, 759, 0, 705, 704, 703, 702, 701, 666, 0, - 758, 0, 623, 0, 0, 751, 750, 749, 0, 743, - 736, 734, 0, 731, 732, 726, 148, 150, 152, 0, - 0, 0, 0, 0, 263, 261, 0, 269, 0, 203, - 347, 70, 325, 331, 0, 345, 341, 0, 0, 0, - 335, 0, 0, 337, 0, 525, 519, 514, 0, 515, - 506, 0, 779, 0, 0, 0, 298, 296, 761, 760, - 0, 0, 624, 580, 0, 745, 738, 0, 0, 154, - 153, 0, 0, 0, 0, 149, 265, 0, 0, 0, - 0, 0, 0, 533, 527, 0, 526, 528, 534, 531, - 521, 0, 520, 522, 532, 508, 0, 507, 0, 653, - 297, 762, 674, 625, 733, 151, 155, 0, 0, 0, - 0, 287, 0, 0, 338, 336, 0, 0, 518, 529, - 530, 517, 523, 524, 509, 0, 156, 0, 0, 0, - 346, 342, 0, 0, 0, 0, 0, 0, 0, 0, - 158, 0, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 159 + 0, 562, 0, 0, 519, 0, 546, 0, 519, 634, + 635, 639, 640, 0, 646, 786, 648, 0, 0, 0, + 0, 655, 315, 302, 297, 0, 683, 770, 0, 0, + 762, 0, 708, 707, 706, 705, 704, 669, 0, 761, + 0, 626, 0, 0, 754, 753, 752, 0, 746, 739, + 737, 0, 734, 735, 729, 150, 152, 154, 0, 0, + 0, 0, 0, 265, 263, 0, 271, 0, 206, 349, + 72, 327, 333, 0, 347, 343, 0, 0, 0, 337, + 0, 0, 339, 0, 529, 523, 518, 0, 519, 510, + 0, 782, 0, 0, 0, 0, 300, 298, 764, 763, + 0, 0, 627, 582, 0, 748, 741, 0, 0, 156, + 155, 0, 0, 0, 0, 151, 267, 0, 0, 0, + 0, 0, 0, 537, 531, 0, 530, 532, 538, 535, + 525, 0, 524, 526, 536, 512, 0, 511, 0, 0, + 656, 299, 765, 677, 628, 736, 153, 157, 0, 0, + 0, 0, 289, 0, 0, 340, 338, 0, 0, 522, + 533, 534, 521, 527, 528, 513, 0, 158, 0, 0, + 0, 348, 344, 0, 0, 0, 0, 0, 0, 0, + 0, 160, 0, 0, 159, 0, 0, 0, 0, 0, + 0, 0, 0, 161 }; /* YYPGOTO[NTERM-NUM]. */ const short int xquery_parser::yypgoto_[] = { - -1529, -1529, -238, -204, -1529, 1167, 1171, -1529, 1170, -562, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1015, -1529, -1529, -1529, -1529, -236, -552, -1529, 705, -192, - -1529, -1529, -1529, -1529, -1529, 250, 477, -1529, -1529, 17, - -191, 1016, -1529, 1013, -1529, -1529, -635, -1529, 411, -1529, - 212, -1529, -255, -299, -1529, -547, -1529, 5, 56, 22, - -248, -176, -1529, -863, -1529, -1529, 253, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, 584, -90, 1499, - 0, -1529, -1529, -1529, -1529, 426, -1529, -1529, -294, -1529, - 8, -1529, 1003, -930, -744, -721, -1529, -1529, 668, -1529, - -1529, -18, 201, -1529, -1529, -1529, 86, -1528, -1529, 342, - 93, -1529, -1529, 98, -1320, -1529, 924, 191, -1529, -1529, - 190, -1010, -1529, -1529, 195, -1529, -1529, -1254, -1245, -1529, - 183, -1529, -1529, 828, 830, -1529, -558, 815, -1529, -1529, - -667, 33, -637, 92, 60, -1529, -1529, -1529, -1529, -1529, - 1159, -1529, -1529, -1529, -1529, -1529, -842, -333, -684, -1529, - -102, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -20, -839, - -1529, -542, 637, 236, -1529, -395, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, 776, -1529, -1021, -1529, 174, -1529, 667, - -792, -1529, -1529, -1529, -1529, -1529, -282, -266, -1175, -840, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - 574, -747, -860, -206, -853, -1529, 97, -832, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, 1055, 1060, -275, 487, 316, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, -1529, -1529, -1529, 160, -1529, -1529, 149, -1529, 153, - -1062, -1529, -1529, -1529, 121, 111, -53, 379, -1529, -1529, - -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, -1529, - -1529, 122, -1529, -1529, -1529, -46, 375, 524, -1529, -1529, - -1529, -1529, -1529, 311, -1529, -1529, -1478, -1529, -1529, -1529, - -560, -1529, 87, -1529, -68, -1529, -1529, -1529, -1529, -1313, - -1529, 133, -1529, -1529, -1529, -1529, -1529, 931, -1529, -1529, - -1529, -1529, -1529, -922, -1529, -1529, -1529, -405, -369, 235, - 1015, -1529 + -1503, -1503, -217, -201, -1503, 1183, 1184, -1503, 1173, -534, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -991, -1503, -1503, -1503, -1503, -214, -595, -1503, 710, -148, + -1503, -1503, -1503, -1503, -1503, 258, 481, -1503, -1503, -3, + -198, 1022, -1503, 1007, -1503, -1503, -646, -1503, 419, -1503, + 227, -1503, -248, -289, -1503, -562, -1503, 25, 21, 14, + -281, -178, -1503, -876, -1503, -1503, 130, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, 596, -93, 1593, + 0, -1503, -1503, -1503, -1503, 430, -1503, -1503, -296, -1503, + 8, -1503, 1008, -929, -721, -710, -1503, -1503, 672, -1503, + -1503, -8, 208, -1503, -1503, -1503, 91, -1284, -1503, 351, + 104, -1503, -1503, 97, -1303, -1503, 923, 196, -1503, -1503, + 194, -1011, -1503, -1503, 192, -1503, -1503, -1272, -1237, -1503, + 188, -1503, -1503, 831, 828, -1503, -479, 812, -1503, -1503, + -661, 319, -636, 335, 331, -1503, -1503, -1503, 557, -1503, + -1503, 1161, -1503, -1503, -1503, -1503, -1503, -856, -337, -682, + -1503, -94, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -11, + -819, -1503, -539, 634, 239, -1503, -398, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, 780, -1503, -1026, -1503, 176, -1503, + 661, -810, -1503, -1503, -1503, -1503, -1503, -279, -272, -1220, + -1022, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -737, -820, -202, -816, -1503, -1503, -1503, -849, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, 1040, 1050, -209, 480, + 314, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, -1503, -1503, -1503, 157, -1503, -1503, 145, -1503, + 149, -1057, -1503, -1503, -1503, 116, 103, -65, 376, -1503, + -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, -1503, + -1503, -1503, 118, -1503, -1503, -1503, -55, 369, 515, -1503, + -1503, -1503, -1503, -1503, 306, -1503, -1503, -1502, -1503, -1503, + -1503, -565, -1503, 79, -1503, -75, -1503, -1503, -1503, -1503, + -1308, -1503, 127, -1503, -1503, -1503, -1503, -1503, 924, -1503, + -1503, -1503, -1503, -1503, -915, -1503, -1503, -1503, -389, -367, + 203, 1114, -1503 }; /* YYDEFGOTO[NTERM-NUM]. */ const short int xquery_parser::yydefgoto_[] = { - -1, 254, 628, 255, 256, 257, 258, 259, 260, 261, + -1, 254, 627, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, - 1266, 777, 272, 273, 274, 275, 276, 277, 953, 954, + 1262, 776, 272, 273, 274, 275, 276, 277, 953, 954, 955, 278, 279, 280, 959, 960, 961, 281, 439, 282, - 283, 704, 284, 441, 442, 443, 458, 767, 768, 285, - 1217, 286, 1686, 1687, 287, 288, 289, 548, 290, 291, - 292, 293, 294, 770, 295, 296, 531, 297, 298, 299, - 300, 301, 302, 638, 303, 304, 861, 862, 305, 306, - 560, 308, 639, 456, 1020, 1021, 309, 640, 310, 642, - 561, 312, 757, 758, 1254, 465, 313, 466, 467, 764, - 1255, 1256, 1257, 643, 644, 1123, 1124, 1536, 645, 1120, - 1121, 1364, 1365, 1366, 1367, 314, 789, 790, 315, 1281, - 1282, 1481, 316, 1284, 1285, 317, 318, 1287, 1288, 1289, - 1290, 319, 320, 321, 322, 901, 323, 324, 1376, 325, - 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, - 336, 337, 663, 664, 338, 339, 340, 341, 342, 343, - 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, - 354, 355, 698, 693, 356, 357, 358, 359, 360, 361, - 362, 363, 364, 931, 365, 366, 367, 1317, 822, 823, - 824, 1717, 1761, 1762, 1755, 1756, 1763, 1757, 1318, 1319, - 368, 369, 1320, 370, 371, 372, 373, 374, 375, 376, - 1163, 1015, 1149, 1417, 1150, 1571, 1151, 377, 378, 379, - 380, 381, 382, 383, 384, 385, 386, 796, 1230, 387, - 388, 389, 390, 1153, 1154, 1155, 1156, 391, 392, 393, - 394, 395, 396, 851, 852, 397, 1349, 1350, 1652, 1106, - 1131, 1386, 1387, 1132, 1133, 1134, 1135, 1136, 1396, 1561, - 1562, 1137, 1399, 1138, 1542, 1139, 1140, 1404, 1405, 1567, - 1565, 1388, 1389, 1390, 1391, 1666, 733, 980, 981, 982, - 983, 984, 985, 1204, 1591, 1683, 1205, 1589, 1681, 986, - 1429, 1586, 1582, 1583, 1584, 987, 988, 1392, 1400, 1552, - 1393, 1548, 1377, 398, 399, 400, 401, 551, 402, 403, - 404, 405, 406, 1157, 1158, 1159, 1160, 1267, 568, 407, - 408, 409 + 283, 703, 284, 441, 442, 443, 458, 766, 767, 285, + 1213, 286, 1685, 1686, 287, 288, 289, 548, 290, 291, + 292, 293, 294, 769, 295, 296, 531, 297, 298, 299, + 300, 301, 302, 637, 303, 304, 860, 861, 305, 306, + 560, 308, 638, 456, 1020, 1021, 309, 639, 310, 641, + 561, 312, 756, 757, 1250, 465, 313, 466, 467, 763, + 1251, 1252, 1253, 642, 643, 1118, 1119, 1535, 644, 1115, + 1116, 1362, 1363, 1364, 1365, 314, 788, 789, 315, 1277, + 1278, 1479, 316, 1280, 1281, 317, 318, 1283, 1284, 1285, + 1286, 319, 320, 321, 322, 901, 323, 324, 1374, 325, + 326, 327, 328, 329, 330, 331, 332, 333, 1158, 334, + 335, 336, 337, 662, 663, 338, 339, 340, 341, 342, + 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 355, 697, 692, 356, 357, 358, 359, 360, + 361, 362, 363, 364, 931, 365, 366, 367, 1313, 821, + 822, 823, 1716, 1761, 1762, 1755, 1756, 1763, 1757, 1314, + 1315, 368, 369, 1316, 370, 371, 372, 373, 374, 375, + 376, 1015, 1144, 1415, 1145, 1570, 1146, 1159, 377, 378, + 379, 380, 381, 382, 383, 384, 385, 386, 795, 1226, + 387, 388, 389, 390, 1148, 1149, 1150, 1151, 391, 392, + 393, 394, 395, 396, 850, 851, 397, 1346, 1347, 1651, + 1101, 1126, 1384, 1385, 1127, 1128, 1129, 1130, 1131, 1394, + 1560, 1561, 1132, 1397, 1133, 1541, 1134, 1135, 1402, 1403, + 1566, 1564, 1386, 1387, 1388, 1389, 1665, 732, 980, 981, + 982, 983, 984, 985, 1200, 1590, 1682, 1201, 1588, 1680, + 986, 1427, 1585, 1581, 1582, 1583, 987, 988, 1390, 1398, + 1551, 1391, 1547, 1375, 398, 399, 400, 401, 551, 402, + 403, 404, 405, 406, 1152, 1153, 1154, 1155, 1263, 568, + 407, 408, 409 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. */ - const short int xquery_parser::yytable_ninf_ = -851; + number is the opposite. If YYTABLE_NINF_, syntax error. */ + const short int xquery_parser::yytable_ninf_ = -854; const short int xquery_parser::yytable_[] = { - 307, 922, 909, 599, 307, 307, 307, 687, 311, 414, - 417, 418, 311, 311, 311, 1013, 708, 641, 1271, 559, - 563, 1105, 617, 614, 705, 705, 416, 416, 416, 440, - 1071, 576, 1035, 910, 911, 912, 913, 619, 1014, 1283, - 626, 839, 1491, 622, 1047, 1531, 1532, 847, 606, 607, - 1502, 626, 1316, 526, 872, 875, 774, 778, 1061, 1162, - 415, 415, 415, 1129, 728, 1372, 879, 881, 1219, 874, - 877, 880, 882, 9, 10, 743, 1207, 1177, 1235, 1009, - 940, 1208, 748, 1017, 615, 1563, 1152, 1152, 9, 10, - 897, 621, 898, 899, 425, 900, 1209, 902, 1210, 749, - 786, 1243, 11, 1181, 1689, 903, 904, 1211, 307, 425, - 667, 615, 1684, 615, 1093, 463, 311, 707, 426, 624, - 615, 428, 1378, 1715, 1152, 811, 935, 1726, 668, 588, - 549, 615, 707, 626, 1212, 615, 428, 1010, 1580, 1011, - 615, 429, 1510, 581, 1482, 582, 627, 585, 1482, 586, - 1237, 590, 1346, 601, 603, 1544, 591, 627, 1218, 739, - 626, 1011, 626, 1260, 415, 1044, 1273, 578, 622, 686, - 1010, 1172, 1010, 430, 431, 1115, 1011, 1361, 1152, 1546, - 826, 1280, 447, 79, 611, 969, 1547, 970, 1173, 626, - 1012, 1152, 1545, 125, 1479, 1379, 667, 90, 1363, 1770, - 612, 623, 625, 1581, 421, 422, 936, 423, 424, 1351, - 1653, 1690, 1244, 1716, 668, 1184, 775, 626, 589, 1309, - 1310, 1663, 104, 1046, 427, 1247, 1126, 1448, 1664, 1127, - 1483, 971, 583, 626, 1617, 626, 587, 748, 1665, 627, - 592, 688, 1094, -167, 626, 1018, 1045, 626, 773, 621, - 125, 1087, 307, 307, 749, 1472, 307, 1491, 626, 1774, - 311, 311, 1213, 776, 311, 626, 627, 641, 627, 1248, - 464, 1245, 1240, 616, 1485, 1259, 1682, 1306, 1380, 1381, - 1355, 1382, 1019, 626, 626, 1129, 1129, 1316, 1383, 1549, - 1408, 307, 1241, 1691, 1246, 627, 1316, 464, 1384, 311, - 618, 622, 867, 1219, 1447, 872, 875, 1178, 527, 869, - 1385, 1152, 1541, 1311, 1274, 1421, 464, 879, 881, 820, - 1112, 966, 543, 627, 1114, 626, 623, 433, 694, 1354, - 1510, 696, 1128, 1312, 740, 1313, -168, 626, 464, 627, - 626, 627, 741, 1125, 818, 477, 564, 827, 1027, 436, - 627, 579, 864, 627, 1214, 1215, 1216, 437, 569, 753, - 572, 863, 626, 1314, 627, 438, 1378, 111, 1739, 771, - 1456, 627, 1032, 1167, 1482, 868, 870, 810, 783, 750, - 873, 876, 972, 1651, 123, 794, 795, 434, 892, 627, - 627, 1078, 626, 1218, 801, 973, 1724, 974, 464, 626, - 935, 866, 1467, 1049, 1028, 1315, 811, 1031, 975, 976, - 977, 626, 978, 1044, 979, 1072, 307, 1076, 1307, 1050, - 1776, 1097, 478, 149, 311, 1659, 1488, -167, 435, 419, - 1152, 627, 626, 1302, 1004, 689, 690, 1309, 1310, 1379, - 1351, 9, 10, 627, 1303, 307, 627, 307, 1006, 1550, - 1551, 1304, 1082, 311, 1152, 311, 691, 1024, 697, 623, - 1622, 420, 626, 626, 626, 626, 1003, 745, 627, 745, - 1648, 1174, 723, 307, 724, 825, 1077, 1437, 307, 1491, - 937, 311, 1073, 812, 1316, 1308, 311, 829, 1175, 1086, - 479, 480, 1449, 1056, 1063, 745, 464, 622, 627, 1058, - 745, 744, 1660, 747, 1168, 627, 725, 857, 859, 1105, - 1130, 1649, 1526, 737, 1005, 1079, 1080, 627, 738, 723, - -168, 724, 1380, 1381, 1457, 1382, 1650, 620, 1007, 792, - 1081, 1311, 1129, 726, 798, 765, 1434, 1025, 627, 1518, - 1171, 1129, 1384, 1627, 1010, 1039, 1570, 1187, 1188, 307, - 1338, 1312, 1129, 1313, 1385, 444, 307, 311, 1185, 1186, - 879, 881, 879, 1189, 311, 1356, 1357, 1358, 627, 627, - 627, 627, 1168, 1057, 1152, 1055, 1083, 1084, 416, 1059, - 726, 1314, 1074, 527, 1169, 111, 527, 925, 926, 11, - 1426, 1085, 1034, 1227, 1075, 727, 924, 1701, 307, 1309, - 1310, 927, 123, 1673, 766, 307, 311, 1714, 1678, 1374, - 622, 1628, 415, 311, 670, 1104, 307, 307, 307, 307, - 858, 713, 1537, 1504, 311, 311, 311, 311, 440, 1626, - 1011, 1109, 1630, 125, 1089, 1113, 307, 714, 870, 1485, - 448, 149, 727, 671, 311, 1166, 1539, 1769, 1772, 630, - 1428, 676, 1170, 631, 1250, 623, 672, 1152, 632, 1251, - 1152, 716, 717, 1201, 720, 677, 1309, 1310, 569, 1753, - 79, 734, 735, 1309, 1010, 1628, 633, 457, 1252, 569, - 1202, 1600, 1201, 1674, 90, 756, 759, 451, 1679, 452, - 759, 673, 1110, 1311, 691, 718, 697, 1011, 779, 1202, - 907, 908, 1010, 11, 569, 787, 788, 791, 612, 104, - 1601, 1634, 797, 1312, 1534, 1313, 1638, 1129, 1556, 1253, - 804, 1309, 1060, 1066, 1067, 1068, 459, 859, 1280, 1229, - 667, 1232, 1130, 1130, 1426, 630, 916, 917, 1414, 631, - 1759, 1484, 1203, 1314, 632, 307, 1010, 111, 668, 1250, - 1535, 1427, 453, 311, 1251, 1595, 470, 454, 1361, 630, - 1311, 1179, 633, 631, 123, 805, 914, 915, 632, 307, - 1415, 669, 1753, 1179, 1026, 634, 1309, 311, 635, 791, - 1312, 1295, 1313, 1296, 79, 1509, 633, 1312, 1416, 1313, - 816, 416, 1011, 636, 1428, 1195, 687, 1754, 90, 307, - 307, 709, 879, 149, 455, 471, 1196, 311, 311, 641, - 1314, 1732, 472, 1733, 111, 710, 667, 1314, 840, 637, - 956, 745, 745, 104, 840, 415, 460, 1126, 853, 1309, - 1127, 123, 475, 1663, 668, 1312, 461, 1313, 1176, 1152, - 1664, 1152, 481, 1718, 1748, 711, 1760, 1721, 1759, 1342, - 1665, 125, 1636, 1420, 769, 1053, 1054, 1730, 1102, 712, - 1470, 634, 462, 957, 635, 1314, 1103, 483, 958, 769, - 149, 870, 1152, 883, 1773, 1758, 1764, 884, 674, 819, - 1489, 1401, 1402, 1661, 1662, 634, 1360, 675, 635, 1783, - 1312, 1786, 1313, 1490, 476, 440, 1492, 1361, 484, 1489, - 1789, 485, 1152, 1347, 1403, 637, 1658, 1362, 1688, 1493, - 1489, 445, 1633, 1197, 446, 482, 1758, 1152, 1363, 1152, - 1314, 530, 1764, 1768, 1198, 599, 1221, 1766, 928, 637, - 1352, 928, 1528, 1529, 928, 1222, 529, 9, 10, 1250, - 532, 1740, 957, 1312, 1251, 1313, 533, 958, 421, 422, - 449, 423, 424, 450, 1792, 544, 1527, 962, 425, 1190, - 1191, 1192, 729, 730, 731, 1193, 468, 426, 427, 469, - 545, 992, 648, 1314, 473, 996, 997, 474, 546, 1130, - 649, 650, 565, 651, 692, 428, 566, 695, 1130, 573, - 429, 652, 1728, 1729, 1322, 653, 1323, 654, 1016, 1130, - 1022, 691, 655, 697, 1327, 574, 1328, 575, 569, 1688, - 577, 569, 1432, 1433, 580, 1036, 1468, 1164, 1164, 656, - 1675, 1676, 430, 431, 432, 943, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 584, 1371, 593, 597, 604, - 598, 594, 595, 657, 658, 659, 660, 661, 662, 596, - 608, 307, 629, 647, 1688, 646, 1069, 665, 666, 311, - 678, 679, 681, 1771, 680, 685, 1613, 691, 699, 707, - 700, 433, 719, 745, 701, 702, 703, 721, 732, 736, - 722, 746, 763, 769, 772, 780, 781, 782, 528, 793, - 760, 799, 800, 761, 806, 527, 446, 1102, 450, 892, - 808, 821, 528, 469, 474, 1103, 485, 1291, 810, 813, - 814, 815, 307, 307, 307, 828, 831, 830, 817, 841, - 311, 311, 311, 1117, 849, 1812, 528, 1813, 440, 1654, - 850, 434, 871, 854, 860, 888, 1821, 889, 528, 855, - 528, 890, 891, 905, 932, 919, 918, 920, 921, 938, - 939, 941, 963, 1161, 1161, 1161, 1161, 964, 967, 968, - 993, 990, 991, 989, 1130, 995, 998, 999, 1000, 1001, - 1008, 1023, 435, 1002, 1029, 1030, 1033, 1040, 1041, 1051, - 1042, 1043, 1048, 1052, 1088, 445, 449, 1095, 468, 473, - 484, 1161, 1096, 1090, 1111, 1091, 1116, 1092, 436, 1118, - 1122, 1108, 1180, 958, 1010, 1194, 437, 1199, 1200, 1225, - 1228, 1226, 1220, 1236, 438, 1238, 1242, 765, 1262, 1264, - 1265, 1269, 1263, 1270, 1268, 1275, 1276, 1249, 307, 1294, - 1224, 1279, 1280, 1441, 1286, 1619, 311, 1298, 1299, 1231, - 1292, 1231, 1293, 759, 1301, 1161, 1305, 1321, 1343, 1339, - 416, 1348, 1344, 1521, 1522, 1523, 1345, 1346, 1161, 725, - 1368, 1370, 1375, 1394, 307, 1406, 11, 1395, 1398, 1407, - 1409, 1425, 311, 1410, 1411, 307, 1412, 1413, 1430, 1418, - 1475, 1436, 1424, 311, 415, 1444, 1439, 1435, 1442, 1452, - 1443, 797, 1440, 797, 307, 1454, 1458, 416, 1445, 1496, - 1461, 1462, 311, 1446, 1460, 1466, 1471, 1474, 1489, 1495, - 1501, 1503, 1506, 1497, 307, 1498, 416, 1516, 1512, 1361, - 1559, 1543, 311, 1511, 1513, 1520, 1514, 840, 1560, 1553, - 1540, 415, 1566, 1572, 1573, 1564, 745, 1574, 1515, 1575, - 1579, 1585, 1576, 1517, 1592, 1577, 1102, 1102, 1590, 1578, - 415, 1594, 1588, 1596, 1103, 1103, 1598, 1369, 1610, 1603, - 1611, 1612, 1699, 528, 1656, 1615, 528, 1669, 858, 1671, - 1507, 1616, 1621, 1703, 1619, 1624, 1705, 1631, 1161, 1672, - 1632, 1637, 1657, 1713, 1644, 1680, 1201, 1670, 1685, 1693, - 1696, 1698, 1704, 1708, 1534, 1734, 1712, 1720, 1735, 1737, - 1723, 1736, 1738, 1742, 1747, 1779, 1692, 1749, 1751, 1743, - 1750, 1782, 1765, 1767, 1788, 1780, 1787, 1794, 1791, 1802, - 1795, 1799, 1803, 609, 1808, 1814, 1818, 610, 1817, 613, - 965, 1423, 1815, 1805, 1182, 1261, 706, 1438, 1745, 1775, - 715, 528, 1777, 1797, 528, 1107, 1608, 1258, 528, 1806, - 1038, 528, 528, 742, 1809, 1465, 1538, 1811, 762, 528, - 1359, 1533, 1820, 1530, 1705, 528, 528, 1476, 807, 759, - 528, 1480, 1494, 1450, 895, 1468, 934, 896, 528, 1486, - 1793, 906, 1505, 307, 528, 528, 528, 528, 1464, 1070, - 1790, 311, 528, 1233, 684, 1165, 1422, 1161, 1525, 1519, - 528, 1524, 1784, 751, 1554, 1558, 1668, 1373, 752, 1557, - 1667, 791, 1397, 1206, 1431, 1677, 1587, 1555, 845, 0, - 0, 1161, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1800, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 528, 0, 0, 0, 0, - 1508, 0, 0, 0, 0, 1800, 0, 0, 0, 528, - 1784, 1725, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 0, 0, 853, 0, 0, 0, 0, 1731, - 0, 0, 0, 527, 0, 0, 527, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 550, 528, 0, - 1102, 0, 0, 0, 0, 0, 0, 0, 1103, 0, - 0, 1102, 1102, 0, 307, 0, 0, 0, 0, 1103, - 1103, 1102, 311, 0, 0, 0, 0, 0, 0, 1103, - 0, 1161, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1593, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1606, 1607, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1102, 0, 0, 0, 0, 0, 0, 0, - 1103, 0, 1623, 1102, 1161, 0, 0, 1161, 0, 0, - 0, 1103, 0, 0, 942, 0, 0, 528, 0, 1635, - 0, 0, 0, 0, 1639, 0, 0, 0, 0, 0, - 307, 528, 0, 0, 0, 528, 528, 0, 311, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 307, 599, 922, 686, 307, 307, 307, 909, 311, 440, + 622, 1071, 311, 311, 311, 640, 559, 563, 416, 416, + 416, 704, 704, 879, 881, 415, 415, 415, 1500, 414, + 417, 418, 707, 910, 911, 912, 913, 1013, 1279, 576, + 1100, 1035, 1267, 617, 838, 614, 1489, 1312, 1014, 1124, + 846, 606, 607, 1047, 873, 877, 880, 882, 619, 615, + 1530, 1531, 526, 615, 1173, 1370, 727, 1061, 940, 1147, + 1147, 1239, 773, 777, 825, 1215, 706, 742, 1017, 1231, + 9, 10, 871, 875, 621, 615, 11, 1683, 1562, 706, + 1269, 9, 10, 1508, 1093, 615, 1714, 1009, 578, 1157, + 463, 425, 785, 615, 1688, 624, 615, 1147, 307, 9, + 10, 615, 425, 615, 1203, 615, 311, 810, 615, 1204, + 747, 426, 549, 615, 615, 615, 615, 615, 428, 415, + 874, 1011, 615, 615, 1205, 622, 1206, 748, 615, 428, + 1177, 1214, 1480, 712, 429, 1207, 747, 1579, 1348, 764, + 601, 603, 615, 874, 1318, 1010, 1319, 1011, 588, 713, + 774, 1147, 1106, 748, 615, 626, 738, 79, 897, 626, + 898, 899, 1208, 900, 1147, 902, 430, 431, 1110, -169, + 615, 90, 1240, 903, 904, 1105, 1715, 1076, 625, 1376, + 1233, 626, 581, 1650, 582, 620, 421, 422, 623, 423, + 424, 612, 969, 1256, 970, 1349, 104, 775, 1012, 1010, + 1121, 1689, 1580, 1122, 615, 615, 427, 626, 765, 809, + 772, 464, 1094, -170, 615, 1180, 1652, 1236, 1481, 1548, + 626, 626, 626, 626, 125, 1775, 615, 615, 626, 626, + 1018, 826, 621, 1087, 626, 615, 1077, 589, 971, 687, + 1349, 615, 307, 307, 1376, 464, 307, 1034, 626, 1302, + 311, 311, 1377, 1489, 311, 640, 1124, 1124, 622, 1483, + 626, 819, 1353, 879, 881, 1470, 527, 1019, 1312, 1244, + 1681, 583, 579, 1508, 616, 1255, 626, 1312, 749, 1147, + 543, 307, 618, 1690, 1241, 866, 1174, 1027, 1419, 311, + 1209, 1445, 868, 1237, 1107, 1242, 1215, 1109, 464, 1003, + 1049, 1050, 1352, 1097, 564, 1540, 1123, 817, 1298, 433, + 626, 626, 1406, 623, 1299, 1270, 569, 1377, 572, 615, + 626, 1086, 871, 875, 464, 615, 966, 693, 1300, 419, + 695, 739, 626, 626, 615, 1378, 1379, 1010, 1380, 740, + 1722, 626, 436, 464, 892, 1381, 752, 626, 615, 615, + 437, 615, 1454, -169, 1626, 1382, 770, 1044, 438, 615, + 1726, 863, 1214, 862, 477, 782, 11, 1383, 935, 434, + 666, 590, 793, 794, 1739, 420, 591, 1032, 1480, 1549, + 1550, 800, 1210, 1211, 1212, 1060, 867, 869, 667, 972, + 1723, 1724, 872, 876, 865, 1028, 884, -170, 1031, 1147, + 1378, 1379, 973, 1380, 974, 1480, 307, 1543, 1011, 1039, + 435, 1163, 1120, 1072, 311, 975, 976, 977, 1055, 978, + 1382, 979, 1627, 1147, 1074, 626, 1044, 1777, 1465, 444, + 1010, 626, 1383, 1771, 585, 307, 586, 307, 1045, 935, + 626, 478, 1769, 311, 1544, 311, 623, 79, 936, 744, + 1004, 744, 1486, 622, 626, 626, 743, 626, 746, 1446, + 592, 90, 824, 307, 1616, 626, 1078, 1312, 307, 1006, + 1024, 311, 1713, 1435, 828, 1056, 311, 744, 464, 1658, + 1073, 1662, 744, 1046, 791, 690, 104, 696, 1663, 797, + 1121, 1621, 716, 1122, 856, 858, 1058, 1125, 1664, 1164, + 1164, 1447, 879, 881, 879, 685, 1124, 1063, 1075, 479, + 480, 722, 1672, 723, 125, 1124, 1100, 1099, 1424, 937, + 1525, 1455, 1489, 587, 1432, 717, 1124, 1167, 1082, 125, + 1005, 1162, 1538, 1010, 1770, 1354, 1355, 1356, 1677, 307, + 1627, 527, 1773, 1334, 527, 1147, 307, 311, 675, 1007, + 1025, 1412, 1305, 1306, 311, 1057, 1659, 1305, 1306, 1753, + 416, 810, 676, 1305, 1181, 1182, 622, 415, 1516, 1185, + 1011, 1753, 725, 1303, 1569, 1305, 1059, 1010, 1426, 1165, + 1166, 1305, 924, 1413, 925, 926, 1243, 927, 307, 1359, + 1079, 1080, 1673, 1111, 1197, 307, 311, 1545, 440, 1223, + 1759, 1414, 857, 311, 1546, 1081, 307, 307, 307, 307, + 1700, 1198, 447, 11, 311, 311, 311, 311, 1678, 715, + 1536, 1599, 719, 629, 1010, 307, 569, 630, 1147, 733, + 734, 1147, 631, 311, 726, 1372, 1533, 569, 811, 472, + 1304, 623, 1104, 755, 758, 1108, 1307, 708, 758, 869, + 632, 1307, 1083, 1084, 1199, 1305, 778, 1625, 1089, 125, + 1629, 709, 569, 786, 787, 790, 1308, 1085, 1309, 448, + 796, 1308, 1534, 1309, 1759, 1276, 1424, 1308, 803, 1309, + 460, 1633, 1758, 1764, 1305, 1306, 1637, 1754, 1477, 1308, + 461, 1309, 1124, 1425, 79, 1308, 1310, 1309, 956, 1790, + 111, 1310, 1483, 1399, 1400, 111, 1760, 1310, 90, 1066, + 1067, 1068, 1555, 858, 1125, 1125, 462, 123, 690, 1310, + 696, 1600, 123, 804, 1758, 1310, 1401, 1246, 483, 722, + 1764, 723, 1247, 104, 307, 666, 1426, 790, 1311, 1359, + 883, 957, 311, 1502, 885, 1594, 958, 879, 815, 633, + 457, 1168, 634, 667, 1098, 451, 149, 452, 307, 484, + 1361, 149, 485, 724, 1170, 459, 311, 635, 1169, 1308, + 1011, 1309, 416, 1358, 688, 689, 839, 686, 1307, 415, + 1793, 1171, 839, 1026, 1359, 1225, 852, 1228, 307, 307, + 725, 1305, 1306, 636, 1360, 1175, 311, 311, 1308, 1310, + 1309, 470, 744, 744, 1197, 1361, 1342, 1175, 629, 1053, + 1054, 1147, 630, 1147, 1717, 9, 10, 631, 1720, 710, + 453, 1198, 673, 666, 471, 454, 421, 422, 1310, 423, + 424, 674, 111, 711, 481, 632, 425, 1291, 669, 1292, + 1732, 667, 1733, 1662, 1147, 426, 427, 307, 1191, 123, + 1663, 736, 726, 611, 475, 311, 737, 629, 476, 1192, + 1664, 630, 1468, 428, 668, 440, 631, 670, 429, 612, + 1507, 884, 455, 1748, 307, 1147, 666, 869, 1660, 1661, + 671, 1172, 311, 482, 632, 1307, 1246, 1418, 149, 529, + 1147, 1247, 1147, 1276, 667, 1487, 1657, 768, 1766, 1687, + 430, 431, 432, 768, 1774, 1308, 1482, 1309, 1488, 1490, + 1248, 1487, 1487, 1350, 962, 672, 1193, 1730, 530, 1784, + 928, 1787, 1491, 928, 1632, 1796, 928, 1194, 992, 1011, + 532, 957, 996, 997, 633, 1310, 958, 634, 1217, 111, + 1740, 1183, 1184, 1246, 1186, 1187, 1188, 1218, 1247, 433, + 1189, 1249, 818, 1527, 1528, 1016, 123, 1022, 445, 449, + 1526, 446, 450, 468, 1125, 569, 469, 473, 569, 1466, + 474, 691, 1036, 1125, 694, 907, 908, 1635, 636, 728, + 729, 730, 533, 633, 1125, 544, 634, 1728, 1729, 690, + 545, 696, 1323, 546, 1324, 149, 916, 917, 914, 915, + 1687, 1522, 1430, 1431, 1674, 1675, 565, 566, 573, 434, + 574, 575, 577, 1069, 580, 593, 594, 584, 1369, 595, + 597, 596, 598, 604, 608, 645, 628, 636, 943, 944, + 945, 946, 947, 948, 949, 950, 951, 952, 640, 646, + 664, 307, 665, 677, 678, 679, 1687, 680, 684, 311, + 435, 698, 527, 690, 699, 744, 700, 701, 702, 1772, + 706, 718, 1287, 720, 721, 731, 735, 745, 759, 760, + 1612, 762, 768, 771, 779, 780, 436, 781, 792, 798, + 799, 1112, 805, 809, 437, 446, 450, 1343, 469, 807, + 474, 485, 438, 440, 812, 1344, 820, 307, 307, 307, + 827, 829, 816, 830, 840, 311, 311, 311, 647, 848, + 813, 1156, 1156, 1160, 1160, 814, 648, 649, 1814, 650, + 1815, 853, 849, 870, 859, 888, 854, 651, 889, 905, + 1823, 652, 918, 653, 1653, 890, 891, 919, 654, 920, + 921, 932, 938, 939, 941, 963, 964, 967, 968, 1156, + 1125, 990, 993, 599, 989, 655, 991, 995, 998, 999, + 1001, 1000, 1008, 1190, 1023, 1002, 1030, 1029, 1040, 1033, + 1041, 1042, 1048, 1052, 1043, 1051, 445, 528, 449, 656, + 657, 658, 659, 660, 661, 468, 473, 484, 1220, 1088, + 1618, 528, 1090, 1091, 1092, 1095, 1096, 1227, 1106, 1227, + 1103, 758, 1117, 1156, 958, 1010, 1195, 1113, 1176, 1196, + 1221, 1222, 1232, 1224, 307, 528, 1156, 1216, 1234, 764, + 1258, 1261, 311, 1245, 1238, 1259, 1260, 528, 416, 528, + 1265, 892, 1266, 1271, 1275, 415, 1272, 1276, 1264, 1439, + 1282, 1290, 1288, 1297, 1294, 1301, 1295, 1289, 1317, 796, + 307, 796, 1335, 1345, 724, 1366, 1368, 1373, 311, 1392, + 1393, 307, 1396, 1404, 1405, 1407, 1408, 1416, 1409, 311, + 1410, 11, 1423, 1411, 1428, 416, 1437, 1422, 1440, 1441, + 307, 1433, 415, 1438, 1443, 839, 1473, 1442, 311, 1450, + 1444, 1452, 1456, 1458, 416, 1464, 1459, 1460, 1469, 1472, + 307, 415, 1434, 1493, 1499, 1494, 1487, 1504, 311, 1514, + 1367, 1495, 1496, 1501, 744, 1510, 1515, 1509, 1698, 1511, + 1348, 1505, 1519, 1512, 1518, 1520, 1521, 1513, 1359, 1702, + 1618, 1156, 1704, 1558, 1539, 1565, 1559, 1563, 1343, 1712, + 1571, 1572, 1573, 1574, 1578, 1575, 1344, 1576, 1577, 1542, + 1584, 1589, 857, 1591, 1597, 1552, 1595, 1609, 1602, 1610, + 1611, 1668, 1615, 1643, 1614, 1655, 1670, 1587, 1620, 1679, + 1593, 1623, 1631, 1630, 1636, 1197, 1656, 1695, 1697, 1692, + 1671, 1684, 1703, 1707, 1711, 1734, 1719, 1533, 1735, 1737, + 1738, 1742, 1747, 1743, 1736, 1749, 1751, 1765, 1750, 1767, + 1783, 1768, 1780, 1788, 1789, 1800, 1803, 1792, 1669, 1781, + 1805, 1804, 1795, 1813, 1820, 1816, 1647, 1648, 1649, 1691, + 1704, 1819, 613, 758, 965, 1421, 1806, 1448, 1178, 609, + 610, 1817, 705, 1257, 1745, 1778, 1798, 741, 1436, 1776, + 1807, 1254, 1462, 1038, 1607, 1810, 1102, 1812, 1463, 1537, + 1529, 1156, 528, 761, 1357, 528, 1822, 806, 1474, 1785, + 1532, 1478, 1484, 1492, 896, 790, 895, 906, 1161, 934, + 1503, 307, 1070, 1794, 1791, 1156, 1229, 1466, 750, 311, + 1420, 1524, 1517, 1667, 1523, 1557, 683, 1553, 751, 1371, + 1666, 1395, 1801, 1556, 1202, 1429, 1586, 1676, 0, 1554, + 0, 844, 0, 0, 1506, 0, 0, 0, 0, 0, + 0, 0, 1343, 1801, 0, 0, 0, 0, 0, 0, + 1344, 0, 1785, 0, 0, 0, 0, 0, 852, 714, + 528, 0, 0, 528, 0, 0, 0, 528, 527, 0, + 528, 528, 527, 0, 0, 0, 0, 1725, 528, 0, + 0, 0, 0, 0, 528, 528, 0, 0, 0, 528, + 0, 0, 0, 0, 0, 1731, 0, 528, 0, 0, + 0, 0, 0, 528, 528, 528, 528, 0, 0, 0, + 0, 528, 0, 0, 0, 0, 0, 0, 0, 528, + 0, 0, 0, 0, 0, 0, 0, 1156, 0, 1343, + 0, 0, 0, 0, 0, 0, 0, 1344, 0, 0, + 1343, 1343, 0, 307, 0, 0, 0, 0, 1344, 1344, + 1343, 311, 0, 0, 0, 0, 1592, 0, 1344, 0, + 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, 0, - 528, 0, 307, 0, 0, 0, 0, 0, 528, 0, - 311, 528, 0, 0, 0, 528, 0, 0, 0, 0, - 0, 0, 0, 1102, 0, 0, 0, 0, 1102, 0, - 0, 1103, 0, 0, 0, 0, 1103, 0, 0, 0, + 0, 0, 1605, 1606, 0, 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 528, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1622, 0, + 1156, 0, 0, 1156, 0, 0, 0, 0, 0, 0, + 0, 550, 0, 0, 0, 1634, 0, 528, 0, 0, + 1638, 1343, 0, 0, 0, 0, 0, 0, 0, 1344, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1707, 0, 1709, 0, 1711, 0, 0, 0, 0, 0, - 0, 1719, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 307, 0, 0, 0, 0, 0, 0, 0, 311, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1343, 0, + 0, 0, 0, 0, 0, 0, 1344, 0, 0, 0, + 0, 0, 0, 307, 0, 0, 0, 0, 0, 0, + 0, 311, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1343, 0, 0, 0, 0, 0, + 0, 0, 1344, 1343, 0, 0, 0, 0, 0, 0, + 0, 1344, 0, 0, 0, 0, 0, 1706, 0, 1708, + 0, 1710, 942, 0, 0, 528, 0, 0, 1718, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, + 0, 0, 0, 528, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 528, 0, 0, 1161, 0, 1161, 0, + 0, 0, 0, 1156, 0, 1156, 528, 0, 528, 0, + 0, 0, 0, 0, 0, 0, 528, 0, 0, 528, + 0, 1741, 0, 528, 1744, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1156, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1752, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1741, 0, 0, 1744, 0, 0, - 0, 0, 0, 528, 528, 528, 528, 0, 0, 1161, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1752, + 0, 0, 0, 0, 528, 0, 0, 1156, 0, 0, + 0, 0, 0, 0, 0, 1779, 0, 0, 0, 0, + 1782, 0, 1156, 0, 1156, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1161, - 0, 528, 0, 0, 0, 0, 0, 1778, 0, 0, - 0, 0, 1781, 0, 1161, 528, 1161, 0, 0, 0, + 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1799, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 528, 1808, 0, 0, 0, 0, 1809, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 0, 0, 1798, 0, 0, 0, 0, 528, - 0, 528, 0, 528, 0, 528, 0, 0, 0, 0, - 1804, 0, 0, 0, 1807, 0, 0, 0, 528, 0, + 1818, 0, 0, 1821, 0, 0, 0, 0, 0, 0, + 0, 0, 528, 528, 528, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1816, 0, 0, 1819, 0, 550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 528, 0, 528, 0, 0, 0, 0, 0, 0, - 832, 833, 0, 0, 842, 843, 844, 846, 0, 848, - 0, 0, 0, 0, 0, 856, 0, 0, 0, 0, - 0, 0, 0, 865, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 885, 886, 887, 0, 0, - 0, 0, 0, 0, 0, 893, 894, 528, 0, 0, + 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 528, 0, + 528, 0, 528, 0, 528, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 528, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 550, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 528, 0, 528, 0, 831, 832, 0, 0, 841, 842, + 843, 845, 0, 847, 0, 0, 0, 0, 0, 855, + 0, 0, 0, 0, 0, 0, 0, 864, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 930, 0, 0, 930, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 994, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, - 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 528, 0, - 0, 0, 0, 0, 0, 0, 0, 528, 0, 0, - 1037, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 886, + 887, 0, 0, 0, 0, 0, 0, 0, 893, 894, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 528, 0, 0, 0, 1062, 0, 0, 0, 1064, - 1065, 0, 0, 0, 0, 0, 0, 0, 893, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, - 0, 0, 0, 528, 0, 0, 528, 0, 0, 0, + 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 930, + 0, 0, 930, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 994, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 528, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 0, 0, 0, 0, 0, 1183, 0, 0, + 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, + 0, 0, 528, 1037, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 528, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 528, 0, 1062, 0, + 0, 0, 1064, 1065, 0, 0, 0, 0, 0, 0, + 0, 893, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 528, 528, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, + 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 887, 0, 0, + 0, 0, 0, 1114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1223, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 528, 0, 528, 0, 0, 528, 0, 0, - 0, 1239, 0, 0, 0, 0, 0, 0, 0, 528, - 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, - 0, 0, 0, 1272, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1277, 1278, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1297, - 0, 0, 1300, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1324, 1325, - 1326, 0, 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, - 1337, 0, 0, 1340, 1341, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1353, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1119, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 528, 0, 528, 0, 0, 0, 0, 0, - 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1419, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 528, 0, 528, 0, + 0, 0, 0, 0, 0, 0, 0, 528, 0, 0, + 0, 1179, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 528, 0, 0, 528, 0, 0, + 0, 0, 0, 528, 528, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 528, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1451, - 0, 1453, 0, 1455, 0, 0, 1459, 0, 0, 528, - 0, 1463, 0, 0, 0, 0, 0, 528, 0, 0, - 0, 0, 528, 1469, 528, 0, 528, 0, 0, 0, - 0, 0, 1473, 0, 0, 0, 0, 0, 1477, 1478, + 0, 528, 0, 0, 528, 1235, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 528, 0, 0, 0, + 0, 528, 0, 0, 0, 0, 0, 1268, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1273, 1274, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 528, 0, 0, 1499, 0, 0, - 1500, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 0, 0, 528, 0, 0, 0, 0, 0, + 0, 0, 0, 1293, 0, 0, 1296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 528, 0, 0, 528, 0, 0, 0, 0, 0, 0, + 0, 0, 1320, 1321, 1322, 0, 1325, 1326, 1327, 1328, + 1329, 1330, 1331, 1332, 1333, 0, 0, 1336, 1337, 0, + 0, 0, 0, 0, 0, 0, 1351, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1119, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 528, 0, + 528, 0, 528, 0, 0, 0, 0, 0, 0, 528, + 0, 0, 0, 0, 0, 0, 0, 1417, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 528, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 528, 0, 0, 528, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 528, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 528, 0, 1449, + 0, 1451, 0, 1453, 0, 0, 1457, 0, 0, 0, + 0, 1461, 0, 0, 0, 0, 0, 0, 528, 0, + 0, 0, 0, 1467, 0, 0, 528, 0, 0, 0, + 0, 528, 1471, 528, 0, 528, 0, 0, 1475, 1476, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1497, 0, 0, + 1498, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 528, 0, 0, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 528, 0, 0, 528, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1597, 0, 0, - 0, 1599, 0, 0, 0, 1602, 0, 1604, 0, 1605, - 0, 0, 0, 0, 0, 1609, 0, 0, 0, 0, - 0, 0, 0, 1614, 0, 0, 0, 0, 0, 0, - 0, 1618, 1620, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1114, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1469, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1640, 1641, 1642, 1643, 0, 1645, 1646, 0, 1647, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1655, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1694, 0, 1695, - 0, 0, 1697, 0, 0, 0, 0, 0, 0, 0, - 1700, 0, 0, 0, 0, 1702, 1620, 0, 0, 0, - 0, 0, 0, 1706, 0, 0, 0, 1710, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 1596, + 0, 0, 0, 1598, 0, 0, 0, 1601, 0, 1603, + 0, 1604, 0, 0, 0, 0, 0, 1608, 0, 0, + 0, 0, 0, 0, 0, 1613, 0, 0, 0, 0, + 0, 0, 0, 1617, 1619, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1722, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1727, 0, 0, 0, 0, + 0, 0, 1467, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1639, 1640, 1641, 1642, 0, 1644, 1645, + 0, 1646, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1654, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1746, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1706, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1785, + 1693, 0, 1694, 0, 0, 1696, 0, 0, 0, 0, + 0, 0, 0, 1699, 0, 0, 0, 0, 1701, 1619, + 0, 0, 0, 0, 0, 0, 1705, 0, 0, 0, + 1709, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1721, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1727, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1796, 0, 0, 0, - 0, 1801, 0, 0, 0, 0, 1785, 0, 0, 871, - 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, - 0, 1801, 0, 0, 0, 1810, 3, 4, 5, 6, - 7, 8, 0, 0, 0, 11, 0, 0, 0, 410, - 411, 0, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 552, 412, 28, 29, 30, 31, - 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 0, 45, 46, 47, 553, 554, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 68, 0, - 69, 70, 71, 72, 73, 0, 74, 75, 76, 0, - 0, 77, 78, 0, 0, 0, 79, 80, 503, 82, - 83, 84, 85, 86, 555, 88, 89, 0, 0, 0, - 90, 0, 91, 92, 93, 94, 0, 95, 0, 0, - 0, 96, 97, 98, 99, 100, 0, 0, 0, 0, - 0, 0, 101, 102, 103, 104, 105, 106, 107, 556, - 109, 0, 110, 111, 112, 113, 114, 0, 0, 0, - 0, 115, 116, 117, 118, 119, 120, 121, 122, 0, - 123, 0, 124, 125, 0, 0, 126, 127, 128, 0, - 0, 0, 129, 0, 130, 131, 0, 132, 133, 0, - 134, 0, 135, 0, 136, 137, 138, 139, 140, 141, - 142, 143, 144, 145, 146, 0, 0, 147, 148, 149, - 0, 413, 151, 152, 153, 154, 155, 156, 157, 158, - 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 520, 521, 522, 176, 177, 523, - 558, 180, 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 192, 0, 193, 194, 195, 0, 196, - 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 0, 244, 0, - 245, 246, 247, 248, 249, 250, 251, -850, 451, 0, - 452, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1746, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -850, - 0, 0, 0, -850, 0, 0, 0, -850, -850, 0, - 0, 0, -850, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 453, 0, 0, -850, 0, 454, 0, + 1705, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -850, - 0, -850, -850, -850, 0, 0, -850, -850, -850, -850, - 0, 0, 0, -850, -850, 0, 0, 0, 0, 0, - -850, 0, 0, -850, -850, 455, 0, 0, -850, 0, - 0, 0, 0, -850, -850, 0, 0, 0, 0, -850, - 0, 0, 0, -850, 0, 0, 0, -850, -850, 0, - -850, 0, -850, -850, 0, 0, 0, -850, -850, 0, - 0, -850, -850, -850, -850, -850, -850, 0, 0, -850, - 0, 0, 0, 0, -850, -850, 0, 0, -850, 0, - 0, 0, 0, -850, 0, 0, -850, 0, 0, 0, - 0, -850, -850, -850, -850, -850, 0, -850, -850, -850, - -850, -850, 0, 0, 0, 0, -850, -850, -850, 0, - -850, -850, -850, -850, -850, -850, 0, -850, 0, -850, - 0, 0, 0, 0, -850, -850, -850, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -850, 0, -850, 0, -850, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -850, 0, 0, 0, - 0, -850, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1786, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, - 2, 0, 0, 0, 0, 0, 0, 0, 3, 4, - 5, 6, 7, 8, 9, 10, 0, 11, -850, 0, - -850, 12, 13, 0, 14, 15, 16, 17, 18, 19, + 0, 0, 0, 0, 0, 0, 0, 0, -165, 874, + 0, 1797, 0, 0, 0, 0, 1802, 0, 0, 1, + 2, 1786, 0, 0, 0, 0, 0, 0, 3, 4, + 5, 6, 7, 8, 9, 10, 1802, 11, 0, 0, + 1811, 12, 411, 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, 45, 46, 47, @@ -13269,7 +13349,7 @@ 128, 0, 0, 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, 0, 147, - 148, 149, 0, 150, 151, 152, 153, 154, 155, 156, + 148, 149, 0, 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, @@ -13279,969 +13359,884 @@ 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 0, - 244, 0, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 1, 2, 0, 0, 0, 0, 0, 0, 0, - 3, 4, 5, 6, 7, 8, 9, 10, 0, 11, - 0, 0, 0, 12, 13, 0, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 0, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 0, 45, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 0, 69, 70, 71, 72, 73, 0, - 74, 75, 76, 0, 0, 77, 78, 0, 0, 0, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 0, 0, 0, 90, 0, 91, 92, 93, 94, - 0, 95, 0, 0, 0, 96, 97, 98, 99, 100, - 0, 0, 0, 0, 0, 0, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 0, 110, 111, 112, 113, - 114, 0, 0, 0, 0, 115, 116, 117, 118, 119, - 120, 121, 122, 0, 123, 0, 124, 125, 0, 0, - 126, 127, 128, 0, 0, 0, 129, 0, 130, 131, - 0, 132, 133, 0, 134, 0, 135, 0, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 147, 148, 149, 0, 150, 151, 152, 153, 154, - 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, - 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, - 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 0, 244, 0, 245, 246, 247, 248, 249, 250, - 251, 0, 605, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 547, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 809, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 1098, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 1099, 1100, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 809, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 1101, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 1098, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 1099, 1100, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 547, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 1101, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 12, 13, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 150, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 12, 13, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 12, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 878, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 9, 10, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 1098, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 1099, 1100, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 108, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 173, 174, 175, 176, 177, 178, 1101, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 557, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 562, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 600, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 602, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 923, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 929, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 933, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 489, 25, - 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 494, - 0, 45, 46, 47, 496, 497, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 682, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 683, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 515, 160, 516, 162, - 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, - 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 525, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 552, 412, 28, 29, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 0, 45, 46, 47, 553, 554, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 96, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, - 520, 521, 522, 176, 177, 523, 558, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 246, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 489, 25, - 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 494, - 0, 45, 46, 47, 496, 497, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 112, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 124, 125, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 515, 160, 516, 162, - 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, - 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 525, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 489, 25, - 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 494, - 0, 45, 46, 47, 496, 497, 50, 498, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 0, 0, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 132, 133, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 515, 160, 516, 162, - 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, - 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 525, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 489, 25, - 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 494, - 0, 45, 46, 47, 496, 497, 50, 498, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 105, 106, 107, 556, 109, 0, 110, 111, - 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 0, 0, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 0, 0, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 515, 160, 516, 162, - 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, - 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 525, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 4, 5, 6, 7, 8, 0, 0, - 0, 11, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 489, 25, - 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 494, - 0, 45, 46, 47, 496, 497, 50, 498, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, 68, 0, 69, 70, 71, 72, - 73, 0, 74, 75, 76, 0, 0, 77, 78, 0, - 0, 0, 79, 80, 503, 82, 83, 84, 85, 86, - 555, 88, 89, 0, 0, 0, 90, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 506, 0, 98, - 99, 100, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 104, 0, 106, 107, 556, 109, 0, 110, 111, - 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 119, 120, 121, 122, 0, 123, 0, 0, 0, - 0, 0, 126, 127, 128, 0, 0, 0, 129, 0, - 130, 131, 0, 0, 0, 0, 134, 0, 135, 0, - 136, 0, 138, 0, 140, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 149, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 515, 160, 516, 162, - 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, - 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 0, 244, 0, 245, 525, 247, 248, - 249, 250, 251, 1, 2, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, 7, 8, 0, 0, - 0, 0, 0, 0, 0, 410, 411, 0, 14, 15, - 16, 486, 18, 19, 20, 487, 22, 488, 489, 490, - 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, - 35, 493, 37, 38, 39, 40, 41, 42, 43, 494, - 0, 45, 495, 47, 496, 497, 50, 498, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 499, 500, 68, 0, 69, 70, 71, 501, - 0, 0, 74, 75, 76, 0, 0, 502, 78, 0, - 0, 0, 0, 80, 503, 82, 504, 505, 85, 86, - 0, 0, 0, 0, 0, 0, 0, 0, 91, 92, - 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, - 507, 508, 0, 0, 0, 0, 0, 0, 101, 102, - 103, 0, 105, 106, 107, 0, 0, 0, 0, 0, - 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, - 118, 509, 120, 121, 510, 0, 0, 0, 0, 0, - 0, 0, 511, 512, 128, 0, 0, 0, 129, 0, - 130, 513, 0, 0, 0, 0, 134, 0, 135, 0, - 136, 137, 138, 139, 514, 141, 142, 143, 144, 145, - 146, 0, 0, 147, 148, 0, 0, 413, 151, 152, - 153, 154, 155, 156, 157, 158, 515, 160, 516, 162, - 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, - 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, - 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, - 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, - 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 0, 0, 1, 2, 245, 525, 247, 248, - 249, 250, 251, 3, 0, 0, 0, 7, 8, 0, - 0, 0, 0, 0, 0, 0, 410, 411, 0, 14, - 15, 16, 534, 18, 19, 20, 487, 535, 536, 489, - 490, 491, 412, 28, 492, 30, 31, 0, 32, 33, - 34, 35, 537, 37, 538, 539, 40, 41, 42, 43, - 494, 0, 45, 540, 47, 496, 497, 50, 498, 52, + 244, 0, 245, 246, 247, 248, 249, 250, 251, -165, + 874, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, + 4, 5, 6, 7, 8, 9, 10, 0, 11, 0, + 0, 0, 878, 411, 0, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 412, 28, + 29, 30, 31, 0, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 0, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 0, 69, 70, 71, 72, 73, 0, 74, + 75, 76, 0, 0, 77, 78, 0, 0, 0, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 0, 0, 0, 90, 0, 91, 92, 93, 94, 0, + 95, 0, 0, 0, 96, 97, 98, 99, 100, 0, + 0, 0, 0, 0, 0, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 0, 110, 111, 112, 113, 114, + 0, 0, 0, 0, 115, 116, 117, 118, 119, 120, + 121, 122, 0, 123, 0, 124, 125, 0, 0, 126, + 127, 128, 0, 0, 0, 129, 0, 130, 131, 0, + 132, 133, 0, 134, 0, 135, 0, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 0, 0, + 147, 148, 149, 0, 413, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 0, 193, 194, + 195, 0, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 874, 244, 0, 245, 246, 247, 248, 249, 250, 251, + 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, + 4, 5, 6, 7, 8, 9, 10, 0, 11, 0, + 0, 0, 410, 411, 0, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 412, 28, + 29, 30, 31, 0, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 0, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 0, 69, 70, 71, 72, 73, 0, 74, + 75, 76, 0, 0, 77, 78, 0, 0, 0, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 0, 0, 0, 90, 0, 91, 92, 93, 94, 0, + 95, 0, 0, 0, 96, 97, 98, 99, 100, 0, + 0, 0, 0, 0, 0, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 0, 110, 111, 112, 113, 114, + 0, 0, 0, 0, 115, 116, 117, 118, 119, 120, + 121, 122, 0, 123, 0, 124, 125, 0, 0, 126, + 127, 128, 0, 0, 0, 129, 0, 130, 131, 0, + 132, 133, 0, 134, 0, 135, 0, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 0, 0, + 147, 148, 149, 0, 413, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 0, 193, 194, + 195, 0, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 874, 244, 0, 245, 246, 247, 248, 249, 250, 251, + 1, 2, 0, 0, 0, 0, 0, 0, 0, 3, + 4, 5, 6, 7, 8, 0, 0, 0, 11, 0, + 0, 0, 410, 411, 0, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 552, 412, 28, + 29, 30, 31, 0, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 0, 45, 46, + 47, 553, 554, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 0, 69, 70, 71, 72, 73, 0, 74, + 75, 76, 0, 0, 77, 78, 0, 0, 0, 79, + 80, 503, 82, 83, 84, 85, 86, 555, 88, 89, + 0, 0, 0, 90, 0, 91, 92, 93, 94, 0, + 95, 0, 0, 0, 96, 97, 98, 99, 100, 0, + 0, 0, 0, 0, 0, 101, 102, 103, 104, 105, + 106, 107, 556, 109, 0, 110, 111, 112, 113, 114, + 0, 0, 0, 0, 115, 116, 117, 118, 119, 120, + 121, 122, 0, 123, 0, 124, 125, 0, 0, 126, + 127, 128, 0, 0, 0, 129, 0, 130, 131, 0, + 132, 133, 0, 134, 0, 135, 0, 136, 137, 138, + 139, 140, 141, 142, 143, 144, 145, 146, 0, 0, + 147, 148, 149, 0, 413, 151, 152, 153, 154, 155, + 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 172, 520, 521, 522, + 176, 177, 523, 558, 180, 181, 182, 183, 184, 185, + 186, 187, 188, 189, 190, 191, 192, 0, 193, 194, + 195, 0, 196, 197, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 0, 244, 0, 245, 246, 247, 248, 249, 250, 251, + -853, 451, 0, 452, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -853, 0, 0, 0, -853, 0, 0, 0, + -853, -853, 0, 0, 0, -853, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 453, 0, 0, -853, + 0, 454, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, -853, 0, -853, -853, -853, 0, 0, -853, + -853, -853, -853, 0, 0, 0, -853, -853, 0, 0, + 0, 0, 0, -853, 0, 0, -853, -853, 455, 0, + 0, -853, 0, 0, 0, 0, -853, -853, 0, 0, + 0, 0, -853, 0, 0, 0, -853, 0, 0, 0, + -853, -853, 0, -853, 0, -853, -853, 0, 0, 0, + -853, -853, 0, 0, -853, -853, -853, -853, -853, -853, + 0, 0, -853, 0, 0, 0, 0, -853, -853, 0, + 0, -853, 0, 0, 0, 0, -853, 0, 0, -853, + 0, 0, 0, 0, -853, -853, -853, -853, -853, 0, + -853, -853, -853, -853, -853, 0, 0, 0, 0, -853, + -853, -853, 0, -853, -853, -853, -853, -853, -853, 0, + -853, 0, -853, 0, 0, 0, 0, -853, -853, -853, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, -853, 0, -853, 0, -853, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, -853, + 0, 0, 0, 0, -853, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 2, 0, 0, 0, 0, 0, 0, + 0, 3, 4, 5, 6, 7, 8, 9, 10, 0, + 11, -853, 0, -853, 12, 13, 0, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 0, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 0, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 0, 69, 70, 71, 72, 73, + 0, 74, 75, 76, 0, 0, 77, 78, 0, 0, + 0, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 0, 0, 0, 90, 0, 91, 92, 93, + 94, 0, 95, 0, 0, 0, 96, 97, 98, 99, + 100, 0, 0, 0, 0, 0, 0, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 0, 110, 111, 112, + 113, 114, 0, 0, 0, 0, 115, 116, 117, 118, + 119, 120, 121, 122, 0, 123, 0, 124, 125, 0, + 0, 126, 127, 128, 0, 0, 0, 129, 0, 130, + 131, 0, 132, 133, 0, 134, 0, 135, 0, 136, + 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, + 0, 0, 147, 148, 149, 0, 150, 151, 152, 153, + 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, + 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 0, + 193, 194, 195, 0, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 0, 244, 0, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 1, 2, 0, 0, 0, 0, + 0, 0, 0, 3, 4, 5, 6, 7, 8, 9, + 10, 0, 11, 0, 0, 0, 12, 13, 0, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 0, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 0, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 499, 500, 68, 0, 69, 70, 71, - 541, 0, 0, 74, 75, 76, 0, 0, 502, 78, - 0, 0, 0, 0, 80, 503, 82, 504, 505, 85, - 86, 0, 0, 0, 0, 0, 0, 0, 0, 91, - 92, 93, 94, 0, 95, 0, 0, 0, 506, 97, - 98, 507, 508, 0, 0, 0, 0, 0, 0, 101, - 102, 103, 0, 105, 106, 107, 0, 0, 0, 0, - 0, 0, 113, 114, 0, 0, 0, 0, 115, 116, - 117, 118, 509, 120, 121, 510, 0, 0, 0, 0, - 0, 0, 0, 511, 512, 128, 0, 0, 0, 129, - 0, 130, 513, 0, 0, 0, 0, 134, 0, 135, - 0, 136, 137, 138, 139, 514, 141, 142, 143, 144, - 145, 146, 0, 0, 147, 148, 0, 0, 413, 151, - 152, 153, 154, 155, 156, 157, 158, 515, 542, 516, - 162, 517, 518, 165, 166, 167, 168, 169, 170, 519, - 172, 520, 521, 522, 176, 177, 523, 524, 180, 181, + 63, 64, 65, 66, 67, 68, 0, 69, 70, 71, + 72, 73, 0, 74, 75, 76, 0, 0, 77, 78, + 0, 0, 0, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 0, 0, 0, 90, 0, 91, + 92, 93, 94, 0, 95, 0, 0, 0, 96, 97, + 98, 99, 100, 0, 0, 0, 0, 0, 0, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 0, 110, + 111, 112, 113, 114, 0, 0, 0, 0, 115, 116, + 117, 118, 119, 120, 121, 122, 0, 123, 0, 124, + 125, 0, 0, 126, 127, 128, 0, 0, 0, 129, + 0, 130, 131, 0, 132, 133, 0, 134, 0, 135, + 0, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 0, 0, 147, 148, 149, 0, 150, 151, + 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, + 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, + 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 0, 0, 0, 567, 245, 525, 247, - 248, 249, 250, 251, 7, 8, 0, 0, 0, 784, - 0, 0, 0, 410, 411, 0, 14, 15, 16, 534, - 18, 19, 20, 487, 535, 536, 489, 490, 491, 412, - 28, 492, 30, 31, 0, 32, 33, 34, 35, 537, - 37, 538, 539, 40, 41, 42, 43, 494, 0, 45, - 540, 47, 496, 497, 50, 498, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 499, 500, 68, 0, 69, 70, 71, 541, 0, 0, - 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, - 0, 80, 503, 82, 504, 505, 85, 86, 0, 0, - 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, - 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, - 0, 0, 0, 0, 0, 0, 101, 102, 103, 0, - 105, 106, 107, 0, 0, 0, 0, 0, 0, 113, - 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, - 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, - 511, 512, 128, 0, 0, 0, 129, 785, 130, 513, - 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, - 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, - 0, 147, 148, 0, 0, 413, 151, 152, 153, 154, - 155, 156, 157, 158, 515, 542, 516, 162, 517, 518, - 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, - 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, - 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 0, 0, 0, 567, 245, 525, 247, 248, 249, 250, - 251, 7, 8, 0, 0, 0, 0, 0, 0, 0, - 410, 411, 0, 14, 15, 16, 534, 18, 19, 20, - 487, 535, 536, 489, 490, 491, 412, 28, 492, 30, - 31, 0, 32, 33, 34, 35, 537, 37, 538, 539, - 40, 41, 42, 43, 494, 0, 45, 540, 47, 496, - 497, 50, 498, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 499, 500, 68, - 0, 69, 70, 71, 541, 0, 0, 74, 75, 76, - 0, 0, 502, 78, 0, 0, 0, 0, 80, 503, - 82, 504, 505, 85, 86, 0, 0, 0, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 0, 95, 0, - 0, 0, 506, 97, 98, 507, 508, 0, 0, 0, - 0, 0, 0, 101, 102, 103, 0, 105, 106, 107, - 0, 0, 0, 0, 0, 0, 113, 114, 0, 0, - 0, 0, 115, 116, 117, 118, 509, 120, 121, 510, - 0, 0, 0, 0, 0, 0, 0, 511, 512, 128, - 0, 0, 0, 129, 0, 130, 513, 0, 0, 0, - 0, 0, 0, 135, 0, 136, 137, 138, 139, 514, - 141, 142, 143, 144, 145, 146, 0, 0, 147, 148, - 0, 0, 413, 151, 152, 153, 154, 155, 156, 157, - 158, 515, 542, 516, 162, 517, 518, 165, 166, 167, - 168, 169, 170, 519, 172, 520, 521, 522, 176, 177, - 523, 524, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 0, 193, 194, 195, 0, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 0, 0, 0, - 0, 245, 525, 247, 248, 249, 250, 251, 570, 571, - 0, 0, 0, 0, 7, 8, 0, 0, 0, 0, - 0, 0, 0, 410, 411, 0, 14, 15, 16, 534, - 18, 19, 20, 487, 535, 536, 489, 490, 491, 412, - 28, 492, 30, 31, 0, 32, 33, 34, 35, 537, - 37, 538, 539, 40, 41, 42, 43, 494, 0, 45, - 540, 47, 496, 497, 50, 498, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 499, 500, 68, 0, 69, 70, 71, 541, 0, 0, - 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, - 0, 80, 503, 82, 504, 505, 85, 86, 0, 0, - 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, - 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, - 0, 0, 0, 0, 0, 0, 101, 102, 103, 0, - 105, 106, 107, 0, 0, 0, 0, 0, 0, 113, - 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, - 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, - 511, 512, 128, 0, 0, 0, 129, 0, 130, 513, - 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, - 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, - 0, 147, 148, 0, 0, 413, 151, 152, 153, 154, - 155, 156, 157, 158, 515, 542, 516, 162, 517, 518, - 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, - 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, - 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 0, 0, 0, 0, 245, 525, 247, 248, 249, 250, - 251, 4, 5, 6, 7, 8, 0, 0, 0, 11, - 0, 0, 0, 410, 411, 0, 14, 15, 16, 834, - 18, 19, 20, 21, 535, 835, 489, 25, 491, 412, - 28, 492, 30, 31, 0, 32, 33, 34, 35, 836, - 37, 538, 539, 40, 41, 42, 43, 494, 0, 45, - 837, 47, 496, 497, 50, 498, 52, 53, 54, 55, - 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 499, 500, 68, 0, 69, 70, 71, 838, 0, 0, - 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, - 79, 80, 503, 82, 504, 505, 85, 86, 555, 88, - 0, 0, 0, 0, 90, 0, 91, 92, 93, 94, - 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, - 0, 0, 0, 0, 0, 0, 101, 102, 103, 104, - 105, 106, 107, 556, 109, 0, 110, 111, 0, 113, - 114, 0, 0, 0, 0, 115, 116, 117, 118, 119, - 120, 121, 510, 0, 123, 0, 0, 0, 0, 0, - 511, 512, 128, 0, 0, 0, 129, 0, 130, 513, - 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, - 138, 139, 140, 141, 142, 143, 144, 145, 146, 0, - 0, 147, 148, 149, 0, 413, 151, 152, 153, 154, - 155, 156, 157, 158, 515, 542, 516, 162, 517, 518, - 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, - 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, - 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, - 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 0, 244, 0, 245, 525, 247, 248, 249, 250, - 251, 7, 8, 0, 0, 0, 0, 0, 0, 0, - 410, 411, 0, 14, 15, 16, 486, 18, 19, 20, - 487, 22, 488, 489, 1141, 491, 412, 28, 492, 30, - 31, 0, 32, 33, 34, 35, 493, 37, 38, 39, - 40, 41, 42, 43, 494, 0, 45, 495, 47, 496, - 497, 50, 498, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 499, 500, 68, - 0, 69, 70, 71, 501, 0, 0, 74, 75, 76, - 0, 0, 502, 78, 0, 0, 0, 0, 80, 503, - 82, 504, 505, 85, 86, 0, 0, 0, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 0, 95, 0, - 0, 0, 506, 97, 98, 507, 508, 0, 0, 0, - 0, 0, 0, 101, 102, 103, 0, 105, 106, 1142, - 0, 0, 0, 1143, 0, 0, 113, 114, 0, 0, - 0, 0, 115, 116, 117, 118, 509, 120, 121, 510, - 0, 0, 0, 0, 0, 0, 0, 511, 512, 128, - 0, 0, 0, 129, 1568, 130, 513, 0, 0, 0, - 0, 1569, 0, 135, 0, 136, 137, 138, 139, 514, - 141, 142, 143, 144, 145, 146, 0, 0, 1144, 148, - 0, 0, 413, 151, 152, 153, 154, 155, 156, 157, - 158, 515, 160, 516, 162, 517, 518, 165, 166, 167, - 168, 169, 170, 519, 172, 520, 521, 522, 176, 177, - 523, 524, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 0, 193, 194, 195, 0, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 0, 0, 7, - 8, 245, 525, 247, 1145, 1146, 1147, 1148, 410, 411, - 0, 14, 15, 16, 534, 18, 19, 20, 487, 535, - 536, 489, 490, 491, 412, 28, 492, 30, 31, 0, - 32, 33, 34, 35, 537, 37, 538, 539, 40, 41, - 42, 43, 494, 0, 45, 540, 47, 496, 497, 50, + 240, 241, 242, 243, 0, 244, 0, 245, 246, 247, + 248, 249, 250, 251, 0, 605, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 547, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 808, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 1338, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 1339, 1340, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 547, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 1341, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 12, 13, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 12, 13, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 12, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 878, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 9, 10, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 1338, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 1339, 1340, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 173, 174, 175, 176, 177, 178, 1341, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 557, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 562, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 600, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 602, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 923, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 929, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 933, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 489, 25, 491, 412, 28, 492, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 494, 0, 45, 46, 47, 496, 497, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 506, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 681, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 682, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, + 160, 516, 162, 517, 518, 165, 166, 167, 168, 169, + 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 525, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 552, 412, 28, 29, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 0, 45, 46, 47, 553, 554, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 96, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 172, 520, 521, 522, 176, 177, 523, 558, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 246, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 489, 25, 491, 412, 28, 492, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 494, 0, 45, 46, 47, 496, 497, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 506, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 112, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 124, 125, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, + 160, 516, 162, 517, 518, 165, 166, 167, 168, 169, + 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 525, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 489, 25, 491, 412, 28, 492, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 494, 0, 45, 46, 47, 496, 497, 50, + 498, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 506, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 0, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 0, 0, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 132, 133, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, + 160, 516, 162, 517, 518, 165, 166, 167, 168, 169, + 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 525, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 489, 25, 491, 412, 28, 492, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 494, 0, 45, 46, 47, 496, 497, 50, + 498, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 506, 97, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 105, 106, 107, 556, 109, + 0, 110, 111, 0, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 0, 0, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 0, 0, 0, 134, + 0, 135, 0, 136, 137, 138, 139, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, + 160, 516, 162, 517, 518, 165, 166, 167, 168, 169, + 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 525, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 4, 5, 6, 7, + 8, 0, 0, 0, 11, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 489, 25, 491, 412, 28, 492, 30, 31, 0, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 494, 0, 45, 46, 47, 496, 497, 50, + 498, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 68, 0, 69, + 70, 71, 72, 73, 0, 74, 75, 76, 0, 0, + 77, 78, 0, 0, 0, 79, 80, 503, 82, 83, + 84, 85, 86, 555, 88, 89, 0, 0, 0, 90, + 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, + 506, 0, 98, 99, 100, 0, 0, 0, 0, 0, + 0, 101, 102, 103, 104, 0, 106, 107, 556, 109, + 0, 110, 111, 0, 113, 114, 0, 0, 0, 0, + 115, 116, 117, 118, 119, 120, 121, 122, 0, 123, + 0, 0, 0, 0, 0, 126, 127, 128, 0, 0, + 0, 129, 0, 130, 131, 0, 0, 0, 0, 134, + 0, 135, 0, 136, 0, 138, 0, 140, 141, 142, + 143, 144, 145, 146, 0, 0, 147, 148, 149, 0, + 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, + 160, 516, 162, 517, 518, 165, 166, 167, 168, 169, + 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 0, 244, 0, 245, + 525, 247, 248, 249, 250, 251, 1, 2, 0, 0, + 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, + 8, 0, 0, 0, 0, 0, 0, 0, 410, 411, + 0, 14, 15, 16, 486, 18, 19, 20, 487, 22, + 488, 489, 490, 491, 412, 28, 492, 30, 31, 0, + 32, 33, 34, 35, 493, 37, 38, 39, 40, 41, + 42, 43, 494, 0, 45, 495, 47, 496, 497, 50, 498, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 499, 500, 68, 0, 69, - 70, 71, 541, 0, 0, 74, 75, 76, 0, 0, + 70, 71, 501, 0, 0, 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, 0, 80, 503, 82, 504, 505, 85, 86, 0, 0, 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, @@ -14250,11 +14245,11 @@ 0, 0, 0, 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, 511, 512, 128, 0, 0, - 0, 129, 754, 130, 513, 0, 0, 0, 0, 755, + 0, 129, 0, 130, 513, 0, 0, 0, 0, 134, 0, 135, 0, 136, 137, 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, 0, 147, 148, 0, 0, 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, - 542, 516, 162, 517, 518, 165, 166, 167, 168, 169, + 160, 516, 162, 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, @@ -14262,8 +14257,39 @@ 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 0, 0, 7, 8, 245, - 525, 247, 248, 249, 250, 251, 410, 411, 0, 14, + 238, 239, 240, 241, 242, 0, 0, 1, 2, 245, + 525, 247, 248, 249, 250, 251, 3, 0, 0, 0, + 7, 8, 0, 0, 0, 0, 0, 0, 0, 410, + 411, 0, 14, 15, 16, 534, 18, 19, 20, 487, + 535, 536, 489, 490, 491, 412, 28, 492, 30, 31, + 0, 32, 33, 34, 35, 537, 37, 538, 539, 40, + 41, 42, 43, 494, 0, 45, 540, 47, 496, 497, + 50, 498, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 499, 500, 68, 0, + 69, 70, 71, 541, 0, 0, 74, 75, 76, 0, + 0, 502, 78, 0, 0, 0, 0, 80, 503, 82, + 504, 505, 85, 86, 0, 0, 0, 0, 0, 0, + 0, 0, 91, 92, 93, 94, 0, 95, 0, 0, + 0, 506, 97, 98, 507, 508, 0, 0, 0, 0, + 0, 0, 101, 102, 103, 0, 105, 106, 107, 0, + 0, 0, 0, 0, 0, 113, 114, 0, 0, 0, + 0, 115, 116, 117, 118, 509, 120, 121, 510, 0, + 0, 0, 0, 0, 0, 0, 511, 512, 128, 0, + 0, 0, 129, 0, 130, 513, 0, 0, 0, 0, + 134, 0, 135, 0, 136, 137, 138, 139, 514, 141, + 142, 143, 144, 145, 146, 0, 0, 147, 148, 0, + 0, 413, 151, 152, 153, 154, 155, 156, 157, 158, + 515, 542, 516, 162, 517, 518, 165, 166, 167, 168, + 169, 170, 519, 172, 520, 521, 522, 176, 177, 523, + 524, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 0, 193, 194, 195, 0, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 0, 0, 0, 567, + 245, 525, 247, 248, 249, 250, 251, 7, 8, 0, + 0, 0, 783, 0, 0, 0, 410, 411, 0, 14, 15, 16, 534, 18, 19, 20, 487, 535, 536, 489, 490, 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, 35, 537, 37, 538, 539, 40, 41, 42, 43, @@ -14279,7 +14305,7 @@ 0, 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, 511, 512, 128, 0, 0, 0, 129, - 802, 130, 513, 0, 0, 0, 0, 803, 0, 135, + 784, 130, 513, 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, 0, 147, 148, 0, 0, 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, 542, 516, @@ -14291,142 +14317,58 @@ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 0, 0, 7, 8, 245, 525, 247, - 248, 249, 250, 251, 410, 411, 0, 14, 15, 16, - 486, 18, 19, 20, 487, 22, 488, 489, 1141, 491, - 412, 28, 492, 30, 31, 0, 32, 33, 34, 35, - 493, 37, 38, 39, 40, 41, 42, 43, 494, 0, - 45, 495, 47, 496, 497, 50, 498, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 499, 500, 68, 0, 69, 70, 71, 501, 0, - 0, 74, 75, 76, 0, 0, 502, 78, 0, 0, - 0, 0, 80, 503, 82, 504, 505, 85, 86, 1487, - 0, 0, 0, 0, 0, 0, 0, 91, 92, 93, - 94, 0, 95, 0, 0, 0, 506, 97, 98, 507, - 508, 0, 0, 0, 0, 0, 0, 101, 102, 103, - 0, 105, 106, 1142, 0, 0, 0, 1143, 0, 0, - 113, 114, 0, 0, 0, 0, 115, 116, 117, 118, - 509, 120, 121, 510, 0, 0, 0, 0, 0, 0, - 0, 511, 512, 128, 0, 0, 0, 129, 0, 130, - 513, 0, 0, 0, 0, 0, 0, 135, 0, 136, - 137, 138, 139, 514, 141, 142, 143, 144, 145, 146, - 0, 0, 1144, 148, 0, 0, 413, 151, 152, 153, - 154, 155, 156, 157, 158, 515, 160, 516, 162, 517, - 518, 165, 166, 167, 168, 169, 170, 519, 172, 520, - 521, 522, 176, 177, 523, 524, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 0, - 193, 194, 195, 0, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 0, 0, 7, 8, 245, 525, 247, 1145, 1146, - 1147, 1148, 410, 411, 0, 14, 15, 16, 486, 18, - 19, 20, 487, 22, 488, 489, 1141, 491, 412, 28, - 492, 30, 31, 0, 32, 33, 34, 35, 493, 37, - 38, 39, 40, 41, 42, 43, 494, 0, 45, 495, - 47, 496, 497, 50, 498, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 499, - 500, 68, 0, 69, 70, 71, 501, 0, 0, 74, - 75, 76, 0, 0, 502, 78, 0, 0, 0, 0, - 80, 503, 82, 504, 505, 85, 86, 1625, 0, 0, - 0, 0, 0, 0, 0, 91, 92, 93, 94, 0, - 95, 0, 0, 0, 506, 97, 98, 507, 508, 0, - 0, 0, 0, 0, 0, 101, 102, 103, 0, 105, - 106, 1142, 0, 0, 0, 1143, 0, 0, 113, 114, - 0, 0, 0, 0, 115, 116, 117, 118, 509, 120, - 121, 510, 0, 0, 0, 0, 0, 0, 0, 511, - 512, 128, 0, 0, 0, 129, 0, 130, 513, 0, - 0, 0, 0, 0, 0, 135, 0, 136, 137, 138, - 139, 514, 141, 142, 143, 144, 145, 146, 0, 0, - 1144, 148, 0, 0, 413, 151, 152, 153, 154, 155, - 156, 157, 158, 515, 160, 516, 162, 517, 518, 165, - 166, 167, 168, 169, 170, 519, 172, 520, 521, 522, - 176, 177, 523, 524, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 0, 193, 194, - 195, 0, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 0, - 0, 7, 8, 245, 525, 247, 1145, 1146, 1147, 1148, - 410, 411, 0, 14, 15, 16, 486, 18, 19, 20, - 487, 22, 488, 489, 1141, 491, 412, 28, 492, 30, - 31, 0, 32, 33, 34, 35, 493, 37, 38, 39, - 40, 41, 42, 43, 494, 0, 45, 495, 47, 496, - 497, 50, 498, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 499, 500, 68, - 0, 69, 70, 71, 501, 0, 0, 74, 75, 76, - 0, 0, 502, 78, 0, 0, 0, 0, 80, 503, - 82, 504, 505, 85, 86, 1629, 0, 0, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 0, 95, 0, - 0, 0, 506, 97, 98, 507, 508, 0, 0, 0, - 0, 0, 0, 101, 102, 103, 0, 105, 106, 1142, - 0, 0, 0, 1143, 0, 0, 113, 114, 0, 0, - 0, 0, 115, 116, 117, 118, 509, 120, 121, 510, - 0, 0, 0, 0, 0, 0, 0, 511, 512, 128, - 0, 0, 0, 129, 0, 130, 513, 0, 0, 0, - 0, 0, 0, 135, 0, 136, 137, 138, 139, 514, - 141, 142, 143, 144, 145, 146, 0, 0, 1144, 148, - 0, 0, 413, 151, 152, 153, 154, 155, 156, 157, - 158, 515, 160, 516, 162, 517, 518, 165, 166, 167, - 168, 169, 170, 519, 172, 520, 521, 522, 176, 177, - 523, 524, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 0, 193, 194, 195, 0, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 0, 0, 7, - 8, 245, 525, 247, 1145, 1146, 1147, 1148, 410, 411, - 0, 14, 15, 16, 486, 18, 19, 20, 487, 22, - 488, 489, 1141, 491, 412, 28, 492, 30, 31, 0, - 32, 33, 34, 35, 493, 37, 38, 39, 40, 41, - 42, 43, 494, 0, 45, 495, 47, 496, 497, 50, - 498, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 499, 500, 68, 0, 69, - 70, 71, 501, 0, 0, 74, 75, 76, 0, 0, - 502, 78, 0, 0, 0, 0, 80, 503, 82, 504, - 505, 85, 86, 0, 0, 0, 0, 0, 0, 0, - 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, - 506, 97, 98, 507, 508, 0, 0, 0, 0, 0, - 0, 101, 102, 103, 0, 105, 106, 1142, 0, 0, - 0, 1143, 0, 0, 113, 114, 0, 0, 0, 0, - 115, 116, 117, 118, 509, 120, 121, 510, 0, 0, - 0, 0, 0, 0, 0, 511, 512, 128, 0, 0, - 0, 129, 0, 130, 513, 0, 0, 0, 0, 0, - 0, 135, 0, 136, 137, 138, 139, 514, 141, 142, - 143, 144, 145, 146, 0, 0, 1144, 148, 0, 0, - 413, 151, 152, 153, 154, 155, 156, 157, 158, 515, - 160, 516, 162, 517, 518, 165, 166, 167, 168, 169, - 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, - 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 192, 0, 193, 194, 195, 0, 196, 197, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 0, 0, 7, 8, 245, - 525, 247, 1145, 1146, 1147, 1148, 410, 411, 0, 14, - 15, 16, 486, 18, 19, 20, 487, 22, 488, 489, - 1141, 491, 412, 28, 492, 30, 31, 0, 32, 33, - 34, 35, 493, 37, 38, 39, 40, 41, 42, 43, - 494, 0, 45, 495, 47, 496, 497, 50, 498, 52, + 240, 241, 242, 0, 0, 0, 567, 245, 525, 247, + 248, 249, 250, 251, 7, 8, 0, 0, 0, 0, + 0, 0, 0, 410, 411, 0, 14, 15, 16, 534, + 18, 19, 20, 487, 535, 536, 489, 490, 491, 412, + 28, 492, 30, 31, 0, 32, 33, 34, 35, 537, + 37, 538, 539, 40, 41, 42, 43, 494, 0, 45, + 540, 47, 496, 497, 50, 498, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 499, 500, 68, 0, 69, 70, 71, 541, 0, 0, + 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, + 0, 80, 503, 82, 504, 505, 85, 86, 0, 0, + 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, + 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, + 0, 0, 0, 0, 0, 0, 101, 102, 103, 0, + 105, 106, 107, 0, 0, 0, 0, 0, 0, 113, + 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, + 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, + 511, 512, 128, 0, 0, 0, 129, 0, 130, 513, + 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, + 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, + 0, 147, 148, 0, 0, 413, 151, 152, 153, 154, + 155, 156, 157, 158, 515, 542, 516, 162, 517, 518, + 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, + 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, + 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 0, 0, 0, 0, 245, 525, 247, 248, 249, 250, + 251, 570, 571, 0, 0, 0, 0, 7, 8, 0, + 0, 0, 0, 0, 0, 0, 410, 411, 0, 14, + 15, 16, 534, 18, 19, 20, 487, 535, 536, 489, + 490, 491, 412, 28, 492, 30, 31, 0, 32, 33, + 34, 35, 537, 37, 538, 539, 40, 41, 42, 43, + 494, 0, 45, 540, 47, 496, 497, 50, 498, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 499, 500, 68, 0, 69, 70, 71, - 501, 0, 0, 74, 75, 76, 0, 0, 502, 78, + 541, 0, 0, 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, 0, 80, 503, 82, 504, 505, 85, 86, 0, 0, 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, 0, 0, 0, 0, 0, 0, 101, - 102, 103, 0, 105, 106, 1142, 0, 0, 0, 1143, + 102, 103, 0, 105, 106, 107, 0, 0, 0, 0, 0, 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, 511, 512, 128, 0, 0, 0, 129, 0, 130, 513, 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, 0, 147, 148, 0, 0, 413, 151, - 152, 153, 154, 155, 156, 157, 158, 515, 160, 516, + 152, 153, 154, 155, 156, 157, 158, 515, 542, 516, 162, 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, @@ -14435,493 +14377,703 @@ 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 0, 0, 7, 8, 245, 525, 247, - 1145, 1146, 1147, 1148, 410, 411, 0, 14, 15, 16, - 534, 18, 19, 20, 487, 535, 536, 489, 490, 491, - 412, 28, 492, 30, 31, 0, 32, 33, 34, 35, - 537, 37, 538, 539, 40, 41, 42, 43, 494, 0, - 45, 540, 47, 496, 497, 50, 498, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 499, 500, 68, 0, 69, 70, 71, 541, 0, - 0, 74, 75, 76, 0, 0, 502, 78, 0, 0, - 0, 0, 80, 503, 82, 504, 505, 85, 86, 1234, - 0, 0, 0, 0, 0, 0, 0, 91, 92, 93, - 94, 0, 95, 0, 0, 0, 506, 97, 98, 507, - 508, 0, 0, 0, 0, 0, 0, 101, 102, 103, - 0, 105, 106, 107, 0, 0, 0, 0, 0, 0, - 113, 114, 0, 0, 0, 0, 115, 116, 117, 118, - 509, 120, 121, 510, 0, 0, 0, 0, 0, 0, - 0, 511, 512, 128, 0, 0, 0, 129, 0, 130, - 513, 0, 0, 0, 0, 0, 0, 135, 0, 136, - 137, 138, 139, 514, 141, 142, 143, 144, 145, 146, - 0, 0, 147, 148, 0, 0, 413, 151, 152, 153, - 154, 155, 156, 157, 158, 515, 542, 516, 162, 517, - 518, 165, 166, 167, 168, 169, 170, 519, 172, 520, - 521, 522, 176, 177, 523, 524, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, 192, 0, - 193, 194, 195, 0, 196, 197, 198, 199, 200, 201, - 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, - 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, - 242, 0, 0, 7, 8, 245, 525, 247, 248, 249, - 250, 251, 410, 411, 0, 14, 15, 16, 534, 18, - 19, 20, 487, 535, 536, 489, 490, 491, 412, 28, - 492, 30, 31, 0, 32, 33, 34, 35, 537, 37, - 538, 539, 40, 41, 42, 43, 494, 0, 45, 540, - 47, 496, 497, 50, 498, 52, 53, 54, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 499, - 500, 68, 0, 69, 70, 71, 541, 0, 0, 74, - 75, 76, 0, 0, 502, 78, 0, 0, 0, 0, - 80, 503, 82, 504, 505, 85, 86, 0, 0, 0, - 0, 0, 0, 0, 0, 91, 92, 93, 94, 0, - 95, 0, 0, 0, 506, 97, 98, 507, 508, 0, - 0, 0, 0, 0, 0, 101, 102, 103, 0, 105, - 106, 107, 0, 0, 0, 0, 0, 0, 113, 114, - 0, 0, 0, 0, 115, 116, 117, 118, 509, 120, - 121, 510, 0, 0, 0, 0, 0, 0, 0, 511, - 512, 128, 0, 0, 0, 129, 0, 130, 513, 0, - 0, 0, 0, 0, 0, 135, 0, 136, 137, 138, - 139, 514, 141, 142, 143, 144, 145, 146, 0, 0, - 147, 148, 0, 0, 413, 151, 152, 153, 154, 155, - 156, 157, 158, 515, 542, 516, 162, 517, 518, 165, - 166, 167, 168, 169, 170, 519, 172, 520, 521, 522, - 176, 177, 523, 524, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 0, 193, 194, - 195, 0, 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, - 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 0, - 0, 7, 8, 245, 525, 247, 248, 249, 250, 251, - 410, 411, 0, 14, 15, 16, 0, 18, 19, 20, - 487, 0, 0, 489, 490, 0, 412, 28, 492, 30, - 31, 0, 32, 33, 34, 35, 0, 37, 0, 0, - 40, 41, 42, 43, 494, 0, 45, 0, 47, 0, - 0, 50, 498, 52, 53, 54, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 499, 500, 68, - 0, 69, 70, 71, 0, 0, 0, 74, 75, 76, - 0, 0, 502, 78, 0, 0, 0, 0, 80, 503, - 82, 504, 505, 85, 86, 0, 0, 0, 0, 0, - 0, 0, 0, 91, 92, 93, 94, 0, 95, 0, - 0, 0, 506, 97, 98, 507, 508, 0, 0, 0, - 0, 0, 0, 101, 102, 103, 0, 105, 106, 0, - 0, 0, 0, 0, 0, 0, 113, 114, 0, 0, - 0, 0, 115, 116, 117, 118, 509, 120, 121, 510, - 0, 0, 0, 0, 0, 0, 0, 511, 512, 128, - 0, 0, 0, 129, 0, 130, 513, 0, 0, 0, - 0, 0, 0, 135, 0, 136, 137, 138, 139, 514, - 141, 142, 143, 144, 145, 146, 0, 0, 0, 148, - 0, 0, 413, 151, 152, 153, 154, 155, 156, 157, - 158, 515, 0, 516, 162, 517, 518, 165, 166, 167, - 168, 169, 170, 519, 172, 520, 521, 522, 176, 177, - 0, 524, 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 192, 0, 193, 194, 195, 0, - 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, - 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, - 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 239, 240, 241, 242, 0, 0, 0, - 0, 245, 525, 247, 248, 249, 250, 251 + 240, 241, 242, 0, 0, 0, 0, 245, 525, 247, + 248, 249, 250, 251, 4, 5, 6, 7, 8, 0, + 0, 0, 11, 0, 0, 0, 410, 411, 0, 14, + 15, 16, 833, 18, 19, 20, 21, 535, 834, 489, + 25, 491, 412, 28, 492, 30, 31, 0, 32, 33, + 34, 35, 835, 37, 538, 539, 40, 41, 42, 43, + 494, 0, 45, 836, 47, 496, 497, 50, 498, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 499, 500, 68, 0, 69, 70, 71, + 837, 0, 0, 74, 75, 76, 0, 0, 502, 78, + 0, 0, 0, 79, 80, 503, 82, 504, 505, 85, + 86, 555, 88, 0, 0, 0, 0, 90, 0, 91, + 92, 93, 94, 0, 95, 0, 0, 0, 506, 97, + 98, 507, 508, 0, 0, 0, 0, 0, 0, 101, + 102, 103, 104, 105, 106, 107, 556, 109, 0, 110, + 111, 0, 113, 114, 0, 0, 0, 0, 115, 116, + 117, 118, 119, 120, 121, 510, 0, 123, 0, 0, + 0, 0, 0, 511, 512, 128, 0, 0, 0, 129, + 0, 130, 513, 0, 0, 0, 0, 0, 0, 135, + 0, 136, 137, 138, 139, 140, 141, 142, 143, 144, + 145, 146, 0, 0, 147, 148, 149, 0, 413, 151, + 152, 153, 154, 155, 156, 157, 158, 515, 542, 516, + 162, 517, 518, 165, 166, 167, 168, 169, 170, 519, + 172, 520, 521, 522, 176, 177, 523, 524, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 0, 193, 194, 195, 0, 196, 197, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, + 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 0, 244, 0, 245, 525, 247, + 248, 249, 250, 251, 7, 8, 0, 0, 0, 0, + 0, 0, 0, 410, 411, 0, 14, 15, 16, 486, + 18, 19, 20, 487, 22, 488, 489, 1136, 491, 412, + 28, 492, 30, 31, 0, 32, 33, 34, 35, 493, + 37, 38, 39, 40, 41, 42, 43, 494, 0, 45, + 495, 47, 496, 497, 50, 498, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 499, 500, 68, 0, 69, 70, 71, 501, 0, 0, + 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, + 0, 80, 503, 82, 504, 505, 85, 86, 0, 0, + 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, + 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, + 0, 0, 0, 0, 0, 0, 101, 102, 103, 0, + 105, 106, 1137, 0, 0, 0, 1138, 0, 0, 113, + 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, + 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, + 511, 512, 128, 0, 0, 0, 129, 1567, 130, 513, + 0, 0, 0, 0, 1568, 0, 135, 0, 136, 137, + 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, + 0, 1139, 148, 0, 0, 413, 151, 152, 153, 154, + 155, 156, 157, 158, 515, 160, 516, 162, 517, 518, + 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, + 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, + 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 0, 0, 7, 8, 245, 525, 247, 1140, 1141, 1142, + 1143, 410, 411, 0, 14, 15, 16, 534, 18, 19, + 20, 487, 535, 536, 489, 490, 491, 412, 28, 492, + 30, 31, 0, 32, 33, 34, 35, 537, 37, 538, + 539, 40, 41, 42, 43, 494, 0, 45, 540, 47, + 496, 497, 50, 498, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 499, 500, + 68, 0, 69, 70, 71, 541, 0, 0, 74, 75, + 76, 0, 0, 502, 78, 0, 0, 0, 0, 80, + 503, 82, 504, 505, 85, 86, 0, 0, 0, 0, + 0, 0, 0, 0, 91, 92, 93, 94, 0, 95, + 0, 0, 0, 506, 97, 98, 507, 508, 0, 0, + 0, 0, 0, 0, 101, 102, 103, 0, 105, 106, + 107, 0, 0, 0, 0, 0, 0, 113, 114, 0, + 0, 0, 0, 115, 116, 117, 118, 509, 120, 121, + 510, 0, 0, 0, 0, 0, 0, 0, 511, 512, + 128, 0, 0, 0, 129, 753, 130, 513, 0, 0, + 0, 0, 754, 0, 135, 0, 136, 137, 138, 139, + 514, 141, 142, 143, 144, 145, 146, 0, 0, 147, + 148, 0, 0, 413, 151, 152, 153, 154, 155, 156, + 157, 158, 515, 542, 516, 162, 517, 518, 165, 166, + 167, 168, 169, 170, 519, 172, 520, 521, 522, 176, + 177, 523, 524, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 0, 193, 194, 195, + 0, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 0, 0, + 7, 8, 245, 525, 247, 248, 249, 250, 251, 410, + 411, 0, 14, 15, 16, 534, 18, 19, 20, 487, + 535, 536, 489, 490, 491, 412, 28, 492, 30, 31, + 0, 32, 33, 34, 35, 537, 37, 538, 539, 40, + 41, 42, 43, 494, 0, 45, 540, 47, 496, 497, + 50, 498, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 499, 500, 68, 0, + 69, 70, 71, 541, 0, 0, 74, 75, 76, 0, + 0, 502, 78, 0, 0, 0, 0, 80, 503, 82, + 504, 505, 85, 86, 0, 0, 0, 0, 0, 0, + 0, 0, 91, 92, 93, 94, 0, 95, 0, 0, + 0, 506, 97, 98, 507, 508, 0, 0, 0, 0, + 0, 0, 101, 102, 103, 0, 105, 106, 107, 0, + 0, 0, 0, 0, 0, 113, 114, 0, 0, 0, + 0, 115, 116, 117, 118, 509, 120, 121, 510, 0, + 0, 0, 0, 0, 0, 0, 511, 512, 128, 0, + 0, 0, 129, 801, 130, 513, 0, 0, 0, 0, + 802, 0, 135, 0, 136, 137, 138, 139, 514, 141, + 142, 143, 144, 145, 146, 0, 0, 147, 148, 0, + 0, 413, 151, 152, 153, 154, 155, 156, 157, 158, + 515, 542, 516, 162, 517, 518, 165, 166, 167, 168, + 169, 170, 519, 172, 520, 521, 522, 176, 177, 523, + 524, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 0, 193, 194, 195, 0, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 0, 0, 7, 8, + 245, 525, 247, 248, 249, 250, 251, 410, 411, 0, + 14, 15, 16, 486, 18, 19, 20, 487, 22, 488, + 489, 1136, 491, 412, 28, 492, 30, 31, 0, 32, + 33, 34, 35, 493, 37, 38, 39, 40, 41, 42, + 43, 494, 0, 45, 495, 47, 496, 497, 50, 498, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 499, 500, 68, 0, 69, 70, + 71, 501, 0, 0, 74, 75, 76, 0, 0, 502, + 78, 0, 0, 0, 0, 80, 503, 82, 504, 505, + 85, 86, 1485, 0, 0, 0, 0, 0, 0, 0, + 91, 92, 93, 94, 0, 95, 0, 0, 0, 506, + 97, 98, 507, 508, 0, 0, 0, 0, 0, 0, + 101, 102, 103, 0, 105, 106, 1137, 0, 0, 0, + 1138, 0, 0, 113, 114, 0, 0, 0, 0, 115, + 116, 117, 118, 509, 120, 121, 510, 0, 0, 0, + 0, 0, 0, 0, 511, 512, 128, 0, 0, 0, + 129, 0, 130, 513, 0, 0, 0, 0, 0, 0, + 135, 0, 136, 137, 138, 139, 514, 141, 142, 143, + 144, 145, 146, 0, 0, 1139, 148, 0, 0, 413, + 151, 152, 153, 154, 155, 156, 157, 158, 515, 160, + 516, 162, 517, 518, 165, 166, 167, 168, 169, 170, + 519, 172, 520, 521, 522, 176, 177, 523, 524, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 0, 193, 194, 195, 0, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 0, 0, 7, 8, 245, 525, + 247, 1140, 1141, 1142, 1143, 410, 411, 0, 14, 15, + 16, 486, 18, 19, 20, 487, 22, 488, 489, 1136, + 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, + 35, 493, 37, 38, 39, 40, 41, 42, 43, 494, + 0, 45, 495, 47, 496, 497, 50, 498, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 499, 500, 68, 0, 69, 70, 71, 501, + 0, 0, 74, 75, 76, 0, 0, 502, 78, 0, + 0, 0, 0, 80, 503, 82, 504, 505, 85, 86, + 1624, 0, 0, 0, 0, 0, 0, 0, 91, 92, + 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, + 507, 508, 0, 0, 0, 0, 0, 0, 101, 102, + 103, 0, 105, 106, 1137, 0, 0, 0, 1138, 0, + 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, + 118, 509, 120, 121, 510, 0, 0, 0, 0, 0, + 0, 0, 511, 512, 128, 0, 0, 0, 129, 0, + 130, 513, 0, 0, 0, 0, 0, 0, 135, 0, + 136, 137, 138, 139, 514, 141, 142, 143, 144, 145, + 146, 0, 0, 1139, 148, 0, 0, 413, 151, 152, + 153, 154, 155, 156, 157, 158, 515, 160, 516, 162, + 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, + 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 0, 0, 7, 8, 245, 525, 247, 1140, + 1141, 1142, 1143, 410, 411, 0, 14, 15, 16, 486, + 18, 19, 20, 487, 22, 488, 489, 1136, 491, 412, + 28, 492, 30, 31, 0, 32, 33, 34, 35, 493, + 37, 38, 39, 40, 41, 42, 43, 494, 0, 45, + 495, 47, 496, 497, 50, 498, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 499, 500, 68, 0, 69, 70, 71, 501, 0, 0, + 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, + 0, 80, 503, 82, 504, 505, 85, 86, 1628, 0, + 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, + 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, + 0, 0, 0, 0, 0, 0, 101, 102, 103, 0, + 105, 106, 1137, 0, 0, 0, 1138, 0, 0, 113, + 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, + 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, + 511, 512, 128, 0, 0, 0, 129, 0, 130, 513, + 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, + 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, + 0, 1139, 148, 0, 0, 413, 151, 152, 153, 154, + 155, 156, 157, 158, 515, 160, 516, 162, 517, 518, + 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, + 522, 176, 177, 523, 524, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, + 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 0, 0, 7, 8, 245, 525, 247, 1140, 1141, 1142, + 1143, 410, 411, 0, 14, 15, 16, 486, 18, 19, + 20, 487, 22, 488, 489, 1136, 491, 412, 28, 492, + 30, 31, 0, 32, 33, 34, 35, 493, 37, 38, + 39, 40, 41, 42, 43, 494, 0, 45, 495, 47, + 496, 497, 50, 498, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 499, 500, + 68, 0, 69, 70, 71, 501, 0, 0, 74, 75, + 76, 0, 0, 502, 78, 0, 0, 0, 0, 80, + 503, 82, 504, 505, 85, 86, 0, 0, 0, 0, + 0, 0, 0, 0, 91, 92, 93, 94, 0, 95, + 0, 0, 0, 506, 97, 98, 507, 508, 0, 0, + 0, 0, 0, 0, 101, 102, 103, 0, 105, 106, + 1137, 0, 0, 0, 1138, 0, 0, 113, 114, 0, + 0, 0, 0, 115, 116, 117, 118, 509, 120, 121, + 510, 0, 0, 0, 0, 0, 0, 0, 511, 512, + 128, 0, 0, 0, 129, 0, 130, 513, 0, 0, + 0, 0, 0, 0, 135, 0, 136, 137, 138, 139, + 514, 141, 142, 143, 144, 145, 146, 0, 0, 1139, + 148, 0, 0, 413, 151, 152, 153, 154, 155, 156, + 157, 158, 515, 160, 516, 162, 517, 518, 165, 166, + 167, 168, 169, 170, 519, 172, 520, 521, 522, 176, + 177, 523, 524, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 0, 193, 194, 195, + 0, 196, 197, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 0, 0, + 7, 8, 245, 525, 247, 1140, 1141, 1142, 1143, 410, + 411, 0, 14, 15, 16, 486, 18, 19, 20, 487, + 22, 488, 489, 1136, 491, 412, 28, 492, 30, 31, + 0, 32, 33, 34, 35, 493, 37, 38, 39, 40, + 41, 42, 43, 494, 0, 45, 495, 47, 496, 497, + 50, 498, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 499, 500, 68, 0, + 69, 70, 71, 501, 0, 0, 74, 75, 76, 0, + 0, 502, 78, 0, 0, 0, 0, 80, 503, 82, + 504, 505, 85, 86, 0, 0, 0, 0, 0, 0, + 0, 0, 91, 92, 93, 94, 0, 95, 0, 0, + 0, 506, 97, 98, 507, 508, 0, 0, 0, 0, + 0, 0, 101, 102, 103, 0, 105, 106, 1137, 0, + 0, 0, 1138, 0, 0, 113, 114, 0, 0, 0, + 0, 115, 116, 117, 118, 509, 120, 121, 510, 0, + 0, 0, 0, 0, 0, 0, 511, 512, 128, 0, + 0, 0, 129, 0, 130, 513, 0, 0, 0, 0, + 0, 0, 135, 0, 136, 137, 138, 139, 514, 141, + 142, 143, 144, 145, 146, 0, 0, 147, 148, 0, + 0, 413, 151, 152, 153, 154, 155, 156, 157, 158, + 515, 160, 516, 162, 517, 518, 165, 166, 167, 168, + 169, 170, 519, 172, 520, 521, 522, 176, 177, 523, + 524, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 0, 193, 194, 195, 0, 196, + 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 0, 0, 7, 8, + 245, 525, 247, 1140, 1141, 1142, 1143, 410, 411, 0, + 14, 15, 16, 534, 18, 19, 20, 487, 535, 536, + 489, 490, 491, 412, 28, 492, 30, 31, 0, 32, + 33, 34, 35, 537, 37, 538, 539, 40, 41, 42, + 43, 494, 0, 45, 540, 47, 496, 497, 50, 498, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 499, 500, 68, 0, 69, 70, + 71, 541, 0, 0, 74, 75, 76, 0, 0, 502, + 78, 0, 0, 0, 0, 80, 503, 82, 504, 505, + 85, 86, 1230, 0, 0, 0, 0, 0, 0, 0, + 91, 92, 93, 94, 0, 95, 0, 0, 0, 506, + 97, 98, 507, 508, 0, 0, 0, 0, 0, 0, + 101, 102, 103, 0, 105, 106, 107, 0, 0, 0, + 0, 0, 0, 113, 114, 0, 0, 0, 0, 115, + 116, 117, 118, 509, 120, 121, 510, 0, 0, 0, + 0, 0, 0, 0, 511, 512, 128, 0, 0, 0, + 129, 0, 130, 513, 0, 0, 0, 0, 0, 0, + 135, 0, 136, 137, 138, 139, 514, 141, 142, 143, + 144, 145, 146, 0, 0, 147, 148, 0, 0, 413, + 151, 152, 153, 154, 155, 156, 157, 158, 515, 542, + 516, 162, 517, 518, 165, 166, 167, 168, 169, 170, + 519, 172, 520, 521, 522, 176, 177, 523, 524, 180, + 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, + 191, 192, 0, 193, 194, 195, 0, 196, 197, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 0, 0, 7, 8, 245, 525, + 247, 248, 249, 250, 251, 410, 411, 0, 14, 15, + 16, 534, 18, 19, 20, 487, 535, 536, 489, 490, + 491, 412, 28, 492, 30, 31, 0, 32, 33, 34, + 35, 537, 37, 538, 539, 40, 41, 42, 43, 494, + 0, 45, 540, 47, 496, 497, 50, 498, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 499, 500, 68, 0, 69, 70, 71, 541, + 0, 0, 74, 75, 76, 0, 0, 502, 78, 0, + 0, 0, 0, 80, 503, 82, 504, 505, 85, 86, + 0, 0, 0, 0, 0, 0, 0, 0, 91, 92, + 93, 94, 0, 95, 0, 0, 0, 506, 97, 98, + 507, 508, 0, 0, 0, 0, 0, 0, 101, 102, + 103, 0, 105, 106, 107, 0, 0, 0, 0, 0, + 0, 113, 114, 0, 0, 0, 0, 115, 116, 117, + 118, 509, 120, 121, 510, 0, 0, 0, 0, 0, + 0, 0, 511, 512, 128, 0, 0, 0, 129, 0, + 130, 513, 0, 0, 0, 0, 0, 0, 135, 0, + 136, 137, 138, 139, 514, 141, 142, 143, 144, 145, + 146, 0, 0, 147, 148, 0, 0, 413, 151, 152, + 153, 154, 155, 156, 157, 158, 515, 542, 516, 162, + 517, 518, 165, 166, 167, 168, 169, 170, 519, 172, + 520, 521, 522, 176, 177, 523, 524, 180, 181, 182, + 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, + 0, 193, 194, 195, 0, 196, 197, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 0, 0, 7, 8, 245, 525, 247, 248, + 249, 250, 251, 410, 411, 0, 14, 15, 16, 0, + 18, 19, 20, 487, 0, 0, 489, 490, 0, 412, + 28, 492, 30, 31, 0, 32, 33, 34, 35, 0, + 37, 0, 0, 40, 41, 42, 43, 494, 0, 45, + 0, 47, 0, 0, 50, 498, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 499, 500, 68, 0, 69, 70, 71, 0, 0, 0, + 74, 75, 76, 0, 0, 502, 78, 0, 0, 0, + 0, 80, 503, 82, 504, 505, 85, 86, 0, 0, + 0, 0, 0, 0, 0, 0, 91, 92, 93, 94, + 0, 95, 0, 0, 0, 506, 97, 98, 507, 508, + 0, 0, 0, 0, 0, 0, 101, 102, 103, 0, + 105, 106, 0, 0, 0, 0, 0, 0, 0, 113, + 114, 0, 0, 0, 0, 115, 116, 117, 118, 509, + 120, 121, 510, 0, 0, 0, 0, 0, 0, 0, + 511, 512, 128, 0, 0, 0, 129, 0, 130, 513, + 0, 0, 0, 0, 0, 0, 135, 0, 136, 137, + 138, 139, 514, 141, 142, 143, 144, 145, 146, 0, + 0, 0, 148, 0, 0, 413, 151, 152, 153, 154, + 155, 156, 157, 158, 515, 0, 516, 162, 517, 518, + 165, 166, 167, 168, 169, 170, 519, 172, 520, 521, + 522, 176, 177, 0, 524, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, 0, 193, + 194, 195, 0, 196, 197, 198, 199, 200, 201, 202, + 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 0, 0, 0, 0, 245, 525, 247, 248, 249, 250, + 251 }; /* YYCHECK. */ const short int xquery_parser::yycheck_[] = { - 0, 685, 669, 179, 4, 5, 6, 340, 0, 4, - 5, 6, 4, 5, 6, 759, 421, 311, 1033, 109, - 110, 860, 260, 259, 419, 420, 4, 5, 6, 12, - 822, 133, 779, 670, 671, 672, 673, 275, 759, 1049, - 1, 583, 1287, 291, 791, 1365, 1366, 589, 252, 253, - 1304, 1, 1073, 73, 616, 617, 461, 462, 805, 919, - 4, 5, 6, 905, 433, 1127, 618, 619, 990, 616, - 617, 618, 619, 26, 27, 444, 39, 940, 1008, 36, - 715, 44, 45, 55, 1, 1398, 918, 919, 26, 27, - 648, 282, 650, 651, 47, 653, 59, 655, 61, 62, - 469, 36, 29, 956, 118, 663, 664, 70, 108, 47, - 158, 1, 1590, 1, 107, 118, 108, 29, 56, 107, - 1, 74, 96, 93, 956, 107, 107, 1655, 176, 225, - 108, 1, 29, 1, 97, 1, 74, 94, 136, 96, - 1, 79, 1317, 225, 100, 227, 107, 225, 100, 227, - 1010, 225, 153, 243, 244, 217, 230, 107, 990, 112, - 1, 96, 1, 1023, 108, 107, 142, 30, 416, 153, - 94, 148, 94, 111, 112, 113, 96, 106, 1010, 268, - 8, 100, 153, 110, 33, 54, 275, 56, 165, 1, - 147, 1023, 254, 177, 113, 169, 158, 124, 127, 1727, - 49, 291, 190, 201, 37, 38, 187, 40, 41, 210, - 1530, 225, 147, 183, 176, 962, 113, 1, 314, 9, - 10, 269, 149, 147, 57, 147, 153, 147, 276, 156, - 186, 100, 314, 1, 186, 1, 314, 45, 286, 107, - 314, 343, 235, 0, 1, 217, 188, 1, 160, 440, - 177, 233, 252, 253, 62, 1270, 256, 1502, 1, 1737, - 252, 253, 225, 160, 256, 1, 107, 561, 107, 1016, - 273, 1015, 147, 190, 1284, 1022, 1589, 1069, 252, 253, - 113, 255, 254, 1, 1, 1127, 1128, 1308, 262, 96, - 1143, 291, 1013, 307, 1015, 107, 1317, 273, 272, 291, - 190, 549, 190, 1225, 1234, 867, 868, 942, 73, 190, - 284, 1143, 1374, 103, 1035, 1178, 273, 869, 870, 187, - 190, 726, 87, 107, 190, 1, 416, 160, 348, 190, - 1505, 351, 259, 123, 287, 125, 0, 1, 273, 107, - 1, 107, 295, 901, 185, 76, 111, 175, 187, 287, - 107, 214, 313, 107, 317, 318, 319, 295, 123, 449, - 125, 311, 1, 153, 107, 303, 96, 157, 1688, 459, - 147, 107, 777, 185, 100, 613, 614, 121, 468, 187, - 616, 617, 251, 153, 174, 475, 476, 220, 636, 107, - 107, 94, 1, 1225, 484, 264, 1650, 266, 273, 1, - 107, 605, 1262, 187, 773, 195, 107, 776, 277, 278, - 279, 1, 281, 107, 283, 130, 416, 131, 130, 187, - 1740, 187, 153, 213, 416, 52, 1286, 184, 261, 156, - 1262, 107, 1, 187, 107, 191, 192, 9, 10, 169, - 210, 26, 27, 107, 187, 445, 107, 447, 107, 256, - 257, 187, 94, 445, 1286, 447, 154, 107, 156, 549, - 186, 156, 1, 1, 1, 1, 184, 445, 107, 447, - 187, 148, 45, 473, 47, 565, 190, 1224, 478, 1724, - 187, 473, 197, 184, 1505, 197, 478, 577, 165, 233, - 221, 222, 1236, 107, 188, 473, 273, 745, 107, 107, - 478, 445, 129, 447, 107, 107, 79, 597, 598, 1348, - 905, 187, 1351, 137, 187, 218, 219, 107, 142, 45, - 184, 47, 252, 253, 1245, 255, 187, 112, 187, 473, - 233, 103, 1374, 106, 478, 118, 1220, 187, 107, 237, - 935, 1383, 272, 118, 94, 184, 1406, 128, 129, 549, - 1092, 123, 1394, 125, 284, 160, 556, 549, 963, 964, - 1112, 1113, 1114, 968, 556, 1112, 1113, 1114, 107, 107, - 107, 107, 107, 187, 1406, 184, 218, 219, 556, 187, - 106, 153, 184, 348, 187, 157, 351, 689, 690, 29, - 96, 233, 142, 998, 184, 168, 686, 1612, 598, 9, - 10, 691, 174, 107, 187, 605, 598, 118, 107, 153, - 858, 186, 556, 605, 117, 184, 616, 617, 618, 619, - 598, 166, 1369, 195, 616, 617, 618, 619, 611, 1489, - 96, 867, 1492, 177, 94, 873, 636, 182, 876, 1649, - 156, 213, 168, 146, 636, 184, 184, 184, 184, 42, - 156, 136, 187, 46, 53, 745, 159, 1489, 51, 58, - 1492, 426, 169, 96, 429, 150, 9, 10, 433, 5, - 110, 436, 437, 9, 94, 186, 69, 156, 77, 444, - 113, 147, 96, 187, 124, 450, 451, 1, 187, 3, - 455, 194, 33, 103, 154, 202, 156, 96, 463, 113, - 667, 668, 94, 29, 469, 470, 471, 472, 49, 149, - 1454, 1503, 477, 123, 106, 125, 1508, 1559, 1385, 118, - 485, 9, 142, 813, 814, 815, 156, 817, 100, 1004, - 158, 1006, 1127, 1128, 96, 42, 676, 677, 144, 46, - 28, 113, 156, 153, 51, 745, 94, 157, 176, 53, - 142, 113, 66, 745, 58, 1439, 156, 71, 106, 42, - 103, 953, 69, 46, 174, 530, 674, 675, 51, 769, - 176, 199, 5, 965, 769, 168, 9, 769, 171, 544, - 123, 1056, 125, 1058, 110, 195, 69, 123, 194, 125, - 555, 769, 96, 186, 156, 263, 1129, 133, 124, 799, - 800, 182, 1354, 213, 118, 156, 274, 799, 800, 1103, - 153, 1671, 118, 1673, 157, 196, 158, 153, 583, 212, - 94, 799, 800, 149, 589, 769, 24, 153, 593, 9, - 156, 174, 156, 269, 176, 123, 34, 125, 137, 1671, - 276, 1673, 122, 1635, 1704, 182, 134, 1639, 28, 1097, - 286, 177, 195, 137, 153, 799, 800, 199, 858, 196, - 1265, 168, 60, 137, 171, 153, 858, 122, 142, 153, - 213, 1109, 1704, 620, 1734, 1715, 1716, 624, 201, 186, - 100, 247, 248, 1550, 1551, 168, 95, 210, 171, 1749, - 123, 1751, 125, 113, 156, 878, 100, 106, 153, 100, - 133, 156, 1734, 186, 270, 212, 1543, 116, 1592, 113, - 100, 153, 113, 263, 156, 122, 1756, 1749, 127, 1751, - 153, 118, 1762, 113, 274, 1101, 299, 1719, 692, 212, - 1106, 695, 128, 129, 698, 308, 122, 26, 27, 53, - 122, 1688, 137, 123, 58, 125, 122, 142, 37, 38, - 153, 40, 41, 156, 134, 118, 1361, 722, 47, 277, - 278, 279, 221, 222, 223, 283, 153, 56, 57, 156, - 122, 736, 132, 153, 153, 740, 741, 156, 122, 1374, - 140, 141, 153, 143, 347, 74, 122, 350, 1383, 122, - 79, 151, 1659, 1660, 232, 155, 234, 157, 763, 1394, - 765, 154, 162, 156, 232, 122, 234, 122, 773, 1693, - 153, 776, 1218, 1219, 216, 780, 1264, 920, 921, 179, - 1580, 1581, 111, 112, 113, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 156, 1126, 118, 156, 314, - 153, 241, 241, 203, 204, 205, 206, 207, 208, 242, - 0, 1051, 190, 92, 1738, 167, 821, 249, 99, 1051, - 50, 200, 102, 1730, 101, 193, 1471, 154, 145, 29, - 156, 160, 47, 1051, 184, 184, 184, 152, 246, 304, - 118, 187, 118, 153, 1, 118, 142, 107, 73, 187, - 284, 153, 153, 284, 142, 860, 156, 1097, 156, 1347, - 184, 35, 87, 156, 156, 1097, 156, 1051, 121, 156, - 156, 156, 1112, 1113, 1114, 17, 29, 214, 153, 187, - 1112, 1113, 1114, 888, 231, 1809, 111, 1811, 1111, 1534, - 230, 220, 3, 190, 245, 118, 1820, 168, 123, 190, - 125, 170, 170, 70, 149, 94, 231, 94, 94, 107, - 107, 29, 160, 918, 919, 920, 921, 160, 127, 132, - 142, 94, 299, 246, 1559, 118, 132, 184, 184, 187, - 107, 94, 261, 187, 96, 45, 96, 187, 187, 153, - 187, 187, 184, 184, 94, 153, 153, 142, 153, 153, - 153, 956, 190, 237, 33, 225, 1, 231, 287, 170, - 118, 233, 132, 142, 94, 970, 295, 29, 286, 94, - 153, 299, 227, 127, 303, 118, 147, 118, 94, 198, - 132, 132, 184, 96, 160, 153, 118, 254, 1228, 153, - 995, 147, 100, 1228, 100, 1483, 1228, 142, 190, 1004, - 184, 1006, 184, 1008, 121, 1010, 35, 29, 156, 118, - 1228, 245, 156, 1343, 1344, 1345, 156, 153, 1023, 79, - 107, 107, 285, 258, 1264, 156, 29, 260, 267, 156, - 156, 29, 1264, 156, 156, 1275, 156, 156, 29, 144, - 1275, 306, 286, 1275, 1228, 144, 227, 287, 187, 147, - 187, 1056, 190, 1058, 1294, 127, 147, 1275, 187, 1294, - 118, 118, 1294, 187, 147, 77, 107, 142, 100, 184, - 198, 132, 7, 187, 1314, 187, 1294, 96, 233, 106, - 147, 250, 1314, 190, 233, 186, 233, 1092, 282, 250, - 187, 1275, 78, 187, 187, 286, 1314, 187, 233, 187, - 29, 29, 187, 237, 170, 187, 1346, 1347, 107, 187, - 1294, 257, 271, 184, 1346, 1347, 147, 1122, 126, 147, - 126, 96, 1610, 348, 142, 184, 351, 153, 1346, 94, - 1314, 186, 186, 1621, 1622, 186, 1624, 186, 1143, 187, - 184, 184, 184, 1631, 316, 29, 96, 280, 187, 170, - 147, 53, 94, 186, 106, 94, 186, 197, 29, 107, - 198, 265, 107, 118, 118, 118, 287, 94, 94, 225, - 186, 186, 197, 197, 93, 225, 186, 197, 183, 186, - 118, 118, 186, 256, 186, 199, 118, 256, 225, 259, - 725, 1181, 287, 293, 957, 1024, 420, 1225, 1693, 1738, - 425, 426, 305, 305, 429, 861, 1464, 1021, 433, 305, - 782, 436, 437, 440, 306, 1254, 1370, 306, 455, 444, - 1118, 1368, 306, 1365, 1712, 450, 451, 1276, 544, 1234, - 455, 1281, 1289, 1238, 646, 1723, 700, 647, 463, 1284, - 1762, 666, 1308, 1483, 469, 470, 471, 472, 1253, 822, - 1756, 1483, 477, 1006, 335, 921, 1180, 1262, 1349, 1339, - 485, 1348, 1750, 448, 1383, 1394, 1559, 1128, 448, 1387, - 1556, 1276, 1137, 989, 1203, 1583, 1429, 1384, 587, -1, - -1, 1286, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1782, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 530, -1, -1, -1, -1, - 1315, -1, -1, -1, -1, 1803, -1, -1, -1, 544, - 1808, 1651, -1, -1, -1, -1, -1, -1, -1, -1, - 555, -1, -1, -1, 1339, -1, -1, -1, -1, 1669, - -1, -1, -1, 1348, -1, -1, 1351, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 108, 593, -1, - 1610, -1, -1, -1, -1, -1, -1, -1, 1610, -1, - -1, 1621, 1622, -1, 1624, -1, -1, -1, -1, 1621, - 1622, 1631, 1624, -1, -1, -1, -1, -1, -1, 1631, - -1, 1406, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1435, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 1461, 1462, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1712, -1, -1, -1, -1, -1, -1, -1, - 1712, -1, 1487, 1723, 1489, -1, -1, 1492, -1, -1, - -1, 1723, -1, -1, 719, -1, -1, 722, -1, 1504, - -1, -1, -1, -1, 1509, -1, -1, -1, -1, -1, - 1750, 736, -1, -1, -1, 740, 741, -1, 1750, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 763, -1, - 765, -1, 1782, -1, -1, -1, -1, -1, 773, -1, - 1782, 776, -1, -1, -1, 780, -1, -1, -1, -1, - -1, -1, -1, 1803, -1, -1, -1, -1, 1808, -1, - -1, 1803, -1, -1, -1, -1, 1808, -1, -1, -1, + 0, 179, 684, 340, 4, 5, 6, 668, 0, 12, + 291, 821, 4, 5, 6, 311, 109, 110, 4, 5, + 6, 419, 420, 618, 619, 4, 5, 6, 1300, 4, + 5, 6, 421, 669, 670, 671, 672, 758, 1049, 133, + 859, 778, 1033, 260, 583, 259, 1283, 1073, 758, 905, + 589, 252, 253, 790, 616, 617, 618, 619, 275, 1, + 1363, 1364, 73, 1, 940, 1122, 433, 804, 714, 918, + 919, 36, 461, 462, 8, 990, 29, 444, 55, 1008, + 26, 27, 616, 617, 282, 1, 29, 1589, 1396, 29, + 142, 26, 27, 1313, 107, 1, 93, 36, 30, 919, + 118, 47, 469, 1, 118, 107, 1, 956, 108, 26, + 27, 1, 47, 1, 39, 1, 108, 107, 1, 44, + 45, 56, 108, 1, 1, 1, 1, 1, 74, 108, + 1, 96, 1, 1, 59, 416, 61, 62, 1, 74, + 956, 990, 100, 166, 79, 70, 45, 136, 153, 118, + 243, 244, 1, 1, 232, 94, 234, 96, 225, 182, + 113, 1010, 33, 62, 1, 107, 112, 110, 647, 107, + 649, 650, 97, 652, 1023, 654, 111, 112, 113, 0, + 1, 124, 147, 662, 663, 33, 183, 131, 190, 96, + 1010, 107, 225, 153, 227, 112, 37, 38, 291, 40, + 41, 49, 54, 1023, 56, 210, 149, 160, 147, 94, + 153, 225, 201, 156, 1, 1, 57, 107, 187, 121, + 160, 273, 235, 0, 1, 962, 1529, 147, 186, 96, + 107, 107, 107, 107, 177, 1737, 1, 1, 107, 107, + 217, 175, 440, 233, 107, 1, 190, 314, 100, 343, + 210, 1, 252, 253, 96, 273, 256, 142, 107, 1069, + 252, 253, 169, 1500, 256, 561, 1122, 1123, 549, 1280, + 107, 187, 113, 868, 869, 1266, 73, 254, 1304, 1016, + 1588, 314, 214, 1503, 190, 1022, 107, 1313, 187, 1138, + 87, 291, 190, 307, 1015, 190, 942, 187, 1174, 291, + 225, 1230, 190, 1013, 190, 1015, 1221, 190, 273, 184, + 187, 187, 190, 187, 111, 1372, 259, 185, 187, 160, + 107, 107, 1138, 416, 187, 1035, 123, 169, 125, 1, + 107, 233, 866, 867, 273, 1, 725, 348, 187, 156, + 351, 287, 107, 107, 1, 252, 253, 94, 255, 295, + 187, 107, 287, 273, 635, 262, 449, 107, 1, 1, + 295, 1, 147, 184, 118, 272, 459, 107, 303, 1, + 1654, 313, 1221, 311, 76, 468, 29, 284, 107, 220, + 158, 225, 475, 476, 1687, 156, 230, 776, 100, 256, + 257, 484, 317, 318, 319, 142, 613, 614, 176, 251, + 187, 187, 616, 617, 605, 772, 623, 184, 775, 1258, + 252, 253, 264, 255, 266, 100, 416, 217, 96, 184, + 261, 185, 901, 130, 416, 277, 278, 279, 184, 281, + 272, 283, 186, 1282, 184, 107, 107, 1740, 1258, 160, + 94, 107, 284, 1727, 225, 445, 227, 447, 188, 107, + 107, 153, 1724, 445, 254, 447, 549, 110, 187, 445, + 107, 447, 1282, 744, 107, 107, 445, 107, 447, 147, + 314, 124, 565, 473, 186, 107, 94, 1503, 478, 107, + 107, 473, 118, 1220, 577, 107, 478, 473, 273, 52, + 197, 269, 478, 147, 473, 154, 149, 156, 276, 478, + 153, 186, 169, 156, 597, 598, 107, 905, 286, 107, + 107, 1232, 1107, 1108, 1109, 153, 1372, 188, 184, 221, + 222, 45, 107, 47, 177, 1381, 1345, 184, 96, 187, + 1349, 1241, 1769, 314, 1216, 202, 1392, 935, 94, 177, + 187, 184, 184, 94, 184, 1107, 1108, 1109, 107, 549, + 186, 348, 184, 1092, 351, 1404, 556, 549, 136, 187, + 187, 144, 9, 10, 556, 187, 129, 9, 10, 5, + 556, 107, 150, 9, 963, 964, 857, 556, 237, 968, + 96, 5, 106, 130, 1404, 9, 187, 94, 156, 187, + 187, 9, 685, 176, 688, 689, 147, 690, 598, 106, + 218, 219, 187, 884, 96, 605, 598, 268, 611, 998, + 28, 194, 598, 605, 275, 233, 616, 617, 618, 619, + 1611, 113, 153, 29, 616, 617, 618, 619, 187, 426, + 1367, 147, 429, 42, 94, 635, 433, 46, 1487, 436, + 437, 1490, 51, 635, 168, 153, 106, 444, 184, 118, + 197, 744, 866, 450, 451, 872, 103, 182, 455, 876, + 69, 103, 218, 219, 156, 9, 463, 1487, 94, 177, + 1490, 196, 469, 470, 471, 472, 123, 233, 125, 156, + 477, 123, 142, 125, 28, 100, 96, 123, 485, 125, + 24, 1501, 1714, 1715, 9, 10, 1506, 133, 113, 123, + 34, 125, 1558, 113, 110, 123, 153, 125, 94, 133, + 157, 153, 1723, 247, 248, 157, 134, 153, 124, 812, + 813, 814, 1383, 816, 1122, 1123, 60, 174, 154, 153, + 156, 1452, 174, 530, 1756, 153, 270, 53, 122, 45, + 1762, 47, 58, 149, 744, 158, 156, 544, 195, 106, + 620, 137, 744, 195, 624, 1437, 142, 1352, 555, 168, + 156, 148, 171, 176, 857, 1, 213, 3, 768, 153, + 127, 213, 156, 79, 148, 156, 768, 186, 165, 123, + 96, 125, 768, 95, 191, 192, 583, 1124, 103, 768, + 134, 165, 589, 768, 106, 1004, 593, 1006, 798, 799, + 106, 9, 10, 212, 116, 953, 798, 799, 123, 153, + 125, 156, 798, 799, 96, 127, 1097, 965, 42, 798, + 799, 1670, 46, 1672, 1634, 26, 27, 51, 1638, 182, + 66, 113, 201, 158, 156, 71, 37, 38, 153, 40, + 41, 210, 157, 196, 122, 69, 47, 1056, 117, 1058, + 1670, 176, 1672, 269, 1703, 56, 57, 857, 263, 174, + 276, 137, 168, 33, 156, 857, 142, 42, 156, 274, + 286, 46, 1261, 74, 199, 878, 51, 146, 79, 49, + 195, 1098, 118, 1703, 884, 1734, 158, 1104, 1549, 1550, + 159, 137, 884, 122, 69, 103, 53, 137, 213, 122, + 1749, 58, 1751, 100, 176, 100, 1542, 153, 1718, 1591, + 111, 112, 113, 153, 1734, 123, 113, 125, 113, 100, + 77, 100, 100, 1101, 721, 194, 263, 199, 118, 1749, + 691, 1751, 113, 694, 113, 113, 697, 274, 735, 96, + 122, 137, 739, 740, 168, 153, 142, 171, 299, 157, + 1687, 128, 129, 53, 277, 278, 279, 308, 58, 160, + 283, 118, 186, 128, 129, 762, 174, 764, 153, 153, + 1359, 156, 156, 153, 1372, 772, 156, 153, 775, 1260, + 156, 347, 779, 1381, 350, 666, 667, 195, 212, 221, + 222, 223, 122, 168, 1392, 118, 171, 1658, 1659, 154, + 122, 156, 232, 122, 234, 213, 675, 676, 673, 674, + 1692, 186, 1214, 1215, 1579, 1580, 153, 122, 122, 220, + 122, 122, 153, 820, 216, 118, 241, 156, 1121, 241, + 156, 242, 153, 314, 0, 167, 190, 212, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 1344, 92, + 249, 1051, 99, 50, 200, 101, 1738, 102, 193, 1051, + 261, 145, 859, 154, 156, 1051, 184, 184, 184, 1730, + 29, 47, 1051, 152, 118, 246, 304, 187, 284, 284, + 1469, 118, 153, 1, 118, 142, 287, 107, 187, 153, + 153, 888, 142, 121, 295, 156, 156, 1097, 156, 184, + 156, 156, 303, 1106, 156, 1097, 35, 1107, 1108, 1109, + 17, 214, 153, 29, 187, 1107, 1108, 1109, 132, 231, + 156, 918, 919, 920, 921, 156, 140, 141, 1810, 143, + 1812, 190, 230, 3, 245, 118, 190, 151, 168, 70, + 1822, 155, 231, 157, 1533, 170, 170, 94, 162, 94, + 94, 149, 107, 107, 29, 160, 160, 127, 132, 956, + 1558, 94, 142, 1341, 246, 179, 299, 118, 132, 184, + 187, 184, 107, 970, 94, 187, 45, 96, 187, 96, + 187, 187, 184, 184, 187, 153, 153, 73, 153, 203, + 204, 205, 206, 207, 208, 153, 153, 153, 995, 94, + 1481, 87, 237, 225, 231, 142, 190, 1004, 33, 1006, + 233, 1008, 118, 1010, 142, 94, 29, 170, 132, 286, + 94, 299, 127, 153, 1224, 111, 1023, 227, 118, 118, + 94, 132, 1224, 254, 147, 184, 198, 123, 1224, 125, + 132, 1522, 96, 153, 147, 1224, 118, 100, 160, 1224, + 100, 153, 184, 121, 142, 35, 190, 184, 29, 1056, + 1260, 1058, 118, 245, 79, 107, 107, 285, 1260, 258, + 260, 1271, 267, 156, 156, 156, 156, 144, 156, 1271, + 156, 29, 29, 156, 29, 1271, 227, 286, 187, 187, + 1290, 287, 1271, 190, 187, 1092, 1271, 144, 1290, 147, + 187, 127, 147, 147, 1290, 77, 118, 118, 107, 142, + 1310, 1290, 306, 184, 198, 1290, 100, 7, 1310, 96, + 1117, 187, 187, 132, 1310, 233, 237, 190, 1609, 233, + 153, 1310, 156, 233, 186, 156, 156, 233, 106, 1620, + 1621, 1138, 1623, 147, 187, 78, 282, 286, 1348, 1630, + 187, 187, 187, 187, 29, 187, 1348, 187, 187, 250, + 29, 107, 1348, 170, 147, 250, 184, 126, 147, 126, + 96, 153, 186, 316, 184, 142, 94, 271, 186, 29, + 257, 186, 184, 186, 184, 96, 184, 147, 53, 170, + 187, 187, 94, 186, 186, 94, 197, 106, 29, 107, + 107, 118, 118, 225, 265, 94, 94, 197, 186, 197, + 186, 198, 118, 186, 93, 118, 186, 183, 280, 225, + 118, 186, 197, 186, 118, 199, 1519, 1520, 1521, 287, + 1711, 225, 259, 1230, 724, 1177, 293, 1234, 957, 256, + 256, 287, 420, 1024, 1692, 305, 305, 440, 1221, 1738, + 305, 1021, 1249, 781, 1462, 306, 860, 306, 1250, 1368, + 1363, 1258, 348, 455, 1113, 351, 306, 544, 1272, 1750, + 1366, 1277, 1280, 1285, 646, 1272, 645, 665, 921, 699, + 1304, 1481, 821, 1762, 1756, 1282, 1006, 1768, 448, 1481, + 1176, 1346, 1335, 1558, 1345, 1392, 335, 1381, 448, 1123, + 1555, 1132, 1783, 1385, 989, 1199, 1427, 1582, -1, 1382, + -1, 587, -1, -1, 1311, -1, -1, -1, -1, -1, + -1, -1, 1522, 1804, -1, -1, -1, -1, -1, -1, + 1522, -1, 1813, -1, -1, -1, -1, -1, 1335, 425, + 426, -1, -1, 429, -1, -1, -1, 433, 1345, -1, + 436, 437, 1349, -1, -1, -1, -1, 1650, 444, -1, + -1, -1, -1, -1, 450, 451, -1, -1, -1, 455, + -1, -1, -1, -1, -1, 1668, -1, 463, -1, -1, + -1, -1, -1, 469, 470, 471, 472, -1, -1, -1, + -1, 477, -1, -1, -1, -1, -1, -1, -1, 485, + -1, -1, -1, -1, -1, -1, -1, 1404, -1, 1609, + -1, -1, -1, -1, -1, -1, -1, 1609, -1, -1, + 1620, 1621, -1, 1623, -1, -1, -1, -1, 1620, 1621, + 1630, 1623, -1, -1, -1, -1, 1433, -1, 1630, -1, + -1, -1, -1, -1, 530, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 544, -1, + -1, -1, 1459, 1460, -1, -1, -1, -1, -1, 555, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 821, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1485, -1, + 1487, -1, -1, 1490, -1, -1, -1, -1, -1, -1, + -1, 108, -1, -1, -1, 1502, -1, 593, -1, -1, + 1507, 1711, -1, -1, -1, -1, -1, -1, -1, 1711, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1625, -1, 1627, -1, 1629, -1, -1, -1, -1, -1, - -1, 1636, -1, -1, -1, 860, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1750, -1, -1, -1, -1, -1, -1, -1, 1750, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1768, -1, + -1, -1, -1, -1, -1, -1, 1768, -1, -1, -1, + -1, -1, -1, 1783, -1, -1, -1, -1, -1, -1, + -1, 1783, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1804, -1, -1, -1, -1, -1, + -1, -1, 1804, 1813, -1, -1, -1, -1, -1, -1, + -1, 1813, -1, -1, -1, -1, -1, 1624, -1, 1626, + -1, 1628, 718, -1, -1, 721, -1, -1, 1635, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 735, + -1, -1, -1, 739, 740, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 888, -1, -1, 1671, -1, 1673, -1, + -1, -1, -1, 1670, -1, 1672, 762, -1, 764, -1, + -1, -1, -1, -1, -1, -1, 772, -1, -1, 775, + -1, 1688, -1, 779, 1691, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1703, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1713, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1689, -1, -1, 1692, -1, -1, - -1, -1, -1, 918, 919, 920, 921, -1, -1, 1704, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1714, + -1, -1, -1, -1, 820, -1, -1, 1734, -1, -1, + -1, -1, -1, -1, -1, 1742, -1, -1, -1, -1, + 1747, -1, 1749, -1, 1751, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1734, - -1, 956, -1, -1, -1, -1, -1, 1742, -1, -1, - -1, -1, 1747, -1, 1749, 970, 1751, -1, -1, -1, + -1, -1, -1, 859, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 888, 1800, -1, -1, -1, -1, 1805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 995, -1, -1, -1, 1779, -1, -1, -1, -1, 1004, - -1, 1006, -1, 1008, -1, 1010, -1, -1, -1, -1, - 1795, -1, -1, -1, 1799, -1, -1, -1, 1023, -1, + 1817, -1, -1, 1820, -1, -1, -1, -1, -1, -1, + -1, -1, 918, 919, 920, 921, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1815, -1, -1, 1818, -1, 556, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1056, -1, 1058, -1, -1, -1, -1, -1, -1, - 581, 582, -1, -1, 585, 586, 587, 588, -1, 590, - -1, -1, -1, -1, -1, 596, -1, -1, -1, -1, - -1, -1, -1, 604, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 626, 627, 628, -1, -1, - -1, -1, -1, -1, -1, 636, 637, 1122, -1, -1, + 956, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 970, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 1143, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 995, + -1, -1, -1, -1, -1, -1, -1, -1, 1004, -1, + 1006, -1, 1008, -1, 1010, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1023, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 556, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1056, -1, 1058, -1, 581, 582, -1, -1, 585, 586, + 587, 588, -1, 590, -1, -1, -1, -1, -1, 596, + -1, -1, -1, -1, -1, -1, -1, 604, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 697, -1, -1, 700, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 626, + 627, -1, -1, -1, -1, -1, -1, -1, 635, 636, + -1, 1117, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 1138, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 738, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1234, - -1, -1, -1, 1238, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 1253, -1, - -1, -1, -1, -1, -1, -1, -1, 1262, -1, -1, - 781, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1276, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1286, -1, -1, -1, 806, -1, -1, -1, 810, - 811, -1, -1, -1, -1, -1, -1, -1, 819, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 696, + -1, -1, 699, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1315, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1339, -1, -1, -1, -1, -1, - -1, -1, -1, 1348, -1, -1, 1351, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 890, + 737, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1230, -1, -1, -1, 1234, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1249, -1, -1, -1, -1, -1, -1, + -1, -1, 1258, 780, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1272, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1282, -1, 805, -1, + -1, -1, 809, 810, -1, -1, -1, -1, -1, -1, + -1, 818, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 1311, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1335, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1345, + -1, -1, -1, 1349, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 884, -1, -1, + -1, -1, -1, 890, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1406, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1404, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1435, -1, -1, -1, -1, -1, -1, 958, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 1461, 1462, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1433, -1, -1, + -1, 958, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 993, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 1487, -1, 1489, -1, -1, 1492, -1, -1, - -1, 1012, -1, -1, -1, -1, -1, -1, -1, 1504, - -1, -1, -1, -1, 1509, -1, -1, -1, -1, -1, - -1, -1, -1, 1034, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1045, 1046, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1060, - -1, -1, 1063, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 1079, 1080, - 1081, -1, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, - 1091, -1, -1, 1094, 1095, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1108, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1118, -1, -1, + -1, -1, -1, 1459, 1460, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 993, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1485, + -1, 1487, -1, -1, 1490, 1012, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1502, -1, -1, -1, + -1, 1507, -1, -1, -1, -1, -1, 1034, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1045, 1046, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1060, -1, -1, 1063, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1625, -1, 1627, -1, 1629, -1, -1, -1, -1, -1, - -1, 1636, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1168, -1, -1, + -1, -1, 1079, 1080, 1081, -1, 1083, 1084, 1085, 1086, + 1087, 1088, 1089, 1090, 1091, -1, -1, 1094, 1095, -1, + -1, -1, -1, -1, -1, -1, 1103, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1113, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 1671, -1, 1673, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1689, -1, -1, 1692, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1704, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1714, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1240, - -1, 1242, -1, 1244, -1, -1, 1247, -1, -1, 1734, - -1, 1252, -1, -1, -1, -1, -1, 1742, -1, -1, - -1, -1, 1747, 1264, 1749, -1, 1751, -1, -1, -1, - -1, -1, 1273, -1, -1, -1, -1, -1, 1279, 1280, + -1, -1, -1, -1, -1, -1, -1, -1, 1624, -1, + 1626, -1, 1628, -1, -1, -1, -1, -1, -1, 1635, + -1, -1, -1, -1, -1, -1, -1, 1164, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1779, -1, -1, 1298, -1, -1, - 1301, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1795, -1, -1, -1, 1799, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1815, -1, -1, 1818, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1670, -1, 1672, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 1688, -1, -1, 1691, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1703, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1713, -1, 1236, + -1, 1238, -1, 1240, -1, -1, 1243, -1, -1, -1, + -1, 1248, -1, -1, -1, -1, -1, -1, 1734, -1, + -1, -1, -1, 1260, -1, -1, 1742, -1, -1, -1, + -1, 1747, 1269, 1749, -1, 1751, -1, -1, 1275, 1276, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1368, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1294, -1, -1, + 1297, -1, -1, -1, 1780, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 1800, -1, -1, -1, -1, 1805, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 1817, -1, -1, 1820, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1366, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1448, -1, -1, - -1, 1452, -1, -1, -1, 1456, -1, 1458, -1, 1460, - -1, -1, -1, -1, -1, 1466, -1, -1, -1, -1, - -1, -1, -1, 1474, -1, -1, -1, -1, -1, -1, - -1, 1482, 1483, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 1501, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 1512, 1513, 1514, 1515, -1, 1517, 1518, -1, 1520, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 1535, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 1446, + -1, -1, -1, 1450, -1, -1, -1, 1454, -1, 1456, + -1, 1458, -1, -1, -1, -1, -1, 1464, -1, -1, + -1, -1, -1, -1, -1, 1472, -1, -1, -1, -1, + -1, -1, -1, 1480, 1481, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 1499, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1510, 1511, 1512, 1513, -1, 1515, 1516, + -1, 1518, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 1534, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1598, -1, 1600, - -1, -1, 1603, -1, -1, -1, -1, -1, -1, -1, - 1611, -1, -1, -1, -1, 1616, 1617, -1, -1, -1, - -1, -1, -1, 1624, -1, -1, -1, 1628, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 1644, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 1656, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 1597, -1, 1599, -1, -1, 1602, -1, -1, -1, -1, + -1, -1, -1, 1610, -1, -1, -1, -1, 1615, 1616, + -1, -1, -1, -1, -1, -1, 1623, -1, -1, -1, + 1627, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 1643, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1655, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 1696, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1708, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 1695, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 1750, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 1777, -1, -1, -1, - -1, 1782, -1, -1, -1, -1, 1787, -1, -1, 3, - -1, -1, -1, -1, -1, -1, -1, 11, 12, -1, - -1, 1802, -1, -1, -1, 1806, 20, 21, 22, 23, - 24, 25, -1, -1, -1, 29, -1, -1, -1, 33, - 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 67, -1, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, - 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, - 94, 95, 96, 97, 98, -1, 100, 101, 102, -1, - -1, 105, 106, -1, -1, -1, 110, 111, 112, 113, - 114, 115, 116, 117, 118, 119, 120, -1, -1, -1, - 124, -1, 126, 127, 128, 129, -1, 131, -1, -1, - -1, 135, 136, 137, 138, 139, -1, -1, -1, -1, - -1, -1, 146, 147, 148, 149, 150, 151, 152, 153, - 154, -1, 156, 157, 158, 159, 160, -1, -1, -1, - -1, 165, 166, 167, 168, 169, 170, 171, 172, -1, - 174, -1, 176, 177, -1, -1, 180, 181, 182, -1, - -1, -1, 186, -1, 188, 189, -1, 191, 192, -1, - 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, -1, -1, 211, 212, 213, - -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, - 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, - 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, - 254, 255, 256, 257, -1, 259, 260, 261, -1, 263, - 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, - 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, - 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, -1, 312, -1, - 314, 315, 316, 317, 318, 319, 320, 0, 1, -1, - 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 42, - -1, -1, -1, 46, -1, -1, -1, 50, 51, -1, - -1, -1, 55, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 66, -1, -1, 69, -1, 71, -1, + 1707, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 92, - -1, 94, 95, 96, -1, -1, 99, 100, 101, 102, - -1, -1, -1, 106, 107, -1, -1, -1, -1, -1, - 113, -1, -1, 116, 117, 118, -1, -1, 121, -1, - -1, -1, -1, 126, 127, -1, -1, -1, -1, 132, - -1, -1, -1, 136, -1, -1, -1, 140, 141, -1, - 143, -1, 145, 146, -1, -1, -1, 150, 151, -1, - -1, 154, 155, 156, 157, 158, 159, -1, -1, 162, - -1, -1, -1, -1, 167, 168, -1, -1, 171, -1, - -1, -1, -1, 176, -1, -1, 179, -1, -1, -1, - -1, 184, 185, 186, 187, 188, -1, 190, 191, 192, - 193, 194, -1, -1, -1, -1, 199, 200, 201, -1, - 203, 204, 205, 206, 207, 208, -1, 210, -1, 212, - -1, -1, -1, -1, 217, 218, 219, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 233, -1, 235, -1, 237, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 249, -1, -1, -1, - -1, 254, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 1750, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 11, - 12, -1, -1, -1, -1, -1, -1, -1, 20, 21, - 22, 23, 24, 25, 26, 27, -1, 29, 311, -1, - 313, 33, 34, -1, 36, 37, 38, 39, 40, 41, + -1, -1, -1, -1, -1, -1, -1, -1, 0, 1, + -1, 1778, -1, -1, -1, -1, 1783, -1, -1, 11, + 12, 1788, -1, -1, -1, -1, -1, -1, 20, 21, + 22, 23, 24, 25, 26, 27, 1803, 29, -1, -1, + 1807, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, -1, 69, 70, 71, @@ -14949,784 +15101,937 @@ 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, -1, - 312, -1, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 11, 12, -1, -1, -1, -1, -1, -1, -1, - 20, 21, 22, 23, 24, 25, 26, 27, -1, 29, - -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, -1, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, -1, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, 98, -1, - 100, 101, 102, -1, -1, 105, 106, -1, -1, -1, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, -1, -1, -1, 124, -1, 126, 127, 128, 129, - -1, 131, -1, -1, -1, 135, 136, 137, 138, 139, - -1, -1, -1, -1, -1, -1, 146, 147, 148, 149, - 150, 151, 152, 153, 154, -1, 156, 157, 158, 159, - 160, -1, -1, -1, -1, 165, 166, 167, 168, 169, - 170, 171, 172, -1, 174, -1, 176, 177, -1, -1, - 180, 181, 182, -1, -1, -1, 186, -1, 188, 189, - -1, 191, 192, -1, 194, -1, 196, -1, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, -1, - -1, 211, 212, 213, -1, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, -1, 259, - 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, -1, 312, -1, 314, 315, 316, 317, 318, 319, - 320, -1, 322, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, 184, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, 184, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, 184, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, 184, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, 26, 27, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, 185, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, 187, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, 311, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, 313, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, 184, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, 187, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, 187, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - 158, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, 176, 177, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, -1, -1, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, 191, 192, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, 150, 151, 152, 153, 154, -1, 156, 157, - -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, -1, -1, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, -1, -1, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, 21, 22, 23, 24, 25, -1, -1, - -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - 98, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, -1, -1, -1, 124, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, -1, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, 149, -1, 151, 152, 153, 154, -1, 156, 157, - -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, 174, -1, -1, -1, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, -1, -1, -1, 194, -1, 196, -1, - 198, -1, 200, -1, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, 213, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, 310, -1, 312, -1, 314, 315, 316, 317, - 318, 319, 320, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 20, -1, -1, -1, 24, 25, -1, -1, - -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, - 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, - -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, - 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, - -1, -1, 100, 101, 102, -1, -1, 105, 106, -1, - -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, - -1, -1, -1, -1, -1, -1, -1, -1, 126, 127, - 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, - 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, - 148, -1, 150, 151, 152, -1, -1, -1, -1, -1, - -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, - 168, 169, 170, 171, 172, -1, -1, -1, -1, -1, - -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, - 188, 189, -1, -1, -1, -1, 194, -1, 196, -1, - 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, - 208, -1, -1, 211, 212, -1, -1, 215, 216, 217, - 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, - 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, - 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, - -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, - 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, - 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, - 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 309, -1, -1, 11, 12, 314, 315, 316, 317, - 318, 319, 320, 20, -1, -1, -1, 24, 25, -1, - -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, + 312, -1, 314, 315, 316, 317, 318, 319, 320, 0, + 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, + 21, 22, 23, 24, 25, 26, 27, -1, 29, -1, + -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, -1, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, 94, 95, 96, 97, 98, -1, 100, + 101, 102, -1, -1, 105, 106, -1, -1, -1, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + -1, -1, -1, 124, -1, 126, 127, 128, 129, -1, + 131, -1, -1, -1, 135, 136, 137, 138, 139, -1, + -1, -1, -1, -1, -1, 146, 147, 148, 149, 150, + 151, 152, 153, 154, -1, 156, 157, 158, 159, 160, + -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, + 171, 172, -1, 174, -1, 176, 177, -1, -1, 180, + 181, 182, -1, -1, -1, 186, -1, 188, 189, -1, + 191, 192, -1, 194, -1, 196, -1, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, -1, -1, + 211, 212, 213, -1, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, -1, 259, 260, + 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 1, 312, -1, 314, 315, 316, 317, 318, 319, 320, + 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, + 21, 22, 23, 24, 25, 26, 27, -1, 29, -1, + -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, -1, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, 94, 95, 96, 97, 98, -1, 100, + 101, 102, -1, -1, 105, 106, -1, -1, -1, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + -1, -1, -1, 124, -1, 126, 127, 128, 129, -1, + 131, -1, -1, -1, 135, 136, 137, 138, 139, -1, + -1, -1, -1, -1, -1, 146, 147, 148, 149, 150, + 151, 152, 153, 154, -1, 156, 157, 158, 159, 160, + -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, + 171, 172, -1, 174, -1, 176, 177, -1, -1, 180, + 181, 182, -1, -1, -1, 186, -1, 188, 189, -1, + 191, 192, -1, 194, -1, 196, -1, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, -1, -1, + 211, 212, 213, -1, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, -1, 259, 260, + 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 1, 312, -1, 314, 315, 316, 317, 318, 319, 320, + 11, 12, -1, -1, -1, -1, -1, -1, -1, 20, + 21, 22, 23, 24, 25, -1, -1, -1, 29, -1, + -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, -1, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, + 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, + 91, 92, -1, 94, 95, 96, 97, 98, -1, 100, + 101, 102, -1, -1, 105, 106, -1, -1, -1, 110, + 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, + -1, -1, -1, 124, -1, 126, 127, 128, 129, -1, + 131, -1, -1, -1, 135, 136, 137, 138, 139, -1, + -1, -1, -1, -1, -1, 146, 147, 148, 149, 150, + 151, 152, 153, 154, -1, 156, 157, 158, 159, 160, + -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, + 171, 172, -1, 174, -1, 176, 177, -1, -1, 180, + 181, 182, -1, -1, -1, 186, -1, 188, 189, -1, + 191, 192, -1, 194, -1, 196, -1, 198, 199, 200, + 201, 202, 203, 204, 205, 206, 207, 208, -1, -1, + 211, 212, 213, -1, 215, 216, 217, 218, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, + 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, + 251, 252, 253, 254, 255, 256, 257, -1, 259, 260, + 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, + 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, + 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + -1, 312, -1, 314, 315, 316, 317, 318, 319, 320, + 0, 1, -1, 3, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 42, -1, -1, -1, 46, -1, -1, -1, + 50, 51, -1, -1, -1, 55, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 66, -1, -1, 69, + -1, 71, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 92, -1, 94, 95, 96, -1, -1, 99, + 100, 101, 102, -1, -1, -1, 106, 107, -1, -1, + -1, -1, -1, 113, -1, -1, 116, 117, 118, -1, + -1, 121, -1, -1, -1, -1, 126, 127, -1, -1, + -1, -1, 132, -1, -1, -1, 136, -1, -1, -1, + 140, 141, -1, 143, -1, 145, 146, -1, -1, -1, + 150, 151, -1, -1, 154, 155, 156, 157, 158, 159, + -1, -1, 162, -1, -1, -1, -1, 167, 168, -1, + -1, 171, -1, -1, -1, -1, 176, -1, -1, 179, + -1, -1, -1, -1, 184, 185, 186, 187, 188, -1, + 190, 191, 192, 193, 194, -1, -1, -1, -1, 199, + 200, 201, -1, 203, 204, 205, 206, 207, 208, -1, + 210, -1, 212, -1, -1, -1, -1, 217, 218, 219, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 233, -1, 235, -1, 237, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 249, + -1, -1, -1, -1, 254, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 11, 12, -1, -1, -1, -1, -1, -1, + -1, 20, 21, 22, 23, 24, 25, 26, 27, -1, + 29, 311, -1, 313, 33, 34, -1, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + 49, 50, 51, 52, 53, -1, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 64, 65, 66, 67, -1, + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, -1, 94, 95, 96, 97, 98, + -1, 100, 101, 102, -1, -1, 105, 106, -1, -1, + -1, 110, 111, 112, 113, 114, 115, 116, 117, 118, + 119, 120, -1, -1, -1, 124, -1, 126, 127, 128, + 129, -1, 131, -1, -1, -1, 135, 136, 137, 138, + 139, -1, -1, -1, -1, -1, -1, 146, 147, 148, + 149, 150, 151, 152, 153, 154, -1, 156, 157, 158, + 159, 160, -1, -1, -1, -1, 165, 166, 167, 168, + 169, 170, 171, 172, -1, 174, -1, 176, 177, -1, + -1, 180, 181, 182, -1, -1, -1, 186, -1, 188, + 189, -1, 191, 192, -1, 194, -1, 196, -1, 198, + 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, + -1, -1, 211, 212, 213, -1, 215, 216, 217, 218, + 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 257, -1, + 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, + 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, + 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, + 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, -1, 312, -1, 314, 315, 316, 317, 318, + 319, 320, 321, 322, 11, 12, -1, -1, -1, -1, + -1, -1, -1, 20, 21, 22, 23, 24, 25, 26, + 27, -1, 29, -1, -1, -1, 33, 34, -1, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, -1, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, 98, -1, 100, 101, 102, -1, -1, 105, 106, + -1, -1, -1, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, -1, -1, -1, 124, -1, 126, + 127, 128, 129, -1, 131, -1, -1, -1, 135, 136, + 137, 138, 139, -1, -1, -1, -1, -1, -1, 146, + 147, 148, 149, 150, 151, 152, 153, 154, -1, 156, + 157, 158, 159, 160, -1, -1, -1, -1, 165, 166, + 167, 168, 169, 170, 171, 172, -1, 174, -1, 176, + 177, -1, -1, 180, 181, 182, -1, -1, -1, 186, + -1, 188, 189, -1, 191, 192, -1, 194, -1, 196, + -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, -1, -1, 211, 212, 213, -1, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, -1, 312, -1, 314, 315, 316, + 317, 318, 319, 320, -1, 322, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, 184, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, 184, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, 184, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, 26, 27, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + 185, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, 187, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, 184, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, 187, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, 187, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, 158, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, 176, 177, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, -1, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, 191, 192, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, 150, 151, 152, 153, 154, + -1, 156, 157, -1, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, -1, -1, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, 21, 22, 23, 24, + 25, -1, -1, -1, 29, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, 98, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, -1, -1, -1, 124, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, -1, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, 149, -1, 151, 152, 153, 154, + -1, 156, 157, -1, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, 174, + -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, -1, -1, -1, 194, + -1, 196, -1, 198, -1, 200, -1, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, 213, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, -1, 312, -1, 314, + 315, 316, 317, 318, 319, 320, 11, 12, -1, -1, + -1, -1, -1, -1, -1, 20, -1, -1, -1, 24, + 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, + 95, 96, 97, -1, -1, 100, 101, 102, -1, -1, + 105, 106, -1, -1, -1, -1, 111, 112, 113, 114, + 115, 116, 117, -1, -1, -1, -1, -1, -1, -1, + -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, + 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, + -1, 146, 147, 148, -1, 150, 151, 152, -1, -1, + -1, -1, -1, -1, 159, 160, -1, -1, -1, -1, + 165, 166, 167, 168, 169, 170, 171, 172, -1, -1, + -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, + -1, 186, -1, 188, 189, -1, -1, -1, -1, 194, + -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, + 205, 206, 207, 208, -1, -1, 211, 212, -1, -1, + 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, + 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, + 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, -1, -1, 11, 12, 314, + 315, 316, 317, 318, 319, 320, 20, -1, -1, -1, + 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, + 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, -1, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + 94, 95, 96, 97, -1, -1, 100, 101, 102, -1, + -1, 105, 106, -1, -1, -1, -1, 111, 112, 113, + 114, 115, 116, 117, -1, -1, -1, -1, -1, -1, + -1, -1, 126, 127, 128, 129, -1, 131, -1, -1, + -1, 135, 136, 137, 138, 139, -1, -1, -1, -1, + -1, -1, 146, 147, 148, -1, 150, 151, 152, -1, + -1, -1, -1, -1, -1, 159, 160, -1, -1, -1, + -1, 165, 166, 167, 168, 169, 170, 171, 172, -1, + -1, -1, -1, -1, -1, -1, 180, 181, 182, -1, + -1, -1, 186, -1, 188, 189, -1, -1, -1, -1, + 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, -1, -1, 211, 212, -1, + -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, -1, 259, 260, 261, -1, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, -1, -1, -1, 16, + 314, 315, 316, 317, 318, 319, 320, 24, 25, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, @@ -15742,7 +16047,7 @@ -1, -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, 172, -1, -1, -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, -1, 186, - -1, 188, 189, -1, -1, -1, -1, 194, -1, 196, + 187, 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, -1, -1, 211, 212, -1, -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, @@ -15755,7 +16060,7 @@ 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, -1, -1, -1, 16, 314, 315, 316, - 317, 318, 319, 320, 24, 25, -1, -1, -1, 29, + 317, 318, 319, 320, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, 58, 59, @@ -15771,7 +16076,7 @@ 150, 151, 152, -1, -1, -1, -1, -1, -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, 172, -1, -1, -1, -1, -1, -1, -1, - 180, 181, 182, -1, -1, -1, 186, 187, 188, 189, + 180, 181, 182, -1, -1, -1, 186, -1, 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, -1, -1, 211, 212, -1, -1, 215, 216, 217, 218, 219, @@ -15784,60 +16089,378 @@ 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - -1, -1, -1, 16, 314, 315, 316, 317, 318, 319, - 320, 24, 25, -1, -1, -1, -1, -1, -1, -1, - 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, -1, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, -1, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - -1, 94, 95, 96, 97, -1, -1, 100, 101, 102, - -1, -1, 105, 106, -1, -1, -1, -1, 111, 112, - 113, 114, 115, 116, 117, -1, -1, -1, -1, -1, - -1, -1, -1, 126, 127, 128, 129, -1, 131, -1, - -1, -1, 135, 136, 137, 138, 139, -1, -1, -1, - -1, -1, -1, 146, 147, 148, -1, 150, 151, 152, - -1, -1, -1, -1, -1, -1, 159, 160, -1, -1, - -1, -1, 165, 166, 167, 168, 169, 170, 171, 172, - -1, -1, -1, -1, -1, -1, -1, 180, 181, 182, - -1, -1, -1, 186, -1, 188, 189, -1, -1, -1, - -1, -1, -1, 196, -1, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, -1, -1, 211, 212, - -1, -1, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, -1, 259, 260, 261, -1, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, -1, -1, -1, - -1, 314, 315, 316, 317, 318, 319, 320, 18, 19, - -1, -1, -1, -1, 24, 25, -1, -1, -1, -1, + -1, -1, -1, -1, 314, 315, 316, 317, 318, 319, + 320, 18, 19, -1, -1, -1, -1, 24, 25, -1, + -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, -1, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, -1, -1, 100, 101, 102, -1, -1, 105, 106, + -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, + 117, -1, -1, -1, -1, -1, -1, -1, -1, 126, + 127, 128, 129, -1, 131, -1, -1, -1, 135, 136, + 137, 138, 139, -1, -1, -1, -1, -1, -1, 146, + 147, 148, -1, 150, 151, 152, -1, -1, -1, -1, + -1, -1, 159, 160, -1, -1, -1, -1, 165, 166, + 167, 168, 169, 170, 171, 172, -1, -1, -1, -1, + -1, -1, -1, 180, 181, 182, -1, -1, -1, 186, + -1, 188, 189, -1, -1, -1, -1, -1, -1, 196, + -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, -1, -1, 211, 212, -1, -1, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, -1, -1, -1, -1, 314, 315, 316, + 317, 318, 319, 320, 21, 22, 23, 24, 25, -1, + -1, -1, 29, -1, -1, -1, 33, 34, -1, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, -1, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, + 97, -1, -1, 100, 101, 102, -1, -1, 105, 106, + -1, -1, -1, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, -1, -1, -1, -1, 124, -1, 126, + 127, 128, 129, -1, 131, -1, -1, -1, 135, 136, + 137, 138, 139, -1, -1, -1, -1, -1, -1, 146, + 147, 148, 149, 150, 151, 152, 153, 154, -1, 156, + 157, -1, 159, 160, -1, -1, -1, -1, 165, 166, + 167, 168, 169, 170, 171, 172, -1, 174, -1, -1, + -1, -1, -1, 180, 181, 182, -1, -1, -1, 186, + -1, 188, 189, -1, -1, -1, -1, -1, -1, 196, + -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, + 207, 208, -1, -1, 211, 212, 213, -1, 215, 216, + 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, + 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, + 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, + 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, + 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, + 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, + 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, + 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, + 307, 308, 309, 310, -1, 312, -1, 314, 315, 316, + 317, 318, 319, 320, 24, 25, -1, -1, -1, -1, -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, -1, -1, + 90, 91, 92, -1, 94, 95, 96, 97, -1, -1, + 100, 101, 102, -1, -1, 105, 106, -1, -1, -1, + -1, 111, 112, 113, 114, 115, 116, 117, -1, -1, + -1, -1, -1, -1, -1, -1, 126, 127, 128, 129, + -1, 131, -1, -1, -1, 135, 136, 137, 138, 139, + -1, -1, -1, -1, -1, -1, 146, 147, 148, -1, + 150, 151, 152, -1, -1, -1, 156, -1, -1, 159, + 160, -1, -1, -1, -1, 165, 166, 167, 168, 169, + 170, 171, 172, -1, -1, -1, -1, -1, -1, -1, + 180, 181, 182, -1, -1, -1, 186, 187, 188, 189, + -1, -1, -1, -1, 194, -1, 196, -1, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, -1, + -1, 211, 212, -1, -1, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, -1, 259, + 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + -1, -1, 24, 25, 314, 315, 316, 317, 318, 319, + 320, 33, 34, -1, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, -1, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, 94, 95, 96, 97, -1, -1, 100, 101, + 102, -1, -1, 105, 106, -1, -1, -1, -1, 111, + 112, 113, 114, 115, 116, 117, -1, -1, -1, -1, + -1, -1, -1, -1, 126, 127, 128, 129, -1, 131, + -1, -1, -1, 135, 136, 137, 138, 139, -1, -1, + -1, -1, -1, -1, 146, 147, 148, -1, 150, 151, + 152, -1, -1, -1, -1, -1, -1, 159, 160, -1, + -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, + 172, -1, -1, -1, -1, -1, -1, -1, 180, 181, + 182, -1, -1, -1, 186, 187, 188, 189, -1, -1, + -1, -1, 194, -1, 196, -1, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, -1, -1, 211, + 212, -1, -1, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, -1, 259, 260, 261, + -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, -1, -1, + 24, 25, 314, 315, 316, 317, 318, 319, 320, 33, + 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, -1, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + 94, 95, 96, 97, -1, -1, 100, 101, 102, -1, + -1, 105, 106, -1, -1, -1, -1, 111, 112, 113, + 114, 115, 116, 117, -1, -1, -1, -1, -1, -1, + -1, -1, 126, 127, 128, 129, -1, 131, -1, -1, + -1, 135, 136, 137, 138, 139, -1, -1, -1, -1, + -1, -1, 146, 147, 148, -1, 150, 151, 152, -1, + -1, -1, -1, -1, -1, 159, 160, -1, -1, -1, + -1, 165, 166, 167, 168, 169, 170, 171, 172, -1, + -1, -1, -1, -1, -1, -1, 180, 181, 182, -1, + -1, -1, 186, 187, 188, 189, -1, -1, -1, -1, + 194, -1, 196, -1, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, -1, -1, 211, 212, -1, + -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, -1, 259, 260, 261, -1, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, -1, -1, 24, 25, + 314, 315, 316, 317, 318, 319, 320, 33, 34, -1, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, -1, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, + 96, 97, -1, -1, 100, 101, 102, -1, -1, 105, + 106, -1, -1, -1, -1, 111, 112, 113, 114, 115, + 116, 117, 118, -1, -1, -1, -1, -1, -1, -1, + 126, 127, 128, 129, -1, 131, -1, -1, -1, 135, + 136, 137, 138, 139, -1, -1, -1, -1, -1, -1, + 146, 147, 148, -1, 150, 151, 152, -1, -1, -1, + 156, -1, -1, 159, 160, -1, -1, -1, -1, 165, + 166, 167, 168, 169, 170, 171, 172, -1, -1, -1, + -1, -1, -1, -1, 180, 181, 182, -1, -1, -1, + 186, -1, 188, 189, -1, -1, -1, -1, -1, -1, + 196, -1, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, -1, -1, 211, 212, -1, -1, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, -1, 259, 260, 261, -1, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, -1, -1, 24, 25, 314, 315, + 316, 317, 318, 319, 320, 33, 34, -1, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, + -1, -1, 100, 101, 102, -1, -1, 105, 106, -1, + -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, + 118, -1, -1, -1, -1, -1, -1, -1, 126, 127, + 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, + 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, + 148, -1, 150, 151, 152, -1, -1, -1, 156, -1, + -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, + 168, 169, 170, 171, 172, -1, -1, -1, -1, -1, + -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, + 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, -1, -1, 211, 212, -1, -1, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, -1, -1, 24, 25, 314, 315, 316, 317, + 318, 319, 320, 33, 34, -1, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, -1, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 66, 67, -1, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, 94, 95, 96, 97, -1, -1, + 100, 101, 102, -1, -1, 105, 106, -1, -1, -1, + -1, 111, 112, 113, 114, 115, 116, 117, 118, -1, + -1, -1, -1, -1, -1, -1, 126, 127, 128, 129, + -1, 131, -1, -1, -1, 135, 136, 137, 138, 139, + -1, -1, -1, -1, -1, -1, 146, 147, 148, -1, + 150, 151, 152, -1, -1, -1, 156, -1, -1, 159, + 160, -1, -1, -1, -1, 165, 166, 167, 168, 169, + 170, 171, 172, -1, -1, -1, -1, -1, -1, -1, + 180, 181, 182, -1, -1, -1, 186, -1, 188, 189, + -1, -1, -1, -1, -1, -1, 196, -1, 198, 199, + 200, 201, 202, 203, 204, 205, 206, 207, 208, -1, + -1, 211, 212, -1, -1, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, + 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 250, 251, 252, 253, 254, 255, 256, 257, -1, 259, + 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, + 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, + 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, + -1, -1, 24, 25, 314, 315, 316, 317, 318, 319, + 320, 33, 34, -1, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, -1, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, -1, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, -1, 94, 95, 96, 97, -1, -1, 100, 101, + 102, -1, -1, 105, 106, -1, -1, -1, -1, 111, + 112, 113, 114, 115, 116, 117, -1, -1, -1, -1, + -1, -1, -1, -1, 126, 127, 128, 129, -1, 131, + -1, -1, -1, 135, 136, 137, 138, 139, -1, -1, + -1, -1, -1, -1, 146, 147, 148, -1, 150, 151, + 152, -1, -1, -1, 156, -1, -1, 159, 160, -1, + -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, + 172, -1, -1, -1, -1, -1, -1, -1, 180, 181, + 182, -1, -1, -1, 186, -1, 188, 189, -1, -1, + -1, -1, -1, -1, 196, -1, 198, 199, 200, 201, + 202, 203, 204, 205, 206, 207, 208, -1, -1, 211, + 212, -1, -1, 215, 216, 217, 218, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, + 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, + 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, + 252, 253, 254, 255, 256, 257, -1, 259, 260, 261, + -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, + 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, + 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, + 302, 303, 304, 305, 306, 307, 308, 309, -1, -1, + 24, 25, 314, 315, 316, 317, 318, 319, 320, 33, + 34, -1, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, + -1, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 64, 65, 66, 67, -1, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, -1, + 94, 95, 96, 97, -1, -1, 100, 101, 102, -1, + -1, 105, 106, -1, -1, -1, -1, 111, 112, 113, + 114, 115, 116, 117, -1, -1, -1, -1, -1, -1, + -1, -1, 126, 127, 128, 129, -1, 131, -1, -1, + -1, 135, 136, 137, 138, 139, -1, -1, -1, -1, + -1, -1, 146, 147, 148, -1, 150, 151, 152, -1, + -1, -1, 156, -1, -1, 159, 160, -1, -1, -1, + -1, 165, 166, 167, 168, 169, 170, 171, 172, -1, + -1, -1, -1, -1, -1, -1, 180, 181, 182, -1, + -1, -1, 186, -1, 188, 189, -1, -1, -1, -1, + -1, -1, 196, -1, 198, 199, 200, 201, 202, 203, + 204, 205, 206, 207, 208, -1, -1, 211, 212, -1, + -1, 215, 216, 217, 218, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, + 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, + 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, + 254, 255, 256, 257, -1, 259, 260, 261, -1, 263, + 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, + 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, + 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, + 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, + 304, 305, 306, 307, 308, 309, -1, -1, 24, 25, + 314, 315, 316, 317, 318, 319, 320, 33, 34, -1, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, -1, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, -1, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, -1, 94, 95, + 96, 97, -1, -1, 100, 101, 102, -1, -1, 105, + 106, -1, -1, -1, -1, 111, 112, 113, 114, 115, + 116, 117, 118, -1, -1, -1, -1, -1, -1, -1, + 126, 127, 128, 129, -1, 131, -1, -1, -1, 135, + 136, 137, 138, 139, -1, -1, -1, -1, -1, -1, + 146, 147, 148, -1, 150, 151, 152, -1, -1, -1, + -1, -1, -1, 159, 160, -1, -1, -1, -1, 165, + 166, 167, 168, 169, 170, 171, 172, -1, -1, -1, + -1, -1, -1, -1, 180, 181, 182, -1, -1, -1, + 186, -1, 188, 189, -1, -1, -1, -1, -1, -1, + 196, -1, 198, 199, 200, 201, 202, 203, 204, 205, + 206, 207, 208, -1, -1, 211, 212, -1, -1, 215, + 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, + 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, + 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, + 256, 257, -1, 259, 260, 261, -1, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, + 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, + 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, + 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, + 306, 307, 308, 309, -1, -1, 24, 25, 314, 315, + 316, 317, 318, 319, 320, 33, 34, -1, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, -1, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, + -1, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, -1, 94, 95, 96, 97, + -1, -1, 100, 101, 102, -1, -1, 105, 106, -1, + -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, + -1, -1, -1, -1, -1, -1, -1, -1, 126, 127, + 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, + 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, + 148, -1, 150, 151, 152, -1, -1, -1, -1, -1, + -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, + 168, 169, 170, 171, 172, -1, -1, -1, -1, -1, + -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, + 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, + 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, + 208, -1, -1, 211, 212, -1, -1, 215, 216, 217, + 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, + 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, + 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, + 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, + -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, + 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, + 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, + 308, 309, -1, -1, 24, 25, 314, 315, 316, 317, + 318, 319, 320, 33, 34, -1, 36, 37, 38, -1, + 40, 41, 42, 43, -1, -1, 46, 47, -1, 49, + 50, 51, 52, 53, -1, 55, 56, 57, 58, -1, + 60, -1, -1, 63, 64, 65, 66, 67, -1, 69, + -1, 71, -1, -1, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, 94, 95, 96, -1, -1, -1, 100, 101, 102, -1, -1, 105, 106, -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, -1, -1, -1, -1, -1, -1, -1, -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, -1, 146, 147, 148, -1, - 150, 151, 152, -1, -1, -1, -1, -1, -1, 159, + 150, 151, -1, -1, -1, -1, -1, -1, -1, 159, 160, -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, 171, 172, -1, -1, -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, -1, 186, -1, 188, 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, -1, - -1, 211, 212, -1, -1, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, + -1, -1, 212, -1, -1, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, -1, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, + 240, 241, 242, -1, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, @@ -15845,354 +16468,7 @@ 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, -1, -1, -1, -1, 314, 315, 316, 317, 318, 319, - 320, 21, 22, 23, 24, 25, -1, -1, -1, 29, - -1, -1, -1, 33, 34, -1, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 52, 53, -1, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, -1, 69, - 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, - 90, 91, 92, -1, 94, 95, 96, 97, -1, -1, - 100, 101, 102, -1, -1, 105, 106, -1, -1, -1, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - -1, -1, -1, -1, 124, -1, 126, 127, 128, 129, - -1, 131, -1, -1, -1, 135, 136, 137, 138, 139, - -1, -1, -1, -1, -1, -1, 146, 147, 148, 149, - 150, 151, 152, 153, 154, -1, 156, 157, -1, 159, - 160, -1, -1, -1, -1, 165, 166, 167, 168, 169, - 170, 171, 172, -1, 174, -1, -1, -1, -1, -1, - 180, 181, 182, -1, -1, -1, 186, -1, 188, 189, - -1, -1, -1, -1, -1, -1, 196, -1, 198, 199, - 200, 201, 202, 203, 204, 205, 206, 207, 208, -1, - -1, 211, 212, 213, -1, 215, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, - 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, - 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, - 250, 251, 252, 253, 254, 255, 256, 257, -1, 259, - 260, 261, -1, 263, 264, 265, 266, 267, 268, 269, - 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, - 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, - 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, - 310, -1, 312, -1, 314, 315, 316, 317, 318, 319, - 320, 24, 25, -1, -1, -1, -1, -1, -1, -1, - 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, -1, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, -1, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - -1, 94, 95, 96, 97, -1, -1, 100, 101, 102, - -1, -1, 105, 106, -1, -1, -1, -1, 111, 112, - 113, 114, 115, 116, 117, -1, -1, -1, -1, -1, - -1, -1, -1, 126, 127, 128, 129, -1, 131, -1, - -1, -1, 135, 136, 137, 138, 139, -1, -1, -1, - -1, -1, -1, 146, 147, 148, -1, 150, 151, 152, - -1, -1, -1, 156, -1, -1, 159, 160, -1, -1, - -1, -1, 165, 166, 167, 168, 169, 170, 171, 172, - -1, -1, -1, -1, -1, -1, -1, 180, 181, 182, - -1, -1, -1, 186, 187, 188, 189, -1, -1, -1, - -1, 194, -1, 196, -1, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, -1, -1, 211, 212, - -1, -1, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, -1, 259, 260, 261, -1, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, -1, -1, 24, - 25, 314, 315, 316, 317, 318, 319, 320, 33, 34, - -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, - 95, 96, 97, -1, -1, 100, 101, 102, -1, -1, - 105, 106, -1, -1, -1, -1, 111, 112, 113, 114, - 115, 116, 117, -1, -1, -1, -1, -1, -1, -1, - -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, - 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, - -1, 146, 147, 148, -1, 150, 151, 152, -1, -1, - -1, -1, -1, -1, 159, 160, -1, -1, -1, -1, - 165, 166, 167, 168, 169, 170, 171, 172, -1, -1, - -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, - -1, 186, 187, 188, 189, -1, -1, -1, -1, 194, - -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, -1, -1, 211, 212, -1, -1, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, -1, -1, 24, 25, 314, - 315, 316, 317, 318, 319, 320, 33, 34, -1, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, -1, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, - 97, -1, -1, 100, 101, 102, -1, -1, 105, 106, - -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, - 117, -1, -1, -1, -1, -1, -1, -1, -1, 126, - 127, 128, 129, -1, 131, -1, -1, -1, 135, 136, - 137, 138, 139, -1, -1, -1, -1, -1, -1, 146, - 147, 148, -1, 150, 151, 152, -1, -1, -1, -1, - -1, -1, 159, 160, -1, -1, -1, -1, 165, 166, - 167, 168, 169, 170, 171, 172, -1, -1, -1, -1, - -1, -1, -1, 180, 181, 182, -1, -1, -1, 186, - 187, 188, 189, -1, -1, -1, -1, 194, -1, 196, - -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, -1, -1, 211, 212, -1, -1, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, -1, -1, 24, 25, 314, 315, 316, - 317, 318, 319, 320, 33, 34, -1, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, -1, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, -1, 94, 95, 96, 97, -1, - -1, 100, 101, 102, -1, -1, 105, 106, -1, -1, - -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, - -1, -1, -1, -1, -1, -1, -1, 126, 127, 128, - 129, -1, 131, -1, -1, -1, 135, 136, 137, 138, - 139, -1, -1, -1, -1, -1, -1, 146, 147, 148, - -1, 150, 151, 152, -1, -1, -1, 156, -1, -1, - 159, 160, -1, -1, -1, -1, 165, 166, 167, 168, - 169, 170, 171, 172, -1, -1, -1, -1, -1, -1, - -1, 180, 181, 182, -1, -1, -1, 186, -1, 188, - 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - -1, -1, 211, 212, -1, -1, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, -1, - 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, -1, -1, 24, 25, 314, 315, 316, 317, 318, - 319, 320, 33, 34, -1, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, -1, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, -1, 94, 95, 96, 97, -1, -1, 100, - 101, 102, -1, -1, 105, 106, -1, -1, -1, -1, - 111, 112, 113, 114, 115, 116, 117, 118, -1, -1, - -1, -1, -1, -1, -1, 126, 127, 128, 129, -1, - 131, -1, -1, -1, 135, 136, 137, 138, 139, -1, - -1, -1, -1, -1, -1, 146, 147, 148, -1, 150, - 151, 152, -1, -1, -1, 156, -1, -1, 159, 160, - -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, - 171, 172, -1, -1, -1, -1, -1, -1, -1, 180, - 181, 182, -1, -1, -1, 186, -1, 188, 189, -1, - -1, -1, -1, -1, -1, 196, -1, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, -1, -1, - 211, 212, -1, -1, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, -1, 259, 260, - 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, -1, - -1, 24, 25, 314, 315, 316, 317, 318, 319, 320, - 33, 34, -1, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, - 53, -1, 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, -1, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - -1, 94, 95, 96, 97, -1, -1, 100, 101, 102, - -1, -1, 105, 106, -1, -1, -1, -1, 111, 112, - 113, 114, 115, 116, 117, 118, -1, -1, -1, -1, - -1, -1, -1, 126, 127, 128, 129, -1, 131, -1, - -1, -1, 135, 136, 137, 138, 139, -1, -1, -1, - -1, -1, -1, 146, 147, 148, -1, 150, 151, 152, - -1, -1, -1, 156, -1, -1, 159, 160, -1, -1, - -1, -1, 165, 166, 167, 168, 169, 170, 171, 172, - -1, -1, -1, -1, -1, -1, -1, 180, 181, 182, - -1, -1, -1, 186, -1, 188, 189, -1, -1, -1, - -1, -1, -1, 196, -1, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, -1, -1, 211, 212, - -1, -1, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, -1, 259, 260, 261, -1, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, -1, -1, 24, - 25, 314, 315, 316, 317, 318, 319, 320, 33, 34, - -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, -1, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, -1, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, -1, 94, - 95, 96, 97, -1, -1, 100, 101, 102, -1, -1, - 105, 106, -1, -1, -1, -1, 111, 112, 113, 114, - 115, 116, 117, -1, -1, -1, -1, -1, -1, -1, - -1, 126, 127, 128, 129, -1, 131, -1, -1, -1, - 135, 136, 137, 138, 139, -1, -1, -1, -1, -1, - -1, 146, 147, 148, -1, 150, 151, 152, -1, -1, - -1, 156, -1, -1, 159, 160, -1, -1, -1, -1, - 165, 166, 167, 168, 169, 170, 171, 172, -1, -1, - -1, -1, -1, -1, -1, 180, 181, 182, -1, -1, - -1, 186, -1, 188, 189, -1, -1, -1, -1, -1, - -1, 196, -1, 198, 199, 200, 201, 202, 203, 204, - 205, 206, 207, 208, -1, -1, 211, 212, -1, -1, - 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, - 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, - 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, - 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, - 255, 256, 257, -1, 259, 260, 261, -1, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, -1, -1, 24, 25, 314, - 315, 316, 317, 318, 319, 320, 33, 34, -1, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, -1, 55, 56, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, -1, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, -1, 94, 95, 96, - 97, -1, -1, 100, 101, 102, -1, -1, 105, 106, - -1, -1, -1, -1, 111, 112, 113, 114, 115, 116, - 117, -1, -1, -1, -1, -1, -1, -1, -1, 126, - 127, 128, 129, -1, 131, -1, -1, -1, 135, 136, - 137, 138, 139, -1, -1, -1, -1, -1, -1, 146, - 147, 148, -1, 150, 151, 152, -1, -1, -1, 156, - -1, -1, 159, 160, -1, -1, -1, -1, 165, 166, - 167, 168, 169, 170, 171, 172, -1, -1, -1, -1, - -1, -1, -1, 180, 181, 182, -1, -1, -1, 186, - -1, 188, 189, -1, -1, -1, -1, -1, -1, 196, - -1, 198, 199, 200, 201, 202, 203, 204, 205, 206, - 207, 208, -1, -1, 211, 212, -1, -1, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, - 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, - 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, - 257, -1, 259, 260, 261, -1, 263, 264, 265, 266, - 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, - 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, - 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, -1, -1, 24, 25, 314, 315, 316, - 317, 318, 319, 320, 33, 34, -1, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, -1, 55, 56, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, -1, - 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, -1, 94, 95, 96, 97, -1, - -1, 100, 101, 102, -1, -1, 105, 106, -1, -1, - -1, -1, 111, 112, 113, 114, 115, 116, 117, 118, - -1, -1, -1, -1, -1, -1, -1, 126, 127, 128, - 129, -1, 131, -1, -1, -1, 135, 136, 137, 138, - 139, -1, -1, -1, -1, -1, -1, 146, 147, 148, - -1, 150, 151, 152, -1, -1, -1, -1, -1, -1, - 159, 160, -1, -1, -1, -1, 165, 166, 167, 168, - 169, 170, 171, 172, -1, -1, -1, -1, -1, -1, - -1, 180, 181, 182, -1, -1, -1, 186, -1, 188, - 189, -1, -1, -1, -1, -1, -1, 196, -1, 198, - 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, - -1, -1, 211, 212, -1, -1, 215, 216, 217, 218, - 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, - 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, - 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, - 249, 250, 251, 252, 253, 254, 255, 256, 257, -1, - 259, 260, 261, -1, 263, 264, 265, 266, 267, 268, - 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, - 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, - 309, -1, -1, 24, 25, 314, 315, 316, 317, 318, - 319, 320, 33, 34, -1, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, - 51, 52, 53, -1, 55, 56, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 67, -1, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, -1, 94, 95, 96, 97, -1, -1, 100, - 101, 102, -1, -1, 105, 106, -1, -1, -1, -1, - 111, 112, 113, 114, 115, 116, 117, -1, -1, -1, - -1, -1, -1, -1, -1, 126, 127, 128, 129, -1, - 131, -1, -1, -1, 135, 136, 137, 138, 139, -1, - -1, -1, -1, -1, -1, 146, 147, 148, -1, 150, - 151, 152, -1, -1, -1, -1, -1, -1, 159, 160, - -1, -1, -1, -1, 165, 166, 167, 168, 169, 170, - 171, 172, -1, -1, -1, -1, -1, -1, -1, 180, - 181, 182, -1, -1, -1, 186, -1, 188, 189, -1, - -1, -1, -1, -1, -1, 196, -1, 198, 199, 200, - 201, 202, 203, 204, 205, 206, 207, 208, -1, -1, - 211, 212, -1, -1, 215, 216, 217, 218, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, - 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, - 251, 252, 253, 254, 255, 256, 257, -1, 259, 260, - 261, -1, 263, 264, 265, 266, 267, 268, 269, 270, - 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, - 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, - 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, - 301, 302, 303, 304, 305, 306, 307, 308, 309, -1, - -1, 24, 25, 314, 315, 316, 317, 318, 319, 320, - 33, 34, -1, 36, 37, 38, -1, 40, 41, 42, - 43, -1, -1, 46, 47, -1, 49, 50, 51, 52, - 53, -1, 55, 56, 57, 58, -1, 60, -1, -1, - 63, 64, 65, 66, 67, -1, 69, -1, 71, -1, - -1, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - -1, 94, 95, 96, -1, -1, -1, 100, 101, 102, - -1, -1, 105, 106, -1, -1, -1, -1, 111, 112, - 113, 114, 115, 116, 117, -1, -1, -1, -1, -1, - -1, -1, -1, 126, 127, 128, 129, -1, 131, -1, - -1, -1, 135, 136, 137, 138, 139, -1, -1, -1, - -1, -1, -1, 146, 147, 148, -1, 150, 151, -1, - -1, -1, -1, -1, -1, -1, 159, 160, -1, -1, - -1, -1, 165, 166, 167, 168, 169, 170, 171, 172, - -1, -1, -1, -1, -1, -1, -1, 180, 181, 182, - -1, -1, -1, 186, -1, 188, 189, -1, -1, -1, - -1, -1, -1, 196, -1, 198, 199, 200, 201, 202, - 203, 204, 205, 206, 207, 208, -1, -1, -1, 212, - -1, -1, 215, 216, 217, 218, 219, 220, 221, 222, - 223, 224, -1, 226, 227, 228, 229, 230, 231, 232, - 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, - -1, 244, 245, 246, 247, 248, 249, 250, 251, 252, - 253, 254, 255, 256, 257, -1, 259, 260, 261, -1, - 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, - 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, - 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, - 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, -1, -1, -1, - -1, 314, 315, 316, 317, 318, 319, 320 + 320 }; /* STOS_[STATE-NUM] -- The (internal number of the) accessing @@ -16233,14 +16509,14 @@ 404, 405, 406, 408, 409, 412, 413, 414, 415, 420, 422, 424, 425, 430, 449, 452, 456, 459, 460, 465, 466, 467, 468, 470, 471, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, 488, 489, - 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, - 500, 501, 502, 503, 504, 505, 508, 509, 510, 511, - 512, 513, 514, 515, 516, 518, 519, 520, 534, 535, - 537, 538, 539, 540, 541, 542, 543, 551, 552, 553, - 554, 555, 556, 557, 558, 559, 560, 563, 564, 565, - 566, 571, 572, 573, 574, 575, 576, 579, 637, 638, - 639, 640, 642, 643, 644, 645, 646, 653, 654, 655, + 478, 479, 480, 481, 483, 484, 485, 486, 489, 490, + 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, + 501, 502, 503, 504, 505, 506, 509, 510, 511, 512, + 513, 514, 515, 516, 517, 519, 520, 521, 535, 536, + 538, 539, 540, 541, 542, 543, 544, 552, 553, 554, + 555, 556, 557, 558, 559, 560, 561, 564, 565, 566, + 567, 572, 573, 574, 575, 576, 577, 580, 638, 639, + 640, 641, 643, 644, 645, 646, 647, 654, 655, 656, 33, 34, 49, 215, 391, 392, 393, 391, 391, 156, 156, 37, 38, 40, 41, 47, 56, 57, 74, 79, 111, 112, 113, 160, 220, 261, 287, 295, 303, 372, @@ -16252,137 +16528,137 @@ 47, 48, 51, 59, 67, 70, 72, 73, 75, 90, 91, 97, 105, 112, 114, 115, 135, 138, 139, 169, 172, 180, 181, 189, 202, 224, 226, 228, 229, 236, - 238, 239, 240, 243, 244, 315, 502, 653, 654, 122, + 238, 239, 240, 243, 244, 315, 503, 654, 655, 122, 118, 400, 122, 122, 39, 44, 45, 59, 61, 62, - 70, 97, 225, 653, 118, 122, 122, 184, 391, 393, - 413, 641, 48, 72, 73, 118, 153, 185, 244, 412, - 414, 424, 187, 412, 653, 153, 122, 16, 652, 653, - 18, 19, 653, 122, 122, 122, 494, 153, 30, 214, + 70, 97, 225, 654, 118, 122, 122, 184, 391, 393, + 413, 642, 48, 72, 73, 118, 153, 185, 244, 412, + 414, 424, 187, 412, 654, 153, 122, 16, 653, 654, + 18, 19, 654, 122, 122, 122, 495, 153, 30, 214, 216, 225, 227, 314, 156, 225, 227, 314, 225, 314, 225, 230, 314, 118, 241, 241, 242, 156, 153, 395, 311, 412, 313, 412, 314, 322, 337, 337, 0, 339, 340, 33, 49, 342, 359, 1, 190, 336, 190, 336, - 112, 374, 394, 412, 107, 190, 1, 107, 336, 190, - 42, 46, 51, 69, 168, 171, 186, 212, 407, 416, - 421, 422, 423, 437, 438, 442, 167, 92, 132, 140, - 141, 143, 151, 155, 157, 162, 179, 203, 204, 205, - 206, 207, 208, 486, 487, 249, 99, 158, 176, 199, - 117, 146, 159, 194, 201, 210, 136, 150, 50, 200, - 101, 102, 158, 176, 484, 193, 153, 491, 494, 191, - 192, 154, 506, 507, 502, 506, 502, 156, 506, 145, - 156, 184, 184, 184, 375, 509, 375, 29, 651, 182, - 196, 182, 196, 166, 182, 654, 653, 169, 202, 47, - 653, 152, 118, 45, 47, 79, 106, 168, 652, 221, - 222, 223, 246, 610, 653, 653, 304, 137, 142, 112, - 287, 295, 377, 652, 392, 393, 187, 392, 45, 62, - 187, 559, 560, 412, 187, 194, 653, 426, 427, 653, - 284, 284, 426, 118, 433, 118, 187, 381, 382, 153, - 397, 412, 1, 160, 651, 113, 160, 355, 651, 653, - 118, 142, 107, 412, 29, 187, 652, 653, 653, 450, - 451, 653, 392, 187, 412, 412, 561, 653, 392, 153, - 153, 412, 187, 194, 653, 653, 142, 450, 184, 184, - 121, 107, 184, 156, 156, 156, 653, 153, 185, 186, - 187, 35, 522, 523, 524, 412, 8, 175, 17, 412, - 214, 29, 413, 413, 39, 45, 59, 70, 97, 505, - 653, 187, 413, 413, 413, 641, 413, 505, 413, 231, - 230, 577, 578, 653, 190, 190, 413, 412, 393, 412, - 245, 410, 411, 311, 313, 413, 337, 190, 336, 190, - 336, 3, 343, 359, 389, 343, 359, 389, 33, 360, - 389, 360, 389, 400, 400, 413, 413, 413, 118, 168, + 112, 374, 394, 412, 107, 190, 107, 336, 190, 42, + 46, 51, 69, 168, 171, 186, 212, 407, 416, 421, + 422, 423, 437, 438, 442, 167, 92, 132, 140, 141, + 143, 151, 155, 157, 162, 179, 203, 204, 205, 206, + 207, 208, 487, 488, 249, 99, 158, 176, 199, 117, + 146, 159, 194, 201, 210, 136, 150, 50, 200, 101, + 102, 158, 176, 485, 193, 153, 492, 495, 191, 192, + 154, 507, 508, 503, 507, 503, 156, 507, 145, 156, + 184, 184, 184, 375, 510, 375, 29, 652, 182, 196, + 182, 196, 166, 182, 655, 654, 169, 202, 47, 654, + 152, 118, 45, 47, 79, 106, 168, 653, 221, 222, + 223, 246, 611, 654, 654, 304, 137, 142, 112, 287, + 295, 377, 653, 392, 393, 187, 392, 45, 62, 187, + 560, 561, 412, 187, 194, 654, 426, 427, 654, 284, + 284, 426, 118, 433, 118, 187, 381, 382, 153, 397, + 412, 1, 160, 652, 113, 160, 355, 652, 654, 118, + 142, 107, 412, 29, 187, 653, 654, 654, 450, 451, + 654, 392, 187, 412, 412, 562, 654, 392, 153, 153, + 412, 187, 194, 654, 654, 142, 450, 184, 184, 121, + 107, 184, 156, 156, 156, 654, 153, 185, 186, 187, + 35, 523, 524, 525, 412, 8, 175, 17, 412, 214, + 29, 413, 413, 39, 45, 59, 70, 97, 506, 654, + 187, 413, 413, 413, 642, 413, 506, 413, 231, 230, + 578, 579, 654, 190, 190, 413, 412, 393, 412, 245, + 410, 411, 311, 313, 413, 337, 190, 336, 190, 336, + 3, 343, 359, 389, 1, 343, 359, 389, 33, 360, + 389, 360, 389, 400, 336, 400, 413, 413, 118, 168, 170, 170, 394, 413, 413, 467, 468, 470, 470, 470, 470, 469, 470, 470, 470, 70, 471, 475, 475, 474, 476, 476, 476, 476, 477, 477, 478, 478, 231, 94, - 94, 94, 492, 184, 412, 494, 494, 412, 507, 187, - 413, 517, 149, 187, 517, 107, 187, 187, 107, 107, - 380, 29, 654, 80, 81, 82, 83, 84, 85, 86, + 94, 94, 493, 184, 412, 495, 495, 412, 508, 187, + 413, 518, 149, 187, 518, 107, 187, 187, 107, 107, + 380, 29, 655, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 362, 363, 364, 94, 137, 142, 368, - 369, 370, 653, 160, 160, 362, 651, 127, 132, 54, + 369, 370, 654, 160, 160, 362, 652, 127, 132, 54, 56, 100, 251, 264, 266, 277, 278, 279, 281, 283, - 611, 612, 613, 614, 615, 616, 623, 629, 630, 246, - 94, 299, 653, 142, 413, 118, 653, 653, 132, 184, + 612, 613, 614, 615, 616, 617, 624, 630, 631, 246, + 94, 299, 654, 142, 413, 118, 654, 654, 132, 184, 184, 187, 187, 184, 107, 187, 107, 187, 107, 36, - 94, 96, 147, 428, 429, 545, 653, 55, 217, 254, - 418, 419, 653, 94, 107, 187, 391, 187, 652, 96, - 45, 652, 651, 96, 142, 545, 653, 413, 432, 184, + 94, 96, 147, 428, 429, 545, 654, 55, 217, 254, + 418, 419, 654, 94, 107, 187, 391, 187, 653, 96, + 45, 653, 652, 96, 142, 545, 654, 413, 432, 184, 187, 187, 187, 187, 107, 188, 147, 545, 184, 187, 187, 153, 184, 392, 392, 184, 107, 187, 107, 187, - 142, 545, 413, 188, 413, 413, 412, 412, 412, 653, - 523, 524, 130, 197, 184, 184, 131, 190, 94, 218, + 142, 545, 413, 188, 413, 413, 412, 412, 412, 654, + 524, 525, 130, 197, 184, 184, 131, 190, 94, 218, 219, 233, 94, 218, 219, 233, 233, 233, 94, 94, - 237, 225, 231, 107, 235, 142, 190, 187, 48, 72, - 73, 244, 414, 424, 184, 503, 583, 411, 233, 359, - 33, 33, 190, 336, 190, 113, 1, 653, 170, 413, - 443, 444, 118, 439, 440, 470, 153, 156, 259, 490, - 509, 584, 587, 588, 589, 590, 591, 595, 597, 599, - 600, 47, 152, 156, 211, 317, 318, 319, 320, 546, - 548, 550, 551, 567, 568, 569, 570, 647, 648, 649, - 650, 653, 546, 544, 550, 544, 184, 185, 107, 187, - 187, 509, 148, 165, 148, 165, 137, 397, 380, 363, - 132, 548, 370, 413, 545, 651, 651, 128, 129, 651, - 277, 278, 279, 283, 653, 263, 274, 263, 274, 29, - 286, 96, 113, 156, 617, 620, 611, 39, 44, 59, - 61, 70, 97, 225, 317, 318, 319, 384, 551, 647, - 227, 299, 308, 413, 653, 94, 299, 651, 153, 561, - 562, 653, 561, 562, 118, 427, 127, 546, 118, 413, - 147, 429, 147, 36, 147, 428, 429, 147, 545, 254, - 53, 58, 77, 118, 428, 434, 435, 436, 419, 545, - 546, 382, 94, 184, 198, 132, 354, 651, 160, 132, - 96, 354, 413, 142, 429, 153, 118, 413, 413, 147, - 100, 453, 454, 455, 457, 458, 100, 461, 462, 463, - 464, 392, 184, 184, 153, 561, 561, 413, 142, 190, - 413, 121, 187, 187, 187, 35, 524, 130, 197, 9, - 10, 103, 123, 125, 153, 195, 519, 521, 532, 533, - 536, 29, 232, 234, 413, 413, 413, 232, 234, 413, - 413, 413, 413, 413, 413, 413, 413, 413, 505, 118, - 413, 413, 394, 156, 156, 156, 153, 186, 245, 580, - 581, 210, 395, 413, 190, 113, 389, 389, 389, 443, - 95, 106, 116, 127, 445, 446, 447, 448, 107, 653, - 107, 412, 584, 591, 153, 285, 472, 636, 96, 169, - 252, 253, 255, 262, 272, 284, 585, 586, 605, 606, - 607, 608, 631, 634, 258, 260, 592, 610, 267, 596, - 632, 247, 248, 270, 601, 602, 156, 156, 548, 156, - 156, 156, 156, 156, 144, 176, 194, 547, 144, 413, - 137, 397, 563, 369, 286, 29, 96, 113, 156, 624, - 29, 617, 547, 547, 492, 287, 306, 545, 384, 227, - 190, 391, 187, 187, 144, 187, 187, 427, 147, 428, - 653, 413, 147, 413, 127, 413, 147, 429, 147, 413, - 147, 118, 118, 413, 653, 436, 77, 546, 394, 413, - 651, 107, 354, 413, 142, 391, 451, 413, 413, 113, - 454, 455, 100, 186, 113, 455, 458, 118, 546, 100, - 113, 462, 100, 113, 464, 184, 391, 187, 187, 413, - 413, 198, 461, 132, 195, 521, 7, 392, 653, 195, - 532, 190, 233, 233, 233, 233, 96, 237, 237, 578, - 186, 412, 412, 412, 583, 581, 503, 651, 128, 129, - 447, 448, 448, 444, 106, 142, 441, 545, 440, 184, - 187, 584, 598, 250, 217, 254, 268, 275, 635, 96, - 256, 257, 633, 250, 588, 635, 474, 605, 589, 147, - 282, 593, 594, 633, 286, 604, 78, 603, 187, 194, - 546, 549, 187, 187, 187, 187, 187, 187, 187, 29, - 136, 201, 626, 627, 628, 29, 625, 626, 271, 621, - 107, 618, 170, 653, 257, 492, 184, 413, 147, 413, - 147, 428, 413, 147, 413, 413, 653, 653, 435, 413, - 126, 126, 96, 651, 413, 184, 186, 186, 413, 394, - 413, 186, 186, 653, 186, 118, 546, 118, 186, 118, - 546, 186, 184, 113, 524, 653, 195, 184, 524, 653, - 413, 413, 413, 413, 316, 413, 413, 413, 187, 187, - 187, 153, 582, 448, 651, 413, 142, 184, 476, 52, - 129, 474, 474, 269, 276, 286, 609, 609, 590, 153, - 280, 94, 187, 107, 187, 624, 624, 628, 107, 187, - 29, 622, 633, 619, 620, 187, 386, 387, 492, 118, - 225, 307, 287, 170, 413, 413, 147, 413, 53, 394, - 413, 354, 413, 394, 94, 394, 413, 653, 186, 653, - 413, 653, 186, 394, 118, 93, 183, 525, 524, 653, - 197, 524, 413, 198, 461, 412, 441, 413, 474, 474, + 237, 225, 231, 107, 235, 142, 190, 187, 412, 184, + 504, 584, 411, 233, 359, 33, 33, 190, 336, 190, + 113, 394, 654, 170, 413, 443, 444, 118, 439, 440, + 470, 153, 156, 259, 491, 510, 585, 588, 589, 590, + 591, 592, 596, 598, 600, 601, 47, 152, 156, 211, + 317, 318, 319, 320, 546, 548, 550, 552, 568, 569, + 570, 571, 648, 649, 650, 651, 654, 546, 482, 551, + 654, 482, 184, 185, 107, 187, 187, 510, 148, 165, + 148, 165, 137, 397, 380, 363, 132, 548, 370, 413, + 545, 652, 652, 128, 129, 652, 277, 278, 279, 283, + 654, 263, 274, 263, 274, 29, 286, 96, 113, 156, + 618, 621, 612, 39, 44, 59, 61, 70, 97, 225, + 317, 318, 319, 384, 552, 648, 227, 299, 308, 413, + 654, 94, 299, 652, 153, 562, 563, 654, 562, 563, + 118, 427, 127, 546, 118, 413, 147, 429, 147, 36, + 147, 428, 429, 147, 545, 254, 53, 58, 77, 118, + 428, 434, 435, 436, 419, 545, 546, 382, 94, 184, + 198, 132, 354, 652, 160, 132, 96, 354, 413, 142, + 429, 153, 118, 413, 413, 147, 100, 453, 454, 455, + 457, 458, 100, 461, 462, 463, 464, 392, 184, 184, + 153, 562, 562, 413, 142, 190, 413, 121, 187, 187, + 187, 35, 525, 130, 197, 9, 10, 103, 123, 125, + 153, 195, 520, 522, 533, 534, 537, 29, 232, 234, + 413, 413, 413, 232, 234, 413, 413, 413, 413, 413, + 413, 413, 413, 413, 506, 118, 413, 413, 48, 72, + 73, 244, 394, 414, 424, 245, 581, 582, 153, 210, + 395, 413, 190, 113, 389, 389, 389, 443, 95, 106, + 116, 127, 445, 446, 447, 448, 107, 654, 107, 412, + 585, 592, 153, 285, 472, 637, 96, 169, 252, 253, + 255, 262, 272, 284, 586, 587, 606, 607, 608, 609, + 632, 635, 258, 260, 593, 611, 267, 597, 633, 247, + 248, 270, 602, 603, 156, 156, 548, 156, 156, 156, + 156, 156, 144, 176, 194, 547, 144, 413, 137, 397, + 564, 369, 286, 29, 96, 113, 156, 625, 29, 618, + 547, 547, 493, 287, 306, 545, 384, 227, 190, 391, + 187, 187, 144, 187, 187, 427, 147, 428, 654, 413, + 147, 413, 127, 413, 147, 429, 147, 413, 147, 118, + 118, 413, 654, 436, 77, 546, 394, 413, 652, 107, + 354, 413, 142, 391, 451, 413, 413, 113, 454, 455, + 100, 186, 113, 455, 458, 118, 546, 100, 113, 462, + 100, 113, 464, 184, 391, 187, 187, 413, 413, 198, + 461, 132, 195, 522, 7, 392, 654, 195, 533, 190, + 233, 233, 233, 233, 96, 237, 237, 579, 186, 156, + 156, 156, 186, 584, 582, 504, 652, 128, 129, 447, + 448, 448, 444, 106, 142, 441, 545, 440, 184, 187, + 585, 599, 250, 217, 254, 268, 275, 636, 96, 256, + 257, 634, 250, 589, 636, 474, 606, 590, 147, 282, + 594, 595, 634, 286, 605, 78, 604, 187, 194, 546, + 549, 187, 187, 187, 187, 187, 187, 187, 29, 136, + 201, 627, 628, 629, 29, 626, 627, 271, 622, 107, + 619, 170, 654, 257, 493, 184, 413, 147, 413, 147, + 428, 413, 147, 413, 413, 654, 654, 435, 413, 126, + 126, 96, 652, 413, 184, 186, 186, 413, 394, 413, + 186, 186, 654, 186, 118, 546, 118, 186, 118, 546, + 186, 184, 113, 525, 654, 195, 184, 525, 654, 413, + 413, 413, 413, 316, 413, 413, 413, 412, 412, 412, + 153, 583, 448, 652, 413, 142, 184, 476, 52, 129, + 474, 474, 269, 276, 286, 610, 610, 591, 153, 280, + 94, 187, 107, 187, 625, 625, 629, 107, 187, 29, + 623, 634, 620, 621, 187, 386, 387, 493, 118, 225, + 307, 287, 170, 413, 413, 147, 413, 53, 394, 413, + 354, 413, 394, 94, 394, 413, 654, 186, 654, 413, + 654, 186, 394, 118, 93, 183, 526, 525, 654, 197, + 525, 413, 187, 187, 187, 412, 441, 413, 474, 474, 199, 412, 546, 546, 94, 29, 265, 107, 107, 448, - 545, 653, 118, 225, 653, 386, 413, 118, 546, 94, - 186, 94, 653, 5, 133, 528, 529, 531, 533, 28, - 134, 526, 527, 530, 533, 197, 524, 197, 113, 184, - 441, 474, 184, 546, 620, 387, 448, 305, 653, 118, - 225, 653, 186, 546, 394, 413, 546, 186, 93, 133, - 531, 183, 134, 530, 197, 118, 413, 305, 653, 118, - 394, 413, 186, 186, 653, 293, 305, 653, 186, 306, - 413, 306, 492, 492, 199, 287, 653, 225, 118, 653, - 306, 492 + 545, 654, 118, 225, 654, 386, 413, 118, 546, 94, + 186, 94, 654, 5, 133, 529, 530, 532, 534, 28, + 134, 527, 528, 531, 534, 197, 525, 197, 198, 461, + 184, 441, 474, 184, 546, 621, 387, 448, 305, 654, + 118, 225, 654, 186, 546, 394, 413, 546, 186, 93, + 133, 532, 183, 134, 531, 197, 113, 413, 305, 654, + 118, 394, 413, 186, 186, 118, 293, 305, 654, 654, + 306, 413, 306, 186, 493, 493, 199, 287, 654, 225, + 118, 654, 306, 493 }; #if YYDEBUG @@ -16432,194 +16708,194 @@ const unsigned short int xquery_parser::yyr1_[] = { - 0, 334, 335, 335, 335, 335, 336, 337, 337, 337, - 337, 338, 338, 339, 339, 339, 339, 339, 339, 339, - 339, 340, 340, 340, 340, 341, 342, 342, 342, 343, - 343, 343, 343, 343, 344, 344, 344, 344, 344, 344, - 344, 344, 345, 345, 346, 347, 348, 348, 349, 349, - 350, 350, 351, 351, 351, 351, 352, 352, 352, 353, - 353, 353, 353, 354, 354, 355, 355, 356, 356, 356, - 356, 357, 358, 358, 359, 359, 359, 360, 360, 360, - 360, 360, 360, 360, 360, 361, 361, 362, 362, 363, - 364, 364, 364, 364, 364, 364, 364, 364, 364, 364, - 365, 366, 367, 368, 368, 369, 369, 369, 370, 371, - 371, 371, 372, 372, 372, 372, 373, 373, 374, 374, - 374, 374, 375, 375, 376, 376, 377, 377, 378, 378, - 379, 379, 380, 380, 380, 380, 381, 381, 382, 382, - 383, 383, 383, 383, 384, 384, 384, 384, 385, 385, - 386, 386, 387, 387, 387, 387, 388, 388, 388, 388, - 389, 390, 390, 390, 391, 391, 391, 392, 392, 393, - 393, 394, 394, 394, 394, 394, 394, 394, 394, 394, - 394, 394, 394, 395, 395, 396, 397, 398, 399, 399, - 399, 400, 400, 400, 400, 401, 402, 403, 404, 405, - 405, 406, 407, 408, 409, 410, 410, 411, 412, 412, - 412, 412, 413, 413, 413, 413, 413, 413, 414, 414, + 0, 334, 335, 335, 335, 335, 336, 336, 336, 337, + 337, 337, 337, 338, 338, 339, 339, 339, 339, 339, + 339, 339, 339, 340, 340, 340, 340, 341, 342, 342, + 342, 343, 343, 343, 343, 343, 344, 344, 344, 344, + 344, 344, 344, 344, 345, 345, 346, 347, 348, 348, + 349, 349, 350, 350, 351, 351, 351, 351, 352, 352, + 352, 353, 353, 353, 353, 354, 354, 355, 355, 356, + 356, 356, 356, 357, 358, 358, 359, 359, 359, 360, + 360, 360, 360, 360, 360, 360, 360, 361, 361, 362, + 362, 363, 364, 364, 364, 364, 364, 364, 364, 364, + 364, 364, 365, 366, 367, 368, 368, 369, 369, 369, + 370, 371, 371, 371, 372, 372, 372, 372, 373, 373, + 374, 374, 374, 374, 375, 375, 376, 376, 377, 377, + 378, 378, 379, 379, 380, 380, 380, 380, 381, 381, + 382, 382, 383, 383, 383, 383, 384, 384, 384, 384, + 385, 385, 386, 386, 387, 387, 387, 387, 388, 388, + 388, 388, 389, 390, 390, 390, 391, 391, 391, 392, + 392, 393, 393, 393, 394, 394, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 395, 395, 396, 397, + 398, 399, 399, 399, 400, 400, 400, 400, 401, 402, + 403, 404, 405, 405, 406, 407, 408, 409, 410, 410, + 411, 412, 412, 412, 413, 413, 413, 413, 413, 413, 414, 414, 414, 414, 414, 414, 414, 414, 414, 414, - 415, 416, 417, 417, 418, 418, 418, 419, 419, 420, - 420, 421, 422, 422, 422, 423, 423, 423, 423, 423, - 424, 424, 425, 425, 425, 426, 426, 426, 427, 427, + 414, 414, 415, 416, 417, 417, 418, 418, 418, 419, + 419, 420, 420, 421, 422, 422, 422, 423, 423, 423, + 423, 423, 424, 424, 425, 425, 425, 426, 426, 426, 427, 427, 427, 427, 427, 427, 427, 427, 427, 427, - 428, 429, 430, 431, 431, 432, 432, 432, 432, 433, - 433, 434, 434, 434, 435, 435, 435, 436, 436, 436, - 437, 438, 439, 439, 440, 440, 440, 440, 440, 440, - 441, 442, 442, 443, 443, 444, 444, 445, 445, 445, - 445, 445, 445, 445, 446, 446, 447, 447, 448, 449, - 449, 450, 450, 451, 451, 452, 453, 453, 454, 455, - 455, 456, 457, 457, 458, 459, 459, 460, 460, 461, - 461, 462, 462, 463, 463, 464, 464, 465, 466, 466, - 467, 467, 468, 468, 468, 468, 468, 469, 468, 468, - 468, 468, 470, 470, 471, 471, 472, 472, 473, 473, - 474, 474, 474, 475, 475, 475, 475, 475, 476, 476, - 476, 477, 477, 477, 478, 478, 479, 479, 480, 480, - 481, 481, 482, 482, 483, 483, 483, 483, 484, 484, - 484, 485, 485, 486, 486, 486, 486, 486, 486, 487, - 487, 487, 488, 488, 488, 488, 489, 489, 490, 490, - 491, 491, 491, 492, 492, 492, 492, 493, 494, 494, - 494, 495, 495, 496, 496, 496, 496, 497, 497, 498, - 498, 498, 498, 498, 498, 498, 499, 499, 500, 500, - 501, 501, 501, 501, 501, 502, 502, 503, 503, 504, - 504, 504, 504, 505, 505, 505, 505, 506, 506, 507, - 508, 508, 508, 508, 508, 508, 508, 508, 508, 508, - 508, 508, 508, 508, 509, 509, 510, 510, 510, 511, - 512, 512, 513, 514, 515, 516, 516, 517, 517, 518, - 518, 519, 519, 519, 520, 520, 520, 520, 520, 520, - 521, 521, 522, 522, 523, 524, 524, 525, 525, 526, - 526, 527, 527, 527, 527, 528, 528, 529, 529, 529, - 529, 530, 530, 531, 531, 532, 532, 532, 532, 533, - 533, 533, 533, 534, 534, 535, 535, 536, 537, 537, - 537, 537, 537, 537, 538, 539, 539, 540, 540, 541, - 542, 543, 543, 544, 544, 545, 546, 546, 546, 547, - 547, 547, 548, 548, 548, 548, 548, 548, 548, 549, - 549, 550, 551, 551, 551, 551, 551, 551, 551, 551, - 551, 552, 553, 553, 553, 554, 555, 556, 556, 556, - 557, 557, 557, 557, 557, 558, 559, 559, 559, 559, - 559, 559, 559, 560, 561, 562, 563, 564, 564, 565, - 566, 567, 567, 568, 569, 569, 570, 571, 571, 571, - 572, 572, 572, 572, 572, 572, 572, 572, 572, 572, - 573, 573, 574, 574, 575, 576, 577, 577, 578, 579, - 580, 580, 581, 582, 583, 583, 584, 585, 585, 586, - 586, 587, 587, 588, 588, 589, 589, 590, 590, 591, - 592, 592, 593, 593, 594, 595, 595, 595, 596, 596, - 597, 598, 598, 599, 600, 600, 601, 601, 602, 602, - 602, 603, 603, 604, 604, 605, 605, 605, 605, 605, - 606, 607, 608, 609, 609, 609, 610, 610, 611, 611, - 611, 611, 611, 611, 611, 611, 612, 612, 612, 612, - 613, 613, 614, 615, 615, 616, 616, 616, 617, 617, - 618, 618, 619, 619, 620, 621, 621, 622, 622, 623, - 623, 623, 624, 624, 625, 625, 626, 626, 627, 627, - 628, 628, 629, 630, 630, 631, 631, 631, 632, 633, - 633, 633, 633, 634, 634, 635, 635, 636, 637, 637, - 638, 638, 639, 639, 640, 641, 641, 642, 642, 642, - 643, 644, 645, 646, 647, 647, 647, 648, 649, 650, - 651, 652, 652, 653, 653, 653, 653, 653, 653, 653, - 653, 653, 653, 653, 653, 653, 653, 653, 653, 654, + 427, 427, 428, 429, 430, 431, 431, 432, 432, 432, + 432, 433, 433, 434, 434, 434, 435, 435, 435, 436, + 436, 436, 437, 438, 439, 439, 440, 440, 440, 440, + 440, 440, 441, 442, 442, 443, 443, 444, 444, 445, + 445, 445, 445, 445, 445, 445, 446, 446, 447, 447, + 448, 449, 449, 450, 450, 451, 451, 452, 453, 453, + 454, 455, 455, 456, 457, 457, 458, 459, 459, 460, + 460, 461, 461, 462, 462, 463, 463, 464, 464, 465, + 466, 466, 467, 467, 468, 468, 468, 468, 468, 469, + 468, 468, 468, 468, 470, 470, 471, 471, 472, 472, + 473, 473, 474, 474, 474, 475, 475, 475, 475, 475, + 476, 476, 476, 477, 477, 477, 478, 478, 479, 479, + 480, 480, 481, 481, 482, 482, 483, 483, 484, 484, + 484, 484, 485, 485, 485, 486, 486, 487, 487, 487, + 487, 487, 487, 488, 488, 488, 489, 489, 489, 489, + 490, 490, 491, 491, 492, 492, 492, 493, 493, 493, + 493, 494, 495, 495, 495, 496, 496, 497, 497, 497, + 497, 498, 498, 499, 499, 499, 499, 499, 499, 499, + 500, 500, 501, 501, 502, 502, 502, 502, 502, 503, + 503, 504, 504, 505, 505, 505, 505, 506, 506, 506, + 506, 507, 507, 508, 509, 509, 509, 509, 509, 509, + 509, 509, 509, 509, 509, 509, 509, 509, 510, 510, + 511, 511, 511, 512, 513, 513, 514, 515, 516, 517, + 517, 518, 518, 519, 519, 520, 520, 520, 521, 521, + 521, 521, 521, 521, 522, 522, 523, 523, 524, 525, + 525, 526, 526, 527, 527, 528, 528, 528, 528, 529, + 529, 530, 530, 530, 530, 531, 531, 532, 532, 533, + 533, 533, 533, 534, 534, 534, 534, 535, 535, 536, + 536, 537, 538, 538, 538, 538, 538, 538, 539, 540, + 540, 541, 541, 542, 543, 544, 544, 545, 546, 546, + 546, 547, 547, 547, 548, 548, 548, 548, 548, 548, + 548, 549, 549, 550, 551, 552, 552, 552, 552, 552, + 552, 552, 552, 552, 553, 554, 554, 554, 555, 556, + 557, 557, 557, 558, 558, 558, 558, 558, 559, 560, + 560, 560, 560, 560, 560, 560, 561, 562, 563, 564, + 565, 565, 566, 567, 568, 568, 569, 570, 570, 571, + 572, 572, 572, 573, 573, 573, 573, 573, 573, 573, + 573, 573, 573, 574, 574, 575, 575, 576, 577, 578, + 578, 579, 580, 581, 581, 582, 583, 584, 584, 585, + 586, 586, 587, 587, 588, 588, 589, 589, 590, 590, + 591, 591, 592, 593, 593, 594, 594, 595, 596, 596, + 596, 597, 597, 598, 599, 599, 600, 601, 601, 602, + 602, 603, 603, 603, 604, 604, 605, 605, 606, 606, + 606, 606, 606, 607, 608, 609, 610, 610, 610, 611, + 611, 612, 612, 612, 612, 612, 612, 612, 612, 613, + 613, 613, 613, 614, 614, 615, 616, 616, 617, 617, + 617, 618, 618, 619, 619, 620, 620, 621, 622, 622, + 623, 623, 624, 624, 624, 625, 625, 626, 626, 627, + 627, 628, 628, 629, 629, 630, 631, 631, 632, 632, + 632, 633, 634, 634, 634, 634, 635, 635, 636, 636, + 637, 638, 638, 639, 639, 640, 640, 641, 642, 642, + 643, 643, 643, 644, 645, 646, 647, 648, 648, 648, + 649, 650, 651, 652, 653, 653, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 654, 654, 654, 654, 654, - 654, 654, 654, 654, 654, 655 + 654, 654, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 655, 655, + 655, 655, 655, 655, 655, 655, 655, 655, 656 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ const unsigned char xquery_parser::yyr2_[] = { - 0, 2, 1, 2, 2, 3, 2, 1, 2, 1, - 2, 4, 6, 3, 3, 5, 1, 3, 3, 5, - 5, 1, 3, 3, 5, 6, 1, 3, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 4, 3, 3, 3, 3, 3, - 5, 5, 5, 5, 5, 5, 1, 1, 3, 3, - 4, 5, 6, 1, 3, 3, 3, 3, 6, 5, - 8, 5, 5, 5, 1, 3, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 4, 4, 1, 2, 3, + 0, 2, 1, 2, 2, 3, 1, 2, 2, 1, + 2, 1, 2, 4, 6, 3, 3, 5, 1, 3, + 3, 5, 5, 1, 3, 3, 5, 6, 1, 3, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 3, 4, 3, 3, 3, + 3, 3, 5, 5, 5, 5, 5, 5, 1, 1, + 3, 3, 4, 5, 6, 1, 3, 3, 3, 3, + 6, 5, 8, 5, 5, 5, 1, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 4, 4, 1, + 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 3, 4, 3, 1, 1, 1, 2, + 2, 4, 3, 5, 3, 4, 4, 5, 1, 2, + 1, 4, 1, 4, 1, 3, 2, 3, 1, 1, + 4, 4, 5, 5, 2, 3, 4, 5, 1, 3, + 2, 3, 3, 5, 4, 6, 1, 2, 1, 2, + 8, 9, 1, 3, 1, 2, 2, 3, 11, 14, + 13, 22, 1, 1, 1, 0, 1, 1, 0, 1, + 2, 1, 2, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 2, 3, 3, + 2, 3, 2, 3, 2, 3, 4, 5, 5, 2, + 4, 5, 3, 3, 2, 2, 8, 3, 1, 2, + 3, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 4, 3, 4, 3, 1, 1, 1, 2, 2, 4, - 3, 5, 3, 4, 4, 5, 1, 2, 1, 4, - 1, 4, 1, 3, 2, 3, 1, 1, 4, 4, - 5, 5, 2, 3, 4, 5, 1, 3, 2, 3, - 3, 5, 4, 6, 1, 2, 1, 2, 8, 9, - 1, 3, 1, 2, 2, 3, 11, 14, 13, 22, - 1, 1, 1, 0, 1, 1, 0, 1, 2, 1, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 2, 3, 3, 2, 3, 2, - 3, 2, 3, 4, 5, 5, 2, 4, 5, 3, - 3, 2, 2, 8, 3, 1, 2, 3, 1, 3, - 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 1, 1, 2, 4, + 3, 5, 4, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 3, 3, 2, 1, 4, 3, + 3, 5, 4, 6, 4, 6, 5, 7, 4, 5, + 5, 6, 3, 3, 2, 1, 3, 4, 5, 3, + 6, 4, 5, 1, 2, 3, 1, 2, 1, 6, + 3, 3, 2, 3, 1, 3, 2, 4, 5, 6, + 5, 3, 2, 3, 4, 1, 3, 1, 2, 1, + 1, 1, 2, 2, 2, 3, 1, 1, 2, 2, + 2, 5, 5, 1, 4, 3, 4, 8, 1, 2, + 3, 2, 3, 8, 1, 2, 3, 8, 10, 8, + 10, 1, 2, 4, 7, 1, 2, 4, 7, 8, + 1, 3, 1, 3, 1, 3, 3, 3, 3, 0, + 4, 3, 3, 3, 1, 5, 1, 3, 0, 1, + 1, 3, 1, 3, 3, 1, 3, 3, 3, 3, + 1, 3, 3, 1, 3, 3, 1, 4, 1, 4, + 1, 4, 1, 4, 1, 2, 1, 2, 1, 1, + 2, 2, 1, 1, 1, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 4, 5, 5, 6, + 3, 4, 1, 2, 3, 2, 2, 1, 2, 2, + 1, 1, 1, 3, 3, 1, 1, 1, 2, 1, + 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, + 1, 2, 2, 1, 2, 2, 2, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 1, 1, 2, 4, 3, 5, - 4, 3, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 3, 3, 2, 1, 4, 3, 3, 5, - 4, 6, 4, 6, 5, 7, 4, 5, 5, 6, - 3, 3, 2, 1, 3, 4, 5, 3, 6, 4, - 5, 1, 2, 3, 1, 2, 1, 6, 3, 3, - 2, 3, 1, 3, 2, 4, 5, 6, 5, 3, - 2, 3, 4, 1, 3, 1, 2, 1, 1, 1, - 2, 2, 2, 3, 1, 1, 2, 2, 2, 5, - 5, 1, 4, 3, 4, 8, 1, 2, 3, 2, - 3, 8, 1, 2, 3, 8, 10, 8, 10, 1, - 2, 4, 7, 1, 2, 4, 7, 8, 1, 3, - 1, 3, 1, 3, 3, 3, 3, 0, 4, 3, - 3, 3, 1, 5, 1, 3, 0, 1, 1, 3, - 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, - 3, 1, 3, 3, 1, 4, 1, 4, 1, 4, - 1, 4, 1, 2, 1, 1, 2, 2, 1, 1, + 1, 1, 1, 2, 2, 3, 1, 4, 4, 3, + 4, 1, 3, 1, 1, 1, 1, 1, 4, 5, + 8, 9, 9, 10, 1, 2, 1, 2, 6, 0, + 1, 3, 3, 0, 1, 1, 1, 2, 2, 0, + 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 3, 2, 3, + 3, 2, 1, 1, 1, 1, 1, 1, 4, 3, + 7, 3, 7, 4, 4, 3, 7, 2, 1, 2, + 3, 1, 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 5, 5, 6, 3, 4, 1, 2, - 3, 2, 2, 1, 2, 2, 1, 1, 1, 3, - 3, 1, 1, 1, 2, 1, 2, 2, 1, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 2, 1, - 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 3, 4, 1, 2, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 2, 3, 1, 4, 4, 3, 4, 1, 3, 1, - 1, 1, 1, 1, 4, 5, 8, 9, 9, 10, - 1, 2, 1, 2, 6, 0, 1, 3, 3, 0, - 1, 1, 1, 2, 2, 0, 1, 1, 1, 2, - 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 3, 2, 3, 3, 2, 1, 1, - 1, 1, 1, 1, 4, 3, 7, 3, 7, 4, - 4, 3, 7, 1, 2, 2, 1, 2, 3, 1, - 1, 1, 1, 1, 3, 3, 1, 1, 1, 1, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 4, 4, 3, 3, 3, 4, 4, - 3, 4, 6, 4, 6, 4, 3, 4, 6, 6, - 4, 6, 6, 4, 1, 2, 1, 1, 1, 3, - 3, 1, 1, 4, 5, 6, 3, 3, 3, 3, - 5, 7, 7, 5, 5, 5, 7, 7, 5, 5, - 3, 3, 5, 7, 5, 7, 1, 4, 3, 5, - 1, 2, 3, 3, 1, 3, 2, 0, 1, 1, - 2, 1, 3, 1, 3, 1, 4, 1, 2, 3, - 0, 1, 0, 1, 4, 2, 3, 1, 0, 1, - 4, 0, 1, 2, 1, 3, 0, 1, 2, 2, - 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, - 1, 3, 3, 1, 1, 1, 2, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, - 2, 2, 3, 1, 2, 2, 5, 2, 1, 1, - 0, 2, 1, 3, 4, 0, 2, 0, 2, 4, - 4, 3, 2, 3, 1, 3, 0, 1, 1, 2, - 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, - 3, 3, 4, 2, 2, 1, 1, 3, 2, 3, - 2, 3, 2, 3, 3, 3, 5, 5, 5, 8, - 5, 3, 5, 7, 1, 1, 1, 3, 3, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 3, 4, 4, 3, 3, + 3, 4, 4, 3, 4, 6, 4, 6, 4, 3, + 4, 6, 6, 4, 6, 6, 4, 1, 2, 1, + 1, 1, 3, 3, 1, 1, 4, 5, 6, 3, + 3, 3, 3, 5, 7, 7, 5, 5, 5, 7, + 7, 5, 5, 3, 3, 5, 7, 5, 7, 1, + 4, 3, 5, 1, 2, 3, 3, 1, 3, 2, + 0, 1, 1, 2, 1, 3, 1, 3, 1, 4, + 1, 2, 3, 0, 1, 0, 1, 4, 2, 3, + 1, 0, 1, 4, 0, 1, 2, 1, 3, 0, + 1, 2, 2, 1, 0, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 3, 3, 1, 1, 1, 2, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 1, 1, 2, 2, 3, 1, 2, 2, 5, + 2, 1, 1, 0, 2, 1, 3, 4, 0, 2, + 0, 2, 4, 4, 3, 2, 3, 1, 3, 0, + 1, 1, 2, 2, 2, 2, 1, 2, 2, 2, + 2, 3, 2, 3, 3, 4, 2, 2, 1, 1, + 3, 2, 3, 2, 3, 2, 3, 3, 3, 5, + 5, 5, 8, 5, 3, 5, 7, 1, 1, 1, + 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -16641,7 +16917,7 @@ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1 }; #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE @@ -16774,10 +17050,10 @@ "IfExpr", "OrExpr", "AndExpr", "ComparisonExpr", "$@1", "FTContainsExpr", "StringConcatExpr", "opt_FTIgnoreOption", "RangeExpr", "AdditiveExpr", "MultiplicativeExpr", "UnionExpr", "IntersectExceptExpr", - "InstanceofExpr", "TreatExpr", "CastableExpr", "CastExpr", "UnaryExpr", - "SignList", "ValueExpr", "SimpleMapExpr", "ValueComp", "NodeComp", - "ValidateExpr", "ExtensionExpr", "Pragma_list", "Pragma", "PathExpr", - "LeadingSlash", "RelativePathExpr", "StepExpr", "AxisStep", + "InstanceofExpr", "TreatExpr", "CastableExpr", "CastExpr", "SingleType", + "UnaryExpr", "SignList", "ValueExpr", "SimpleMapExpr", "ValueComp", + "NodeComp", "ValidateExpr", "ExtensionExpr", "Pragma_list", "Pragma", + "PathExpr", "LeadingSlash", "RelativePathExpr", "StepExpr", "AxisStep", "ForwardStep", "ForwardAxis", "AbbrevForwardStep", "ReverseStep", "ReverseAxis", "NodeTest", "NameTest", "Wildcard", "FilterExpr", "PredicateList", "Predicate", "PrimaryExpr", "Literal", "NumericLiteral", @@ -16791,9 +17067,9 @@ "CommonContent", "DirCommentConstructor", "DirPIConstructor", "CDataSection", "ComputedConstructor", "CompDocConstructor", "CompElemConstructor", "CompAttrConstructor", "CompTextConstructor", - "CompCommentConstructor", "CompPIConstructor", "SingleType", - "TypeDeclaration", "SequenceType", "OccurrenceIndicator", "ItemType", - "TypeList", "AtomicType", "KindTest", "AnyKindTest", "DocumentTest", + "CompCommentConstructor", "CompPIConstructor", "TypeDeclaration", + "SequenceType", "OccurrenceIndicator", "ItemType", "TypeList", + "AtomicType", "SimpleType", "KindTest", "AnyKindTest", "DocumentTest", "TextTest", "CommentTest", "PITest", "AttributeTest", "SchemaAttributeTest", "ElementTest", "SchemaElementTest", "TypeName", "TypeName_WITH_HOOK", "StringLiteral", "FunctionItemExpr", @@ -16831,329 +17107,330 @@ xquery_parser::yyrhs_[] = { 335, 0, -1, 337, -1, 321, 337, -1, 322, 337, - -1, 321, 322, 337, -1, 1, 3, -1, 339, -1, - 338, 339, -1, 340, -1, 338, 340, -1, 215, 216, - 29, 190, -1, 215, 216, 29, 131, 29, 190, -1, - 342, 190, 389, -1, 359, 190, 389, -1, 342, 190, - 359, 190, 389, -1, 389, -1, 342, 336, 389, -1, - 359, 336, 389, -1, 342, 190, 359, 336, 389, -1, - 342, 336, 359, 190, 389, -1, 341, -1, 341, 342, - 190, -1, 341, 359, 190, -1, 341, 342, 190, 359, - 190, -1, 34, 160, 652, 132, 651, 190, -1, 343, - -1, 342, 190, 343, -1, 342, 336, 343, -1, 344, - -1, 352, -1, 357, -1, 358, -1, 366, -1, 345, - -1, 346, -1, 347, -1, 348, -1, 349, -1, 350, - -1, 351, -1, 571, -1, 33, 38, 182, -1, 33, - 38, 196, -1, 33, 113, 106, 651, -1, 33, 37, - 651, -1, 33, 40, 182, -1, 33, 40, 196, -1, - 33, 57, 169, -1, 33, 57, 202, -1, 33, 113, - 168, 127, 128, -1, 33, 113, 168, 127, 129, -1, - 33, 41, 182, 107, 148, -1, 33, 41, 182, 107, - 165, -1, 33, 41, 166, 107, 148, -1, 33, 41, - 166, 107, 165, -1, 353, -1, 356, -1, 49, 24, - 1, -1, 49, 60, 651, -1, 49, 60, 355, 651, - -1, 49, 60, 651, 96, 354, -1, 49, 60, 355, - 651, 96, 354, -1, 651, -1, 354, 107, 651, -1, - 160, 652, 132, -1, 113, 45, 160, -1, 49, 34, - 651, -1, 49, 34, 160, 652, 132, 651, -1, 49, - 34, 651, 96, 354, -1, 49, 34, 160, 652, 132, - 651, 96, 354, -1, 33, 160, 652, 132, 651, -1, - 33, 113, 45, 160, 651, -1, 33, 113, 47, 160, - 651, -1, 360, -1, 359, 190, 360, -1, 359, 336, - 360, -1, 361, -1, 365, -1, 367, -1, 371, -1, - 376, -1, 383, -1, 385, -1, 388, -1, 33, 113, - 79, 362, -1, 33, 79, 653, 362, -1, 363, -1, - 362, 363, -1, 364, 132, 563, -1, 80, -1, 88, - -1, 81, -1, 82, -1, 83, -1, 84, -1, 89, - -1, 85, -1, 86, -1, 87, -1, 33, 56, 653, - 29, -1, 33, 261, 610, -1, 33, 111, 152, 368, - -1, 94, 548, 369, -1, 369, -1, 370, -1, 137, - -1, 137, 370, -1, 142, 413, -1, 33, 372, 142, - 413, -1, 33, 372, 137, -1, 33, 372, 137, 142, - 413, -1, 112, 118, 653, -1, 112, 118, 653, 545, - -1, 373, 112, 118, 653, -1, 373, 112, 118, 653, - 545, -1, 374, -1, 373, 374, -1, 26, -1, 26, - 156, 375, 187, -1, 27, -1, 27, 156, 375, 187, - -1, 509, -1, 375, 107, 509, -1, 33, 377, -1, - 33, 373, 377, -1, 378, -1, 379, -1, 47, 654, - 380, 397, -1, 47, 654, 380, 137, -1, 74, 47, - 654, 380, 397, -1, 74, 47, 654, 380, 137, -1, - 156, 187, -1, 156, 381, 187, -1, 156, 187, 94, - 546, -1, 156, 381, 187, 94, 546, -1, 382, -1, - 381, 107, 382, -1, 118, 653, -1, 118, 653, 545, - -1, 33, 287, 653, -1, 33, 287, 653, 94, 384, - -1, 33, 373, 287, 653, -1, 33, 373, 287, 653, - 94, 384, -1, 551, -1, 551, 547, -1, 647, -1, - 647, 547, -1, 33, 295, 653, 299, 227, 492, 170, - 386, -1, 33, 373, 295, 653, 299, 227, 492, 170, - 386, -1, 387, -1, 386, 107, 387, -1, 492, -1, - 492, 545, -1, 492, 448, -1, 492, 545, 448, -1, - 33, 303, 304, 653, 299, 287, 653, 118, 653, 305, - 413, -1, 33, 303, 304, 653, 299, 287, 653, 225, - 118, 653, 305, 293, 306, 492, -1, 33, 303, 304, - 653, 299, 287, 653, 307, 225, 118, 653, 305, 413, - -1, 33, 303, 304, 653, 308, 306, 257, 287, 653, - 225, 118, 653, 306, 492, 199, 287, 653, 225, 118, - 653, 306, 492, -1, 390, -1, 392, -1, 393, -1, - -1, 392, -1, 393, -1, -1, 412, -1, 393, 412, - -1, 394, -1, 393, 394, -1, 395, -1, 398, -1, + -1, 321, 322, 337, -1, 1, -1, 1, 3, -1, + 336, 1, -1, 339, -1, 338, 339, -1, 340, -1, + 338, 340, -1, 215, 216, 29, 190, -1, 215, 216, + 29, 131, 29, 190, -1, 342, 190, 389, -1, 359, + 190, 389, -1, 342, 190, 359, 190, 389, -1, 389, + -1, 342, 336, 389, -1, 359, 336, 389, -1, 342, + 190, 359, 336, 389, -1, 342, 336, 359, 190, 389, + -1, 341, -1, 341, 342, 190, -1, 341, 359, 190, + -1, 341, 342, 190, 359, 190, -1, 34, 160, 653, + 132, 652, 190, -1, 343, -1, 342, 190, 343, -1, + 342, 336, 343, -1, 344, -1, 352, -1, 357, -1, + 358, -1, 366, -1, 345, -1, 346, -1, 347, -1, + 348, -1, 349, -1, 350, -1, 351, -1, 572, -1, + 33, 38, 182, -1, 33, 38, 196, -1, 33, 113, + 106, 652, -1, 33, 37, 652, -1, 33, 40, 182, + -1, 33, 40, 196, -1, 33, 57, 169, -1, 33, + 57, 202, -1, 33, 113, 168, 127, 128, -1, 33, + 113, 168, 127, 129, -1, 33, 41, 182, 107, 148, + -1, 33, 41, 182, 107, 165, -1, 33, 41, 166, + 107, 148, -1, 33, 41, 166, 107, 165, -1, 353, + -1, 356, -1, 49, 24, 1, -1, 49, 60, 652, + -1, 49, 60, 355, 652, -1, 49, 60, 652, 96, + 354, -1, 49, 60, 355, 652, 96, 354, -1, 652, + -1, 354, 107, 652, -1, 160, 653, 132, -1, 113, + 45, 160, -1, 49, 34, 652, -1, 49, 34, 160, + 653, 132, 652, -1, 49, 34, 652, 96, 354, -1, + 49, 34, 160, 653, 132, 652, 96, 354, -1, 33, + 160, 653, 132, 652, -1, 33, 113, 45, 160, 652, + -1, 33, 113, 47, 160, 652, -1, 360, -1, 359, + 190, 360, -1, 359, 336, 360, -1, 361, -1, 365, + -1, 367, -1, 371, -1, 376, -1, 383, -1, 385, + -1, 388, -1, 33, 113, 79, 362, -1, 33, 79, + 654, 362, -1, 363, -1, 362, 363, -1, 364, 132, + 564, -1, 80, -1, 88, -1, 81, -1, 82, -1, + 83, -1, 84, -1, 89, -1, 85, -1, 86, -1, + 87, -1, 33, 56, 654, 29, -1, 33, 261, 611, + -1, 33, 111, 152, 368, -1, 94, 548, 369, -1, + 369, -1, 370, -1, 137, -1, 137, 370, -1, 142, + 413, -1, 33, 372, 142, 413, -1, 33, 372, 137, + -1, 33, 372, 137, 142, 413, -1, 112, 118, 654, + -1, 112, 118, 654, 545, -1, 373, 112, 118, 654, + -1, 373, 112, 118, 654, 545, -1, 374, -1, 373, + 374, -1, 26, -1, 26, 156, 375, 187, -1, 27, + -1, 27, 156, 375, 187, -1, 510, -1, 375, 107, + 510, -1, 33, 377, -1, 33, 373, 377, -1, 378, + -1, 379, -1, 47, 655, 380, 397, -1, 47, 655, + 380, 137, -1, 74, 47, 655, 380, 397, -1, 74, + 47, 655, 380, 137, -1, 156, 187, -1, 156, 381, + 187, -1, 156, 187, 94, 546, -1, 156, 381, 187, + 94, 546, -1, 382, -1, 381, 107, 382, -1, 118, + 654, -1, 118, 654, 545, -1, 33, 287, 654, -1, + 33, 287, 654, 94, 384, -1, 33, 373, 287, 654, + -1, 33, 373, 287, 654, 94, 384, -1, 552, -1, + 552, 547, -1, 648, -1, 648, 547, -1, 33, 295, + 654, 299, 227, 493, 170, 386, -1, 33, 373, 295, + 654, 299, 227, 493, 170, 386, -1, 387, -1, 386, + 107, 387, -1, 493, -1, 493, 545, -1, 493, 448, + -1, 493, 545, 448, -1, 33, 303, 304, 654, 299, + 287, 654, 118, 654, 305, 413, -1, 33, 303, 304, + 654, 299, 287, 654, 225, 118, 654, 305, 293, 306, + 493, -1, 33, 303, 304, 654, 299, 287, 654, 307, + 225, 118, 654, 305, 413, -1, 33, 303, 304, 654, + 308, 306, 257, 287, 654, 225, 118, 654, 306, 493, + 199, 287, 654, 225, 118, 654, 306, 493, -1, 390, + -1, 392, -1, 393, -1, -1, 392, -1, 393, -1, + -1, 412, -1, 393, 412, -1, 394, -1, 393, 394, + -1, 393, 412, 336, 394, -1, 395, -1, 398, -1, 401, -1, 402, -1, 403, -1, 404, -1, 405, -1, 406, -1, 408, -1, 460, -1, 456, -1, 409, -1, 153, 393, 184, -1, 153, 184, -1, 153, 391, 184, -1, 153, 391, 184, -1, 399, 190, -1, 399, 107, 400, -1, 112, 400, -1, 373, 112, 400, -1, 118, - 653, -1, 118, 653, 545, -1, 118, 653, 142, 413, - -1, 118, 653, 545, 142, 413, -1, 118, 653, 142, + 654, -1, 118, 654, 545, -1, 118, 654, 142, 413, + -1, 118, 654, 545, 142, 413, -1, 118, 654, 142, 413, 190, -1, 414, 190, -1, 240, 242, 413, 190, -1, 243, 156, 412, 187, 394, -1, 238, 241, 190, -1, 239, 241, 190, -1, 424, 407, -1, 186, 394, -1, 48, 156, 412, 187, 198, 394, 126, 394, -1, 244, 395, 410, -1, 411, -1, 410, 411, -1, 245, - 583, 395, -1, 413, -1, 412, 107, 413, -1, 412, - 1, 413, 1, -1, 412, 336, 413, -1, 415, -1, - 452, -1, 459, -1, 465, -1, 579, -1, 414, -1, - 466, -1, 449, -1, 572, -1, 573, -1, 575, -1, - 574, -1, 576, -1, 644, -1, 642, -1, 645, -1, - 646, -1, 643, -1, 424, 416, -1, 186, 413, -1, - 66, 284, -1, 71, 284, -1, 217, -1, 254, -1, - 55, 254, -1, 418, 434, 77, 413, -1, 418, 77, - 413, -1, 46, 417, 433, 419, 419, -1, 46, 417, - 433, 419, -1, 42, 118, 653, -1, 425, -1, 430, - -1, 420, -1, 422, -1, 437, -1, 442, -1, 438, - -1, 421, -1, 422, -1, 424, 423, -1, 46, 118, - 426, -1, 46, 1, 426, -1, 46, 3, -1, 427, - -1, 426, 107, 118, 427, -1, 426, 107, 427, -1, - 653, 147, 413, -1, 653, 36, 127, 147, 413, -1, - 653, 545, 147, 413, -1, 653, 545, 36, 127, 147, - 413, -1, 653, 428, 147, 413, -1, 653, 36, 127, - 428, 147, 413, -1, 653, 545, 428, 147, 413, -1, - 653, 545, 36, 127, 428, 147, 413, -1, 653, 429, - 147, 413, -1, 653, 545, 429, 147, 413, -1, 653, - 428, 429, 147, 413, -1, 653, 545, 428, 429, 147, - 413, -1, 96, 118, 653, -1, 273, 118, 653, -1, - 51, 431, -1, 432, -1, 431, 107, 432, -1, 118, - 653, 142, 413, -1, 118, 653, 545, 142, 413, -1, - 429, 142, 413, -1, 118, 653, 545, 429, 142, 413, - -1, 118, 653, 147, 413, -1, 118, 653, 545, 147, - 413, -1, 435, -1, 118, 653, -1, 118, 653, 435, - -1, 428, -1, 428, 436, -1, 436, -1, 58, 118, - 653, 53, 118, 653, -1, 53, 118, 653, -1, 58, - 118, 653, -1, 212, 413, -1, 171, 170, 439, -1, - 440, -1, 439, 107, 440, -1, 118, 653, -1, 118, - 653, 142, 413, -1, 118, 653, 545, 142, 413, -1, - 118, 653, 545, 142, 413, 441, -1, 118, 653, 142, - 413, 441, -1, 118, 653, 441, -1, 106, 651, -1, - 168, 170, 443, -1, 69, 168, 170, 443, -1, 444, - -1, 443, 107, 444, -1, 413, -1, 413, 445, -1, - 446, -1, 447, -1, 448, -1, 446, 447, -1, 446, - 448, -1, 447, 448, -1, 446, 447, 448, -1, 95, - -1, 116, -1, 127, 128, -1, 127, 129, -1, 106, - 651, -1, 67, 118, 450, 188, 413, -1, 135, 118, - 450, 188, 413, -1, 451, -1, 450, 107, 118, 451, - -1, 653, 147, 413, -1, 653, 545, 147, 413, -1, - 72, 156, 412, 187, 453, 113, 186, 413, -1, 454, - -1, 453, 454, -1, 455, 186, 413, -1, 100, 413, - -1, 455, 100, 413, -1, 72, 156, 412, 187, 457, - 113, 186, 394, -1, 458, -1, 457, 458, -1, 455, - 186, 394, -1, 73, 156, 412, 187, 461, 113, 186, - 413, -1, 73, 156, 412, 187, 461, 113, 118, 653, - 186, 413, -1, 73, 156, 412, 187, 463, 113, 186, - 394, -1, 73, 156, 412, 187, 461, 113, 118, 653, - 186, 394, -1, 462, -1, 461, 462, -1, 100, 546, - 186, 413, -1, 100, 118, 653, 94, 546, 186, 413, - -1, 464, -1, 463, 464, -1, 100, 546, 186, 394, - -1, 100, 118, 653, 94, 546, 186, 394, -1, 48, - 156, 412, 187, 198, 413, 126, 413, -1, 467, -1, - 466, 167, 467, -1, 468, -1, 467, 92, 468, -1, - 470, -1, 470, 486, 470, -1, 470, 487, 470, -1, - 470, 132, 470, -1, 470, 162, 470, -1, -1, 470, - 157, 469, 470, -1, 470, 155, 470, -1, 470, 143, - 470, -1, 470, 141, 470, -1, 471, -1, 471, 249, - 70, 584, 472, -1, 473, -1, 473, 99, 471, -1, - -1, 636, -1, 474, -1, 474, 199, 474, -1, 475, - -1, 474, 176, 475, -1, 474, 158, 475, -1, 476, - -1, 475, 194, 476, -1, 475, 117, 476, -1, 475, - 146, 476, -1, 475, 159, 476, -1, 477, -1, 476, - 201, 477, -1, 476, 210, 477, -1, 478, -1, 477, - 150, 478, -1, 477, 136, 478, -1, 479, -1, 479, - 50, 231, 546, -1, 480, -1, 480, 200, 94, 546, - -1, 481, -1, 481, 101, 94, 544, -1, 482, -1, - 482, 102, 94, 544, -1, 484, -1, 483, 484, -1, - 176, -1, 158, -1, 483, 176, -1, 483, 158, -1, - 488, -1, 485, -1, 489, -1, 492, -1, 485, 193, - 492, -1, 203, -1, 208, -1, 207, -1, 206, -1, + 584, 395, -1, 413, -1, 412, 107, 413, -1, 412, + 336, 413, -1, 415, -1, 452, -1, 459, -1, 465, + -1, 580, -1, 414, -1, 466, -1, 449, -1, 573, + -1, 574, -1, 576, -1, 575, -1, 577, -1, 645, + -1, 643, -1, 646, -1, 647, -1, 644, -1, 424, + 416, -1, 186, 413, -1, 66, 284, -1, 71, 284, + -1, 217, -1, 254, -1, 55, 254, -1, 418, 434, + 77, 413, -1, 418, 77, 413, -1, 46, 417, 433, + 419, 419, -1, 46, 417, 433, 419, -1, 42, 118, + 654, -1, 425, -1, 430, -1, 420, -1, 422, -1, + 437, -1, 442, -1, 438, -1, 421, -1, 422, -1, + 424, 423, -1, 46, 118, 426, -1, 46, 1, 426, + -1, 46, 3, -1, 427, -1, 426, 107, 118, 427, + -1, 426, 107, 427, -1, 654, 147, 413, -1, 654, + 36, 127, 147, 413, -1, 654, 545, 147, 413, -1, + 654, 545, 36, 127, 147, 413, -1, 654, 428, 147, + 413, -1, 654, 36, 127, 428, 147, 413, -1, 654, + 545, 428, 147, 413, -1, 654, 545, 36, 127, 428, + 147, 413, -1, 654, 429, 147, 413, -1, 654, 545, + 429, 147, 413, -1, 654, 428, 429, 147, 413, -1, + 654, 545, 428, 429, 147, 413, -1, 96, 118, 654, + -1, 273, 118, 654, -1, 51, 431, -1, 432, -1, + 431, 107, 432, -1, 118, 654, 142, 413, -1, 118, + 654, 545, 142, 413, -1, 429, 142, 413, -1, 118, + 654, 545, 429, 142, 413, -1, 118, 654, 147, 413, + -1, 118, 654, 545, 147, 413, -1, 435, -1, 118, + 654, -1, 118, 654, 435, -1, 428, -1, 428, 436, + -1, 436, -1, 58, 118, 654, 53, 118, 654, -1, + 53, 118, 654, -1, 58, 118, 654, -1, 212, 413, + -1, 171, 170, 439, -1, 440, -1, 439, 107, 440, + -1, 118, 654, -1, 118, 654, 142, 413, -1, 118, + 654, 545, 142, 413, -1, 118, 654, 545, 142, 413, + 441, -1, 118, 654, 142, 413, 441, -1, 118, 654, + 441, -1, 106, 652, -1, 168, 170, 443, -1, 69, + 168, 170, 443, -1, 444, -1, 443, 107, 444, -1, + 413, -1, 413, 445, -1, 446, -1, 447, -1, 448, + -1, 446, 447, -1, 446, 448, -1, 447, 448, -1, + 446, 447, 448, -1, 95, -1, 116, -1, 127, 128, + -1, 127, 129, -1, 106, 652, -1, 67, 118, 450, + 188, 413, -1, 135, 118, 450, 188, 413, -1, 451, + -1, 450, 107, 118, 451, -1, 654, 147, 413, -1, + 654, 545, 147, 413, -1, 72, 156, 412, 187, 453, + 113, 186, 413, -1, 454, -1, 453, 454, -1, 455, + 186, 413, -1, 100, 413, -1, 455, 100, 413, -1, + 72, 156, 412, 187, 457, 113, 186, 394, -1, 458, + -1, 457, 458, -1, 455, 186, 394, -1, 73, 156, + 412, 187, 461, 113, 186, 413, -1, 73, 156, 412, + 187, 461, 113, 118, 654, 186, 413, -1, 73, 156, + 412, 187, 463, 113, 186, 394, -1, 73, 156, 412, + 187, 461, 113, 118, 654, 186, 394, -1, 462, -1, + 461, 462, -1, 100, 546, 186, 413, -1, 100, 118, + 654, 94, 546, 186, 413, -1, 464, -1, 463, 464, + -1, 100, 546, 186, 394, -1, 100, 118, 654, 94, + 546, 186, 394, -1, 48, 156, 412, 187, 198, 413, + 126, 413, -1, 467, -1, 466, 167, 467, -1, 468, + -1, 467, 92, 468, -1, 470, -1, 470, 487, 470, + -1, 470, 488, 470, -1, 470, 132, 470, -1, 470, + 162, 470, -1, -1, 470, 157, 469, 470, -1, 470, + 155, 470, -1, 470, 143, 470, -1, 470, 141, 470, + -1, 471, -1, 471, 249, 70, 585, 472, -1, 473, + -1, 473, 99, 471, -1, -1, 637, -1, 474, -1, + 474, 199, 474, -1, 475, -1, 474, 176, 475, -1, + 474, 158, 475, -1, 476, -1, 475, 194, 476, -1, + 475, 117, 476, -1, 475, 146, 476, -1, 475, 159, + 476, -1, 477, -1, 476, 201, 477, -1, 476, 210, + 477, -1, 478, -1, 477, 150, 478, -1, 477, 136, + 478, -1, 479, -1, 479, 50, 231, 546, -1, 480, + -1, 480, 200, 94, 546, -1, 481, -1, 481, 101, + 94, 482, -1, 483, -1, 483, 102, 94, 482, -1, + 551, -1, 551, 144, -1, 485, -1, 484, 485, -1, + 176, -1, 158, -1, 484, 176, -1, 484, 158, -1, + 489, -1, 486, -1, 490, -1, 493, -1, 486, 193, + 493, -1, 203, -1, 208, -1, 207, -1, 206, -1, 205, -1, 204, -1, 151, -1, 179, -1, 140, -1, 75, 153, 392, 184, -1, 75, 222, 153, 392, 184, - -1, 75, 221, 153, 392, 184, -1, 75, 76, 561, - 153, 392, 184, -1, 490, 153, 184, -1, 490, 153, - 412, 184, -1, 491, -1, 490, 491, -1, 177, 653, - 17, -1, 177, 18, -1, 177, 19, -1, 493, -1, - 493, 494, -1, 192, 494, -1, 494, -1, 191, -1, - 495, -1, 495, 191, 494, -1, 495, 192, 494, -1, - 496, -1, 505, -1, 497, -1, 497, 506, -1, 500, - -1, 500, 506, -1, 498, 502, -1, 499, -1, 105, + -1, 75, 221, 153, 392, 184, -1, 75, 76, 562, + 153, 392, 184, -1, 491, 153, 184, -1, 491, 153, + 412, 184, -1, 492, -1, 491, 492, -1, 177, 654, + 17, -1, 177, 18, -1, 177, 19, -1, 494, -1, + 494, 495, -1, 192, 495, -1, 495, -1, 191, -1, + 496, -1, 496, 191, 495, -1, 496, 192, 495, -1, + 497, -1, 506, -1, 498, -1, 498, 507, -1, 501, + -1, 501, 507, -1, 499, 503, -1, 500, -1, 105, 122, -1, 114, 122, -1, 97, 122, -1, 189, 122, -1, 115, 122, -1, 139, 122, -1, 138, 122, -1, - 502, -1, 98, 502, -1, 501, 502, -1, 120, -1, + 503, -1, 98, 503, -1, 502, 503, -1, 120, -1, 172, 122, -1, 90, 122, -1, 181, 122, -1, 180, - 122, -1, 91, 122, -1, 551, -1, 503, -1, 653, - -1, 504, -1, 194, -1, 11, -1, 12, -1, 20, - -1, 508, -1, 505, 506, -1, 505, 156, 187, -1, - 505, 156, 517, 187, -1, 507, -1, 506, 507, -1, - 154, 412, 185, -1, 509, -1, 511, -1, 512, -1, - 513, -1, 516, -1, 518, -1, 514, -1, 515, -1, - 564, -1, 396, -1, 640, -1, 637, -1, 638, -1, - 639, -1, 510, -1, 563, -1, 110, -1, 149, -1, - 124, -1, 118, 653, -1, 156, 187, -1, 156, 412, + 122, -1, 91, 122, -1, 552, -1, 504, -1, 654, + -1, 505, -1, 194, -1, 11, -1, 12, -1, 20, + -1, 509, -1, 506, 507, -1, 506, 156, 187, -1, + 506, 156, 518, 187, -1, 508, -1, 507, 508, -1, + 154, 412, 185, -1, 510, -1, 512, -1, 513, -1, + 514, -1, 517, -1, 519, -1, 515, -1, 516, -1, + 565, -1, 396, -1, 641, -1, 638, -1, 639, -1, + 640, -1, 511, -1, 564, -1, 110, -1, 149, -1, + 124, -1, 118, 654, -1, 156, 187, -1, 156, 412, 187, -1, 119, -1, 169, 153, 412, 184, -1, 202, - 153, 412, 184, -1, 654, 156, 187, -1, 654, 156, - 517, 187, -1, 413, -1, 517, 107, 413, -1, 519, - -1, 537, -1, 520, -1, 534, -1, 535, -1, 157, - 653, 524, 130, -1, 157, 653, 522, 524, 130, -1, - 157, 653, 524, 197, 195, 653, 524, 197, -1, 157, - 653, 524, 197, 521, 195, 653, 524, 197, -1, 157, - 653, 522, 524, 197, 195, 653, 524, 197, -1, 157, - 653, 522, 524, 197, 521, 195, 653, 524, 197, -1, - 532, -1, 521, 532, -1, 523, -1, 522, 523, -1, - 35, 653, 524, 132, 524, 525, -1, -1, 35, -1, - 183, 526, 183, -1, 93, 528, 93, -1, -1, 527, - -1, 134, -1, 530, -1, 527, 134, -1, 527, 530, - -1, -1, 529, -1, 133, -1, 531, -1, 529, 133, - -1, 529, 531, -1, 28, -1, 533, -1, 5, -1, - 533, -1, 519, -1, 10, -1, 536, -1, 533, -1, + 153, 412, 184, -1, 655, 156, 187, -1, 655, 156, + 518, 187, -1, 413, -1, 518, 107, 413, -1, 520, + -1, 538, -1, 521, -1, 535, -1, 536, -1, 157, + 654, 525, 130, -1, 157, 654, 523, 525, 130, -1, + 157, 654, 525, 197, 195, 654, 525, 197, -1, 157, + 654, 525, 197, 522, 195, 654, 525, 197, -1, 157, + 654, 523, 525, 197, 195, 654, 525, 197, -1, 157, + 654, 523, 525, 197, 522, 195, 654, 525, 197, -1, + 533, -1, 522, 533, -1, 524, -1, 523, 524, -1, + 35, 654, 525, 132, 525, 526, -1, -1, 35, -1, + 183, 527, 183, -1, 93, 529, 93, -1, -1, 528, + -1, 134, -1, 531, -1, 528, 134, -1, 528, 531, + -1, -1, 530, -1, 133, -1, 532, -1, 530, 133, + -1, 530, 532, -1, 28, -1, 534, -1, 5, -1, + 534, -1, 520, -1, 10, -1, 537, -1, 534, -1, 9, -1, 123, -1, 125, -1, 153, 392, 184, -1, - 213, 30, 214, -1, 213, 214, -1, 174, 652, 175, - -1, 174, 652, 8, -1, 103, 7, -1, 538, -1, - 539, -1, 540, -1, 541, -1, 542, -1, 543, -1, + 213, 30, 214, -1, 213, 214, -1, 174, 653, 175, + -1, 174, 653, 8, -1, 103, 7, -1, 539, -1, + 540, -1, 541, -1, 542, -1, 543, -1, 544, -1, 43, 153, 392, 184, -1, 21, 391, 184, -1, 45, 153, 412, 184, 153, 391, 184, -1, 22, 391, 184, -1, 97, 153, 412, 184, 153, 391, 184, -1, 70, 153, 392, 184, -1, 39, 153, 392, 184, -1, 23, 391, 184, -1, 59, 153, 412, 184, 153, 391, 184, - -1, 550, -1, 550, 144, -1, 94, 546, -1, 548, - -1, 548, 547, -1, 211, 156, 187, -1, 144, -1, - 194, -1, 176, -1, 550, -1, 551, -1, 152, 156, - 187, -1, 320, 156, 187, -1, 567, -1, 570, -1, - 647, -1, 546, -1, 549, 107, 546, -1, 653, -1, - 553, -1, 559, -1, 557, -1, 560, -1, 558, -1, - 556, -1, 555, -1, 554, -1, 552, -1, 225, 156, - 187, -1, 44, 156, 187, -1, 44, 156, 559, 187, - -1, 44, 156, 560, 187, -1, 70, 156, 187, -1, - 39, 156, 187, -1, 59, 156, 187, -1, 59, 156, - 652, 187, -1, 59, 156, 29, 187, -1, 97, 156, - 187, -1, 97, 156, 653, 187, -1, 97, 156, 653, - 107, 561, 187, -1, 97, 156, 194, 187, -1, 97, - 156, 194, 107, 561, 187, -1, 61, 156, 653, 187, - -1, 45, 156, 187, -1, 45, 156, 653, 187, -1, - 45, 156, 653, 107, 561, 187, -1, 45, 156, 653, - 107, 562, 187, -1, 45, 156, 194, 187, -1, 45, - 156, 194, 107, 561, 187, -1, 45, 156, 194, 107, - 562, 187, -1, 62, 156, 653, 187, -1, 653, -1, - 653, 144, -1, 29, -1, 565, -1, 566, -1, 653, - 145, 149, -1, 47, 380, 397, -1, 568, -1, 569, - -1, 47, 156, 194, 187, -1, 47, 156, 187, 94, - 546, -1, 47, 156, 549, 187, 94, 546, -1, 156, - 548, 187, -1, 33, 220, 221, -1, 33, 220, 222, - -1, 33, 220, 223, -1, 226, 225, 413, 233, 413, - -1, 226, 225, 413, 94, 232, 233, 413, -1, 226, - 225, 413, 94, 234, 233, 413, -1, 226, 225, 413, - 218, 413, -1, 226, 225, 413, 219, 413, -1, 226, - 227, 413, 233, 413, -1, 226, 227, 413, 94, 232, - 233, 413, -1, 226, 227, 413, 94, 234, 233, 413, - -1, 226, 227, 413, 218, 413, -1, 226, 227, 413, - 219, 413, -1, 224, 225, 413, -1, 224, 227, 413, - -1, 229, 225, 413, 237, 413, -1, 229, 230, 231, - 225, 413, 237, 413, -1, 228, 225, 413, 94, 413, - -1, 236, 118, 577, 235, 413, 186, 413, -1, 578, - -1, 577, 107, 118, 578, -1, 653, 142, 413, -1, - 244, 153, 412, 184, 580, -1, 581, -1, 580, 581, - -1, 245, 583, 582, -1, 153, 412, 184, -1, 503, - -1, 583, 210, 503, -1, 587, 585, -1, -1, 586, - -1, 605, -1, 586, 605, -1, 588, -1, 587, 262, - 588, -1, 589, -1, 588, 258, 589, -1, 590, -1, - 589, 260, 147, 590, -1, 591, -1, 259, 591, -1, - 595, 592, 593, -1, -1, 610, -1, -1, 594, -1, - 282, 153, 412, 184, -1, 599, 596, -1, 156, 584, - 187, -1, 597, -1, -1, 632, -1, 490, 153, 598, - 184, -1, -1, 584, -1, 600, 601, -1, 509, -1, - 153, 412, 184, -1, -1, 602, -1, 248, 603, -1, - 247, 604, -1, 270, -1, -1, 78, -1, -1, 286, - -1, 606, -1, 607, -1, 608, -1, 634, -1, 631, - -1, 169, -1, 284, 474, 609, -1, 253, 633, 609, - -1, 286, -1, 276, -1, 269, -1, 246, 611, -1, - 610, 246, 611, -1, 612, -1, 613, -1, 614, -1, - 629, -1, 615, -1, 623, -1, 616, -1, 630, -1, - 100, 274, -1, 100, 263, -1, 266, -1, 281, -1, - 251, 274, -1, 251, 263, -1, 56, 653, 29, -1, - 277, -1, 54, 277, -1, 279, 617, -1, 279, 156, - 617, 618, 187, -1, 54, 279, -1, 620, -1, 113, - -1, -1, 107, 619, -1, 620, -1, 619, 107, 620, - -1, 96, 29, 621, 622, -1, -1, 271, 29, -1, - -1, 633, 265, -1, 278, 286, 624, 626, -1, 278, - 286, 113, 626, -1, 54, 278, 286, -1, 96, 29, - -1, 156, 625, 187, -1, 29, -1, 625, 107, 29, - -1, -1, 627, -1, 628, -1, 627, 628, -1, 201, - 624, -1, 136, 624, -1, 264, 29, -1, 283, -1, - 54, 283, -1, 96, 217, -1, 96, 254, -1, 255, - 250, -1, 267, 633, 280, -1, 256, 474, -1, 96, - 129, 474, -1, 96, 52, 474, -1, 257, 474, 199, - 474, -1, 272, 635, -1, 252, 635, -1, 275, -1, - 268, -1, 285, 250, 476, -1, 154, 185, -1, 154, - 412, 185, -1, 310, 311, -1, 310, 412, 311, -1, - 312, 313, -1, 312, 412, 313, -1, 153, 641, 184, - -1, 413, 121, 413, -1, 641, 107, 413, 121, 413, - -1, 226, 314, 413, 233, 413, -1, 226, 314, 641, - 233, 413, -1, 226, 314, 413, 233, 413, 96, 316, - 413, -1, 315, 314, 413, 233, 413, -1, 224, 314, - 505, -1, 228, 314, 505, 94, 413, -1, 229, 314, - 230, 231, 505, 237, 413, -1, 648, -1, 649, -1, - 650, -1, 319, 156, 187, -1, 317, 156, 187, -1, - 318, 156, 187, -1, 29, -1, 16, -1, 653, -1, - 654, -1, 97, -1, 39, -1, 44, -1, 45, -1, - 152, -1, 48, -1, 225, -1, 59, -1, 61, -1, - 62, -1, 70, -1, 73, -1, 72, -1, 211, -1, - 243, -1, 655, -1, 24, -1, 215, -1, 127, -1, - 38, -1, 261, -1, 37, -1, 222, -1, 221, -1, - 146, -1, 43, -1, 259, -1, 260, -1, 274, -1, - 263, -1, 251, -1, 285, -1, 277, -1, 279, -1, - 278, -1, 283, -1, 255, -1, 250, -1, 78, -1, - 217, -1, 254, -1, 52, -1, 223, -1, 236, -1, - 302, -1, 230, -1, 203, -1, 208, -1, 207, -1, - 206, -1, 205, -1, 204, -1, 96, -1, 111, -1, - 112, -1, 186, -1, 46, -1, 36, -1, 66, -1, - 71, -1, 58, -1, 53, -1, 55, -1, 77, -1, - 42, -1, 147, -1, 51, -1, 212, -1, 170, -1, - 171, -1, 168, -1, 69, -1, 95, -1, 116, -1, - 128, -1, 129, -1, 106, -1, 67, -1, 135, -1, - 188, -1, 100, -1, 94, -1, 198, -1, 126, -1, - 167, -1, 92, -1, 50, -1, 231, -1, 101, -1, - 199, -1, 117, -1, 159, -1, 201, -1, 150, -1, - 136, -1, 75, -1, 76, -1, 102, -1, 200, -1, - 151, -1, 182, -1, 196, -1, 160, -1, 137, -1, - 131, -1, 166, -1, 148, -1, 165, -1, 33, -1, - 40, -1, 57, -1, 113, -1, 41, -1, 56, -1, - 216, -1, 49, -1, 60, -1, 34, -1, 47, -1, - 273, -1, 249, -1, 282, -1, 284, -1, 253, -1, - 267, -1, 280, -1, 272, -1, 252, -1, 266, -1, - 281, -1, 271, -1, 265, -1, 264, -1, 248, -1, - 247, -1, 256, -1, 257, -1, 286, -1, 276, -1, - 275, -1, 270, -1, 268, -1, 269, -1, 229, -1, - 235, -1, 232, -1, 226, -1, 219, -1, 218, -1, - 220, -1, 237, -1, 227, -1, 228, -1, 234, -1, - 224, -1, 233, -1, 65, -1, 63, -1, 74, -1, - 169, -1, 202, -1, 242, -1, 240, -1, 241, -1, - 238, -1, 239, -1, 244, -1, 245, -1, 246, -1, - 64, -1, 295, -1, 293, -1, 294, -1, 299, -1, - 300, -1, 301, -1, 296, -1, 297, -1, 298, -1, - 79, -1, 80, -1, 81, -1, 82, -1, 83, -1, - 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, - 89, -1, 287, -1, 288, -1, 289, -1, 290, -1, - 291, -1, 292, -1, 303, -1, 304, -1, 305, -1, - 306, -1, 307, -1, 308, -1, 309, -1, 90, -1, - 105, -1, 114, -1, 172, -1, 180, -1, 189, -1, - 138, -1, 91, -1, 115, -1, 139, -1, 181, -1, - 314, -1, 315, -1, 316, -1, 319, -1, 318, -1, - 317, -1, 320, -1, 25, -1 + -1, 94, 546, -1, 548, -1, 548, 547, -1, 211, + 156, 187, -1, 144, -1, 194, -1, 176, -1, 550, + -1, 552, -1, 152, 156, 187, -1, 320, 156, 187, + -1, 568, -1, 571, -1, 648, -1, 546, -1, 549, + 107, 546, -1, 654, -1, 654, -1, 554, -1, 560, + -1, 558, -1, 561, -1, 559, -1, 557, -1, 556, + -1, 555, -1, 553, -1, 225, 156, 187, -1, 44, + 156, 187, -1, 44, 156, 560, 187, -1, 44, 156, + 561, 187, -1, 70, 156, 187, -1, 39, 156, 187, + -1, 59, 156, 187, -1, 59, 156, 653, 187, -1, + 59, 156, 29, 187, -1, 97, 156, 187, -1, 97, + 156, 654, 187, -1, 97, 156, 654, 107, 562, 187, + -1, 97, 156, 194, 187, -1, 97, 156, 194, 107, + 562, 187, -1, 61, 156, 654, 187, -1, 45, 156, + 187, -1, 45, 156, 654, 187, -1, 45, 156, 654, + 107, 562, 187, -1, 45, 156, 654, 107, 563, 187, + -1, 45, 156, 194, 187, -1, 45, 156, 194, 107, + 562, 187, -1, 45, 156, 194, 107, 563, 187, -1, + 62, 156, 654, 187, -1, 654, -1, 654, 144, -1, + 29, -1, 566, -1, 567, -1, 654, 145, 149, -1, + 47, 380, 397, -1, 569, -1, 570, -1, 47, 156, + 194, 187, -1, 47, 156, 187, 94, 546, -1, 47, + 156, 549, 187, 94, 546, -1, 156, 548, 187, -1, + 33, 220, 221, -1, 33, 220, 222, -1, 33, 220, + 223, -1, 226, 225, 413, 233, 413, -1, 226, 225, + 413, 94, 232, 233, 413, -1, 226, 225, 413, 94, + 234, 233, 413, -1, 226, 225, 413, 218, 413, -1, + 226, 225, 413, 219, 413, -1, 226, 227, 413, 233, + 413, -1, 226, 227, 413, 94, 232, 233, 413, -1, + 226, 227, 413, 94, 234, 233, 413, -1, 226, 227, + 413, 218, 413, -1, 226, 227, 413, 219, 413, -1, + 224, 225, 413, -1, 224, 227, 413, -1, 229, 225, + 413, 237, 413, -1, 229, 230, 231, 225, 413, 237, + 413, -1, 228, 225, 413, 94, 413, -1, 236, 118, + 578, 235, 413, 186, 413, -1, 579, -1, 578, 107, + 118, 579, -1, 654, 142, 413, -1, 244, 153, 412, + 184, 581, -1, 582, -1, 581, 582, -1, 245, 584, + 583, -1, 153, 412, 184, -1, 504, -1, 584, 210, + 504, -1, 588, 586, -1, -1, 587, -1, 606, -1, + 587, 606, -1, 589, -1, 588, 262, 589, -1, 590, + -1, 589, 258, 590, -1, 591, -1, 590, 260, 147, + 591, -1, 592, -1, 259, 592, -1, 596, 593, 594, + -1, -1, 611, -1, -1, 595, -1, 282, 153, 412, + 184, -1, 600, 597, -1, 156, 585, 187, -1, 598, + -1, -1, 633, -1, 491, 153, 599, 184, -1, -1, + 585, -1, 601, 602, -1, 510, -1, 153, 412, 184, + -1, -1, 603, -1, 248, 604, -1, 247, 605, -1, + 270, -1, -1, 78, -1, -1, 286, -1, 607, -1, + 608, -1, 609, -1, 635, -1, 632, -1, 169, -1, + 284, 474, 610, -1, 253, 634, 610, -1, 286, -1, + 276, -1, 269, -1, 246, 612, -1, 611, 246, 612, + -1, 613, -1, 614, -1, 615, -1, 630, -1, 616, + -1, 624, -1, 617, -1, 631, -1, 100, 274, -1, + 100, 263, -1, 266, -1, 281, -1, 251, 274, -1, + 251, 263, -1, 56, 654, 29, -1, 277, -1, 54, + 277, -1, 279, 618, -1, 279, 156, 618, 619, 187, + -1, 54, 279, -1, 621, -1, 113, -1, -1, 107, + 620, -1, 621, -1, 620, 107, 621, -1, 96, 29, + 622, 623, -1, -1, 271, 29, -1, -1, 634, 265, + -1, 278, 286, 625, 627, -1, 278, 286, 113, 627, + -1, 54, 278, 286, -1, 96, 29, -1, 156, 626, + 187, -1, 29, -1, 626, 107, 29, -1, -1, 628, + -1, 629, -1, 628, 629, -1, 201, 625, -1, 136, + 625, -1, 264, 29, -1, 283, -1, 54, 283, -1, + 96, 217, -1, 96, 254, -1, 255, 250, -1, 267, + 634, 280, -1, 256, 474, -1, 96, 129, 474, -1, + 96, 52, 474, -1, 257, 474, 199, 474, -1, 272, + 636, -1, 252, 636, -1, 275, -1, 268, -1, 285, + 250, 476, -1, 154, 185, -1, 154, 412, 185, -1, + 310, 311, -1, 310, 412, 311, -1, 312, 313, -1, + 312, 412, 313, -1, 153, 642, 184, -1, 413, 121, + 413, -1, 642, 107, 413, 121, 413, -1, 226, 314, + 413, 233, 413, -1, 226, 314, 642, 233, 413, -1, + 226, 314, 413, 233, 413, 96, 316, 413, -1, 315, + 314, 413, 233, 413, -1, 224, 314, 506, -1, 228, + 314, 506, 94, 413, -1, 229, 314, 230, 231, 506, + 237, 413, -1, 649, -1, 650, -1, 651, -1, 319, + 156, 187, -1, 317, 156, 187, -1, 318, 156, 187, + -1, 29, -1, 16, -1, 654, -1, 655, -1, 97, + -1, 39, -1, 44, -1, 45, -1, 152, -1, 48, + -1, 225, -1, 59, -1, 61, -1, 62, -1, 70, + -1, 73, -1, 72, -1, 211, -1, 243, -1, 656, + -1, 24, -1, 215, -1, 127, -1, 38, -1, 261, + -1, 37, -1, 222, -1, 221, -1, 146, -1, 43, + -1, 259, -1, 260, -1, 274, -1, 263, -1, 251, + -1, 285, -1, 277, -1, 279, -1, 278, -1, 283, + -1, 255, -1, 250, -1, 78, -1, 217, -1, 254, + -1, 52, -1, 223, -1, 236, -1, 302, -1, 230, + -1, 203, -1, 208, -1, 207, -1, 206, -1, 205, + -1, 204, -1, 96, -1, 111, -1, 112, -1, 186, + -1, 46, -1, 36, -1, 66, -1, 71, -1, 58, + -1, 53, -1, 55, -1, 77, -1, 42, -1, 147, + -1, 51, -1, 212, -1, 170, -1, 171, -1, 168, + -1, 69, -1, 95, -1, 116, -1, 128, -1, 129, + -1, 106, -1, 67, -1, 135, -1, 188, -1, 100, + -1, 94, -1, 198, -1, 126, -1, 167, -1, 92, + -1, 50, -1, 231, -1, 101, -1, 199, -1, 117, + -1, 159, -1, 201, -1, 150, -1, 136, -1, 75, + -1, 76, -1, 102, -1, 200, -1, 151, -1, 182, + -1, 196, -1, 160, -1, 137, -1, 131, -1, 166, + -1, 148, -1, 165, -1, 33, -1, 40, -1, 57, + -1, 113, -1, 41, -1, 56, -1, 216, -1, 49, + -1, 60, -1, 34, -1, 47, -1, 273, -1, 249, + -1, 282, -1, 284, -1, 253, -1, 267, -1, 280, + -1, 272, -1, 252, -1, 266, -1, 281, -1, 271, + -1, 265, -1, 264, -1, 248, -1, 247, -1, 256, + -1, 257, -1, 286, -1, 276, -1, 275, -1, 270, + -1, 268, -1, 269, -1, 229, -1, 235, -1, 232, + -1, 226, -1, 219, -1, 218, -1, 220, -1, 237, + -1, 227, -1, 228, -1, 234, -1, 224, -1, 233, + -1, 65, -1, 63, -1, 74, -1, 169, -1, 202, + -1, 242, -1, 240, -1, 241, -1, 238, -1, 239, + -1, 244, -1, 245, -1, 246, -1, 64, -1, 295, + -1, 293, -1, 294, -1, 299, -1, 300, -1, 301, + -1, 296, -1, 297, -1, 298, -1, 79, -1, 80, + -1, 81, -1, 82, -1, 83, -1, 84, -1, 85, + -1, 86, -1, 87, -1, 88, -1, 89, -1, 287, + -1, 288, -1, 289, -1, 290, -1, 291, -1, 292, + -1, 303, -1, 304, -1, 305, -1, 306, -1, 307, + -1, 308, -1, 309, -1, 90, -1, 105, -1, 114, + -1, 172, -1, 180, -1, 189, -1, 138, -1, 91, + -1, 115, -1, 139, -1, 181, -1, 314, -1, 315, + -1, 316, -1, 319, -1, 318, -1, 317, -1, 320, + -1, 25, -1 }; /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in @@ -17161,198 +17438,196 @@ const unsigned short int xquery_parser::yyprhs_[] = { - 0, 0, 3, 5, 8, 11, 15, 18, 20, 23, - 25, 28, 33, 40, 44, 48, 54, 56, 60, 64, - 70, 76, 78, 82, 86, 92, 99, 101, 105, 109, - 111, 113, 115, 117, 119, 121, 123, 125, 127, 129, - 131, 133, 135, 139, 143, 148, 152, 156, 160, 164, - 168, 174, 180, 186, 192, 198, 204, 206, 208, 212, - 216, 221, 227, 234, 236, 240, 244, 248, 252, 259, - 265, 274, 280, 286, 292, 294, 298, 302, 304, 306, - 308, 310, 312, 314, 316, 318, 323, 328, 330, 333, - 337, 339, 341, 343, 345, 347, 349, 351, 353, 355, - 357, 362, 366, 371, 375, 377, 379, 381, 384, 387, - 392, 396, 402, 406, 411, 416, 422, 424, 427, 429, - 434, 436, 441, 443, 447, 450, 454, 456, 458, 463, - 468, 474, 480, 483, 487, 492, 498, 500, 504, 507, - 511, 515, 521, 526, 533, 535, 538, 540, 543, 552, - 562, 564, 568, 570, 573, 576, 580, 592, 607, 621, - 644, 646, 648, 650, 651, 653, 655, 656, 658, 661, - 663, 666, 668, 670, 672, 674, 676, 678, 680, 682, - 684, 686, 688, 690, 694, 697, 701, 705, 708, 712, - 715, 719, 722, 726, 731, 737, 743, 746, 751, 757, - 761, 765, 768, 771, 780, 784, 786, 789, 793, 795, - 799, 804, 808, 810, 812, 814, 816, 818, 820, 822, - 824, 826, 828, 830, 832, 834, 836, 838, 840, 842, - 844, 847, 850, 853, 856, 858, 860, 863, 868, 872, - 878, 883, 887, 889, 891, 893, 895, 897, 899, 901, - 903, 905, 908, 912, 916, 919, 921, 926, 930, 934, - 940, 945, 952, 957, 964, 970, 978, 983, 989, 995, - 1002, 1006, 1010, 1013, 1015, 1019, 1024, 1030, 1034, 1041, - 1046, 1052, 1054, 1057, 1061, 1063, 1066, 1068, 1075, 1079, - 1083, 1086, 1090, 1092, 1096, 1099, 1104, 1110, 1117, 1123, - 1127, 1130, 1134, 1139, 1141, 1145, 1147, 1150, 1152, 1154, - 1156, 1159, 1162, 1165, 1169, 1171, 1173, 1176, 1179, 1182, - 1188, 1194, 1196, 1201, 1205, 1210, 1219, 1221, 1224, 1228, - 1231, 1235, 1244, 1246, 1249, 1253, 1262, 1273, 1282, 1293, - 1295, 1298, 1303, 1311, 1313, 1316, 1321, 1329, 1338, 1340, - 1344, 1346, 1350, 1352, 1356, 1360, 1364, 1368, 1369, 1374, - 1378, 1382, 1386, 1388, 1394, 1396, 1400, 1401, 1403, 1405, - 1409, 1411, 1415, 1419, 1421, 1425, 1429, 1433, 1437, 1439, - 1443, 1447, 1449, 1453, 1457, 1459, 1464, 1466, 1471, 1473, - 1478, 1480, 1485, 1487, 1490, 1492, 1494, 1497, 1500, 1502, - 1504, 1506, 1508, 1512, 1514, 1516, 1518, 1520, 1522, 1524, - 1526, 1528, 1530, 1535, 1541, 1547, 1554, 1558, 1563, 1565, - 1568, 1572, 1575, 1578, 1580, 1583, 1586, 1588, 1590, 1592, - 1596, 1600, 1602, 1604, 1606, 1609, 1611, 1614, 1617, 1619, - 1622, 1625, 1628, 1631, 1634, 1637, 1640, 1642, 1645, 1648, - 1650, 1653, 1656, 1659, 1662, 1665, 1667, 1669, 1671, 1673, - 1675, 1677, 1679, 1681, 1683, 1686, 1690, 1695, 1697, 1700, - 1704, 1706, 1708, 1710, 1712, 1714, 1716, 1718, 1720, 1722, - 1724, 1726, 1728, 1730, 1732, 1734, 1736, 1738, 1740, 1742, - 1745, 1748, 1752, 1754, 1759, 1764, 1768, 1773, 1775, 1779, - 1781, 1783, 1785, 1787, 1789, 1794, 1800, 1809, 1819, 1829, - 1840, 1842, 1845, 1847, 1850, 1857, 1858, 1860, 1864, 1868, - 1869, 1871, 1873, 1875, 1878, 1881, 1882, 1884, 1886, 1888, - 1891, 1894, 1896, 1898, 1900, 1902, 1904, 1906, 1908, 1910, - 1912, 1914, 1916, 1920, 1924, 1927, 1931, 1935, 1938, 1940, - 1942, 1944, 1946, 1948, 1950, 1955, 1959, 1967, 1971, 1979, - 1984, 1989, 1993, 2001, 2003, 2006, 2009, 2011, 2014, 2018, - 2020, 2022, 2024, 2026, 2028, 2032, 2036, 2038, 2040, 2042, - 2044, 2048, 2050, 2052, 2054, 2056, 2058, 2060, 2062, 2064, - 2066, 2068, 2072, 2076, 2081, 2086, 2090, 2094, 2098, 2103, - 2108, 2112, 2117, 2124, 2129, 2136, 2141, 2145, 2150, 2157, - 2164, 2169, 2176, 2183, 2188, 2190, 2193, 2195, 2197, 2199, - 2203, 2207, 2209, 2211, 2216, 2222, 2229, 2233, 2237, 2241, - 2245, 2251, 2259, 2267, 2273, 2279, 2285, 2293, 2301, 2307, - 2313, 2317, 2321, 2327, 2335, 2341, 2349, 2351, 2356, 2360, - 2366, 2368, 2371, 2375, 2379, 2381, 2385, 2388, 2389, 2391, - 2393, 2396, 2398, 2402, 2404, 2408, 2410, 2415, 2417, 2420, - 2424, 2425, 2427, 2428, 2430, 2435, 2438, 2442, 2444, 2445, - 2447, 2452, 2453, 2455, 2458, 2460, 2464, 2465, 2467, 2470, - 2473, 2475, 2476, 2478, 2479, 2481, 2483, 2485, 2487, 2489, - 2491, 2493, 2497, 2501, 2503, 2505, 2507, 2510, 2514, 2516, - 2518, 2520, 2522, 2524, 2526, 2528, 2530, 2533, 2536, 2538, - 2540, 2543, 2546, 2550, 2552, 2555, 2558, 2564, 2567, 2569, - 2571, 2572, 2575, 2577, 2581, 2586, 2587, 2590, 2591, 2594, - 2599, 2604, 2608, 2611, 2615, 2617, 2621, 2622, 2624, 2626, - 2629, 2632, 2635, 2638, 2640, 2643, 2646, 2649, 2652, 2656, - 2659, 2663, 2667, 2672, 2675, 2678, 2680, 2682, 2686, 2689, - 2693, 2696, 2700, 2703, 2707, 2711, 2715, 2721, 2727, 2733, - 2742, 2748, 2752, 2758, 2766, 2768, 2770, 2772, 2776, 2780, - 2784, 2786, 2788, 2790, 2792, 2794, 2796, 2798, 2800, 2802, - 2804, 2806, 2808, 2810, 2812, 2814, 2816, 2818, 2820, 2822, - 2824, 2826, 2828, 2830, 2832, 2834, 2836, 2838, 2840, 2842, - 2844, 2846, 2848, 2850, 2852, 2854, 2856, 2858, 2860, 2862, - 2864, 2866, 2868, 2870, 2872, 2874, 2876, 2878, 2880, 2882, - 2884, 2886, 2888, 2890, 2892, 2894, 2896, 2898, 2900, 2902, - 2904, 2906, 2908, 2910, 2912, 2914, 2916, 2918, 2920, 2922, - 2924, 2926, 2928, 2930, 2932, 2934, 2936, 2938, 2940, 2942, - 2944, 2946, 2948, 2950, 2952, 2954, 2956, 2958, 2960, 2962, - 2964, 2966, 2968, 2970, 2972, 2974, 2976, 2978, 2980, 2982, - 2984, 2986, 2988, 2990, 2992, 2994, 2996, 2998, 3000, 3002, - 3004, 3006, 3008, 3010, 3012, 3014, 3016, 3018, 3020, 3022, - 3024, 3026, 3028, 3030, 3032, 3034, 3036, 3038, 3040, 3042, - 3044, 3046, 3048, 3050, 3052, 3054, 3056, 3058, 3060, 3062, - 3064, 3066, 3068, 3070, 3072, 3074, 3076, 3078, 3080, 3082, - 3084, 3086, 3088, 3090, 3092, 3094, 3096, 3098, 3100, 3102, - 3104, 3106, 3108, 3110, 3112, 3114, 3116, 3118, 3120, 3122, - 3124, 3126, 3128, 3130, 3132, 3134, 3136, 3138, 3140, 3142, - 3144, 3146, 3148, 3150, 3152, 3154, 3156, 3158, 3160, 3162, - 3164, 3166, 3168, 3170, 3172, 3174, 3176, 3178, 3180, 3182, - 3184, 3186, 3188, 3190, 3192, 3194, 3196, 3198, 3200, 3202, - 3204, 3206, 3208, 3210, 3212, 3214, 3216, 3218, 3220, 3222, - 3224, 3226, 3228, 3230, 3232, 3234 + 0, 0, 3, 5, 8, 11, 15, 17, 20, 23, + 25, 28, 30, 33, 38, 45, 49, 53, 59, 61, + 65, 69, 75, 81, 83, 87, 91, 97, 104, 106, + 110, 114, 116, 118, 120, 122, 124, 126, 128, 130, + 132, 134, 136, 138, 140, 144, 148, 153, 157, 161, + 165, 169, 173, 179, 185, 191, 197, 203, 209, 211, + 213, 217, 221, 226, 232, 239, 241, 245, 249, 253, + 257, 264, 270, 279, 285, 291, 297, 299, 303, 307, + 309, 311, 313, 315, 317, 319, 321, 323, 328, 333, + 335, 338, 342, 344, 346, 348, 350, 352, 354, 356, + 358, 360, 362, 367, 371, 376, 380, 382, 384, 386, + 389, 392, 397, 401, 407, 411, 416, 421, 427, 429, + 432, 434, 439, 441, 446, 448, 452, 455, 459, 461, + 463, 468, 473, 479, 485, 488, 492, 497, 503, 505, + 509, 512, 516, 520, 526, 531, 538, 540, 543, 545, + 548, 557, 567, 569, 573, 575, 578, 581, 585, 597, + 612, 626, 649, 651, 653, 655, 656, 658, 660, 661, + 663, 666, 668, 671, 676, 678, 680, 682, 684, 686, + 688, 690, 692, 694, 696, 698, 700, 704, 707, 711, + 715, 718, 722, 725, 729, 732, 736, 741, 747, 753, + 756, 761, 767, 771, 775, 778, 781, 790, 794, 796, + 799, 803, 805, 809, 813, 815, 817, 819, 821, 823, + 825, 827, 829, 831, 833, 835, 837, 839, 841, 843, + 845, 847, 849, 852, 855, 858, 861, 863, 865, 868, + 873, 877, 883, 888, 892, 894, 896, 898, 900, 902, + 904, 906, 908, 910, 913, 917, 921, 924, 926, 931, + 935, 939, 945, 950, 957, 962, 969, 975, 983, 988, + 994, 1000, 1007, 1011, 1015, 1018, 1020, 1024, 1029, 1035, + 1039, 1046, 1051, 1057, 1059, 1062, 1066, 1068, 1071, 1073, + 1080, 1084, 1088, 1091, 1095, 1097, 1101, 1104, 1109, 1115, + 1122, 1128, 1132, 1135, 1139, 1144, 1146, 1150, 1152, 1155, + 1157, 1159, 1161, 1164, 1167, 1170, 1174, 1176, 1178, 1181, + 1184, 1187, 1193, 1199, 1201, 1206, 1210, 1215, 1224, 1226, + 1229, 1233, 1236, 1240, 1249, 1251, 1254, 1258, 1267, 1278, + 1287, 1298, 1300, 1303, 1308, 1316, 1318, 1321, 1326, 1334, + 1343, 1345, 1349, 1351, 1355, 1357, 1361, 1365, 1369, 1373, + 1374, 1379, 1383, 1387, 1391, 1393, 1399, 1401, 1405, 1406, + 1408, 1410, 1414, 1416, 1420, 1424, 1426, 1430, 1434, 1438, + 1442, 1444, 1448, 1452, 1454, 1458, 1462, 1464, 1469, 1471, + 1476, 1478, 1483, 1485, 1490, 1492, 1495, 1497, 1500, 1502, + 1504, 1507, 1510, 1512, 1514, 1516, 1518, 1522, 1524, 1526, + 1528, 1530, 1532, 1534, 1536, 1538, 1540, 1545, 1551, 1557, + 1564, 1568, 1573, 1575, 1578, 1582, 1585, 1588, 1590, 1593, + 1596, 1598, 1600, 1602, 1606, 1610, 1612, 1614, 1616, 1619, + 1621, 1624, 1627, 1629, 1632, 1635, 1638, 1641, 1644, 1647, + 1650, 1652, 1655, 1658, 1660, 1663, 1666, 1669, 1672, 1675, + 1677, 1679, 1681, 1683, 1685, 1687, 1689, 1691, 1693, 1696, + 1700, 1705, 1707, 1710, 1714, 1716, 1718, 1720, 1722, 1724, + 1726, 1728, 1730, 1732, 1734, 1736, 1738, 1740, 1742, 1744, + 1746, 1748, 1750, 1752, 1755, 1758, 1762, 1764, 1769, 1774, + 1778, 1783, 1785, 1789, 1791, 1793, 1795, 1797, 1799, 1804, + 1810, 1819, 1829, 1839, 1850, 1852, 1855, 1857, 1860, 1867, + 1868, 1870, 1874, 1878, 1879, 1881, 1883, 1885, 1888, 1891, + 1892, 1894, 1896, 1898, 1901, 1904, 1906, 1908, 1910, 1912, + 1914, 1916, 1918, 1920, 1922, 1924, 1926, 1930, 1934, 1937, + 1941, 1945, 1948, 1950, 1952, 1954, 1956, 1958, 1960, 1965, + 1969, 1977, 1981, 1989, 1994, 1999, 2003, 2011, 2014, 2016, + 2019, 2023, 2025, 2027, 2029, 2031, 2033, 2037, 2041, 2043, + 2045, 2047, 2049, 2053, 2055, 2057, 2059, 2061, 2063, 2065, + 2067, 2069, 2071, 2073, 2075, 2079, 2083, 2088, 2093, 2097, + 2101, 2105, 2110, 2115, 2119, 2124, 2131, 2136, 2143, 2148, + 2152, 2157, 2164, 2171, 2176, 2183, 2190, 2195, 2197, 2200, + 2202, 2204, 2206, 2210, 2214, 2216, 2218, 2223, 2229, 2236, + 2240, 2244, 2248, 2252, 2258, 2266, 2274, 2280, 2286, 2292, + 2300, 2308, 2314, 2320, 2324, 2328, 2334, 2342, 2348, 2356, + 2358, 2363, 2367, 2373, 2375, 2378, 2382, 2386, 2388, 2392, + 2395, 2396, 2398, 2400, 2403, 2405, 2409, 2411, 2415, 2417, + 2422, 2424, 2427, 2431, 2432, 2434, 2435, 2437, 2442, 2445, + 2449, 2451, 2452, 2454, 2459, 2460, 2462, 2465, 2467, 2471, + 2472, 2474, 2477, 2480, 2482, 2483, 2485, 2486, 2488, 2490, + 2492, 2494, 2496, 2498, 2500, 2504, 2508, 2510, 2512, 2514, + 2517, 2521, 2523, 2525, 2527, 2529, 2531, 2533, 2535, 2537, + 2540, 2543, 2545, 2547, 2550, 2553, 2557, 2559, 2562, 2565, + 2571, 2574, 2576, 2578, 2579, 2582, 2584, 2588, 2593, 2594, + 2597, 2598, 2601, 2606, 2611, 2615, 2618, 2622, 2624, 2628, + 2629, 2631, 2633, 2636, 2639, 2642, 2645, 2647, 2650, 2653, + 2656, 2659, 2663, 2666, 2670, 2674, 2679, 2682, 2685, 2687, + 2689, 2693, 2696, 2700, 2703, 2707, 2710, 2714, 2718, 2722, + 2728, 2734, 2740, 2749, 2755, 2759, 2765, 2773, 2775, 2777, + 2779, 2783, 2787, 2791, 2793, 2795, 2797, 2799, 2801, 2803, + 2805, 2807, 2809, 2811, 2813, 2815, 2817, 2819, 2821, 2823, + 2825, 2827, 2829, 2831, 2833, 2835, 2837, 2839, 2841, 2843, + 2845, 2847, 2849, 2851, 2853, 2855, 2857, 2859, 2861, 2863, + 2865, 2867, 2869, 2871, 2873, 2875, 2877, 2879, 2881, 2883, + 2885, 2887, 2889, 2891, 2893, 2895, 2897, 2899, 2901, 2903, + 2905, 2907, 2909, 2911, 2913, 2915, 2917, 2919, 2921, 2923, + 2925, 2927, 2929, 2931, 2933, 2935, 2937, 2939, 2941, 2943, + 2945, 2947, 2949, 2951, 2953, 2955, 2957, 2959, 2961, 2963, + 2965, 2967, 2969, 2971, 2973, 2975, 2977, 2979, 2981, 2983, + 2985, 2987, 2989, 2991, 2993, 2995, 2997, 2999, 3001, 3003, + 3005, 3007, 3009, 3011, 3013, 3015, 3017, 3019, 3021, 3023, + 3025, 3027, 3029, 3031, 3033, 3035, 3037, 3039, 3041, 3043, + 3045, 3047, 3049, 3051, 3053, 3055, 3057, 3059, 3061, 3063, + 3065, 3067, 3069, 3071, 3073, 3075, 3077, 3079, 3081, 3083, + 3085, 3087, 3089, 3091, 3093, 3095, 3097, 3099, 3101, 3103, + 3105, 3107, 3109, 3111, 3113, 3115, 3117, 3119, 3121, 3123, + 3125, 3127, 3129, 3131, 3133, 3135, 3137, 3139, 3141, 3143, + 3145, 3147, 3149, 3151, 3153, 3155, 3157, 3159, 3161, 3163, + 3165, 3167, 3169, 3171, 3173, 3175, 3177, 3179, 3181, 3183, + 3185, 3187, 3189, 3191, 3193, 3195, 3197, 3199, 3201, 3203, + 3205, 3207, 3209, 3211, 3213, 3215, 3217, 3219, 3221, 3223, + 3225, 3227, 3229, 3231, 3233, 3235, 3237, 3239, 3241 }; /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ const unsigned short int xquery_parser::yyrline_[] = { - 0, 1049, 1049, 1050, 1054, 1058, 1069, 1078, 1084, 1092, - 1098, 1109, 1114, 1122, 1129, 1136, 1145, 1152, 1160, 1168, - 1176, 1187, 1192, 1199, 1206, 1218, 1228, 1235, 1242, 1254, - 1255, 1256, 1257, 1258, 1263, 1264, 1265, 1266, 1267, 1268, - 1269, 1272, 1277, 1282, 1290, 1298, 1306, 1311, 1319, 1324, - 1332, 1337, 1345, 1350, 1355, 1360, 1368, 1370, 1373, 1383, - 1388, 1396, 1404, 1415, 1422, 1433, 1438, 1446, 1453, 1460, - 1469, 1482, 1490, 1497, 1507, 1514, 1521, 1532, 1533, 1534, - 1535, 1536, 1537, 1538, 1539, 1544, 1550, 1559, 1566, 1576, - 1586, 1587, 1588, 1589, 1590, 1591, 1592, 1593, 1594, 1595, - 1600, 1608, 1616, 1624, 1631, 1639, 1646, 1651, 1659, 1667, - 1681, 1695, 1712, 1717, 1725, 1733, 1744, 1749, 1758, 1763, - 1770, 1775, 1785, 1790, 1799, 1805, 1818, 1823, 1831, 1842, - 1857, 1869, 1884, 1889, 1894, 1899, 1907, 1914, 1925, 1930, - 1940, 1949, 1958, 1967, 1979, 1983, 1989, 1993, 2003, 2013, - 2026, 2032, 2041, 2046, 2053, 2060, 2071, 2081, 2091, 2101, - 2119, 2139, 2143, 2148, 2155, 2159, 2164, 2171, 2176, 2188, - 2195, 2207, 2208, 2209, 2210, 2211, 2212, 2213, 2215, 2216, - 2217, 2218, 2219, 2224, 2229, 2237, 2254, 2262, 2270, 2277, - 2284, 2295, 2304, 2313, 2322, 2335, 2343, 2351, 2359, 2374, - 2379, 2387, 2401, 2418, 2443, 2451, 2458, 2469, 2479, 2484, - 2496, 2505, 2518, 2519, 2520, 2521, 2522, 2523, 2528, 2529, - 2532, 2533, 2534, 2535, 2536, 2539, 2540, 2541, 2542, 2543, - 2548, 2562, 2570, 2575, 2583, 2588, 2593, 2601, 2610, 2622, - 2632, 2645, 2653, 2654, 2655, 2660, 2661, 2662, 2663, 2664, - 2669, 2676, 2686, 2692, 2701, 2711, 2718, 2726, 2738, 2748, - 2758, 2768, 2778, 2788, 2798, 2808, 2819, 2828, 2838, 2848, - 2864, 2873, 2882, 2890, 2896, 2908, 2916, 2926, 2934, 2946, - 2952, 2963, 2965, 2969, 2977, 2981, 2986, 2990, 2994, 2998, - 3008, 3016, 3023, 3029, 3039, 3043, 3047, 3055, 3063, 3071, - 3083, 3091, 3097, 3107, 3113, 3123, 3127, 3137, 3143, 3149, - 3155, 3164, 3173, 3182, 3195, 3199, 3207, 3213, 3223, 3231, - 3240, 3253, 3260, 3272, 3276, 3288, 3295, 3301, 3310, 3317, - 3323, 3334, 3341, 3347, 3356, 3365, 3372, 3383, 3390, 3402, - 3408, 3420, 3426, 3437, 3443, 3454, 3460, 3471, 3480, 3484, - 3493, 3497, 3505, 3509, 3519, 3526, 3535, 3545, 3544, 3558, - 3567, 3576, 3589, 3593, 3605, 3609, 3617, 3620, 3627, 3631, - 3640, 3644, 3648, 3656, 3660, 3666, 3672, 3678, 3688, 3692, - 3696, 3704, 3708, 3714, 3724, 3728, 3738, 3742, 3752, 3756, - 3766, 3770, 3780, 3784, 3792, 3796, 3800, 3804, 3814, 3818, - 3822, 3829, 3834, 3842, 3846, 3850, 3854, 3858, 3862, 3870, - 3874, 3878, 3886, 3890, 3894, 3898, 3909, 3915, 3925, 3931, - 3941, 3945, 3949, 3987, 3991, 4001, 4011, 4024, 4033, 4043, - 4047, 4056, 4060, 4069, 4075, 4083, 4089, 4101, 4107, 4117, - 4121, 4125, 4129, 4133, 4139, 4145, 4153, 4157, 4165, 4169, - 4180, 4184, 4188, 4194, 4198, 4212, 4216, 4224, 4228, 4238, - 4242, 4246, 4250, 4259, 4263, 4267, 4271, 4279, 4285, 4295, - 4303, 4307, 4311, 4315, 4319, 4323, 4327, 4331, 4335, 4339, - 4344, 4348, 4352, 4356, 4364, 4368, 4376, 4383, 4390, 4401, - 4409, 4413, 4421, 4429, 4437, 4491, 4495, 4508, 4514, 4524, - 4528, 4536, 4540, 4544, 4552, 4562, 4572, 4589, 4606, 4623, - 4645, 4651, 4662, 4668, 4679, 4690, 4692, 4696, 4701, 4711, - 4714, 4721, 4727, 4733, 4741, 4754, 4757, 4764, 4770, 4776, - 4783, 4794, 4798, 4808, 4812, 4822, 4826, 4830, 4835, 4844, - 4850, 4856, 4862, 4870, 4875, 4883, 4888, 4896, 4904, 4909, - 4914, 4919, 4924, 4929, 4938, 4946, 4950, 4967, 4971, 4979, - 4987, 4995, 4999, 5007, 5013, 5023, 5031, 5035, 5039, 5074, - 5080, 5086, 5096, 5100, 5104, 5108, 5112, 5116, 5120, 5127, - 5133, 5143, 5151, 5155, 5159, 5163, 5167, 5171, 5175, 5179, - 5183, 5191, 5199, 5203, 5207, 5217, 5225, 5233, 5237, 5241, - 5249, 5253, 5259, 5265, 5269, 5279, 5287, 5291, 5297, 5306, - 5315, 5321, 5327, 5337, 5354, 5361, 5376, 5412, 5416, 5424, - 5432, 5444, 5448, 5456, 5464, 5468, 5479, 5496, 5502, 5508, - 5518, 5522, 5528, 5534, 5538, 5544, 5548, 5554, 5560, 5567, - 5577, 5582, 5590, 5596, 5606, 5628, 5637, 5643, 5656, 5670, - 5677, 5683, 5693, 5702, 5710, 5716, 5734, 5742, 5746, 5753, - 5758, 5766, 5770, 5777, 5781, 5788, 5792, 5799, 5803, 5812, - 5825, 5828, 5836, 5839, 5847, 5855, 5863, 5867, 5875, 5878, - 5886, 5898, 5901, 5909, 5921, 5927, 5937, 5940, 5948, 5952, - 5956, 5964, 5967, 5975, 5978, 5986, 5990, 5994, 5998, 6002, - 6010, 6018, 6030, 6042, 6046, 6050, 6058, 6064, 6074, 6078, - 6082, 6086, 6090, 6094, 6098, 6102, 6110, 6114, 6118, 6122, - 6130, 6136, 6146, 6156, 6160, 6168, 6178, 6189, 6196, 6200, - 6208, 6211, 6218, 6223, 6232, 6242, 6245, 6252, 6256, 6264, - 6273, 6280, 6290, 6294, 6301, 6307, 6317, 6320, 6327, 6332, - 6344, 6352, 6364, 6372, 6376, 6384, 6388, 6392, 6400, 6408, - 6412, 6416, 6420, 6428, 6436, 6448, 6452, 6460, 6474, 6478, - 6485, 6490, 6498, 6503, 6512, 6520, 6526, 6536, 6542, 6552, - 6559, 6566, 6591, 6619, 6647, 6651, 6655, 6662, 6669, 6676, - 6688, 6692, 6693, 6706, 6707, 6708, 6709, 6710, 6711, 6712, - 6713, 6714, 6715, 6716, 6717, 6718, 6719, 6720, 6721, 6725, - 6726, 6727, 6728, 6729, 6730, 6731, 6732, 6733, 6734, 6735, - 6736, 6737, 6738, 6739, 6740, 6741, 6742, 6743, 6744, 6745, - 6746, 6747, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, + 0, 1051, 1051, 1052, 1056, 1060, 1068, 1074, 1078, 1087, + 1093, 1101, 1107, 1118, 1123, 1131, 1138, 1145, 1154, 1161, + 1169, 1177, 1185, 1196, 1201, 1208, 1215, 1227, 1237, 1244, + 1251, 1263, 1264, 1265, 1266, 1267, 1272, 1273, 1274, 1275, + 1276, 1277, 1278, 1281, 1286, 1291, 1299, 1307, 1315, 1320, + 1328, 1333, 1341, 1346, 1354, 1359, 1364, 1369, 1377, 1379, + 1382, 1392, 1397, 1405, 1413, 1424, 1431, 1442, 1447, 1455, + 1462, 1469, 1478, 1491, 1499, 1506, 1516, 1523, 1530, 1541, + 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1553, 1559, 1568, + 1575, 1585, 1595, 1596, 1597, 1598, 1599, 1600, 1601, 1602, + 1603, 1604, 1609, 1617, 1625, 1633, 1640, 1648, 1655, 1660, + 1668, 1676, 1690, 1704, 1721, 1726, 1734, 1742, 1753, 1758, + 1767, 1772, 1779, 1784, 1794, 1799, 1808, 1814, 1827, 1832, + 1840, 1851, 1866, 1878, 1893, 1898, 1903, 1908, 1916, 1923, + 1934, 1939, 1949, 1958, 1967, 1976, 1988, 1992, 1998, 2002, + 2012, 2022, 2035, 2041, 2050, 2055, 2062, 2069, 2080, 2090, + 2100, 2110, 2128, 2148, 2152, 2157, 2164, 2168, 2173, 2180, + 2185, 2197, 2204, 2214, 2229, 2230, 2231, 2232, 2233, 2234, + 2235, 2237, 2238, 2239, 2240, 2241, 2246, 2251, 2259, 2276, + 2284, 2292, 2299, 2306, 2317, 2326, 2335, 2344, 2357, 2365, + 2373, 2381, 2396, 2401, 2409, 2423, 2440, 2465, 2473, 2480, + 2491, 2501, 2506, 2519, 2536, 2537, 2538, 2539, 2540, 2541, + 2546, 2547, 2550, 2551, 2552, 2553, 2554, 2557, 2558, 2559, + 2560, 2561, 2566, 2580, 2588, 2593, 2601, 2606, 2611, 2619, + 2628, 2640, 2650, 2663, 2671, 2672, 2673, 2678, 2679, 2680, + 2681, 2682, 2687, 2694, 2704, 2710, 2719, 2729, 2736, 2744, + 2756, 2766, 2776, 2786, 2796, 2806, 2816, 2826, 2837, 2846, + 2856, 2866, 2882, 2891, 2900, 2908, 2914, 2926, 2934, 2944, + 2952, 2964, 2970, 2981, 2983, 2987, 2995, 2999, 3004, 3008, + 3012, 3016, 3026, 3034, 3041, 3047, 3057, 3061, 3065, 3073, + 3081, 3089, 3101, 3109, 3115, 3125, 3131, 3141, 3145, 3155, + 3161, 3167, 3173, 3182, 3191, 3200, 3213, 3217, 3225, 3231, + 3241, 3249, 3258, 3271, 3278, 3290, 3294, 3306, 3313, 3319, + 3328, 3335, 3341, 3352, 3359, 3365, 3374, 3383, 3390, 3401, + 3408, 3420, 3426, 3438, 3444, 3455, 3461, 3472, 3478, 3489, + 3498, 3502, 3511, 3515, 3523, 3527, 3537, 3544, 3553, 3563, + 3562, 3576, 3585, 3594, 3607, 3611, 3623, 3627, 3635, 3638, + 3645, 3649, 3658, 3662, 3666, 3674, 3678, 3684, 3690, 3696, + 3706, 3710, 3714, 3722, 3726, 3732, 3742, 3746, 3756, 3760, + 3770, 3774, 3784, 3788, 3798, 3802, 3811, 3815, 3823, 3827, + 3831, 3835, 3845, 3849, 3853, 3860, 3865, 3873, 3877, 3881, + 3885, 3889, 3893, 3901, 3905, 3909, 3917, 3921, 3925, 3929, + 3940, 3946, 3956, 3962, 3972, 3976, 3980, 4018, 4022, 4032, + 4042, 4055, 4064, 4074, 4078, 4087, 4091, 4100, 4106, 4114, + 4120, 4132, 4138, 4148, 4152, 4156, 4160, 4164, 4170, 4176, + 4184, 4188, 4196, 4200, 4211, 4215, 4219, 4225, 4229, 4243, + 4247, 4255, 4259, 4269, 4273, 4277, 4281, 4290, 4294, 4298, + 4302, 4310, 4316, 4326, 4334, 4338, 4342, 4346, 4350, 4354, + 4358, 4362, 4366, 4370, 4375, 4379, 4383, 4387, 4395, 4399, + 4407, 4414, 4421, 4432, 4440, 4444, 4452, 4460, 4468, 4522, + 4526, 4539, 4545, 4555, 4559, 4567, 4571, 4575, 4583, 4593, + 4603, 4620, 4637, 4654, 4676, 4682, 4693, 4699, 4710, 4721, + 4723, 4727, 4732, 4742, 4745, 4752, 4758, 4764, 4772, 4785, + 4788, 4795, 4801, 4807, 4814, 4825, 4829, 4839, 4843, 4853, + 4857, 4861, 4866, 4875, 4881, 4887, 4893, 4901, 4906, 4914, + 4919, 4927, 4935, 4940, 4945, 4950, 4955, 4960, 4969, 4977, + 4981, 4998, 5002, 5010, 5018, 5026, 5030, 5038, 5046, 5050, + 5054, 5089, 5095, 5101, 5111, 5115, 5119, 5123, 5127, 5131, + 5135, 5142, 5148, 5158, 5166, 5174, 5178, 5182, 5186, 5190, + 5194, 5198, 5202, 5206, 5214, 5222, 5226, 5230, 5240, 5248, + 5256, 5260, 5264, 5272, 5276, 5282, 5288, 5292, 5302, 5310, + 5314, 5320, 5329, 5338, 5344, 5350, 5360, 5377, 5384, 5399, + 5435, 5439, 5447, 5455, 5467, 5471, 5479, 5487, 5491, 5502, + 5519, 5525, 5531, 5541, 5545, 5551, 5557, 5561, 5567, 5571, + 5577, 5583, 5590, 5600, 5605, 5613, 5619, 5629, 5651, 5660, + 5666, 5679, 5693, 5700, 5706, 5716, 5725, 5733, 5739, 5757, + 5765, 5769, 5776, 5781, 5789, 5793, 5800, 5804, 5811, 5815, + 5822, 5826, 5835, 5848, 5851, 5859, 5862, 5870, 5878, 5886, + 5890, 5898, 5901, 5909, 5921, 5924, 5932, 5944, 5950, 5960, + 5963, 5971, 5975, 5979, 5987, 5990, 5998, 6001, 6009, 6013, + 6017, 6021, 6025, 6033, 6041, 6053, 6065, 6069, 6073, 6081, + 6087, 6097, 6101, 6105, 6109, 6113, 6117, 6121, 6125, 6133, + 6137, 6141, 6145, 6153, 6159, 6169, 6179, 6183, 6191, 6201, + 6212, 6219, 6223, 6231, 6234, 6241, 6246, 6255, 6265, 6268, + 6275, 6279, 6287, 6296, 6303, 6313, 6317, 6324, 6330, 6340, + 6343, 6350, 6355, 6367, 6375, 6387, 6395, 6399, 6407, 6411, + 6415, 6423, 6431, 6435, 6439, 6443, 6451, 6459, 6471, 6475, + 6483, 6497, 6501, 6508, 6513, 6521, 6526, 6535, 6543, 6549, + 6559, 6565, 6575, 6582, 6589, 6614, 6642, 6670, 6674, 6678, + 6685, 6692, 6699, 6711, 6715, 6716, 6729, 6730, 6731, 6732, + 6733, 6734, 6735, 6736, 6737, 6738, 6739, 6740, 6741, 6742, + 6743, 6744, 6748, 6749, 6750, 6751, 6752, 6753, 6754, 6755, 6756, 6757, 6758, 6759, 6760, 6761, 6762, 6763, 6764, 6765, 6766, 6767, 6768, 6769, 6770, 6771, 6772, 6773, 6774, 6775, 6776, 6777, 6778, 6779, 6780, 6781, 6782, 6783, 6784, 6785, @@ -17370,7 +17645,9 @@ 6896, 6897, 6898, 6899, 6900, 6901, 6902, 6903, 6904, 6905, 6906, 6907, 6908, 6909, 6910, 6911, 6912, 6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920, 6921, 6922, 6923, 6924, 6925, - 6926, 6927, 6928, 6929, 6930, 6935 + 6926, 6927, 6928, 6929, 6930, 6931, 6932, 6933, 6934, 6935, + 6936, 6937, 6938, 6939, 6940, 6941, 6942, 6943, 6944, 6945, + 6946, 6947, 6948, 6949, 6950, 6951, 6952, 6953, 6958 }; // Print the state stack on the debug stream. @@ -17477,8 +17754,8 @@ } const int xquery_parser::yyeof_ = 0; - const int xquery_parser::yylast_ = 16637; - const int xquery_parser::yynnts_ = 322; + const int xquery_parser::yylast_ = 17350; + const int xquery_parser::yynnts_ = 323; const int xquery_parser::yyempty_ = -2; const int xquery_parser::yyfinal_ = 608; const int xquery_parser::yyterror_ = 1; @@ -17489,17 +17766,14 @@ const xquery_parser::token_number_type xquery_parser::yyundef_token_ = 2; -/* Line 1054 of lalr1.cc */ -#line 1 "[Bison:b4_percent_define_default]" - } // zorba -/* Line 1054 of lalr1.cc */ -#line 17499 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.cpp" +/* Line 1136 of lalr1.cc */ +#line 17773 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.cpp" -/* Line 1056 of lalr1.cc */ -#line 6939 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +/* Line 1138 of lalr1.cc */ +#line 6962 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" namespace zorba { @@ -17523,9 +17797,27 @@ } else { - // remove the double quoting "''" from every token description + ParseErrorNode* prevErr = dynamic_cast(driver.get_expr()); + + if (prevErr != NULL) + { + // Error message heuristics: if the current error message has the "(missing comma "," between expressions?)" text, + // and the old message has a "','" text, then replace the old message with the new one. Unfortunately this + // makes the parser error messages harder to internationalize. + if (msg.find("(missing comma \",\" between expressions?)") != string::npos + && + prevErr->msg.find(zstring("\",\"")) == zstring::npos) + return; + } + + // Replace the first occurrence of "unexpected "'QName'"" with "unexpected qualified name %actual_qname%" string message = msg; int pos; + std::string unexpected_qname = "unexpected \"'QName'\""; + if ((pos = message.find(unexpected_qname)) != -1) + message = message.substr(0, pos) + "unexpected qualified name \"" + driver.symtab.get_last_qname() + "\"" + message.substr(pos+unexpected_qname.length()); + + // remove the double quoting "''" from every token description while ((pos = message.find("\"'")) != -1 || (pos = message.find("'\"")) != -1) message.replace(pos, 2, "\""); driver.set_expr(new ParseErrorNode(driver.createQueryLoc(loc), err::XPST0003, message)); diff -Nru zorba-2.7.0-0/src/compiler/parser/xquery_parser.hpp zorba-2.8.0-0/src/compiler/parser/xquery_parser.hpp --- zorba-2.7.0-0/src/compiler/parser/xquery_parser.hpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/xquery_parser.hpp 2013-01-16 18:28:18.000000000 +0000 @@ -1,10 +1,8 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* A Bison parser, made by GNU Bison 2.5. */ /* Skeleton interface for Bison LALR(1) parsers in C++ - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software - Foundation, Inc. + Copyright (C) 2002-2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,7 +38,7 @@ /* "%code requires" blocks. */ /* Line 35 of lalr1.cc */ -#line 35 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 35 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" /* @@ -86,32 +84,12 @@ /* Line 35 of lalr1.cc */ -#line 90 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.hpp" +#line 88 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.hpp" #include #include #include "stack.hh" - - -/* Line 35 of lalr1.cc */ -#line 1 "[Bison:b4_percent_define_default]" - -namespace zorba { - -/* Line 35 of lalr1.cc */ -#line 104 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.hpp" - class position; - class location; - -/* Line 35 of lalr1.cc */ -#line 1 "[Bison:b4_percent_define_default]" - -} // zorba - -/* Line 35 of lalr1.cc */ -#line 114 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.hpp" - #include "location.hh" /* Enabling traces. */ @@ -132,33 +110,11 @@ # define YYTOKEN_TABLE 0 #endif -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ -do { \ - if (N) \ - { \ - (Current).begin = (Rhs)[1].begin; \ - (Current).end = (Rhs)[N].end; \ - } \ - else \ - { \ - (Current).begin = (Current).end = (Rhs)[0].end; \ - } \ -} while (false) -#endif - - -/* Line 35 of lalr1.cc */ -#line 1 "[Bison:b4_percent_define_default]" namespace zorba { /* Line 35 of lalr1.cc */ -#line 162 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.hpp" +#line 118 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.hpp" /// A Bison parser. class xquery_parser @@ -170,7 +126,7 @@ { /* Line 35 of lalr1.cc */ -#line 155 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_parser.y" +#line 155 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_parser.y" zorba::parsenode *node; zorba::exprnode *expr; @@ -194,7 +150,7 @@ /* Line 35 of lalr1.cc */ -#line 198 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.hpp" +#line 154 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.hpp" }; #else typedef YYSTYPE semantic_type; @@ -608,6 +564,14 @@ /// The location stack. location_stack_type yylocation_stack_; + /// Whether the given \c yypact_ value indicates a defaulted state. + /// \param yyvalue the value to check + static bool yy_pact_value_is_default_ (int yyvalue); + + /// Whether the given \c yytable_ value indicates a syntax error. + /// \param yyvalue the value to check + static bool yy_table_value_is_error_ (int yyvalue); + /// Internal symbol numbers. typedef unsigned short int token_number_type; /* Tables. */ @@ -615,7 +579,7 @@ static const short int yypact_[]; static const short int yypact_ninf_; - /// For a state, default rule to reduce. + /// For a state, default reduction number. /// Unless\a yytable_ specifies something else to do. /// Zero means the default is an error. static const unsigned short int yydefact_[]; @@ -646,10 +610,8 @@ static const char* const yytname_[]; #endif -#if YYERROR_VERBOSE /// Convert the symbol name \a n to a form suitable for a diagnostic. - virtual std::string yytnamerr_ (const char *n); -#endif + static std::string yytnamerr_ (const char *n); #if YYDEBUG /// A type to store symbol numbers and -1. @@ -705,13 +667,10 @@ xquery_driver& driver; }; -/* Line 35 of lalr1.cc */ -#line 1 "[Bison:b4_percent_define_default]" - } // zorba /* Line 35 of lalr1.cc */ -#line 715 "/home/markos/zorba/repo/markos-scratch/build/src/compiler/parser/xquery_parser.hpp" +#line 674 "/home/colea/xquery_bzr/error-messages/build/src/compiler/parser/xquery_parser.hpp" diff -Nru zorba-2.7.0-0/src/compiler/parser/xquery_parser.y zorba-2.8.0-0/src/compiler/parser/xquery_parser.y --- zorba-2.7.0-0/src/compiler/parser/xquery_parser.y 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/xquery_parser.y 2013-01-16 18:28:18.000000000 +0000 @@ -186,6 +186,7 @@ %type ERROR "'error'" + /* constant string tokens */ %type WindowType %type FLWORWinCondType @@ -207,7 +208,7 @@ %token NCNAME_SVAL "'NCName_sval'" %token PRAGMA_LITERAL_AND_END_PRAGMA "'pragma literal'" %token QNAME_SVAL_AND_END_PRAGMA "'QName #)'" -%token EQNAME_SVAL_AND_END_PRAGMA "'EQName #)'" +%token EQNAME_SVAL_AND_END_PRAGMA "'EQName #)'" %token PREFIX_WILDCARD "'*:QName'" %token COMP_ELEMENT_QNAME_LBRACE "'element QName {'" %token COMP_ATTRIBUTE_QNAME_LBRACE "'attribute QName {'" @@ -580,6 +581,7 @@ %type AposAttrValueContent %type ArgList %type AtomicType +%type SimpleType %type AttributeTest %type BaseURIDecl %type BoundarySpaceDecl @@ -917,7 +919,7 @@ %} // parsenodes -%destructor { release_hack( $$ ); } AbbrevForwardStep AnyKindTest Annotation AnnotationList AnnotationLiteralList AposAttrContentList opt_AposAttrContentList AposAttrValueContent ArgList AtomicType AttributeTest BaseURIDecl BoundarySpaceDecl CaseClause CaseClauseList CommentTest ConstructionDecl CopyNamespacesDecl DefaultCollationDecl DefaultNamespaceDecl DirAttr DirAttributeList DirAttributeValue DirElemContentList DocumentTest ElementTest EmptyOrderDecl WindowClause ForClause ForLetWinClause FLWORClauseList ForwardAxis ForwardStep FunctionDecl FunctionDecl2 FunctionDeclSimple FunctionDeclUpdating Import ItemType KindTest LetClause LibraryModule MainModule /* Module */ ModuleDecl ModuleImport NameTest NamespaceDecl NodeComp NodeTest OccurrenceIndicator OptionDecl GroupByClause GroupSpecList GroupSpec GroupCollationSpec OrderByClause OrderCollationSpec OrderDirSpec OrderEmptySpec OrderModifier OrderSpec OrderSpecList OrderingModeDecl PITest Param ParamList PositionalVar Pragma Pragma_list PredicateList QVarInDecl QVarInDeclList QuoteAttrValueContent QuoteAttrContentList opt_QuoteAttrContentList ReverseAxis ReverseStep SIND_Decl SIND_DeclList SchemaAttributeTest SchemaElementTest SchemaImport SchemaPrefix SequenceType Setter SignList SingleType TextTest TypeDeclaration TypeName TypeName_WITH_HOOK URILiteralList ValueComp CollectionDecl IndexDecl IndexKeySpec IndexKeyList IntegrityConstraintDecl CtxItemDecl CtxItemDecl2 CtxItemDecl3 CtxItemDecl4 VarDecl VarGetsDecl VarGetsDeclList VarInDecl VarInDeclList WindowVarDecl WindowVars WindowVars2 WindowVars3 FLWORWinCond VersionDecl VFO_Decl VFO_DeclList WhereClause CountClause Wildcard DecimalFormatDecl TypedFunctionTest AnyFunctionTest TypeList SwitchCaseClause SwitchCaseClauseList SwitchCaseOperandList +%destructor { release_hack( $$ ); } AbbrevForwardStep AnyKindTest Annotation AnnotationList AnnotationLiteralList AposAttrContentList opt_AposAttrContentList AposAttrValueContent ArgList AtomicType SimpleType AttributeTest BaseURIDecl BoundarySpaceDecl CaseClause CaseClauseList CommentTest ConstructionDecl CopyNamespacesDecl DefaultCollationDecl DefaultNamespaceDecl DirAttr DirAttributeList DirAttributeValue DirElemContentList DocumentTest ElementTest EmptyOrderDecl WindowClause ForClause ForLetWinClause FLWORClauseList ForwardAxis ForwardStep FunctionDecl FunctionDecl2 FunctionDeclSimple FunctionDeclUpdating Import ItemType KindTest LetClause LibraryModule MainModule /* Module */ ModuleDecl ModuleImport NameTest NamespaceDecl NodeComp NodeTest OccurrenceIndicator OptionDecl GroupByClause GroupSpecList GroupSpec GroupCollationSpec OrderByClause OrderCollationSpec OrderDirSpec OrderEmptySpec OrderModifier OrderSpec OrderSpecList OrderingModeDecl PITest Param ParamList PositionalVar Pragma Pragma_list PredicateList QVarInDecl QVarInDeclList QuoteAttrValueContent QuoteAttrContentList opt_QuoteAttrContentList ReverseAxis ReverseStep SIND_Decl SIND_DeclList SchemaAttributeTest SchemaElementTest SchemaImport SchemaPrefix SequenceType Setter SignList SingleType TextTest TypeDeclaration TypeName TypeName_WITH_HOOK URILiteralList ValueComp CollectionDecl IndexDecl IndexKeySpec IndexKeyList IntegrityConstraintDecl CtxItemDecl CtxItemDecl2 CtxItemDecl3 CtxItemDecl4 VarDecl VarGetsDecl VarGetsDeclList VarInDecl VarInDeclList WindowVarDecl WindowVars WindowVars2 WindowVars3 FLWORWinCond VersionDecl VFO_Decl VFO_DeclList WhereClause CountClause Wildcard DecimalFormatDecl TypedFunctionTest AnyFunctionTest TypeList SwitchCaseClause SwitchCaseClauseList SwitchCaseOperandList // parsenodes: Full-Text %destructor { release_hack( $$ ); } FTAnd FTAnyallOption FTBigUnit FTCaseOption FTContent FTDiacriticsOption FTDistance FTExtensionOption FTExtensionSelection FTIgnoreOption opt_FTIgnoreOption FTLanguageOption FTMatchOption FTMatchOptions opt_FTMatchOptions FTMildNot FTOptionDecl FTOr FTOrder FTPosFilter FTPrimary FTPrimaryWithOptions FTRange FTScope FTScoreVar FTSelection FTStemOption FTStopWords FTStopWordOption FTStopWordsInclExcl FTThesaurusID FTThesaurusOption FTTimes opt_FTTimes FTUnaryNot FTUnit FTWeight FTWildCardOption FTWindow FTWords FTWordsValue @@ -1059,14 +1061,21 @@ { $$ = $3; } - - ; + ERROR : - // Special rule to get Bison out of some infinte loops. This can happen when the lexer + error + { + $$ = NULL; + } + // Special rules to get Bison out of some infinte loops. This can happen when the lexer // throws an error and Bison finds an error too. - error UNRECOGNIZED + | error UNRECOGNIZED + { + $$ = NULL; YYABORT; + } + | ERROR error { $$ = NULL; YYABORT; } @@ -2120,7 +2129,7 @@ { if ($1 == NULL) { - error(@1, "syntax error, unexpected end of file, the query should not be empty"); + error(@1, "syntax error, unexpected end of file, the query body should not be empty"); YYERROR; } @@ -2199,6 +2208,19 @@ blk->add($2); $$ = blk; + } + // ============================ Improved error messages ============================ + | + Statements Expr ERROR Statement + { + $$ = $1; // to prevent the Bison warning + $$ = $2; // to prevent the Bison warning + $$ = $4; // to prevent the Bison warning + error(@3, "syntax error, unexpected statement (missing semicolon \";\" between statements?)"); + delete $1; // these need to be deleted here because the parser deallocator will skip them + delete $2; + delete $4; + YYERROR; } ; @@ -2493,24 +2515,20 @@ $$ = expr; } // ============================ Improved error messages ============================ - | Expr error ExprSingle error + | + Expr ERROR ExprSingle { $$ = $1; // to prevent the Bison warning $$ = $3; // to prevent the Bison warning - error(@2, "syntax error, unexpected ExprSingle (missing comma \",\" between expressions?)"); + // Heuristics to improve the error message: if the $1 Expr is a QName (which in turn gets + // promoted to a PathExpr), chances are that it's not a missing comma, so don't modify + // the error message. + if (dynamic_cast($1) == NULL) + error(@2, "syntax error, unexpected expression (missing comma \",\" between expressions?)"); delete $1; // these need to be deleted here because the parser deallocator will skip them delete $3; YYERROR; } - | Expr ERROR ExprSingle - { - // This rule will never be reached, as the ERROR rule will stop the parser, - // but it is nevertheless needed to fix a testcase with an unterminated comment which - // would otherwise cycle indefinitely - $$ = $1; // to prevent the Bison warning - $$ = $3; // to prevent the Bison warning - YYERROR; - } ; @@ -2687,12 +2705,12 @@ { $$ = new ForClause(LOC(@$), dynamic_cast($3)); } - // ============================ Improved error messages ============================ + // ============================ Improved error messages ============================ | FOR error VarInDeclList { $$ = $3; // to prevent the Bison warning - error(@2, "syntax error, unexpected QName \"" + error(@2, "syntax error, unexpected qualified name \"" + static_cast($3)->operator[](0)->get_var_name()->get_qname().str() + "\" (missing \"$\" sign?)"); delete $3; YYERROR; @@ -3775,6 +3793,19 @@ } ; + +SingleType : + SimpleType + { + $$ = new SingleType(LOC(@$), dynamic_cast($1), false); + } + | SimpleType HOOK + { + $$ = new SingleType(LOC(@$), dynamic_cast($1), true); + } +; + + // [58] UnaryExpr : ValueExpr @@ -5002,31 +5033,15 @@ } ; -// [115] -SingleType : - AtomicType - { - $$ = new SingleType( - LOC(@$), dynamic_cast($1), false - ); - } - | AtomicType HOOK - { - $$ = new SingleType( - LOC(@$), dynamic_cast($1), true - ); - } - ; -// [116] TypeDeclaration : - AS SequenceType - { - $$ = $2; - } - ; + AS SequenceType + { + $$ = $2; + } +; + -// [117] SequenceType : ItemType %prec SEQUENCE_TYPE_REDUCE { @@ -5138,15 +5153,23 @@ } ; -// [120] + AtomicType : - QNAME - { - $$ = new AtomicType( LOC(@$), static_cast($1) ); - } - ; + QNAME + { + $$ = new AtomicType( LOC(@$), static_cast($1) ); + } +; + + +SimpleType : + QNAME + { + $$ = new SimpleType( LOC(@$), static_cast($1) ); + } +; + -// [121] KindTest : DocumentTest { @@ -6959,9 +6982,27 @@ } else { - // remove the double quoting "''" from every token description + ParseErrorNode* prevErr = dynamic_cast(driver.get_expr()); + + if (prevErr != NULL) + { + // Error message heuristics: if the current error message has the "(missing comma "," between expressions?)" text, + // and the old message has a "','" text, then replace the old message with the new one. Unfortunately this + // makes the parser error messages harder to internationalize. + if (msg.find("(missing comma \",\" between expressions?)") != string::npos + && + prevErr->msg.find(zstring("\",\"")) == zstring::npos) + return; + } + + // Replace the first occurrence of "unexpected "'QName'"" with "unexpected qualified name %actual_qname%" string message = msg; int pos; + std::string unexpected_qname = "unexpected \"'QName'\""; + if ((pos = message.find(unexpected_qname)) != -1) + message = message.substr(0, pos) + "unexpected qualified name \"" + driver.symtab.get_last_qname() + "\"" + message.substr(pos+unexpected_qname.length()); + + // remove the double quoting "''" from every token description while ((pos = message.find("\"'")) != -1 || (pos = message.find("'\"")) != -1) message.replace(pos, 2, "\""); driver.set_expr(new ParseErrorNode(driver.createQueryLoc(loc), err::XPST0003, message)); diff -Nru zorba-2.7.0-0/src/compiler/parser/xquery_scanner.cpp zorba-2.8.0-0/src/compiler/parser/xquery_scanner.cpp --- zorba-2.7.0-0/src/compiler/parser/xquery_scanner.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parser/xquery_scanner.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -3264,7 +3264,7 @@ #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" /* * Copyright 2006-2008 The FLWOR Foundation. * @@ -3280,7 +3280,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#line 17 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 17 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" #if defined (WIN32) @@ -3549,13 +3549,13 @@ -#line 386 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 386 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" typedef zorba::xquery_parser::token token; /*______________________________________________________________________ | | Override Flex's starting state here. |______________________________________________________________________*/ -#line 395 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 395 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" #define YY_USER_INIT \ { \ BEGIN MODE_SHEBANG; \ @@ -3741,7 +3741,7 @@ register int yy_act; /* %% [7.0] user's declarations go here */ -#line 402 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 402 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" @@ -3864,13 +3864,13 @@ case 1: /* rule 1 can match eol */ YY_RULE_SETUP -#line 413 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 413 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SHEBANG; } YY_BREAK case 2: /* rule 2 can match eol */ YY_RULE_SETUP -#line 414 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 414 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN INITIAL; yyless(0); } YY_BREAK @@ -3884,107 +3884,107 @@ case 3: YY_RULE_SETUP -#line 428 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 428 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LPAR; } YY_BREAK case 4: YY_RULE_SETUP -#line 429 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 429 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SEMI; } YY_BREAK case 5: YY_RULE_SETUP -#line 430 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 430 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COMMA; } YY_BREAK case 6: YY_RULE_SETUP -#line 431 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 431 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MINUS; } YY_BREAK case 7: YY_RULE_SETUP -#line 432 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 432 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PLUS; } YY_BREAK case 8: YY_RULE_SETUP -#line 433 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 433 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SLASH; } YY_BREAK case 9: YY_RULE_SETUP -#line 434 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 434 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SLASH_SLASH; } YY_BREAK case 10: YY_RULE_SETUP -#line 435 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 435 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::BANG; } YY_BREAK case 11: YY_RULE_SETUP -#line 436 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 436 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::AT_SIGN; } YY_BREAK case 12: YY_RULE_SETUP -#line 437 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 437 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::RPAR; } YY_BREAK case 13: YY_RULE_SETUP -#line 438 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 438 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::STAR; } YY_BREAK case 14: YY_RULE_SETUP -#line 439 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 439 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOT_DOT; } YY_BREAK case 15: YY_RULE_SETUP -#line 440 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 440 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOT; } YY_BREAK case 16: YY_RULE_SETUP -#line 441 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 441 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::HOOK; } YY_BREAK case 17: YY_RULE_SETUP -#line 442 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 442 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOLLAR; } YY_BREAK case 18: YY_RULE_SETUP -#line 443 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 443 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::HASH; } YY_BREAK case 19: YY_RULE_SETUP -#line 444 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 444 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COLON; } YY_BREAK case 20: YY_RULE_SETUP -#line 445 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 445 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOUBLE_COLON; } YY_BREAK case 21: YY_RULE_SETUP -#line 446 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 446 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PERCENTAGE; } YY_BREAK case 22: YY_RULE_SETUP -#line 447 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 447 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONCAT; } YY_BREAK case 23: YY_RULE_SETUP -#line 449 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 449 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { std::string lDocComment = theDriver->theDocComment.str(); yylval->sval = getDriver()->symtab.put_commentcontent(lDocComment.c_str(), lDocComment.length()); @@ -3994,7 +3994,7 @@ YY_BREAK case 24: YY_RULE_SETUP -#line 456 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 456 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { std::string lDocComment = theDriver->theDocComment.str(); yylval->sval = getDriver()->symtab.put_commentcontent(lDocComment.c_str(), lDocComment.length()); @@ -4005,424 +4005,424 @@ /* Tokens with state transitions */ case 25: YY_RULE_SETUP -#line 464 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 464 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_ELEM_COMP_CONSTR); } YY_BREAK case 26: YY_RULE_SETUP -#line 465 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 465 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_ATTR_COMP_CONSTR); } YY_BREAK case 27: YY_RULE_SETUP -#line 466 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 466 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_PI_COMP_CONSTR); } YY_BREAK case 28: YY_RULE_SETUP -#line 469 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 469 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::IF; } YY_BREAK case 29: YY_RULE_SETUP -#line 470 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 470 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::RETURNING; } YY_BREAK case 30: YY_RULE_SETUP -#line 472 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 472 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EXIT; } YY_BREAK case 31: YY_RULE_SETUP -#line 473 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 473 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WITH; } YY_BREAK case 32: YY_RULE_SETUP -#line 474 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 474 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::BREAK; } YY_BREAK case 33: YY_RULE_SETUP -#line 475 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 475 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LOOP; } YY_BREAK case 34: YY_RULE_SETUP -#line 476 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 476 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONTINUE; } YY_BREAK case 35: YY_RULE_SETUP -#line 477 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 477 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WHILE; } YY_BREAK case 36: YY_RULE_SETUP -#line 478 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 478 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SET; } YY_BREAK case 37: YY_RULE_SETUP -#line 479 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 479 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VALIDATE; } YY_BREAK case 38: YY_RULE_SETUP -#line 480 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 480 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TYPE; } YY_BREAK case 39: YY_RULE_SETUP -#line 481 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 481 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SWITCH; } YY_BREAK case 40: YY_RULE_SETUP -#line 482 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 482 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TYPESWITCH; } YY_BREAK case 41: YY_RULE_SETUP -#line 483 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 483 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOCUMENT; } YY_BREAK case 42: YY_RULE_SETUP -#line 484 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 484 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TEXT; } YY_BREAK case 43: YY_RULE_SETUP -#line 485 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 485 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COMMENT; } YY_BREAK case 44: YY_RULE_SETUP -#line 486 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 486 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FUNCTION; } YY_BREAK case 45: YY_RULE_SETUP -#line 487 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 487 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SIMPLE; } YY_BREAK case 46: YY_RULE_SETUP -#line 488 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 488 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::UPDATING; } YY_BREAK case 47: YY_RULE_SETUP -#line 489 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 489 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SEQUENTIAL; } YY_BREAK case 48: YY_RULE_SETUP -#line 490 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 490 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ORDERED;} YY_BREAK case 49: YY_RULE_SETUP -#line 491 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 491 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::UNORDERED; } YY_BREAK case 50: YY_RULE_SETUP -#line 492 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 492 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SCHEMA_ELEMENT; } YY_BREAK case 51: YY_RULE_SETUP -#line 493 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 493 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SCHEMA_ATTRIBUTE; } YY_BREAK case 52: YY_RULE_SETUP -#line 494 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 494 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NODE; } YY_BREAK case 53: YY_RULE_SETUP -#line 495 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 495 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOCUMENT_NODE; } YY_BREAK case 54: YY_RULE_SETUP -#line 496 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 496 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONSTRUCTION; } YY_BREAK case 55: YY_RULE_SETUP -#line 497 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 497 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DEFAULT; } YY_BREAK case 56: YY_RULE_SETUP -#line 498 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 498 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ORDER; } YY_BREAK case 57: YY_RULE_SETUP -#line 499 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 499 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COLLATION; } YY_BREAK case 58: YY_RULE_SETUP -#line 500 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 500 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NAMESPACE; } YY_BREAK case 59: YY_RULE_SETUP -#line 501 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 501 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::BASE_URI; } YY_BREAK case 60: YY_RULE_SETUP -#line 502 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 502 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::IMPORT; } YY_BREAK case 61: YY_RULE_SETUP -#line 503 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 503 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SCHEMA; } YY_BREAK case 62: YY_RULE_SETUP -#line 504 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 504 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COPY_NAMESPACES; } YY_BREAK case 63: YY_RULE_SETUP -#line 505 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 505 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FOR; } YY_BREAK case 64: YY_RULE_SETUP -#line 506 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 506 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LET; } YY_BREAK case 65: YY_RULE_SETUP -#line 507 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 507 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ALLOWING; } YY_BREAK case 66: YY_RULE_SETUP -#line 508 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 508 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SLIDING; } YY_BREAK case 67: YY_RULE_SETUP -#line 509 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 509 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TUMBLING; } YY_BREAK case 68: YY_RULE_SETUP -#line 510 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 510 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PREVIOUS; } YY_BREAK case 69: YY_RULE_SETUP -#line 511 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 511 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NEXT; } YY_BREAK case 70: YY_RULE_SETUP -#line 512 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 512 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ONLY; } YY_BREAK case 71: YY_RULE_SETUP -#line 513 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 513 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WHEN; } YY_BREAK case 72: YY_RULE_SETUP -#line 514 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 514 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COUNT; } YY_BREAK case 73: YY_RULE_SETUP -#line 515 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 515 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::USING; } YY_BREAK case 74: YY_RULE_SETUP -#line 516 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 516 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SOME; } YY_BREAK case 75: YY_RULE_SETUP -#line 517 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 517 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EVERY; } YY_BREAK case 76: YY_RULE_SETUP -#line 518 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 518 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONTEXT; } YY_BREAK case 77: YY_RULE_SETUP -#line 519 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 519 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VARIABLE; } YY_BREAK case 78: YY_RULE_SETUP -#line 520 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 520 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::BOUNDARY_SPACE; } YY_BREAK case 79: YY_RULE_SETUP -#line 521 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 521 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ORDERING; } YY_BREAK case 80: YY_RULE_SETUP -#line 522 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 522 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::XQUERY; } YY_BREAK case 81: YY_RULE_SETUP -#line 523 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 523 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VERSION; } YY_BREAK case 82: YY_RULE_SETUP -#line 524 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 524 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::OPTION; } YY_BREAK case 83: YY_RULE_SETUP -#line 525 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 525 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::AT; } YY_BREAK case 84: YY_RULE_SETUP -#line 526 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 526 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::REVALIDATION; } YY_BREAK case 85: YY_RULE_SETUP -#line 527 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 527 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::AS; } YY_BREAK case 86: YY_RULE_SETUP -#line 528 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 528 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TRY; } YY_BREAK /* Axes */ case 87: YY_RULE_SETUP -#line 531 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 531 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ANCESTOR_OR_SELF; } YY_BREAK case 88: YY_RULE_SETUP -#line 532 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 532 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ANCESTOR; } YY_BREAK case 89: YY_RULE_SETUP -#line 533 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 533 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CHILD; } YY_BREAK case 90: YY_RULE_SETUP -#line 534 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 534 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DESCENDANT_OR_SELF; } YY_BREAK case 91: YY_RULE_SETUP -#line 535 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 535 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DESCENDANT; } YY_BREAK case 92: YY_RULE_SETUP -#line 536 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 536 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FOLLOWING_SIBLING; } YY_BREAK case 93: YY_RULE_SETUP -#line 537 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 537 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FOLLOWING; } YY_BREAK case 94: YY_RULE_SETUP -#line 538 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 538 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PARENT; } YY_BREAK case 95: YY_RULE_SETUP -#line 539 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 539 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PRECEDING_SIBLING; } YY_BREAK case 96: YY_RULE_SETUP -#line 540 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 540 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PRECEDING; } YY_BREAK case 97: YY_RULE_SETUP -#line 541 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 541 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SELF;} YY_BREAK /* Decimal format */ case 98: YY_RULE_SETUP -#line 544 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 544 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DECIMAL_FORMAT; } YY_BREAK case 99: YY_RULE_SETUP -#line 545 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 545 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DECIMAL_SEPARATOR; } YY_BREAK case 100: YY_RULE_SETUP -#line 546 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 546 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::GROUPING_SEPARATOR; } YY_BREAK case 101: YY_RULE_SETUP -#line 547 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 547 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INFINITY_VALUE; } YY_BREAK case 102: YY_RULE_SETUP -#line 548 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 548 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MINUS_SIGN; } YY_BREAK case 103: YY_RULE_SETUP -#line 549 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 549 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NaN; } YY_BREAK case 104: YY_RULE_SETUP -#line 550 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 550 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PERCENT; } YY_BREAK case 105: YY_RULE_SETUP -#line 551 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 551 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PER_MILLE; } YY_BREAK case 106: YY_RULE_SETUP -#line 552 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 552 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ZERO_DIGIT; } YY_BREAK case 107: YY_RULE_SETUP -#line 553 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 553 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DIGIT; } YY_BREAK case 108: YY_RULE_SETUP -#line 554 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 554 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PATTERN_SEPARATOR; } YY_BREAK /*______________________________________________________________________ @@ -4431,117 +4431,117 @@ |______________________________________________________________________*/ case 109: YY_RULE_SETUP -#line 561 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 561 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COLLECTION; } YY_BREAK case 110: YY_RULE_SETUP -#line 562 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 562 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONSTOPT; } YY_BREAK case 111: YY_RULE_SETUP -#line 563 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 563 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::APPEND_ONLY; } YY_BREAK case 112: YY_RULE_SETUP -#line 564 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 564 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::QUEUE; } YY_BREAK case 113: YY_RULE_SETUP -#line 565 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 565 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MUTABLE; } YY_BREAK case 114: YY_RULE_SETUP -#line 566 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 566 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::READ_ONLY; } YY_BREAK case 115: YY_RULE_SETUP -#line 568 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 568 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INDEX; } YY_BREAK case 116: YY_RULE_SETUP -#line 569 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 569 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::UNIQUE; } YY_BREAK case 117: YY_RULE_SETUP -#line 570 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 570 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NON; } YY_BREAK case 118: YY_RULE_SETUP -#line 571 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 571 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MANUALLY; } YY_BREAK case 119: YY_RULE_SETUP -#line 572 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 572 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::AUTOMATICALLY; } YY_BREAK case 120: YY_RULE_SETUP -#line 573 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 573 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MAINTAINED; } YY_BREAK case 121: YY_RULE_SETUP -#line 574 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 574 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::RANGE; } YY_BREAK case 122: YY_RULE_SETUP -#line 575 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 575 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EQUALITY; } YY_BREAK case 123: YY_RULE_SETUP -#line 576 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 576 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ON; } YY_BREAK case 124: YY_RULE_SETUP -#line 577 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 577 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::GENERAL; } YY_BREAK case 125: YY_RULE_SETUP -#line 579 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 579 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INTEGRITY; } YY_BREAK case 126: YY_RULE_SETUP -#line 580 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 580 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONSTRAINT; } YY_BREAK case 127: YY_RULE_SETUP -#line 581 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 581 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CHECK; } YY_BREAK case 128: YY_RULE_SETUP -#line 582 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 582 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::KEY; } YY_BREAK case 129: YY_RULE_SETUP -#line 583 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 583 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FOREACH; } YY_BREAK case 130: YY_RULE_SETUP -#line 584 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 584 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FOREIGN; } YY_BREAK case 131: YY_RULE_SETUP -#line 585 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 585 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::KEYS; } YY_BREAK /*______________________________________________________________________ @@ -4552,22 +4552,22 @@ of the "{[ ]}" grammar construct */ case 132: YY_RULE_SETUP -#line 595 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 595 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(INITIAL); return token::LBRACK; } YY_BREAK case 133: YY_RULE_SETUP -#line 596 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 596 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); return token::RBRACK; } YY_BREAK case 134: YY_RULE_SETUP -#line 598 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 598 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(INITIAL_ACCUMULATOR); return token::L_ACCUMULATOR_OBJ_UNION; } YY_BREAK case 135: YY_RULE_SETUP -#line 599 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 599 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { // This if() disambiguates between the "{[ ]}" grammar construct and the // plain "[ ]" predicate @@ -4586,47 +4586,47 @@ YY_BREAK case 136: YY_RULE_SETUP -#line 615 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 615 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::L_SIMPLE_OBJ_UNION; } YY_BREAK case 137: YY_RULE_SETUP -#line 616 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 616 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::R_SIMPLE_OBJ_UNION; } YY_BREAK case 138: YY_RULE_SETUP -#line 617 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 617 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::JSON; } YY_BREAK case 139: YY_RULE_SETUP -#line 618 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 618 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::APPEND; } YY_BREAK case 140: YY_RULE_SETUP -#line 619 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 619 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::POSITION; } YY_BREAK case 141: YY_RULE_SETUP -#line 620 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 620 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::JSON_ITEM; } YY_BREAK case 142: YY_RULE_SETUP -#line 621 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 621 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::STRUCTURED_ITEM; } YY_BREAK case 143: YY_RULE_SETUP -#line 622 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 622 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ARRAY; } YY_BREAK case 144: YY_RULE_SETUP -#line 623 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 623 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::OBJECT; } YY_BREAK /*______________________________________________________________________ @@ -4635,397 +4635,397 @@ |______________________________________________________________________*/ case 145: YY_RULE_SETUP -#line 631 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 631 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONTAINS; } YY_BREAK case 146: YY_RULE_SETUP -#line 632 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 632 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FTAND; } YY_BREAK case 147: YY_RULE_SETUP -#line 633 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 633 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FTOR; } YY_BREAK case 148: YY_RULE_SETUP -#line 634 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 634 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FTNOT; } YY_BREAK case 149: YY_RULE_SETUP -#line 635 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 635 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NOT; } YY_BREAK case 150: YY_RULE_SETUP -#line 636 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 636 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::_IN; } YY_BREAK case 151: YY_RULE_SETUP -#line 637 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 637 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ALL; } YY_BREAK case 152: YY_RULE_SETUP -#line 638 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 638 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WORDS; } YY_BREAK case 153: YY_RULE_SETUP -#line 639 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 639 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ANY; } YY_BREAK case 154: YY_RULE_SETUP -#line 640 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 640 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WORD; } YY_BREAK case 155: YY_RULE_SETUP -#line 641 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 641 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::END; } YY_BREAK case 156: YY_RULE_SETUP -#line 642 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 642 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LEAST; } YY_BREAK case 157: YY_RULE_SETUP -#line 643 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 643 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MOST; } YY_BREAK case 158: YY_RULE_SETUP -#line 644 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 644 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::START; } YY_BREAK case 159: YY_RULE_SETUP -#line 645 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 645 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CASE; } YY_BREAK case 160: YY_RULE_SETUP -#line 646 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 646 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INSENSITIVE; } YY_BREAK case 161: YY_RULE_SETUP -#line 647 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 647 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SENSITIVE; } YY_BREAK case 162: YY_RULE_SETUP -#line 648 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 648 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FT_OPTION; } YY_BREAK case 163: YY_RULE_SETUP -#line 649 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 649 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DIACRITICS; } YY_BREAK case 164: YY_RULE_SETUP -#line 650 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 650 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DIFFERENT; } YY_BREAK case 165: YY_RULE_SETUP -#line 651 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 651 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DISTANCE; } YY_BREAK case 166: YY_RULE_SETUP -#line 652 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 652 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ENTIRE; } YY_BREAK case 167: YY_RULE_SETUP -#line 653 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 653 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CONTENT; } YY_BREAK case 168: YY_RULE_SETUP -#line 654 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 654 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EXACTLY; } YY_BREAK case 169: YY_RULE_SETUP -#line 655 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 655 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FROM; } YY_BREAK case 170: YY_RULE_SETUP -#line 656 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 656 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LANGUAGE; } YY_BREAK case 171: YY_RULE_SETUP -#line 657 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 657 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LEVELS; } YY_BREAK case 172: YY_RULE_SETUP -#line 658 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 658 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LOWERCASE; } YY_BREAK case 173: YY_RULE_SETUP -#line 659 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 659 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NO; } YY_BREAK case 174: YY_RULE_SETUP -#line 660 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 660 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::OCCURS; } YY_BREAK case 175: YY_RULE_SETUP -#line 661 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 661 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PARAGRAPH; } YY_BREAK case 176: YY_RULE_SETUP -#line 662 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 662 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PARAGRAPHS; } YY_BREAK case 177: YY_RULE_SETUP -#line 663 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 663 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PHRASE; } YY_BREAK case 178: YY_RULE_SETUP -#line 664 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 664 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::RELATIONSHIP; } YY_BREAK case 179: YY_RULE_SETUP -#line 665 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 665 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SAME; } YY_BREAK case 180: YY_RULE_SETUP -#line 666 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 666 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SCORE; } YY_BREAK case 181: YY_RULE_SETUP -#line 667 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 667 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SENTENCE; } YY_BREAK case 182: YY_RULE_SETUP -#line 668 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 668 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SENTENCES; } YY_BREAK case 183: YY_RULE_SETUP -#line 669 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 669 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TIMES; } YY_BREAK case 184: YY_RULE_SETUP -#line 670 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 670 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::UPPERCASE; } YY_BREAK case 185: YY_RULE_SETUP -#line 671 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 671 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WEIGHT; } YY_BREAK case 186: YY_RULE_SETUP -#line 672 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 672 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WINDOW; } YY_BREAK case 187: YY_RULE_SETUP -#line 673 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 673 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WITHOUT; } YY_BREAK case 188: YY_RULE_SETUP -#line 674 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 674 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::STEMMING; } YY_BREAK case 189: YY_RULE_SETUP -#line 675 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 675 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::STOP; } YY_BREAK case 190: YY_RULE_SETUP -#line 676 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 676 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::THESAURUS; } YY_BREAK case 191: YY_RULE_SETUP -#line 677 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 677 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WILDCARDS; } YY_BREAK case 192: YY_RULE_SETUP -#line 678 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 678 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::GETS; } YY_BREAK case 193: YY_RULE_SETUP -#line 679 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 679 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DIV; } YY_BREAK case 194: YY_RULE_SETUP -#line 680 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 680 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EQUALS; } YY_BREAK case 195: YY_RULE_SETUP -#line 681 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 681 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EXCEPT; } YY_BREAK case 196: YY_RULE_SETUP -#line 682 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 682 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VAL_EQ; } YY_BREAK case 197: YY_RULE_SETUP -#line 683 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 683 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VAL_GE; } YY_BREAK case 198: YY_RULE_SETUP -#line 684 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 684 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VAL_GT; } YY_BREAK case 199: YY_RULE_SETUP -#line 685 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 685 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VAL_LE; } YY_BREAK case 200: YY_RULE_SETUP -#line 686 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 686 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VAL_LT; } YY_BREAK case 201: YY_RULE_SETUP -#line 687 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 687 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VAL_NE; } YY_BREAK case 202: YY_RULE_SETUP -#line 688 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 688 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::GE; } YY_BREAK case 203: YY_RULE_SETUP -#line 689 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 689 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FOLLOWS; } YY_BREAK case 204: YY_RULE_SETUP -#line 690 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 690 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::GT; } YY_BREAK case 205: YY_RULE_SETUP -#line 691 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 691 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::IDIV; } YY_BREAK case 206: YY_RULE_SETUP -#line 692 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 692 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INTERSECT; } YY_BREAK case 207: YY_RULE_SETUP -#line 693 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 693 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::IS; } YY_BREAK case 208: YY_RULE_SETUP -#line 694 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 694 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LE; } YY_BREAK case 209: YY_RULE_SETUP -#line 695 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 695 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PRECEDES; } YY_BREAK case 210: YY_RULE_SETUP -#line 696 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 696 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MOD; } YY_BREAK case 211: YY_RULE_SETUP -#line 697 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 697 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NE; } YY_BREAK case 212: YY_RULE_SETUP -#line 698 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 698 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::GROUP; } YY_BREAK case 213: YY_RULE_SETUP -#line 699 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 699 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::BY; } YY_BREAK case 214: YY_RULE_SETUP -#line 700 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 700 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::STABLE; } YY_BREAK case 215: YY_RULE_SETUP -#line 701 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 701 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::OR; } YY_BREAK case 216: YY_RULE_SETUP -#line 702 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 702 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::RETURN; } YY_BREAK case 217: YY_RULE_SETUP -#line 703 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 703 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SATISFIES; } YY_BREAK case 218: YY_RULE_SETUP -#line 704 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 704 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TO; } YY_BREAK case 219: YY_RULE_SETUP -#line 705 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 705 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::UNION; } YY_BREAK case 220: YY_RULE_SETUP -#line 706 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 706 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VBAR; } YY_BREAK case 221: YY_RULE_SETUP -#line 707 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 707 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::WHERE; } YY_BREAK case 222: YY_RULE_SETUP -#line 708 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 708 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::PRESERVE; } YY_BREAK case 223: YY_RULE_SETUP -#line 709 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 709 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::STRIP; } YY_BREAK /*______________________________________________________________________ @@ -5034,182 +5034,182 @@ |______________________________________________________________________*/ case 224: YY_RULE_SETUP -#line 717 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 717 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INSERT; } YY_BREAK case 225: YY_RULE_SETUP -#line 718 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 718 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::_DELETE; } YY_BREAK case 226: YY_RULE_SETUP -#line 719 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 719 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::REPLACE; } YY_BREAK case 227: YY_RULE_SETUP -#line 720 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 720 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::VALUE; } YY_BREAK case 228: YY_RULE_SETUP -#line 721 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 721 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::OF; } YY_BREAK case 229: YY_RULE_SETUP -#line 722 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 722 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::RENAME; } YY_BREAK case 230: YY_RULE_SETUP -#line 723 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 723 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::COPY; } YY_BREAK case 231: YY_RULE_SETUP -#line 724 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 724 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NODES; } YY_BREAK case 232: YY_RULE_SETUP -#line 725 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 725 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INTO; } YY_BREAK case 233: YY_RULE_SETUP -#line 726 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 726 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::AFTER; } YY_BREAK case 234: YY_RULE_SETUP -#line 727 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 727 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::BEFORE; } YY_BREAK case 235: YY_RULE_SETUP -#line 728 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 728 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::MODIFY; } YY_BREAK case 236: YY_RULE_SETUP -#line 730 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 730 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::_STRICT; } YY_BREAK case 237: YY_RULE_SETUP -#line 731 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 731 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LAX; } YY_BREAK case 238: YY_RULE_SETUP -#line 732 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 732 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::SKIP; } YY_BREAK case 239: YY_RULE_SETUP -#line 733 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 733 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::THEN; } YY_BREAK case 240: YY_RULE_SETUP -#line 734 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 734 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ELSE; } YY_BREAK case 241: YY_RULE_SETUP -#line 735 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 735 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EXTERNAL; } YY_BREAK case 242: YY_RULE_SETUP -#line 736 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 736 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::AND; } YY_BREAK case 243: YY_RULE_SETUP -#line 738 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 738 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INHERIT; } YY_BREAK case 244: YY_RULE_SETUP -#line 739 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 739 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NO_INHERIT; } YY_BREAK case 245: YY_RULE_SETUP -#line 740 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 740 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::NO_PRESERVE; } YY_BREAK case 246: YY_RULE_SETUP -#line 741 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 741 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EMPTY_SEQUENCE; } YY_BREAK case 247: YY_RULE_SETUP -#line 742 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 742 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ITEM; } YY_BREAK case 248: YY_RULE_SETUP -#line 743 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 743 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CAST; } YY_BREAK case 249: YY_RULE_SETUP -#line 744 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 744 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CASTABLE; } YY_BREAK case 250: YY_RULE_SETUP -#line 745 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 745 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::INSTANCE;} YY_BREAK case 251: YY_RULE_SETUP -#line 746 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 746 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::TREAT; } YY_BREAK case 252: YY_RULE_SETUP -#line 747 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 747 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::FIRST; } YY_BREAK case 253: YY_RULE_SETUP -#line 748 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 748 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::LAST; } YY_BREAK case 254: YY_RULE_SETUP -#line 749 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 749 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::CATCH; } YY_BREAK case 255: YY_RULE_SETUP -#line 750 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 750 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::_EMPTY; } YY_BREAK case 256: YY_RULE_SETUP -#line 751 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 751 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::GREATEST; } YY_BREAK case 257: YY_RULE_SETUP -#line 752 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 752 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ASCENDING; } YY_BREAK case 258: YY_RULE_SETUP -#line 753 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 753 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DESCENDING; } YY_BREAK case 259: YY_RULE_SETUP -#line 754 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 754 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ENCODING; } YY_BREAK /*______________________________________________________________________ @@ -5218,7 +5218,7 @@ |______________________________________________________________________*/ case 260: YY_RULE_SETUP -#line 762 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 762 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->ival = getDriver()->symtab.integerval(yytext, yyleng); if (yylval->ival == NULL) @@ -5232,7 +5232,7 @@ YY_BREAK case 261: YY_RULE_SETUP -#line 773 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 773 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->decval = getDriver()->symtab.decimalval(yytext, yyleng); return token::DECIMAL_LITERAL; @@ -5240,7 +5240,7 @@ YY_BREAK case 262: YY_RULE_SETUP -#line 778 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 778 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->dval = getDriver()->symtab.doubleval(yytext, yyleng); if (yylval->dval == NULL) @@ -5255,7 +5255,7 @@ YY_BREAK case 263: YY_RULE_SETUP -#line 790 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 790 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { /* invalid integer literal */ yylval->err = getDriver()->parserErr(std::string("syntax error, unexpected \"") + yytext + "\", separator needed after numeric literal", *yylloc); @@ -5264,59 +5264,59 @@ YY_BREAK case 264: YY_RULE_SETUP -#line 796 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 796 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(ELEM_WILDCARD, put_ncname(yytext, yyleng-2), yytext); } YY_BREAK case 265: /* rule 265 can match eol */ YY_RULE_SETUP -#line 798 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 798 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(ELEM_EQNAME_WILDCARD, put_ncname(yytext+2, yyleng-4), yytext+2); } YY_BREAK case 266: YY_RULE_SETUP -#line 800 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 800 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(QNAME_SVAL, put_qname(yytext, yyleng), yytext); } YY_BREAK case 267: /* rule 267 can match eol */ YY_RULE_SETUP -#line 802 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 802 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(EQNAME_SVAL, put_qname(yytext, yyleng, false, false, true), yytext); } YY_BREAK case 268: YY_RULE_SETUP -#line 804 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 804 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(ANNOTATION_QNAME_SVAL, put_qname(yytext+1, yyleng-1), yytext+1); /* skip the % sign */ } YY_BREAK case 269: /* rule 269 can match eol */ YY_RULE_SETUP -#line 806 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 806 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(ANNOTATION_EQNAME_SVAL, put_qname(yytext+1, yyleng-1, false, false, true), yytext+1); /* skip the % sign */ } YY_BREAK case 270: YY_RULE_SETUP -#line 808 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 808 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN (PREFIX_WILDCARD, put_ncname(yytext+2, yyleng-2), yytext); } YY_BREAK case 271: /* rule 271 can match eol */ YY_RULE_SETUP -#line 810 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 810 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { if (checkXmlRefs(&yylval->err, yytext, yyleng, this, yylloc)) return token::UNRECOGNIZED; TRY_STRING_LITERAL(STRING_LITERAL, yytext, yyleng); } YY_BREAK /* Invalid string literals */ case 272: /* rule 272 can match eol */ YY_RULE_SETUP -#line 813 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 813 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->invalidCharRef(yytext, *yylloc); return token::UNRECOGNIZED; } YY_BREAK case 273: /* rule 273 can match eol */ YY_RULE_SETUP -#line 814 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 814 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->parserErr(std::string("syntax error, unterminated string literal \"") + yytext + "\"", *yylloc); return token::UNRECOGNIZED; } YY_BREAK /*______________________________________________________________________ @@ -5327,69 +5327,69 @@ /* ------------------------------ */ case 274: YY_RULE_SETUP -#line 823 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 823 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_XML_COMMENT); return token::XML_COMMENT_BEGIN; } YY_BREAK /* transition to PROCESSING_INSTRUCTION */ /* ------------------------------------ */ case 275: YY_RULE_SETUP -#line 828 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 828 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_PROCESSING_INSTRUCTION);return token::PI_BEGIN; } YY_BREAK /* transition to CDATA_SECTION */ /* --------------------------- */ case 276: YY_RULE_SETUP -#line 833 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 833 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { /* PUSH_AND_BEGIN (MODE_CDATA_SECTION, MODE_OPERATOR); */ return token::CDATA_BEGIN; } YY_BREAK /* transition to MODE_START_TAG */ /* ---------------------------- */ case 277: YY_RULE_SETUP -#line 838 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 838 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_START_TAG); return token::LT_OR_START_TAG; } YY_BREAK /* transition to MODE_EXPR_DOC_COMMENT */ /* ----------------------------------- */ case 278: YY_RULE_SETUP -#line 843 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 843 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_EXPR_DOC_COMMENT); } YY_BREAK /* transition to MODE_EXPR_COMMENT */ /* ------------------------------- */ case 279: YY_RULE_SETUP -#line 848 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 848 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_EXPR_COMMENT); } YY_BREAK /* transition to PRAGMA */ /* -------------------- */ case 280: YY_RULE_SETUP -#line 853 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 853 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_PRAGMA; return token::PRAGMA_BEGIN;} YY_BREAK /* push initial state */ /* ------------------ */ case 281: YY_RULE_SETUP -#line 858 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 858 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(INITIAL); return token::LBRACE; } YY_BREAK /* pop previous state */ /* ------------------ */ case 282: YY_RULE_SETUP -#line 863 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 863 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); return token::RBRACE; } YY_BREAK case 283: /* rule 283 can match eol */ YY_RULE_SETUP -#line 866 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 866 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { /* eat up whitespace */ } @@ -5403,7 +5403,7 @@ |______________________________________________________________________*/ case 284: YY_RULE_SETUP -#line 880 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 880 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { if (yy_comp_constr_qname == "") yy_comp_constr_qname = yytext; @@ -5413,7 +5413,7 @@ YY_BREAK case 285: YY_RULE_SETUP -#line 886 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 886 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { if (yy_comp_constr_qname == "") yy_comp_constr_qname = yytext; @@ -5423,7 +5423,7 @@ YY_BREAK case 286: YY_RULE_SETUP -#line 892 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 892 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { if ( yy_comp_constr_qname == "") COMP_CONSTR_ROLLBACK(true); @@ -5444,24 +5444,24 @@ YY_BREAK case 287: YY_RULE_SETUP -#line 909 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 909 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_EXPR_COMMENT); } YY_BREAK case 288: /* rule 288 can match eol */ YY_RULE_SETUP -#line 910 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 910 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { /* continue lexing */ } YY_BREAK case YY_STATE_EOF(MODE_ELEM_COMP_CONSTR): case YY_STATE_EOF(MODE_ATTR_COMP_CONSTR): case YY_STATE_EOF(MODE_PI_COMP_CONSTR): -#line 911 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 911 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { COMP_CONSTR_ROLLBACK(false); } YY_BREAK case 289: YY_RULE_SETUP -#line 912 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 912 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { COMP_CONSTR_ROLLBACK(true); } YY_BREAK /*______________________________________________________________________ @@ -5475,30 +5475,30 @@ case 290: /* rule 290 can match eol */ YY_RULE_SETUP -#line 924 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 924 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_PRAGMACONTENTS; TRY_SVAL_TOKEN(QNAME_SVAL, put_qname(yytext, yyleng, true, true), yytext); } YY_BREAK case 291: /* rule 291 can match eol */ YY_RULE_SETUP -#line 925 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 925 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_PRAGMACONTENTS; TRY_SVAL_TOKEN(EQNAME_SVAL, put_qname(yytext, yyleng, true, true), yytext); } YY_BREAK case 292: YY_RULE_SETUP -#line 926 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 926 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN INITIAL; TRY_SVAL_TOKEN(QNAME_SVAL_AND_END_PRAGMA, put_qname(yytext, yyleng-2), yytext); } YY_BREAK case 293: /* rule 293 can match eol */ YY_RULE_SETUP -#line 927 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 927 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN INITIAL; TRY_SVAL_TOKEN(EQNAME_SVAL_AND_END_PRAGMA, put_qname(yytext, yyleng-2), yytext); } YY_BREAK case 294: /* rule 294 can match eol */ YY_RULE_SETUP -#line 928 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 928 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { /* continue lexing */ } YY_BREAK /*______________________________________________________________________ @@ -5511,7 +5511,7 @@ case 295: /* rule 295 can match eol */ YY_RULE_SETUP -#line 939 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 939 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN INITIAL; TRY_SVAL_TOKEN(PRAGMA_LITERAL_AND_END_PRAGMA, put(yytext, yyleng-2), yytext); } YY_BREAK /*______________________________________________________________________ @@ -5526,47 +5526,47 @@ |______________________________________________________________________*/ case 296: YY_RULE_SETUP -#line 953 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 953 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_ELEMENT_CONTENT; return token::TAG_END; } YY_BREAK case 297: YY_RULE_SETUP -#line 954 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 954 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_QUOTE_ATTRIBUTE_CONTENT; return token::QUOTE; } YY_BREAK case 298: YY_RULE_SETUP -#line 955 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 955 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_APOS_ATTRIBUTE_CONTENT; return token::APOS; } YY_BREAK case 299: YY_RULE_SETUP -#line 956 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 956 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::EQUALS; } YY_BREAK case 300: /* rule 300 can match eol */ YY_RULE_SETUP -#line 957 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 957 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::BLANK; } YY_BREAK case 301: YY_RULE_SETUP -#line 958 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 958 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); return token::EMPTY_TAG_END; } YY_BREAK case 302: YY_RULE_SETUP -#line 959 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 959 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN (QNAME_SVAL, put_qname(yytext, yyleng), yytext); } YY_BREAK case 303: YY_RULE_SETUP -#line 960 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 960 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->unrecognizedCharErr(yytext, *yylloc); return token::UNRECOGNIZED; } YY_BREAK case YY_STATE_EOF(MODE_START_TAG): -#line 961 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 961 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->unterminatedElementConstructor(*yylloc); return token::UNRECOGNIZED; } YY_BREAK /*______________________________________________________________________ @@ -5584,62 +5584,62 @@ |______________________________________________________________________*/ case 304: YY_RULE_SETUP -#line 978 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 978 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_END_TAG; return token::START_TAG_END; } YY_BREAK case 305: YY_RULE_SETUP -#line 979 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 979 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(INITIAL); return token::LBRACE; } YY_BREAK case 306: YY_RULE_SETUP -#line 980 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 980 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_XML_COMMENT); return token::XML_COMMENT_BEGIN; } YY_BREAK case 307: YY_RULE_SETUP -#line 981 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 981 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_PROCESSING_INSTRUCTION); return token::PI_BEGIN; } YY_BREAK case 308: YY_RULE_SETUP -#line 982 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 982 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_CDATA_SECTION); return token::CDATA_BEGIN; } YY_BREAK case 309: YY_RULE_SETUP -#line 983 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 983 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_START_TAG); return token::LT_OR_START_TAG; } YY_BREAK case 310: /* rule 310 can match eol */ YY_RULE_SETUP -#line 984 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 984 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(ELEMENT_CONTENT, put(yytext, yyleng, 1), yytext); } YY_BREAK case 311: YY_RULE_SETUP -#line 985 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 985 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(ELEMENT_CONTENT, put_entityref(yytext, yyleng), yytext); } YY_BREAK case 312: YY_RULE_SETUP -#line 986 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 986 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_CHARREF_LITERAL(CHAR_REF_LITERAL, put_charref, yytext, yyleng); } YY_BREAK case 313: YY_RULE_SETUP -#line 987 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 987 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOUBLE_LBRACE; } YY_BREAK case 314: YY_RULE_SETUP -#line 988 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 988 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOUBLE_RBRACE; } YY_BREAK case YY_STATE_EOF(MODE_ELEMENT_CONTENT): -#line 989 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 989 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->noClosingTagForElementConstructor(*yylloc); return token::UNRECOGNIZED; } YY_BREAK /*______________________________________________________________________ @@ -5651,17 +5651,17 @@ |______________________________________________________________________*/ case 315: YY_RULE_SETUP -#line 1000 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1000 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); return token::TAG_END; } YY_BREAK case 316: /* rule 316 can match eol */ YY_RULE_SETUP -#line 1001 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1001 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN (QNAME_SVAL, put_qname(yytext, yyleng, false, true), yytext); } YY_BREAK case YY_STATE_EOF(MODE_END_TAG): -#line 1002 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1002 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->noClosingTagForElementConstructor(*yylloc); return token::UNRECOGNIZED; } YY_BREAK /*______________________________________________________________________ @@ -5673,13 +5673,13 @@ |______________________________________________________________________*/ case 317: YY_RULE_SETUP -#line 1013 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1013 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); return token::XML_COMMENT_END; } YY_BREAK case 318: /* rule 318 can match eol */ YY_RULE_SETUP -#line 1014 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1014 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN (XML_COMMENT_LITERAL, put(yytext, yyleng, 1), yytext); } YY_BREAK /*______________________________________________________________________ @@ -5692,27 +5692,27 @@ |______________________________________________________________________*/ case 319: YY_RULE_SETUP -#line 1026 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1026 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); } YY_BREAK case 320: YY_RULE_SETUP -#line 1027 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1027 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(MODE_EXPR_COMMENT); } YY_BREAK case 321: /* rule 321 can match eol */ YY_RULE_SETUP -#line 1028 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1028 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { /* do nothing */ } YY_BREAK case 322: YY_RULE_SETUP -#line 1029 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1029 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { /* do nothing */ } YY_BREAK case YY_STATE_EOF(MODE_EXPR_COMMENT): -#line 1030 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1030 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->unterminatedCommentErr(*yylloc); return token::UNRECOGNIZED; } YY_BREAK /*______________________________________________________________________ @@ -5726,22 +5726,22 @@ case 323: /* rule 323 can match eol */ YY_RULE_SETUP -#line 1042 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1042 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { getDriver()->theDocComment << yytext; } YY_BREAK case 324: /* rule 324 can match eol */ YY_RULE_SETUP -#line 1043 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1043 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { getDriver()->theDocComment << yytext; } YY_BREAK case 325: YY_RULE_SETUP -#line 1044 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1044 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); } YY_BREAK case YY_STATE_EOF(MODE_EXPR_DOC_COMMENT): -#line 1045 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1045 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->unterminatedCommentErr(*yylloc); return token::UNRECOGNIZED; } YY_BREAK /*______________________________________________________________________ @@ -5754,17 +5754,17 @@ case 326: /* rule 326 can match eol */ YY_RULE_SETUP -#line 1056 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1056 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_PROCESSING_INSTRUCTION_CONTENT; /* continue lexing */ } YY_BREAK case 327: YY_RULE_SETUP -#line 1057 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1057 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); return token::PI_END; } YY_BREAK case 328: YY_RULE_SETUP -#line 1058 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1058 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" /* PITarget */ { TRY_SVAL_TOKEN (NCNAME_SVAL, put(yytext, yyleng), yytext); } YY_BREAK /*______________________________________________________________________ @@ -5777,7 +5777,7 @@ case 329: /* rule 329 can match eol */ YY_RULE_SETUP -#line 1069 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1069 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); TRY_SVAL_TOKEN (CHAR_LITERAL_AND_PI_END, put(yytext, yyleng-2), yytext); @@ -5793,7 +5793,7 @@ case 330: /* rule 330 can match eol */ YY_RULE_SETUP -#line 1083 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1083 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { POP_STATE(); TRY_SVAL_TOKEN (CHAR_LITERAL_AND_CDATA_END, put(yytext, yyleng-3, 1), yytext); } YY_BREAK /*______________________________________________________________________ @@ -5811,43 +5811,43 @@ |______________________________________________________________________*/ case 331: YY_RULE_SETUP -#line 1100 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1100 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_START_TAG; return token::QUOTE; } YY_BREAK case 332: YY_RULE_SETUP -#line 1101 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1101 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_STATE(INITIAL); return token::LBRACE; } YY_BREAK case 333: YY_RULE_SETUP -#line 1102 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1102 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ESCAPE_QUOTE; } YY_BREAK case 334: /* rule 334 can match eol */ YY_RULE_SETUP -#line 1103 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1103 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(QUOTE_ATTR_CONTENT, put(yytext, yyleng, 2), yytext); } YY_BREAK case 335: YY_RULE_SETUP -#line 1104 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1104 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(QUOTE_ATTR_CONTENT, put_entityref(yytext, yyleng), yytext); } YY_BREAK case 336: YY_RULE_SETUP -#line 1105 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1105 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_CHARREF_LITERAL(CHAR_REF_LITERAL, put_charref, yytext, yyleng); } YY_BREAK case 337: YY_RULE_SETUP -#line 1106 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1106 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOUBLE_LBRACE; } YY_BREAK case 338: YY_RULE_SETUP -#line 1107 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1107 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOUBLE_RBRACE; } YY_BREAK /*______________________________________________________________________ @@ -5860,43 +5860,43 @@ |______________________________________________________________________*/ case 339: YY_RULE_SETUP -#line 1119 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1119 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { BEGIN MODE_START_TAG; return token::APOS; } YY_BREAK case 340: YY_RULE_SETUP -#line 1120 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1120 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { PUSH_AND_BEGIN (INITIAL, MODE_APOS_ATTRIBUTE_CONTENT); return token::LBRACE; } YY_BREAK case 341: YY_RULE_SETUP -#line 1121 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1121 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::ESCAPE_APOS; } YY_BREAK case 342: /* rule 342 can match eol */ YY_RULE_SETUP -#line 1122 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1122 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(APOS_ATTR_CONTENT, put(yytext, yyleng, 2), yytext); } YY_BREAK case 343: YY_RULE_SETUP -#line 1123 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1123 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_SVAL_TOKEN(APOS_ATTR_CONTENT, put_entityref(yytext, yyleng), yytext); } YY_BREAK case 344: YY_RULE_SETUP -#line 1124 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1124 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { TRY_CHARREF_LITERAL(CHAR_REF_LITERAL, put_charref, yytext, yyleng); } YY_BREAK case 345: YY_RULE_SETUP -#line 1125 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1125 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOUBLE_LBRACE; } YY_BREAK case 346: YY_RULE_SETUP -#line 1126 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1126 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { return token::DOUBLE_RBRACE; } YY_BREAK /*______________________________________________________________________ @@ -5905,7 +5905,7 @@ |______________________________________________________________________*/ case 347: YY_RULE_SETUP -#line 1135 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1135 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" { yylval->err = getDriver()->unrecognizedCharErr(yytext, *yylloc); return token::UNRECOGNIZED; @@ -5914,7 +5914,7 @@ /* END OF FLEX RULES */ case 348: YY_RULE_SETUP -#line 1144 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1144 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" ECHO; YY_BREAK #line 5921 "xquery_scanner.yy.cpp" @@ -6977,7 +6977,7 @@ /* %ok-for-header */ -#line 1144 "/home/markos/zorba/repo/markos-scratch/src/compiler/parser/xquery_scanner.l" +#line 1144 "/home/colea/xquery_bzr/error-messages/src/compiler/parser/xquery_scanner.l" diff -Nru zorba-2.7.0-0/src/compiler/parsetree/parsenode_print_xml_visitor.cpp zorba-2.8.0-0/src/compiler/parsetree/parsenode_print_xml_visitor.cpp --- zorba-2.7.0-0/src/compiler/parsetree/parsenode_print_xml_visitor.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parsetree/parsenode_print_xml_visitor.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -694,6 +694,7 @@ BEGIN_END_TAG (AposAttrValueContent) BEGIN_END_TAG (ArgList) BEGIN_END_TAG (AtomicType) +BEGIN_END_TAG (SimpleType) BEGIN_END_TAG (AttributeTest) BEGIN_END_TAG (AxisStep) BEGIN_END_TAG (BaseURIDecl) diff -Nru zorba-2.7.0-0/src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp zorba-2.8.0-0/src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp --- zorba-2.7.0-0/src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -1339,6 +1339,7 @@ XQDOC_NO_BEGIN_END_TAG (ArgList) XQDOC_NO_BEGIN_END_TAG (AssignExpr) XQDOC_NO_BEGIN_END_TAG (AtomicType) +XQDOC_NO_BEGIN_END_TAG (SimpleType) XQDOC_NO_BEGIN_END_TAG (AttributeTest) XQDOC_NO_BEGIN_END_TAG (AxisStep) XQDOC_NO_BEGIN_END_TAG (BaseURIDecl) diff -Nru zorba-2.7.0-0/src/compiler/parsetree/parsenode_print_xquery_visitor.cpp zorba-2.8.0-0/src/compiler/parsetree/parsenode_print_xquery_visitor.cpp --- zorba-2.7.0-0/src/compiler/parsetree/parsenode_print_xquery_visitor.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parsetree/parsenode_print_xquery_visitor.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -130,9 +130,10 @@ } -DEFAULT_END_VISIT (ArgList) +DEFAULT_END_VISIT(ArgList) -DEFAULT_BEGIN_VISIT (AtomicType) + +DEFAULT_BEGIN_VISIT(AtomicType) void end_visit(const AtomicType& n, void* state) @@ -141,6 +142,15 @@ } +DEFAULT_BEGIN_VISIT(SimpleType) + + +void end_visit(const SimpleType& n, void* state) +{ + os << n.get_qname()->get_qname(); +} + + void* begin_visit(const AttributeTest& n) { os << "attribute("; diff -Nru zorba-2.7.0-0/src/compiler/parsetree/parsenode_visitor.h zorba-2.8.0-0/src/compiler/parsetree/parsenode_visitor.h --- zorba-2.7.0-0/src/compiler/parsetree/parsenode_visitor.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parsetree/parsenode_visitor.h 2013-01-16 18:28:18.000000000 +0000 @@ -53,6 +53,7 @@ DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AposAttrValueContent ); DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( ArgList ); DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AtomicType ); + DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( SimpleType ); DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( AttributeTest ); DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( BaseURIDecl ); DECL_PARSENODE_VISITOR_VISIT_MEM_FNS( BoundarySpaceDecl ); diff -Nru zorba-2.7.0-0/src/compiler/parsetree/parsenodes.cpp zorba-2.8.0-0/src/compiler/parsetree/parsenodes.cpp --- zorba-2.7.0-0/src/compiler/parsetree/parsenodes.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parsetree/parsenodes.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -17,6 +17,7 @@ #include "util/stl_util.h" #include "diagnostics/assert.h" +#include "diagnostics/util_macros.h" #include "diagnostics/xquery_diagnostics.h" #include "types/typemanager.h" @@ -3644,20 +3645,23 @@ dir_content_hv.rbegin(); const DirElemContent* lPrev = 0; - // To find out if a DirElemContent is boundary whitespace, the current item cannot be accepted till - // the next item (relative to the current item) is passed to check_boundary_whitespace. + // To find out if a DirElemContent is boundary whitespace, the current item + // cannot be accepted till the next item (relative to the current item) is + // passed to check_boundary_whitespace. v.begin_check_boundary_whitespace(); - for (; it!=dir_content_hv.rend(); ++it) + for (; it != dir_content_hv.rend(); ++it) { const DirElemContent* e_p = &**it; v.check_boundary_whitespace (*e_p); - if (lPrev != 0) { + if (lPrev != 0) + { ACCEPT_CHK(lPrev); } lPrev = e_p; } v.end_check_boundary_whitespace(); - if (lPrev != 0) { + if (lPrev != 0) + { ACCEPT_CHK(lPrev); } END_VISITOR(); @@ -3666,11 +3670,33 @@ // [97] DirAttributeList -DirAttributeList::DirAttributeList( - const QueryLoc& loc) -: +DirAttributeList::DirAttributeList(const QueryLoc& loc) + : parsenode(loc) -{} +{ +} + + +void DirAttributeList::push_back(rchandle attr) +{ + const QName* qname = attr->get_name(); + + if (qname->get_qname() == "xmlns" || qname->get_prefix() == "xmlns") + { + std::vector >::const_iterator ite = theAttributes.begin(); + std::vector >::const_iterator end = theAttributes.end(); + for (; ite != end; ++ite) + { + if (*((*ite)->get_name()) == *(qname)) + { + RAISE_ERROR(err::XQST0071, attr->get_location(), + ERROR_PARAMS(attr->get_name()->get_qname())); + } + } + } + + theAttributes.push_back(attr); +} void DirAttributeList::accept( parsenode_visitor &v ) const @@ -4183,20 +4209,38 @@ // [117] SingleType // ---------------- SingleType::SingleType( - const QueryLoc& loc_, - rchandle _atomic_type_h, - bool _hook_b) + const QueryLoc& loc, + rchandle type, + bool hook) : - parsenode(loc_), - atomic_type_h(_atomic_type_h), - hook_b(_hook_b) -{} + parsenode(loc), + theType(type), + theHook(hook) +{ +} + + +void SingleType::accept(parsenode_visitor& v) const +{ + BEGIN_VISITOR(); + ACCEPT(theType); + END_VISITOR(); +} -void SingleType::accept( parsenode_visitor &v ) const +// SimpleType +// ---------------- +SimpleType::SimpleType(const QueryLoc& loc, rchandle _qname_h) + : + parsenode(loc), + qname_h(_qname_h) +{ +} + + +void SimpleType::accept(parsenode_visitor& v) const { BEGIN_VISITOR(); - ACCEPT (atomic_type_h); END_VISITOR(); } @@ -4290,8 +4334,6 @@ {} -//-AtomicType:: - void AtomicType::accept( parsenode_visitor &v ) const { BEGIN_VISITOR(); @@ -4492,8 +4534,6 @@ {} -//-SchemaElementTest:: - void SchemaElementTest::accept( parsenode_visitor &v ) const { BEGIN_VISITOR(); @@ -4534,8 +4574,6 @@ {} -//-TypeName:: - void TypeName::accept( parsenode_visitor &v ) const { BEGIN_VISITOR(); @@ -5694,7 +5732,7 @@ void InlineFunction::accept(parsenode_visitor& v) const { BEGIN_VISITOR (); - ACCEPT (theReturnType); + //ACCEPT (theReturnType); //ACCEPT (theParamList); ACCEPT (theEnclosedExpr); END_VISITOR (); diff -Nru zorba-2.7.0-0/src/compiler/parsetree/parsenodes.h zorba-2.8.0-0/src/compiler/parsetree/parsenodes.h --- zorba-2.7.0-0/src/compiler/parsetree/parsenodes.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/parsetree/parsenodes.h 2013-01-16 18:28:18.000000000 +0000 @@ -54,6 +54,7 @@ class AposAttrValueContent; class ArgList; class AtomicType; +class SimpleType; class AttributeTest; class AxisStep; class BaseURIDecl; @@ -3324,16 +3325,17 @@ class CastableExpr : public exprnode { protected: - rchandle cast_expr_h; + rchandle cast_expr_h; rchandle singletype_h; public: CastableExpr( - const QueryLoc&, - rchandle, - rchandle); + const QueryLoc&, + rchandle, + rchandle); rchandle cast_expr() const { return cast_expr_h; } + rchandle singletype() const { return singletype_h; } virtual void accept(parsenode_visitor&) const; @@ -3346,16 +3348,17 @@ class CastExpr : public exprnode { protected: - rchandle unary_expr_h; + rchandle unary_expr_h; rchandle singletype_h; public: CastExpr( - const QueryLoc&, - rchandle, - rchandle); + const QueryLoc&, + rchandle, + rchandle); rchandle get_unary_expr() const { return unary_expr_h; } + rchandle get_singletype() const { return singletype_h; } virtual void accept(parsenode_visitor&) const; @@ -4355,13 +4358,13 @@ public: DirAttributeList(const QueryLoc&); - void push_back(rchandle attr) { theAttributes.push_back(attr); } + void push_back(rchandle attr); rchandle operator[](int i) { return theAttributes[i]; } - const DirAttr *operator[] (int i) const { return theAttributes[i]; } + const DirAttr* operator[](int i) const { return theAttributes[i]; } - ulong size () const { return (ulong)theAttributes.size (); } + csize size() const { return theAttributes.size(); } void accept(parsenode_visitor&) const; }; @@ -4385,6 +4388,7 @@ public: rchandle get_name() const { return theName; } + rchandle get_value() const { return theValue; } public: @@ -4871,7 +4875,7 @@ /******************************************************************************* - [143] SingleType ::= AtomicType "?"? + [143] SingleType ::= SimpleType "?"? [144] TypeDeclaration ::= "as" SequenceType @@ -4934,23 +4938,37 @@ /******************************************************************************* - [143] SingleType ::= AtomicType "?"? + [143] SingleType ::= SimpleType "?"? ********************************************************************************/ class SingleType : public parsenode { protected: - rchandle atomic_type_h; - bool hook_b; + rchandle theType; + bool theHook; public: - SingleType( - const QueryLoc&, - rchandle, - bool hook_b); + SingleType(const QueryLoc& loc, rchandle type, bool hook); + + rchandle get_type() const { return theType; } + + bool get_hook_bit() const { return theHook; } + + void accept(parsenode_visitor&) const; +}; - rchandle get_atomic_type() const { return atomic_type_h; } - bool get_hook_bit() const { return hook_b; } +/******************************************************************************* + SimpleType ::= QName +********************************************************************************/ +class SimpleType : public parsenode +{ +protected: + rchandle qname_h; + +public: + SimpleType(const QueryLoc&, rchandle); + + rchandle get_qname() const { return qname_h; } void accept(parsenode_visitor&) const; }; diff -Nru zorba-2.7.0-0/src/compiler/rewriter/framework/rewriter.h zorba-2.8.0-0/src/compiler/rewriter/framework/rewriter.h --- zorba-2.7.0-0/src/compiler/rewriter/framework/rewriter.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/framework/rewriter.h 2013-01-16 18:28:18.000000000 +0000 @@ -29,12 +29,10 @@ { public: Rewriter() {} + virtual ~Rewriter() { } virtual bool rewrite(RewriterContext& rCtx) = 0; - -protected: - CompilerCB::config::opt_level_t theOptLevel; }; } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/framework/rewriter_context.cpp zorba-2.8.0-0/src/compiler/rewriter/framework/rewriter_context.cpp --- zorba-2.7.0-0/src/compiler/rewriter/framework/rewriter_context.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/framework/rewriter_context.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -49,6 +49,8 @@ theIdVarMap(NULL), theExprVarsMap(NULL) { + theForSerializationOnly = theCCB->theConfig.for_serialization_only; + if (msg.empty()) { if (udf != NULL) @@ -70,7 +72,7 @@ } -expr* RewriterContext::getRoot() +expr* RewriterContext::getRoot() const { return theRoot; } @@ -92,7 +94,7 @@ std::string varname = ss.str(); store::Item_t qname; GENV_ITEMFACTORY->createQName(qname, "", "", varname.c_str()); - var_expr* var = theEM->create_var_expr(sctx, loc, kind, qname); + var_expr* var = theEM->create_var_expr(sctx, theUDF, loc, kind, qname); return var; } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/framework/rewriter_context.h zorba-2.8.0-0/src/compiler/rewriter/framework/rewriter_context.h --- zorba-2.7.0-0/src/compiler/rewriter/framework/rewriter_context.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/framework/rewriter_context.h 2013-01-16 18:28:18.000000000 +0000 @@ -85,6 +85,8 @@ int m_tempvarCounter; + bool theForSerializationOnly; + bool theIsInOrderedMode; VarIdMap * theVarIdMap; @@ -105,10 +107,12 @@ CompilerCB* getCompilerCB() const { return theCCB; } - expr* getRoot(); + expr* getRoot() const; void setRoot(expr* root); + void setForSerializationOnly(bool v) { theForSerializationOnly = v; } + var_expr* createTempVar( static_context* sctx, const QueryLoc& loc, @@ -116,25 +120,6 @@ }; -/******************************************************************************* - -********************************************************************************/ -struct UDFCallChain -{ - fo_expr * theFo; - UDFCallChain * thePrev; - - UDFCallChain() : theFo(NULL), thePrev(NULL) {} - - UDFCallChain(fo_expr* caller, UDFCallChain* prevCaller) - : - theFo(caller), - thePrev(prevCaller) - { - } -}; - - } #endif /* ZORBA_REWRITER_CONTEXT_H */ diff -Nru zorba-2.7.0-0/src/compiler/rewriter/framework/rule_driver.cpp zorba-2.8.0-0/src/compiler/rewriter/framework/rule_driver.cpp --- zorba-2.7.0-0/src/compiler/rewriter/framework/rule_driver.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/framework/rule_driver.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -20,6 +20,8 @@ #include "compiler/rewriter/rules/rule_base.h" #include "compiler/rewriter/framework/rewriter_context.h" +#include "functions/udf.h" + #include "system/properties.h" @@ -60,9 +62,14 @@ bool rule_modified = false; expr* newRoot = (*i)->apply(rCtx, &*rCtx.getRoot(), rule_modified); - if (newRoot != NULL) + if (newRoot != NULL && newRoot != rCtx.theRoot) { rCtx.setRoot(newRoot); + if (rCtx.theUDF != NULL) + { + rCtx.theUDF->setBody(newRoot); + rCtx.theUDF->invalidatePlan(); + } } if (rule_modified) @@ -70,6 +77,11 @@ modified = true; totalModified = true; + if (rCtx.theUDF != NULL) + { + rCtx.theUDF->invalidatePlan(); + } + if (Properties::instance()->printIntermediateOpt()) { std::cout << rCtx.theMessage << std::endl @@ -77,7 +89,8 @@ rCtx.getRoot()->put(std::cout) << std::endl; } - if ((*i)->getKind() != RewriteRule::MarkExprs) + if ((*i)->getKind() != RewriteRule::MarkExprs && + (*i)->getKind() != RewriteRule::FoldConst) break; } } @@ -99,10 +112,20 @@ if (newRoot != NULL) { rCtx.setRoot(newRoot); + if (rCtx.theUDF != NULL) + { + rCtx.theUDF->setBody(newRoot); + rCtx.theUDF->invalidatePlan(); + } } if (modified && Properties::instance()->printIntermediateOpt()) { + if (rCtx.theUDF != NULL) + { + rCtx.theUDF->invalidatePlan(); + } + std::cout << rCtx.theMessage << std::endl << "After " << theRule->getRuleName() << " :" << std::endl; rCtx.getRoot()->put(std::cout) << std::endl; diff -Nru zorba-2.7.0-0/src/compiler/rewriter/framework/rule_driver.h zorba-2.8.0-0/src/compiler/rewriter/framework/rule_driver.h --- zorba-2.7.0-0/src/compiler/rewriter/framework/rule_driver.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/framework/rule_driver.h 2013-01-16 18:28:18.000000000 +0000 @@ -84,7 +84,7 @@ ********************************************************************************/ class RuleOnceDriverBase : public Rewriter { -private: +protected: rule_ptr_t theRule; public: @@ -99,6 +99,8 @@ { public: RuleOnceDriver() : RuleOnceDriverBase(rule_ptr_t(new R)) {} + + R* getRule() const { return static_cast(theRule.getp()); } }; diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rewriters/default_optimizer.cpp zorba-2.8.0-0/src/compiler/rewriter/rewriters/default_optimizer.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rewriters/default_optimizer.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rewriters/default_optimizer.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -36,11 +36,9 @@ public: FoldRules() { - //ADD_RULE(MarkExpensiveOps); - // Most rules try to update the freevars annotations, but for now let's stay on the safe side ADD_RULE(MarkExprs); ADD_RULE(MarkFreeVars); - ADD_RULE(FoldConst(false)); + ADD_RULE(FoldConst); ADD_RULE(PartialEval); ADD_RULE(RefactorPredFLWOR); ADD_RULE(EliminateUnusedLetVars); @@ -65,7 +63,6 @@ SingletonRuleMajorDriver driverTypeRules; SingletonRuleMajorDriver driverPathSimplify; - //SingletonRuleMajorDriver driverExprSimplify; RuleOnceDriver driverEliminateVars; RuleOnceDriver driverMarkProducerNodeProps; RuleOnceDriver driverMarkConsumerNodeProps; @@ -88,6 +85,13 @@ if (driverPathSimplify.rewrite(rCtx)) modified = true; + if (rCtx.theUDF != NULL) + { + RuleOnceDriver driverMarkLocalExprs; + driverMarkLocalExprs.getRule()->setLocal(true); + driverMarkLocalExprs.rewrite(rCtx); + } + repeat1: // TypeRules diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/expr_minimize_rules.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/expr_minimize_rules.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/expr_minimize_rules.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/expr_minimize_rules.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,117 +0,0 @@ -/* - * Copyright 2006-2008 The FLWOR Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "stdafx.h" - -#include "system/globalenv.h" - -#include "context/static_context.h" - -#include "compiler/rewriter/rules/ruleset.h" -#include "compiler/expression/expr.h" -#include "compiler/expression/fo_expr.h" -#include "compiler/expression/flwor_expr.h" - -#include "functions/function.h" - -#include "types/typeops.h" - -namespace zorba -{ - -static expr_t get_constant_if_typequant_one(expr* e, bool& modified); - - - -/******************************************************************************* - This rule looks for exprs of the form: - - FN(E) or - FN(flwor_FE), - where FN is one of fn:count, fn:empty, or fn:exists, and flwor_FE is a flwor - expr whose return expr is FE. - - Then, it checks whether the return type of E/FE has quantifier ONE, and if so, - it replaces E/FE with the constant 1. - - In fact the check on FE is recursive: if FE does not have a return type with - quantifier ONE, but FE is a flwor expr with return expr FFE, then the rule is - applied to FFE and so on. -********************************************************************************/ - -RULE_REWRITE_PRE(ReplaceExprWithConstantOneWhenPossible) -{ - if (node->get_expr_kind() != fo_expr_kind) - return NULL; - - fo_expr* fo = static_cast(&*node); - const function* fn = fo->get_func(); - FunctionConsts::FunctionKind fkind = fn->getKind(); - - if (fkind == FunctionConsts::FN_COUNT_1 || - fkind == FunctionConsts::FN_EMPTY_1 || - fkind == FunctionConsts::FN_EXISTS_1) - { - bool modified = false; - expr_t child = fo->get_arg(0); - expr_t nc = get_constant_if_typequant_one(child, modified); - if (nc != NULL) - { - fo->set_arg(0, nc); - return node; - } - } - return NULL; -} - - -RULE_REWRITE_POST(ReplaceExprWithConstantOneWhenPossible) -{ - return NULL; -} - - -static expr_t get_constant_if_typequant_one(expr* e, bool& modified) -{ - TypeManager* tm = e->get_type_manager(); - - if (e->get_expr_kind() != const_expr_kind) - { - if (!e->isNonDiscardable() && - TypeOps::type_cnt(tm, *(e->get_return_type())) == 1) - { - modified = true; - return rCtx.theEM->create_const_expr(e->get_sctx(), e->get_loc(), 1; - } - else if (e->get_expr_kind() == flwor_expr_kind) - { - flwor_expr* flwor = static_cast(e); - expr* ret = flwor->get_return_expr(); - expr_t newRet = get_constant_if_typequant_one(ret, modified); - if (newRet != NULL) - { - modified = true; - flwor->set_return_expr(newRet); - } - } - } - - return NULL; -} - - - -} -/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/flwor_rules.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/flwor_rules.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/flwor_rules.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/flwor_rules.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -23,6 +23,7 @@ #include "compiler/rewriter/tools/expr_tools.h" #include "compiler/expression/flwor_expr.h" +#include "compiler/expression/script_exprs.h" #include "compiler/expression/expr_iter.h" #include "compiler/expression/expr.h" @@ -34,23 +35,16 @@ #include "diagnostics/xquery_warning.h" #include "diagnostics/assert.h" +#include "system/properties.h" + #include #include namespace zorba { -static void -collect_flw_vars(const flwor_expr&, expr::FreeVars&); - static bool is_trivial_expr(const expr*); -static bool -safe_to_fold_single_use(var_expr*, TypeConstants::quantifier_t, const flwor_expr&); - -static bool -var_in_try_or_loop(const var_expr*, const expr*, bool, bool, bool&); - static void rewrite_positional_pred( RewriterContext&, @@ -83,94 +77,74 @@ } -/***************************************************************************** +//////////////////////////////////////////////////////////////////////////////// +// // +// SubstVars // +// // +//////////////////////////////////////////////////////////////////////////////// + +/***************************************************************************** + Replace all references to theVarExpr inside the root expr of a given rCtx + with theSubstExpr ******************************************************************************/ -class SubstVars : public PrePostRewriteRule +class SubstVars : public RewriteRule { protected: - const var_expr * theVarExpr; + var_expr * theVarExpr; expr * theSubstExpr; - std::vector thePath; + //std::vector thePath; public: - SubstVars(const var_expr* var, expr* subst) + SubstVars(var_expr* var, expr* subst) : - PrePostRewriteRule(RewriteRule::SubstVars, "SubstVars"), + RewriteRule(RewriteRule::SubstVars, "SubstVars"), theVarExpr(var), theSubstExpr(subst) { } -protected: - expr* rewritePre(expr* node, RewriterContext& rCtx); - expr* rewritePost(expr* node, RewriterContext& rCtx); + expr* apply(RewriterContext& rCtx, expr* node, bool& modified); }; -RULE_REWRITE_PRE(SubstVars) +expr* SubstVars::apply(RewriterContext& rCtx, expr* node, bool& modified) { - thePath.push_back(node); + //thePath.push_back(node); + + ExprIterator iter(node); - if (node == theVarExpr) + while (!iter.done()) { - std::vector::iterator ite = thePath.begin(); - std::vector::iterator end = thePath.end(); - for (; ite != end; ++ite) + if (**iter == theVarExpr) + { +#if 0 + std::vector::iterator ite = thePath.begin(); + std::vector::iterator end = thePath.end(); + for (; ite != end; ++ite) + { + expr::FreeVars& vars = (*ite)->getFreeVars(); + vars.erase(theVarExpr); + vars.insert(theSubstExpr->getFreeVars().begin(), + theSubstExpr->getFreeVars().end()); + } +#endif + **iter = theSubstExpr; + modified = true; + } + else { - expr::FreeVars& vars = (*ite)->getFreeVars(); - vars.erase(theVarExpr); - vars.insert(theSubstExpr->getFreeVars().begin(), - theSubstExpr->getFreeVars().end()); + apply(rCtx, **iter, modified); } - return theSubstExpr; + iter.next(); } - else - { - return NULL; - } -} - -RULE_REWRITE_POST(SubstVars) -{ - thePath.pop_back(); + //thePath.pop_back(); return NULL; } -/****************************************************************************** - Replace all references to var "var" inside the expr "root" with expr "subst" -********************************************************************************/ -expr* subst_vars( - const RewriterContext& rCtx0, - expr* root, - const var_expr* var, - expr* subst) -{ - RewriterContext rCtx(rCtx0.getCompilerCB(), - root, - rCtx0.theUDF, - rCtx0.theMessage, - rCtx0.theIsInOrderedMode); - - SubstVars rule(var, subst); - - bool modified; - - rule.apply(rCtx, root, modified); - -#if 0 // debug substitutions - std::cout << rCtx.theMessage << std::endl - << "After subst " << var << " :" << std::endl; - rCtx.getRoot()->put(std::cout) << std::endl; -#endif - - return rCtx.getRoot(); -} - - //////////////////////////////////////////////////////////////////////////////// // // // EliminateUnusedLetVars // @@ -179,6 +153,24 @@ /******************************************************************************* + This is actually 4 rules bundled together: + + 1. trivial-FLWOR-elimination : + + "for $x in E return $x" --> "E" + "let $x := E return $x" --> "E" + + + 2. where-clause-to-if-then-else : + + "for $x in ... where E ... return ...", and E doesn't depend on FLWOR vars --> + "if E then flwor else ()", where flwor is the original flwor expr without the + where clause. + + + 3. LET-FOR-variable-folding-or-elimination : + + 4. non-grouping-variable-elimination : *******************************************************************************/ RULE_REWRITE_PRE(EliminateUnusedLetVars) @@ -189,98 +181,55 @@ const QueryLoc& loc = node->get_loc(); static_context* sctx = node->get_sctx(); + user_function* udf = node->get_udf(); + + assert(udf == rCtx.theUDF); - flwor_expr* flworp = static_cast(node); - flwor_expr& flwor = *flworp; + theFlwor = static_cast(node); - csize numClauses = flwor.num_clauses(); + csize numClauses = theFlwor->num_clauses(); // numClauses may be 0 in the case this flwor became a common sub-expression // due to var-inlining inside an if-then-else expr (see test // zorba/optim/flwor_vars_02.xq) if (numClauses == 0) { - return flwor.get_return_expr(); + return theFlwor->get_return_expr(); } - // "for $x in E return $x" --> "E" - // "let $x := E return $x" --> "E" - // Single windowing clauses are left alone + // 1. trivial-FLWOR-elimination if (numClauses == 1 && - flwor.get_clause(0)->get_kind() != flwor_clause::window_clause) + theFlwor->get_clause(0)->get_kind() != flwor_clause::window_clause) { - assert(flwor.get_clause(0)->get_kind() == flwor_clause::for_clause || - flwor.get_clause(0)->get_kind() == flwor_clause::let_clause); + assert(theFlwor->get_clause(0)->get_kind() == flwor_clause::for_clause || + theFlwor->get_clause(0)->get_kind() == flwor_clause::let_clause); const forletwin_clause* flwc = - static_cast(flwor.get_clause(0)); + static_cast(theFlwor->get_clause(0)); - if (flwor.get_return_expr()->get_var() == flwc->get_var()) + if (theFlwor->get_return_expr()->get_var() == flwc->get_var()) { return flwc->get_expr(); } } - // "for $x in ... where E ... return ...", and E doesn't depend on FLWOR vars - // --> "if E then flwor else ()", where flwor is the original flwor expr - // without the where clause. - if (!flwor.has_sequential_clauses()) - { - expr::FreeVars myVars; - expr* whereExpr = NULL; - - for (csize i = 0; i < numClauses; ++i) - { - flwor_clause* clause = flwor.get_clause(i); - - if (clause->get_kind() == flwor_clause::where_clause) - { - whereExpr = clause->get_expr(); - const expr::FreeVars& whereVars = whereExpr->getFreeVars(); - - if (myVars.empty()) - collect_flw_vars(flwor, myVars); - - expr::FreeVars diff; - std::set_intersection(myVars.begin(), - myVars.end(), - whereVars.begin(), - whereVars.end(), - std::inserter(diff, diff.begin())); - if (diff.empty()) - { - flwor.remove_where_clause(); - - if_expr* ifExpr = rCtx.theEM-> - create_if_expr(sctx, - loc, - whereExpr, - flworp, - rCtx.theEM->create_seq(sctx, loc)); - - fix_if_annotations(ifExpr); - - return ifExpr; - } - } - } - } - bool modified = false; // (a) Remove, if possible, FOR/LET vars that are not referenced anywhere // (b) Replace, if possible, FOR/LET vars that are referenced only once, with // their domain expr. - // (c) Change a LET var into a FOR var, if its domain expr consists of - // exactly one item. - // (d) Remove any unused non-group variables from GROUP BY clauses. + // (c) Remove any unused non-group variables from GROUP BY clauses. for (csize i = 0; i < numClauses; ++i) { - bool substitute = false; + int numRefs; + bool folded = false; + var_expr* var; - flwor_clause* c = flwor.get_clause(i); + flwor_clause* c = theFlwor->get_clause(i); - if (c->get_kind() == flwor_clause::group_clause) + switch (c->get_kind()) + { + case flwor_clause::group_clause: { group_clause* gc = static_cast(c); @@ -290,7 +239,7 @@ for(; ite != end; ++ite) { var_expr* var = ite->second; - int uses = expr_tools::count_variable_uses(&flwor, var, 2); + int uses = expr_tools::count_variable_uses(theFlwor, var, 1, NULL); if (uses == 0 && !ite->first->isNonDiscardable()) { @@ -299,174 +248,121 @@ end = gc->endNonGroupVars(); } } + + break; } - else if (c->get_kind() == flwor_clause::for_clause) + case flwor_clause::for_clause: { for_clause* fc = static_cast(c); - expr* domainExpr = fc->get_expr(); - xqtref_t domainType = domainExpr->get_return_type(); - var_expr* var = fc->get_var(); - TypeConstants::quantifier_t domainQuant = domainType->get_quantifier(); - ulong domainCount = domainType->max_card(); - const var_expr* pvar = fc->get_pos_var(); + bool outerFor = fc->is_allowing_empty(); + expr* domExpr = fc->get_expr(); + xqtref_t domType = domExpr->get_return_type(); + TypeConstants::quantifier_t domQuant = domType->get_quantifier(); + ulong domCount = domType->max_card(); + var_expr* pvar = fc->get_pos_var(); + var = fc->get_var(); if (pvar != NULL && - expr_tools::count_variable_uses(&flwor, pvar, 1) == 0) + expr_tools::count_variable_uses(theFlwor, pvar, 1, NULL) == 0) { fc->set_pos_var(NULL); pvar = NULL; } - // Cannot inline a FOR var whose domain is a sequential expr or - // might contain more than 1 items. - if (domainExpr->is_sequential() || domainCount > 1) + if (domExpr->is_sequential() || domCount > 1) continue; // FOR clause with 0 cardinality - if (domainCount == 0) + if (domCount == 0) { - if (! fc->is_allowing_empty()) + if (! outerFor) { - return rCtx.theEM->create_seq(sctx, LOC(node)); + return rCtx.theEM->create_seq(sctx, udf, LOC(node)); } else { if (pvar != NULL) { expr* constExpr = rCtx.theEM-> - create_const_expr(sctx, loc, xs_integer::zero()); + create_const_expr(sctx, udf, loc, xs_integer::zero()); - MODIFY(subst_vars(rCtx, node, pvar, constExpr)); + subst_vars(rCtx, pvar, constExpr, 2); fc->set_pos_var(NULL); } - expr* emptyExpr = rCtx.theEM->create_seq(sctx, LOC(node)); - MODIFY(subst_vars(rCtx, node, var, emptyExpr)); - substitute = true; + expr* emptyExpr = rCtx.theEM->create_seq(sctx, udf, LOC(node)); + subst_vars(rCtx, var, emptyExpr, 2); + + folded = true; } } - // FOR clause with cardinality 0 or 1 else { - if (pvar != NULL) + if (pvar != NULL && (domQuant == TypeConstants::QUANT_ONE || ! outerFor)) { - if (domainQuant == TypeConstants::QUANT_ONE || - ! fc->is_allowing_empty()) - { - expr* constExpr = rCtx.theEM-> - create_const_expr(sctx, loc, xs_integer::one()); + expr* constExpr = rCtx.theEM-> + create_const_expr(sctx, udf, loc, xs_integer::one()); - MODIFY(subst_vars(rCtx, node, pvar, constExpr)); - fc->set_pos_var(NULL); - } + subst_vars(rCtx, pvar, constExpr, 2); + fc->set_pos_var(NULL); + folded = true; } - int uses = expr_tools::count_variable_uses(&flwor, var, 2); - - if (uses > 1 && - is_trivial_expr(domainExpr) && - (domainQuant == TypeConstants::QUANT_ONE || - fc->is_allowing_empty())) - { - subst_vars(rCtx, node, var, domainExpr); - substitute = true; - } - else if (uses == 1 && - (domainQuant == TypeConstants::QUANT_ONE || i == numClauses -1) && - ((is_trivial_expr(domainExpr) && - domainQuant == TypeConstants::QUANT_ONE) || - safe_to_fold_single_use(var, domainQuant, flwor))) + if (safe_to_fold_var(i, numRefs)) { - subst_vars(rCtx, node, var, domainExpr); - substitute = true; - } - else if (uses == 0 && - !domainExpr->isNonDiscardable() && - (domainQuant == TypeConstants::QUANT_ONE || - fc->is_allowing_empty())) - { - substitute = true; + if (numRefs != 0) + subst_vars(rCtx, var, domExpr, numRefs); + + folded = true; } } - if (substitute) - { - MODIFY(flwor.remove_clause(i)); - --numClauses; - --i; - - flwor.compute_return_type(true, NULL); - } + break; } - else if (c->get_kind() == flwor_clause::let_clause) + case flwor_clause::let_clause: { let_clause* lc = static_cast(c); + expr* domExpr = lc->get_expr(); + var = lc->get_var(); - expr* domainExpr = lc->get_expr(); - xqtref_t domainType = domainExpr->get_return_type(); - TypeConstants::quantifier_t domainQuant = domainType->get_quantifier(); - var_expr* var = lc->get_var(); - - if (domainExpr->is_sequential()) - continue; - - int uses = expr_tools::count_variable_uses(&flwor, var, 2); - - if (uses > 1 && is_trivial_expr(domainExpr)) - { - subst_vars(rCtx, node, var, domainExpr); - substitute = true; - } - else if (uses == 1 && - (is_trivial_expr(domainExpr) || - safe_to_fold_single_use(var, TypeConstants::QUANT_ONE, flwor))) + if (safe_to_fold_var(i, numRefs)) { - subst_vars(rCtx, node, var, domainExpr); - substitute = true; - } - else if (uses == 0 && !domainExpr->isNonDiscardable()) - { - substitute = true; -#if 0 - rCtx.getCompilerCB()->theXQueryDiagnostics->add_warning( - NEW_XQUERY_WARNING(zwarn::ZWST0001_UNUSED_VARIABLE, - WARN_PARAMS(var->get_name()->getStringValue()), - WARN_LOC(var->get_loc()))); -#endif - } + if (numRefs != 0) + subst_vars(rCtx, var, domExpr, numRefs); - if (substitute) - { - MODIFY(flwor.remove_clause(i)); - --numClauses; - --i; + folded = true; } - else if (domainQuant == TypeConstants::QUANT_ONE) - { - MODIFY(flwor.remove_clause(i)); - const QueryLoc& loc = var->get_loc(); - var_expr* fvar = rCtx.theEM-> - create_var_expr(sctx, loc, var_expr::for_var, var->get_name()); - - fvar->getFreeVars().insert(fvar); + } + default: + break; + } - for_clause* fc = rCtx.theEM-> - create_for_clause(sctx, loc, fvar, domainExpr); + if (folded) + { + theFlwor->remove_clause(i); + --numClauses; + --i; + modified = true; - flwor.add_clause(i, fc); + if (c->get_kind() == flwor_clause::for_clause) + theFlwor->compute_return_type(false, NULL); - subst_vars(rCtx, node, var, fvar); + if (Properties::instance()->printIntermediateOpt()) + { + std::cout << rCtx.theMessage << std::endl + << "After folding var : " << var << " :" << std::endl; + rCtx.getRoot()->put(std::cout) << std::endl; } } - } + } // for each clause expr* whereCond = NULL; - while (flwor.num_clauses() > 0) + while (theFlwor->num_clauses() > 0) { - flwor_clause* clause = flwor.get_clause(0); + flwor_clause* clause = theFlwor->get_clause(0); if (clause->get_kind() == flwor_clause::for_clause || clause->get_kind() == flwor_clause::let_clause || @@ -491,7 +387,7 @@ let_clause* letClause = rCtx.theEM-> create_let_clause(sctx, gVar->get_loc(), gVar, inputExpr); - flwor.add_clause(1, letClause); + theFlwor->add_clause(1, letClause); } const flwor_clause::rebind_list_t& ngVars = gc->get_nongrouping_vars(); @@ -507,15 +403,15 @@ let_clause* letClause = rCtx.theEM-> create_let_clause(sctx, ngVar->get_loc(), ngVar, inputExpr); - flwor.add_clause(1, letClause); + theFlwor->add_clause(1, letClause); } - flwor.remove_clause(0); + theFlwor->remove_clause(0); continue; } else if (clause->get_kind() == flwor_clause::where_clause) { - expr* whereExpr = clause->get_expr(); + expr* whereExpr = static_cast(clause)->get_expr(); //TODO: Consider case where both whereExpr and whereCond ar AND ops if (whereCond == NULL) @@ -534,35 +430,36 @@ { whereCond = rCtx.theEM-> create_fo_expr(sctx, + udf, whereCond->get_loc(), - GET_BUILTIN_FUNCTION(OP_AND_N), + BUILTIN_FUNC(OP_AND_N), whereExpr, whereCond); } //as soon as whereCond is not NULL we don't need to mark as modified - flwor.remove_clause(0); + theFlwor->remove_clause(0); continue; } else if (clause->get_kind() == flwor_clause::count_clause) { // since one value is still returned, count variables are changed to 1 subst_vars(rCtx, - flworp, static_cast(clause)->get_var(), - rCtx.theEM->create_const_expr(sctx, loc, xs_integer::one())); + rCtx.theEM->create_const_expr(sctx, udf, loc, xs_integer::one()), + 2); - flwor.remove_clause(0); + theFlwor->remove_clause(0); continue; } else if (clause->get_kind() == flwor_clause::order_clause) { - flwor.remove_clause(0); + theFlwor->remove_clause(0); continue; } else if (clause->get_kind() == flwor_clause::materialize_clause) { - flwor.remove_clause(0); + theFlwor->remove_clause(0); continue; } else @@ -573,22 +470,23 @@ if (whereCond != NULL) { - expr* result = (flwor.num_clauses() > 0 ? flworp : flwor.get_return_expr()); + expr* result = (theFlwor->num_clauses() > 0 ? theFlwor : theFlwor->get_return_expr()); if_expr* ifExpr = rCtx.theEM-> create_if_expr(sctx, + udf, whereCond->get_loc(), whereCond, result, - rCtx.theEM->create_seq(sctx, whereCond->get_loc())); + rCtx.theEM->create_seq(sctx, udf, whereCond->get_loc())); fix_if_annotations(ifExpr); return ifExpr; } - if (flwor.num_clauses() == 0) - return flwor.get_return_expr(); + if (theFlwor->num_clauses() == 0) + return theFlwor->get_return_expr(); return modified ? node : NULL; } @@ -601,602 +499,248 @@ /***************************************************************************** - Returns a set containing all the variables defined by the clauses of a flwor - expr. + ******************************************************************************/ -static void collect_flw_vars(const flwor_expr& flwor, expr::FreeVars& vars) +bool EliminateUnusedLetVars::safe_to_fold_var(csize varPos, int& numRefs) { - for (csize i = 0; i < flwor.num_clauses(); ++i) - { - const flwor_clause& c = *flwor.get_clause(i); + numRefs = 0; + theRefs.clear(); - switch (c.get_kind()) - { - case flwor_clause::for_clause: - { - const for_clause* fc = static_cast(&c); + forlet_clause* varClause = static_cast(theFlwor->get_clause(varPos)); + expr* varDomExpr = varClause->get_expr(); + var_expr* var = varClause->get_var(); - vars.insert(fc->get_var()); - - if (fc->get_pos_var() != NULL) - vars.insert(fc->get_pos_var()); - - break; - } - case flwor_clause::let_clause: - { - const let_clause* lc = static_cast(&c); - vars.insert(lc->get_var()); - break; - } - case flwor_clause::window_clause: - { - const window_clause* wc = static_cast(&c); + if (varDomExpr->is_sequential()) + return false; - vars.insert(wc->get_var()); + bool isSafeVar = + (varClause->get_kind() == flwor_clause::let_clause || + varClause->is_allowing_empty() || + varDomExpr->get_return_type()->get_quantifier() == TypeConstants::QUANT_ONE); - if (wc->get_win_start() != NULL) - { - const flwor_wincond* cond = wc->get_win_start(); - const flwor_wincond::vars& condvars = cond->get_out_vars(); + if (is_trivial_expr(varDomExpr)) + { + numRefs = 2; + return isSafeVar; + } - if (condvars.posvar != NULL) vars.insert(condvars.posvar); - if (condvars.curr != NULL) vars.insert(condvars.curr); - if (condvars.prev != NULL) vars.insert(condvars.prev); - if (condvars.next != NULL) vars.insert(condvars.next); - } + // If set to true, then it is unsafe to fold, but we may still be able to + // completely eliminate the var if it not referenced anywhere. + bool unsafe = false; - if (wc->get_win_stop() != NULL) - { - const flwor_wincond* cond = wc->get_win_stop(); - const flwor_wincond::vars& condvars = cond->get_out_vars(); + if (theFlwor->dereferencesNodes() && varDomExpr->constructsNodes()) + unsafe = true; - if (condvars.posvar != NULL) vars.insert(condvars.posvar); - if (condvars.curr != NULL) vars.insert(condvars.curr); - if (condvars.prev != NULL) vars.insert(condvars.prev); - if (condvars.next != NULL) vars.insert(condvars.next); - } + bool safe = safe_to_fold_var_rec(theFlwor, varPos+1, var, unsafe, isSafeVar, numRefs); - break; - } - case flwor_clause::group_clause: + if (safe && numRefs == 0) + { + if (varDomExpr->isNonDiscardable() || !isSafeVar) { - const group_clause* gc = static_cast(&c); - - flwor_clause::rebind_list_t::const_iterator ite = gc->beginGroupVars(); - flwor_clause::rebind_list_t::const_iterator end = gc->endGroupVars(); - - for (; ite != end; ++ite) - { - vars.insert((*ite).second); - } - - ite = gc->beginNonGroupVars(); - end = gc->endNonGroupVars(); - - for (; ite != end; ++ite) - { - vars.insert((*ite).second); - } - - break; + return false; } - case flwor_clause::count_clause: + else { - const count_clause* cc = static_cast(&c); - vars.insert(cc->get_var()); - break; - } - default: - break; +#if 0 + rCtx.getCompilerCB()->theXQueryDiagnostics->add_warning( + NEW_XQUERY_WARNING(zwarn::ZWST0001_UNUSED_VARIABLE, + WARN_PARAMS(var->get_name()->getStringValue()), + WARN_LOC(var->get_loc()))); +#endif + return true; } } -} - - -/****************************************************************************** - -******************************************************************************/ -static bool is_trivial_expr(const expr* e) -{ - switch (e->get_expr_kind()) - { - case const_expr_kind: - { - return true; - } - case var_expr_kind: - { - const var_expr* ve = static_cast(e); - enum var_expr::var_kind k = ve->get_kind(); - - // NOTE: An arg var is not materialized, and as a result, it cannot be - // referenced more than once or be refeneced inside a loop or try block. - // Therefore, an arg var that appears as the domain expr of a LET var - // cannot trivially substitute the LET var. - if (k == var_expr::arg_var || - k == var_expr::local_var || - (k == var_expr::prolog_var && ve->is_mutable())) - return false; - return true; - } - case wrapper_expr_kind: - { - return is_trivial_expr(static_cast(e)->get_expr()); - } - default: - return false; - } + return safe; } -/***************************************************************************** - Check if it is OK to fold (inline) a FOR/LET var X that we know is referenced - only once withing its flwor expr. - - For a LET var, varQuant is always QUANT_ONE. - - For a FOR var, varQuant is the quantifier of the type of the domain expr. - It can be either QUANT_ONE or QUANT_QUESTION. -******************************************************************************/ -static bool safe_to_fold_single_use( +bool EliminateUnusedLetVars::safe_to_fold_var_rec( + expr* node, + csize varPos, var_expr* var, - TypeConstants::quantifier_t varQuant, - const flwor_expr& flwor) + bool unsafe, + bool isSafeVar, + int& numRefs) { - TypeManager* tm = var->get_type_manager(); - - bool declared = false; - expr* referencingExpr = NULL; - - bool hasNodeConstr = var->get_domain_expr()->contains_node_construction(); + TypeManager* tm = theFlwor->get_type_manager(); - csize numClauses = flwor.num_clauses(); - - for (csize i = 0; i < numClauses && referencingExpr == NULL; ++i) + switch (node->get_expr_kind()) + { + case flwor_expr_kind: + case gflwor_expr_kind: { - const flwor_clause* clause = flwor.get_clause(i); - flwor_clause::ClauseKind kind = clause->get_kind(); + bool unsafe1 = unsafe || !isSafeVar; - switch (kind) - { - case flwor_clause::for_clause: - case flwor_clause::let_clause: + flwor_expr* flwor = static_cast(node); + csize numClauses = flwor->num_clauses(); + + for (csize i = varPos; i < numClauses; ++i) { - const forletwin_clause* flc = static_cast(clause); - var_expr* varExpr = flc->get_var(); - expr* domExpr = flc->get_expr(); - - if (! declared) - { - declared = (varExpr == var); - continue; - } - - assert(varQuant == TypeConstants::QUANT_ONE); - - if (domExpr->is_sequential()) - return false; + flwor_clause* clause = flwor->get_clause(i); + flwor_clause::ClauseKind kind = clause->get_kind(); - // If X is referenced in the current FOR clause ..... - if (expr_tools::count_variable_uses(domExpr, var, 1) == 1) + switch (kind) { - referencingExpr = domExpr; - break; - } - - // If X is referenced after this FOR clause. In this case, we don't want - // to inline X because its domain expr will be computed once per iteration - // instead of just once. - if (kind == flwor_clause::for_clause && - domExpr->get_return_type()->max_card() >= 2) - return false; - - // test rbkt/zorba/extern/5890.xq illustrates why this check is needed - //if (hasNodeConstr && fc.get_expr()->contains_node_construction()) - // return false; - - break; - } - case flwor_clause::where_clause: - { - if (!declared) - continue; - - assert(varQuant == TypeConstants::QUANT_ONE); - - if (expr_tools::count_variable_uses(clause->get_expr(), var, 1) == 1) + case flwor_clause::for_clause: + case flwor_clause::let_clause: { - referencingExpr = clause->get_expr(); - break; - } + forletwin_clause* cl = static_cast(clause); + expr** domExpr = cl->get_expr_ref(); - break; - } - case flwor_clause::order_clause: - { - if (!declared) - continue; - - assert(varQuant == TypeConstants::QUANT_ONE); - - const orderby_clause* oc = static_cast(clause); - - std::vector::const_iterator ite = oc->begin(); - std::vector::const_iterator end = oc->end(); - - for (; ite != end; ++ite) - { - if (expr_tools::count_variable_uses(*ite, var, 1) == 1) + if (*domExpr == var) { - referencingExpr = *ite; - break; - } - } + ++numRefs; - break; - } - case flwor_clause::group_clause: - { - if (!declared) - continue; - - assert(varQuant == TypeConstants::QUANT_ONE); - - const group_clause* gc = static_cast(clause); - - flwor_clause::rebind_list_t::const_iterator ite = gc->beginGroupVars(); - flwor_clause::rebind_list_t::const_iterator end = gc->endGroupVars(); + if (unsafe1 || numRefs > 1) + return false; - for (; ite != end; ++ite) - { - expr* inputExpr = ite->first; - if (expr_tools::count_variable_uses(inputExpr, var, 1) == 1) + theRefs.push_back(domExpr); + } + else if (!safe_to_fold_var_rec(*domExpr, 0, var, unsafe1, true, numRefs)) { - referencingExpr = inputExpr; - break; + return false; } - } - - ite = gc->beginNonGroupVars(); - end = gc->endNonGroupVars(); - - for (; ite != end; ++ite) - { - expr* inputExpr = ite->first; - if (expr_tools::count_variable_uses(inputExpr, var, 1) == 1) + else if (kind == flwor_clause::for_clause && + (*domExpr)->get_return_type()->max_card() >= 2) { - referencingExpr = inputExpr; - break; + unsafe = unsafe1 = true; } - } - - break; - } - case flwor_clause::window_clause: - { - if (!declared) - continue; - - assert(varQuant == TypeConstants::QUANT_ONE); - - const window_clause* wc = static_cast(clause); - expr* domExpr = wc->get_expr(); - flwor_wincond* startCond = wc->get_win_start(); - flwor_wincond* stopCond = wc->get_win_stop(); - expr* startExpr = (startCond == NULL ? NULL : startCond->get_cond()); - expr* stopExpr = (stopCond == NULL ? NULL : stopCond->get_cond()); - - if (domExpr->is_sequential()) - return false; - if (expr_tools::count_variable_uses(domExpr, var, 1) == 1) - { - referencingExpr = domExpr; - break; - } - - if (domExpr->get_return_type()->max_card() > 1) - return false; - - if (expr_tools::count_variable_uses(startExpr, var, 1) == 1) - { - referencingExpr = domExpr; break; } - - if (expr_tools::count_variable_uses(stopExpr, var, 1) == 1) + case flwor_clause::window_clause: { - referencingExpr = domExpr; - break; - } + window_clause* cl = static_cast(clause); + expr* domExpr = cl->get_expr(); + flwor_wincond* startCond = cl->get_win_start(); + flwor_wincond* stopCond = cl->get_win_stop(); - break; - } - case flwor_clause::materialize_clause: - { - return false; - } - case flwor_clause::count_clause: - { - break; - } - default: - { - ZORBA_ASSERT(false); - } - } - } - - if (referencingExpr == NULL) - { - expr* retExpr = flwor.get_return_expr(); - - if (retExpr->is_sequential()) - return false; - - if (expr_tools::count_variable_uses(retExpr, var, 1) == 1) - { - if (varQuant != TypeConstants::QUANT_ONE) - { - // We are considering folding a FOR var whose domain expr may be the - // empty sequence. We can fold only if doing so will cause the result - // of the flwor expr to be the empty sequence in the case where the - // domain expr will indeed be equal to the empty sequence. - xqtref_t type = retExpr->get_return_type_with_empty_input(var); + if (domExpr == var) + { + ++numRefs; + if (unsafe1 || numRefs > 1) + return false; - if (TypeOps::is_equal(tm, *type, *GENV_TYPESYSTEM.EMPTY_TYPE, retExpr->get_loc())) + theRefs.push_back(cl->get_expr_ref()); + } + else if (!safe_to_fold_var_rec(domExpr, 0, var, unsafe1, true, numRefs)) { - referencingExpr = retExpr; + return false; } else { - return false; + unsafe = unsafe1 = true; } - } - else - { - referencingExpr = retExpr; - } - } - } - - assert(referencingExpr != NULL); - - if (referencingExpr == NULL) - return false; - - bool found = false; - return !var_in_try_or_loop(var, referencingExpr, false, hasNodeConstr, found); -} - - -/******************************************************************************* - Given a variable V and an expression E that references V exactly once, return - true if the reference occurs inside a - (a) for-loop within E, or - (b) try expr within E, or - (c) while expr within E - - The method traverses recursively the subtree of E looking for variable V and - checking whether it crosses a loop or try expr. If it finds V and there is a - loop or try expr in the path from E to V, it returns true; otherwise it returns - false. - - Note: On the 1st (non-recursive) call, we know that E references V exactly - once. But during a recursive call on a subexpr, the subexpr may or may not - reference V. -********************************************************************************/ -static bool var_in_try_or_loop( - const var_expr* v, - const expr* e, - bool inTryOrLoop, - bool hasNodeConstr, - bool& found) -{ - if (found) - return false; - - expr_kind_t kind = e->get_expr_kind(); - - if (kind == trycatch_expr_kind) - { - const trycatch_expr* tce = static_cast(e); - if (var_in_try_or_loop(v, tce->get_try_expr(), true, hasNodeConstr, found)) - { - assert(found); - return true; - } - - ZORBA_ASSERT(!found); - - csize numClauses = tce->clause_count(); - - for (csize i = 0; i < numClauses; ++i) - { - if (var_in_try_or_loop(v, - tce->get_catch_expr(i), - inTryOrLoop, - hasNodeConstr, - found)) - { - assert(found); - return true; - } - } - - return false; - } - else if (kind == while_expr_kind) - { - const while_expr* we = static_cast(e); - - if (var_in_try_or_loop(v, we->get_body(), true, hasNodeConstr, found)) - { - assert(found); - return true; - } - - ZORBA_ASSERT(!found); - - return false; - } - else if (kind == flwor_expr_kind || kind == gflwor_expr_kind) - { - const flwor_expr& flwor = *static_cast(e); - - for (csize i = 0; i < flwor.num_clauses(); ++i) - { - const flwor_clause* c = flwor.get_clause(i); - - switch (c->get_kind()) - { - case flwor_clause::for_clause: - case flwor_clause::let_clause: - { - const forletwin_clause* flc = static_cast(c); - expr* domExpr = flc->get_expr(); - - if (var_in_try_or_loop(v, domExpr, inTryOrLoop, hasNodeConstr, found)) + if (startCond) { - assert(found); - return true; + int uses = expr_tools::count_variable_uses(startCond->get_expr(), var, 1, NULL); + if (uses > 0) + return false; } - if (found) - return false; - - if (c->get_kind() == flwor_clause::for_clause && - domExpr->get_return_type()->max_card() >= 2) + if (stopCond) { - inTryOrLoop = true; + int uses = expr_tools::count_variable_uses(stopCond->get_expr(), var, 1, NULL); + if (uses > 0) + return false; } - // test rbkt/zorba/extern/5890.xq illustrates why this check is needed - //if (hasNodeConstr && domExpr->contains_node_construction()) - //{ - // return true; - //} - break; } - case flwor_clause::window_clause: + case flwor_clause::where_clause: { - const window_clause* wc = static_cast(c); - expr* domExpr = wc->get_expr(); + where_clause* cl = static_cast(clause); + expr* domExpr = cl->get_expr(); - if (var_in_try_or_loop(v, domExpr, inTryOrLoop, hasNodeConstr, found)) + if (domExpr == var) { - assert(found); - return true; - } + ++numRefs; - if (found) - return false; - - inTryOrLoop = true; - - flwor_wincond* startCond = wc->get_win_start(); - flwor_wincond* stopCond = wc->get_win_stop(); - expr* startExpr = startCond == NULL ? NULL : startCond->get_cond(); - expr* stopExpr = stopCond == NULL ? NULL : stopCond->get_cond(); + if (unsafe1 || numRefs > 1) + return false; - if (startExpr && - var_in_try_or_loop(v, startExpr, inTryOrLoop, hasNodeConstr, found)) - { - assert(found); - return true; + theRefs.push_back(cl->get_expr_ref()); } - - if (found) - return false; - - if (stopExpr && - var_in_try_or_loop(v, stopExpr, inTryOrLoop, hasNodeConstr, found)) + else if (!safe_to_fold_var_rec(domExpr, 0, var, unsafe1, true, numRefs)) { - assert(found); - return true; - } - - if (found) return false; + } break; } - case flwor_clause::group_clause: + case flwor_clause::order_clause: { - const group_clause* gc = static_cast(c); + orderby_clause* cl = static_cast(clause); - flwor_clause::rebind_list_t::const_iterator ite = gc->beginGroupVars(); - flwor_clause::rebind_list_t::const_iterator end = gc->endGroupVars(); + csize numExprs = cl->num_columns(); - for (; ite != end; ++ite) + for (csize i = 0; i < numExprs; ++i) { - expr* gExpr = (*ite).first; + expr* domExpr = cl->get_column_expr(i); - if (var_in_try_or_loop(v, gExpr, inTryOrLoop, hasNodeConstr, found)) + if (domExpr == var) { - assert(found); - return true; - } + ++numRefs; + + if (unsafe1 || numRefs > 1) + return false; - if (found) + theRefs.push_back(cl->get_expr_ref(i)); + } + else if (!safe_to_fold_var_rec(domExpr, 0, var, unsafe1, true, numRefs)) + { return false; + } } - ite = gc->beginNonGroupVars(); - end = gc->endNonGroupVars(); + break; + } + case flwor_clause::group_clause: + { + group_clause* cl = static_cast(clause); + + csize numExprs = cl->numGroupingVars(); - for (; ite != end; ++ite) + for (csize i = 0; i < numExprs; ++i) { - expr* ngExpr = (*ite).first; + expr** domExpr = cl->get_gexpr_ref(i); - if (var_in_try_or_loop(v, ngExpr, inTryOrLoop, hasNodeConstr, found)) + if (*domExpr == var) { - assert(found); - return true; - } + ++numRefs; + + if (unsafe1 || numRefs > 1) + return false; - if (found) + theRefs.push_back(domExpr); + } + else if (!safe_to_fold_var_rec(*domExpr, 0, var, unsafe1, true, numRefs)) + { return false; + } } - break; // TODO - } - case flwor_clause::where_clause: - { - const where_clause* wc = static_cast(c); + numExprs = cl->numNonGroupingVars(); - if (var_in_try_or_loop(v, wc->get_expr(), inTryOrLoop, hasNodeConstr, found)) + for (csize i = 0; i < numExprs; ++i) { - assert(found); - return true; - } + expr** domExpr = cl->get_ngexpr_ref(i); - if (found) - return false; - - break; - } - case flwor_clause::order_clause: - { - const orderby_clause* oc = static_cast(c); + if (*domExpr == var) + { + ++numRefs; - std::vector::const_iterator ite = oc->begin(); - std::vector::const_iterator end = oc->end(); + if (unsafe1 || numRefs > 1) + return false; - for (; ite != end; ++ite) - { - if (var_in_try_or_loop(v, *ite, inTryOrLoop, hasNodeConstr, found)) - { - assert(found); - return true; + theRefs.push_back(domExpr); } - - if (found) + else if (!safe_to_fold_var_rec(*domExpr, 0, var, unsafe1, true, numRefs)) + { return false; + } } break; @@ -1207,95 +751,228 @@ } case flwor_clause::materialize_clause: { - ZORBA_ASSERT(false); + return false; } default: { ZORBA_ASSERT(false); } } + } // for each clause + + expr* retExpr = flwor->get_return_expr(); + int saveNumRefs = numRefs; + + if (retExpr == var) + { + ++numRefs; + + if (unsafe || numRefs > 1) + return false; + + theRefs.push_back(flwor->get_return_expr_ref()); } + else if (!safe_to_fold_var_rec(retExpr, 0, var, unsafe, true, numRefs)) + { + return false; + } + else if (numRefs > 0 && saveNumRefs == 0 && varPos != 0) + { + forlet_clause* varClause = static_cast(theFlwor->get_clause(varPos-1)); + expr* varDomExpr = varClause->get_expr(); - return var_in_try_or_loop(v, - flwor.get_return_expr(), - inTryOrLoop, - hasNodeConstr, - found); - } - else if (e == v) - { - found = true; - return inTryOrLoop; + if (varClause->get_kind() == flwor_clause::for_clause && + varDomExpr->get_return_type()->get_quantifier() != TypeConstants::QUANT_ONE) + { + // We are considering folding a FOR var whose domain expr may be the + // empty sequence. We can fold only if doing so will cause the result + // of the flwor expr to be the empty sequence in the case where the + // domain expr will indeed be equal to the empty sequence. + xqtref_t type = retExpr->get_return_type_with_empty_input(var); + + if (!TypeOps::is_equal(tm, *type, *GENV_TYPESYSTEM.EMPTY_TYPE, retExpr->get_loc())) + { + return false; + } + } + } + + break; } - else if (kind == if_expr_kind) + case if_expr_kind: { - const if_expr* ifExpr = static_cast(e); - const expr* condExpr = ifExpr->get_cond_expr(); + ExprIterator iter(node); - if (var_in_try_or_loop(v, condExpr, inTryOrLoop, hasNodeConstr, found)) - return true; + // Process COND + if (**iter == var) + { + ++numRefs; + + if (unsafe || numRefs > 1) + return false; - if (found) + theRefs.push_back(*iter); + } + else if (!safe_to_fold_var_rec(**iter, 0, var, unsafe, true, numRefs)) + { return false; + } + + // Process THEN + iter.next(); - // The var may actually be referenced in both the then and the else branches. - // So, if we find it in the then branch and is not in try-or-loop in there, - // we must still check the else branch. - - bool thenFound = false; - bool elseFound = false; - const expr* thenExpr = ifExpr->get_then_expr(); - const expr* elseExpr = ifExpr->get_else_expr(); + int thenRefs = numRefs; - if (var_in_try_or_loop(v, thenExpr, inTryOrLoop, hasNodeConstr, thenFound)) + if (**iter == var) { - assert(thenFound); - found = true; - return true; + ++thenRefs; + + if (unsafe || thenRefs > 1) + return false; + + theRefs.push_back(*iter); } + else if (!safe_to_fold_var_rec(**iter, 0, var, unsafe, true, thenRefs)) + { + return false; + } + + // Process ELSE + iter.next(); - if (var_in_try_or_loop(v, elseExpr, inTryOrLoop, hasNodeConstr, elseFound)) + int elseRefs = numRefs; + + if (**iter == var) { - assert(elseFound); - found = true; - return true; + ++elseRefs; + + if (unsafe || elseRefs > 1) + return false; + + theRefs.push_back(*iter); + } + else if (!safe_to_fold_var_rec(**iter, 0, var, unsafe, true, elseRefs)) + { + return false; } - found = (thenFound || elseFound); - return false; + // Combine THEN and ELSE + numRefs = (thenRefs > elseRefs ? thenRefs : elseRefs); + + break; } -#if 0 - else if (kind == elem_expr_kind || - kind == attr_expr_kind || - kind == pi_expr_kind || - kind == text_expr_kind || - kind == doc_expr_kind) + case while_expr_kind: + case trycatch_expr_kind: { - // test rbkt/zorba/extern/5890.xq illustrates why this check is needed - if (hasNodeConstr) - return true; + unsafe = true; } -#endif + default: + { + if (node->is_sequential()) + unsafe = true; + + ExprIterator iter(node); + + while (!iter.done()) + { + if (**iter == var) + { + ++numRefs; - // Or else navigate down all children - ExprConstIterator ei(e); - while (!ei.done()) + if (unsafe || numRefs > 1) + return false; + + theRefs.push_back(*iter); + } + else if (!safe_to_fold_var_rec(**iter, 0, var, unsafe, true, numRefs)) + { + return false; + } + + iter.next(); + } + } + } + + return true; +} + + +/****************************************************************************** + Replace all references to var "var" inside the expr "root" with expr "subst" +********************************************************************************/ +void EliminateUnusedLetVars::subst_vars( + const RewriterContext& rCtx0, + var_expr* var, + expr* subst, + int numRefs) +{ + if (numRefs == 1) { - if (var_in_try_or_loop(v, ei.get_expr(), inTryOrLoop, hasNodeConstr, found)) + for (csize i = 0; i < theRefs.size(); ++i) { - return true; + if (i > 0) + subst = subst->clone(subst->get_udf()); + + *(theRefs[i]) = subst; } + } + else + { + RewriterContext rCtx(rCtx0.getCompilerCB(), + theFlwor, + rCtx0.theUDF, + rCtx0.theMessage, + rCtx0.theIsInOrderedMode); + + zorba::SubstVars rule(var, subst); + + bool modified; + rule.apply(rCtx, theFlwor, modified); + } +} - if (found) - return false; - ei.next(); + +/****************************************************************************** + +******************************************************************************/ +static bool is_trivial_expr(const expr* e) +{ + switch (e->get_expr_kind()) + { + case const_expr_kind: + { + return true; } + case var_expr_kind: + { + const var_expr* ve = static_cast(e); + enum var_expr::var_kind k = ve->get_kind(); - return false; + // NOTE: An arg var is not materialized, and as a result, it cannot be + // referenced more than once or be refeneced inside a loop or try block. + // Therefore, an arg var that appears as the domain expr of a LET var + // cannot trivially substitute the LET var. + if (k == var_expr::arg_var || + k == var_expr::local_var || + (k == var_expr::prolog_var && ve->is_mutable())) + return false; + + assert(!e->isNonDiscardable()); + return true; + } + case wrapper_expr_kind: + { + return is_trivial_expr(static_cast(e)->get_input()); + } + default: + return false; + } } + //////////////////////////////////////////////////////////////////////////////// // // // RefactorPredFLWOR // @@ -1319,6 +996,9 @@ flwor_expr* flwor = static_cast(node); static_context* sctx = flwor->get_sctx(); + user_function* udf = node->get_udf(); + + assert(udf == rCtx.theUDF); // "for $x in ... return if (ce) then te else ()" --> // "for $x in ... where ce return te" @@ -1355,28 +1035,40 @@ if (condExpr->get_function_kind() == FunctionConsts::OP_AND_N) { fo_expr* foCondExpr = static_cast(condExpr); - foWhereExpr->add_args(foCondExpr->get_args()); + + for (csize i = 0; i < foCondExpr->num_args(); ++i) + { + foWhereExpr->add_arg(foCondExpr->get_arg(i)); + expr_tools::fix_annotations(foWhereExpr, foCondExpr->get_arg(i)); + } } else { foWhereExpr->add_arg(condExpr); + expr_tools::fix_annotations(foWhereExpr, condExpr); } } else if (condExpr->get_function_kind() == FunctionConsts::OP_AND_N) { fo_expr* foCondExpr = static_cast(condExpr); foCondExpr->add_arg(whereExpr); + expr_tools::fix_annotations(foCondExpr, whereExpr); + flwor->set_where(condExpr); } else { expr* newWhereExpr = rCtx.theEM-> create_fo_expr(sctx, + udf, whereExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_AND_N), + BUILTIN_FUNC(OP_AND_N), whereExpr, condExpr); + expr_tools::fix_annotations(newWhereExpr, whereExpr); + expr_tools::fix_annotations(newWhereExpr, condExpr); + flwor->set_where(newWhereExpr); } } @@ -1404,7 +1096,7 @@ if (clause->get_kind() != flwor_clause::where_clause) continue; - expr* whereExpr = clause->get_expr(); + expr* whereExpr = static_cast(clause)->get_expr(); expr* posExpr = NULL; var_expr* posVar = NULL; @@ -1422,7 +1114,7 @@ expr* arg = andExpr->get_arg(i); if (is_positional_pred(flwor, clausePos, arg, posVar, posExpr, compKind) && - expr_tools::count_variable_uses(flwor, posVar, 2) <= 1) + expr_tools::count_variable_uses(flwor, posVar, 2, NULL) <= 1) { rewrite_positional_pred(rCtx, flwor, posVar, posExpr, compKind); @@ -1444,7 +1136,7 @@ else { if (is_positional_pred(flwor, clausePos, whereExpr, posVar, posExpr, compKind) && - expr_tools::count_variable_uses(flwor, posVar, 2) <= 1) + expr_tools::count_variable_uses(flwor, posVar, 2, NULL) <= 1) { rewrite_positional_pred(rCtx, flwor, posVar, posExpr, compKind); @@ -1460,6 +1152,57 @@ } } + // 2. where-clause-to-if-then-else + // "for $x in ... where E ... return ...", and E doesn't depend on FLWOR vars --> + // "if E then flwor else ()", where flwor is the original flwor expr without the + // where clause. + + if (!flwor->has_sequential_clauses()) + { + expr* whereExpr = NULL; + csize numClauses = flwor->num_clauses(); + + for (csize i = 0; i < numClauses; ++i) + { + flwor_clause* clause = flwor->get_clause(i); + + if (clause->get_kind() == flwor_clause::where_clause) + { + whereExpr = static_cast(clause)->get_expr(); + const expr::FreeVars& whereVars = whereExpr->getFreeVars(); + + csize k = 0; + expr::FreeVars::const_iterator ite = whereVars.begin(); + expr::FreeVars::const_iterator end = whereVars.end(); + for (; ite != end; ++ite) + { + flwor_clause* vc = (*ite)->get_flwor_clause(); + if (vc != NULL && vc->get_flwor_expr() == flwor) + break; + + ++k; + } + + if (k == whereVars.size()) + { + flwor->remove_clause(i); + + if_expr* ifExpr = rCtx.theEM-> + create_if_expr(sctx, + udf, + flwor->get_loc(), + whereExpr, + flwor, + rCtx.theEM->create_seq(sctx, udf, flwor->get_loc())); + + fix_if_annotations(ifExpr); + + return ifExpr; + } + } + } + } + return (modified ? flwor : NULL); } @@ -1484,8 +1227,11 @@ CompareConsts::CompareType& compKind) { static_context* sctx = flworExpr->get_sctx(); + user_function* udf = flworExpr->get_udf(); - for_clause* forClause = posVar->get_for_clause(); + assert(udf == rCtx.theUDF); + + for_clause* forClause = posVar->get_forlet_clause(); expr* domainExpr = forClause->get_expr(); fo_expr* result; @@ -1497,8 +1243,9 @@ { result = rCtx.theEM-> create_fo_expr(sctx, + udf, domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_SEQUENCE_POINT_ACCESS_2), + BUILTIN_FUNC(OP_ZORBA_SEQUENCE_POINT_ACCESS_2), domainExpr, posExpr); break; @@ -1507,7 +1254,7 @@ case CompareConsts::VALUE_LESS_EQUAL: { expr* oneExpr = rCtx.theEM-> - create_const_expr(sctx, domainExpr->get_loc(), xs_integer(1)); + create_const_expr(sctx, udf, domainExpr->get_loc(), xs_integer(1)); std::vector args(3); args[0] = domainExpr; @@ -1516,8 +1263,9 @@ result = rCtx.theEM-> create_fo_expr(sctx, + udf, domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_3), + BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_3), args); break; } @@ -1525,15 +1273,16 @@ case CompareConsts::VALUE_LESS: { expr* oneExpr1 = rCtx.theEM-> - create_const_expr(sctx, domainExpr->get_loc(), xs_integer(1)); + create_const_expr(sctx, udf, domainExpr->get_loc(), xs_integer(1)); expr* oneExpr2 = rCtx.theEM-> - create_const_expr(sctx, domainExpr->get_loc(), xs_integer(1)); + create_const_expr(sctx, udf, domainExpr->get_loc(), xs_integer(1)); posExpr = rCtx.theEM-> create_fo_expr(sctx, + udf, domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_NUMERIC_SUBTRACT_INTEGER_2), + BUILTIN_FUNC(OP_NUMERIC_SUBTRACT_INTEGER_2), posExpr, oneExpr2); @@ -1544,8 +1293,9 @@ result = rCtx.theEM-> create_fo_expr(sctx, + udf, domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_3), + BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_3), args); break; } @@ -1554,8 +1304,9 @@ { result = rCtx.theEM-> create_fo_expr(sctx, + udf, domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_2), + BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_2), domainExpr, posExpr); break; @@ -1564,19 +1315,21 @@ case CompareConsts::VALUE_GREATER: { expr* oneExpr = rCtx.theEM-> - create_const_expr(sctx, domainExpr->get_loc(), xs_integer(1)); + create_const_expr(sctx, udf, domainExpr->get_loc(), xs_integer(1)); posExpr = rCtx.theEM-> create_fo_expr(sctx, + udf, domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_NUMERIC_ADD_INTEGER_2), + BUILTIN_FUNC(OP_NUMERIC_ADD_INTEGER_2), posExpr, oneExpr); result = rCtx.theEM-> create_fo_expr(sctx, + udf, domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_2), + BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_2), domainExpr, posExpr); break; @@ -1726,7 +1479,7 @@ } } - for_clause* forClause = posVar->get_for_clause(); + for_clause* forClause = posVar->get_forlet_clause(); if (forClause->is_allowing_empty()) return false; @@ -1805,179 +1558,184 @@ /****************************************************************************** *******************************************************************************/ -RULE_REWRITE_PRE(MergeFLWOR) +expr* MergeFLWOR::apply(RewriterContext& rCtx, expr* node, bool& modified) { - flwor_expr* flwor = dynamic_cast(node); + if (node->get_expr_kind() == flwor_expr_kind || + node->get_expr_kind() == gflwor_expr_kind) + { + flwor_expr* flwor = static_cast(node); - if (flwor == NULL) - return NULL; + // Try to merge an inner flwor that appears in the return clause of the + // outer flwor. + if (flwor->get_return_expr()->get_expr_kind() == flwor_expr_kind && + !flwor->get_return_expr()->is_sequential()) + { + // TODO: If the return clause is sequential, we can still do the merge, + // but we must keep both the outer and the inner materialize clauses. - bool modified = false; + flwor_expr* returnFlwor = static_cast(flwor->get_return_expr()); - // Try to merge an inner flwor that appears in the return clause of the - // outer flwor. - if (flwor->get_return_expr()->get_expr_kind() == flwor_expr_kind && - !flwor->get_return_expr()->is_sequential()) - { - // TODO: If the return clause is sequential, we can still do the merge, - // but we must keep both the outer and the inner materialize clauses. - - flwor_expr* returnFlwor = static_cast(flwor->get_return_expr()); - - // If the outer flwor is not general, and it contains where, groupby, or - // orderby clauses, we cannot merge because for/let clauses cannot appear - // after where, groupby, or orderby clauses, - if (!flwor->is_general()) - { - csize numClauses = flwor->num_clauses(); + // If the outer flwor is not general, and it contains where, groupby, or + // orderby clauses, we cannot merge because for/let clauses cannot appear + // after where, groupby, or orderby clauses, + if (!flwor->is_general()) + { + csize numClauses = flwor->num_clauses(); + + for (csize i = 0; i < numClauses; ++i) + { + const flwor_clause* c = flwor->get_clause(i); + + if (c->get_kind() == flwor_clause::where_clause || + c->get_kind() == flwor_clause::group_clause || + c->get_kind() == flwor_clause::order_clause) + { + goto next1; + } + } + } + + csize numClauses = returnFlwor->num_clauses(); for (csize i = 0; i < numClauses; ++i) { - const flwor_clause* c = flwor->get_clause(i); - - if (c->get_kind() == flwor_clause::where_clause || - c->get_kind() == flwor_clause::group_clause || + const flwor_clause* c = returnFlwor->get_clause(i); + + if (c->get_kind() == flwor_clause::group_clause || c->get_kind() == flwor_clause::order_clause) { goto next1; } } - } - - csize numClauses = returnFlwor->num_clauses(); - - for (csize i = 0; i < numClauses; ++i) - { - const flwor_clause* c = returnFlwor->get_clause(i); - - if (c->get_kind() == flwor_clause::group_clause || - c->get_kind() == flwor_clause::order_clause) + + for (csize i = 0; i < numClauses; ++i) { - goto next1; + flwor->add_clause(returnFlwor->get_clause(i)); } + + flwor->set_return_expr(returnFlwor->get_return_expr()); + + modified = true; } - + + next1: + + csize numClauses = flwor->num_clauses(); + + // Try to merge an inner flwor that appears in a for/let clause of the outer + // flwor. for (csize i = 0; i < numClauses; ++i) { - flwor->add_clause(returnFlwor->get_clause(i)); - } - - flwor->set_return_expr(returnFlwor->get_return_expr()); - - modified = true; - } - - next1: - - csize numClauses = flwor->num_clauses(); - - // Try to merge an inner flwor that appears in a for/let clause of the outer - // flwor. - for (csize i = 0; i < numClauses; ++i) - { - bool merge = false; - flwor_expr* nestedFlwor = NULL; - ulong numNestedClauses; - - flwor_clause* c = flwor->get_clause(i); - - expr* domainExpr = c->get_expr(); - - if (domainExpr != NULL && - domainExpr->get_expr_kind() == flwor_expr_kind && - !domainExpr->is_sequential()) - { - nestedFlwor = static_cast(c->get_expr()); - numNestedClauses = nestedFlwor->num_clauses(); - + bool merge = false; + flwor_expr* nestedFlwor = NULL; + csize numNestedClauses; + + flwor_clause* c = flwor->get_clause(i); + if (c->get_kind() == flwor_clause::let_clause) { - merge = true; - - for (ulong j = 0; j < numNestedClauses; ++j) + expr* domainExpr = static_cast(c)->get_expr(); + + if (domainExpr->get_expr_kind() == flwor_expr_kind && + !domainExpr->is_sequential()) { - flwor_clause* nestedClause = nestedFlwor->get_clause(j); - flwor_clause::ClauseKind nestedClauseKind = nestedClause->get_kind(); - - if (nestedClauseKind == flwor_clause::for_clause) + nestedFlwor = static_cast(domainExpr); + numNestedClauses = nestedFlwor->num_clauses(); + merge = true; + + for (csize j = 0; j < numNestedClauses; ++j) { - xqtref_t nestedDomainType = - nestedClause->get_expr()->get_return_type(); - - if (nestedDomainType->get_quantifier() != TypeConstants::QUANT_ONE) + flwor_clause* nestedClause = nestedFlwor->get_clause(j); + flwor_clause::ClauseKind nestedClauseKind = nestedClause->get_kind(); + + if (nestedClauseKind == flwor_clause::for_clause) + { + xqtref_t nestedDomainType = + static_cast(nestedClause)->get_expr()->get_return_type(); + + if (nestedDomainType->get_quantifier() != TypeConstants::QUANT_ONE) + { + merge = false; + break; + } + } + else if (nestedClauseKind != flwor_clause::let_clause) { merge = false; break; } } - else if (nestedClauseKind != flwor_clause::let_clause) - { - merge = false; - break; - } } } else if (c->get_kind() == flwor_clause::for_clause && - c->get_pos_var() == NULL) + static_cast(c)->get_pos_var() == NULL) { - merge = true; + expr* domainExpr = static_cast(c)->get_expr(); - for (ulong j = 0; j < numNestedClauses; ++j) + if (domainExpr->get_expr_kind() == flwor_expr_kind && + !domainExpr->is_sequential()) { - flwor_clause* nestedClause = nestedFlwor->get_clause(j); - flwor_clause::ClauseKind nestedClauseKind = nestedClause->get_kind(); + nestedFlwor = static_cast(domainExpr); + numNestedClauses = nestedFlwor->num_clauses(); + merge = true; - if (nestedClauseKind != flwor_clause::let_clause && - nestedClauseKind != flwor_clause::for_clause) + for (csize j = 0; j < numNestedClauses; ++j) { -#if 1 - // temp hack until we have an optimized general flwor - if (nestedClauseKind == flwor_clause::where_clause && - i == numClauses-1 && - flwor->get_where() == NULL && - nestedFlwor->get_return_expr()->get_var() != NULL) + flwor_clause* nestedClause = nestedFlwor->get_clause(j); + flwor_clause::ClauseKind nestedClauseKind = nestedClause->get_kind(); + + if (nestedClauseKind != flwor_clause::let_clause && + nestedClauseKind != flwor_clause::for_clause) { - continue; - } +#if 1 + // temp hack until we have an optimized general flwor + if (nestedClauseKind == flwor_clause::where_clause && + i == numClauses-1 && + flwor->get_where() == NULL && + nestedFlwor->get_return_expr()->get_var() != NULL) + { + continue; + } #endif - merge = false; - break; + merge = false; + break; + } } } } - } - - if (merge) - { - for (ulong j = 0; j < numNestedClauses; ++j) + + if (merge) { - flwor_clause* nestedClause = nestedFlwor->get_clause(j); + for (csize j = 0; j < numNestedClauses; ++j) + { + flwor_clause* nestedClause = nestedFlwor->get_clause(j); #if 1 - if (nestedClause->get_kind() == flwor_clause::where_clause) - flwor->add_clause(i+j+1, nestedClause); - else + if (nestedClause->get_kind() == flwor_clause::where_clause) + flwor->add_clause(i+j+1, nestedClause); + else #endif - flwor->add_clause(i+j, nestedClause); + flwor->add_clause(i+j, nestedClause); + } + + c->set_expr(nestedFlwor->get_return_expr()); + + numClauses += numNestedClauses; + i += numNestedClauses; + + modified = true; } - - c->set_expr(nestedFlwor->get_return_expr()); - - numClauses += numNestedClauses; - i += numNestedClauses; - - modified = true; } } - return (modified ? node : NULL); -} + ExprIterator iter(node); + while (!iter.done()) + { + apply(rCtx, **iter, modified); -/****************************************************************************** + iter.next(); + } -*******************************************************************************/ -RULE_REWRITE_POST(MergeFLWOR) -{ return NULL; } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/fold_rules.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/fold_rules.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/fold_rules.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/fold_rules.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -49,106 +49,22 @@ #include -using namespace std; - namespace zorba { -static void remove_wincond_vars(const flwor_wincond*, expr::FreeVars&); - -static bool standalone_expr(expr*); - -static bool already_folded(expr*, RewriterContext&); +static bool execute(CompilerCB*, expr* node, store::Item_t& result); -static expr* partial_eval_fo (RewriterContext&, fo_expr*); +static expr* partial_eval_fo(RewriterContext&, fo_expr*); static expr* partial_eval_logic(fo_expr*, bool, RewriterContext&); static expr* partial_eval_eq(RewriterContext&, fo_expr&); -static expr* partial_eval_return_clause(flwor_expr* flworExpr, bool& modified, RewriterContext& rCtx); +static expr* partial_eval_return_clause(flwor_expr*, bool&, RewriterContext&); static bool maybe_needs_implicit_timezone(const fo_expr* fo); /******************************************************************************* - -********************************************************************************/ -static expr* execute ( - CompilerCB* compilercb, - expr* node, - vector& result) -{ - ulong nextVarId = 1; - PlanIter_t plan = codegen ("const-folded expr", node, compilercb, nextVarId); - QueryLoc loc = LOC (node); - store::Item_t item; - - CompilerCB expr_ccb(*compilercb); - expr_ccb.theRootSctx = node->get_sctx(); - try - { - //std::cout << "Const folding expr : " << std::endl; - //node->put(std::cout); - //std::cout << std::endl; - - PlanWrapperHolder pw(new PlanWrapper(plan, - &expr_ccb, - 0, // dynamic ctx - NULL, // xquery - 0, // stack depth - expr_ccb.theHaveTimeout, - expr_ccb.theTimeout)); - for (;;) - { - if (!pw->next(item)) - { - break; - } - - if (item->isError()) - { - node->setUnfoldable(ANNOTATION_TRUE_FIXED); - node->setNonDiscardable(ANNOTATION_TRUE_FIXED); - return node; - } - - result.push_back(item); - } - - return NULL; - } - catch (ZorbaException const&) - { - node->setUnfoldable(ANNOTATION_TRUE_FIXED); - node->setNonDiscardable(ANNOTATION_TRUE_FIXED); - return node; - // TODO: - // we had to disable folding of errors because the FnErrorIterator - // was erroneously used. It always raises a ZorbaUserError (which is not correct). -#if 0 - Error lErrorCode = e.theErrorCode; - QueryLoc loc; - loc.setLineBegin(e.theQueryLine); - loc.setColumnBegin(e.theQueryColumn); - store::Item_t qname; - ITEM_FACTORY->createQName(qname, - "http://www.w3.org/2005/xqt-errors", - "err", - error::ZorbaError::toString(lErrorCode).c_str()); - expr* err_expr = rCtx.theEM->create_fo_expr(node->get_sctx_id(), - loc, - GET_BUILTIN_FUNCTION(FN_ERROR_2), - rCtx.theEM->create_const_expr(node->get_sctx_id(), loc, qname), - rCtx.theEM->create_const_expr(node->get_sctx_id(), loc, e.theDescription)); - err_expr->setUnfoldable(ANNOTATION_TRUE_FIXED); - err_expr->setNonDiscardable(ANNOTATION_TRUE_FIXED); - return err_expr; -#endif - } -} - - -/******************************************************************************* Compute the NON_DISCARDABLE and UNFOLDABLE properties of expressions The meaning/purpose of the NON_DISCARDABLE property is as follows: @@ -170,12 +86,16 @@ BoolAnnotationValue saveNonDiscardable = node->getNonDiscardable(); BoolAnnotationValue saveUnfoldable = node->getUnfoldable(); BoolAnnotationValue saveContainsRecursiveCall = node->getContainsRecursiveCall(); + BoolAnnotationValue saveConstructsNodes = node->getConstructsNodes(); + BoolAnnotationValue saveDereferencesNodes = node->getDereferencesNodes(); - // By default, an expr is discardable, foldable, and does not contain - // recursive calls + // By default, an expr is discardable, foldable, does not contain recursive + // calls, and returns constructed nodes. BoolAnnotationValue curNonDiscardable = ANNOTATION_FALSE; BoolAnnotationValue curUnfoldable = ANNOTATION_FALSE; BoolAnnotationValue curContainsRecursiveCall = ANNOTATION_FALSE; + BoolAnnotationValue curConstructsNodes = ANNOTATION_FALSE; + BoolAnnotationValue curDereferencesNodes = ANNOTATION_FALSE; // Process udfs: If the current expr is a udf invocation, optimize the udf // body, if not optimized already, and determine whether the invocation is @@ -185,12 +105,14 @@ fo_expr* fo = static_cast(node); function* f = fo->get_func(); - if (f->isUdf()) + if (f->isUdf() && !theIsLocal) { user_function* udf = static_cast(f); if (!udf->isOptimized()) { + // we can be here in case of mutually recursive udfs or during plan + // serialization and udf was not callable by the main program udf->optimize(); } @@ -221,123 +143,90 @@ if (childExpr->containsRecursiveCall()) curContainsRecursiveCall = ANNOTATION_TRUE; + if (childExpr->constructsNodes()) + curConstructsNodes = ANNOTATION_TRUE; + + if (childExpr->dereferencesNodes()) + curDereferencesNodes = ANNOTATION_TRUE; + iter.next(); } - // Certain exprs are nondiscardable independently from their children. - if (saveNonDiscardable != ANNOTATION_TRUE_FIXED) + switch (node->get_expr_kind()) { - if (node->is_sequential()) - { - curNonDiscardable = ANNOTATION_TRUE_FIXED; - } - else + case fo_expr_kind: + { + fo_expr* fo = static_cast(node); + function* f = fo->get_func(); + + if (!f->isUdf()) { - switch (node->get_expr_kind()) - { - case fo_expr_kind: - { - fo_expr* fo = static_cast(node); - function* f = fo->get_func(); - - bool isErrorFunc = (dynamic_cast(f) != NULL); - - if (f->getKind() == FunctionConsts::FN_TRACE_2 || - isErrorFunc) - { - curNonDiscardable = ANNOTATION_TRUE_FIXED; - } - - break; - } - - case cast_expr_kind: - case treat_expr_kind: - case promote_expr_kind: + if (FunctionConsts::FN_ERROR_0 <= f->getKind() && + f->getKind() <= FunctionConsts::FN_TRACE_2) { curNonDiscardable = ANNOTATION_TRUE_FIXED; - break; + curUnfoldable = ANNOTATION_TRUE_FIXED; } - - default: + else if (f->getKind() == FunctionConsts::FN_ZORBA_REF_NODE_BY_REFERENCE_1) { - break; + curDereferencesNodes = ANNOTATION_TRUE; } + + // Do not fold functions that always require access to the dynamic context, + // or may need to access the implicit timezone (which is also in the dynamic + // constext). + if (saveUnfoldable != ANNOTATION_TRUE_FIXED && + (f->accessesDynCtx() || + maybe_needs_implicit_timezone(fo) || + !f->isDeterministic())) + { + curUnfoldable = ANNOTATION_TRUE_FIXED; } } - } - - // Certain exprs are unfoldable independently from their children - if (saveUnfoldable != ANNOTATION_TRUE_FIXED) - { - if (node->is_sequential()) + else if (theIsLocal) { - curUnfoldable = ANNOTATION_TRUE_FIXED; + curUnfoldable = saveUnfoldable; + curDereferencesNodes = saveDereferencesNodes; + curConstructsNodes = saveConstructsNodes; } else { - switch (node->get_expr_kind()) - { - case fo_expr_kind: - { - fo_expr* fo = static_cast(node); - function* f = fo->get_func(); - - bool isErrorFunc = (dynamic_cast(f) != NULL); - - // Do not fold functions that always require access to the dynamic context, - // or may need to access the implicit timezone (which is also in the dynamic - // constext). - if (isErrorFunc || - f->accessesDynCtx() || - maybe_needs_implicit_timezone(fo) || - !f->isDeterministic()) - { - curUnfoldable = ANNOTATION_TRUE_FIXED; - } - - break; - } - - case var_expr_kind: - { - var_expr::var_kind varKind = static_cast(node)->get_kind(); - - if (varKind == var_expr::prolog_var || varKind == var_expr::local_var) - curUnfoldable = ANNOTATION_TRUE_FIXED; - - break; - } - - // Node constructors are unfoldable because if a node constructor is inside - // a loop, then it will create a different xml tree every time it is invoked, - // even if the constructor itself is "constant" (i.e. does not reference any - // varialbes) - case elem_expr_kind: - case attr_expr_kind: - case text_expr_kind: - case pi_expr_kind: - case doc_expr_kind: + if (saveUnfoldable != ANNOTATION_TRUE_FIXED && + (f->accessesDynCtx() || !f->isDeterministic())) { curUnfoldable = ANNOTATION_TRUE_FIXED; - break; - } - - case delete_expr_kind: - case insert_expr_kind: - case rename_expr_kind: - case replace_expr_kind: - { - curUnfoldable = ANNOTATION_TRUE_FIXED; - break; - } - - default: - { - break; - } } + + if (static_cast(f)->dereferencesNodes()) + curDereferencesNodes = ANNOTATION_TRUE; + + if (static_cast(f)->constructsNodes()) + curConstructsNodes = ANNOTATION_TRUE; } + + break; + } + + case var_expr_kind: + { + var_expr::var_kind varKind = static_cast(node)->get_kind(); + + if (varKind == var_expr::prolog_var || varKind == var_expr::local_var) + curUnfoldable = ANNOTATION_TRUE_FIXED; + + break; + } + + default: + { + break; + } + } + + if (node->is_sequential()) + { + curNonDiscardable = ANNOTATION_TRUE_FIXED; + curUnfoldable = ANNOTATION_TRUE_FIXED; } if (saveNonDiscardable != curNonDiscardable && @@ -361,6 +250,20 @@ modified = true; } + if (saveConstructsNodes != curConstructsNodes && + saveConstructsNodes != ANNOTATION_TRUE_FIXED) + { + node->setConstructsNodes(curConstructsNodes); + modified = true; + } + + if (saveDereferencesNodes != curDereferencesNodes && + saveDereferencesNodes != ANNOTATION_TRUE_FIXED) + { + node->setDereferencesNodes(curDereferencesNodes); + modified = true; + } + return NULL; } @@ -385,7 +288,7 @@ fkind == FunctionConsts::FN_MIN_2 || fkind == FunctionConsts::FN_MAX_1 || fkind == FunctionConsts::FN_MAX_2) - && TypeOps::maybe_date_time(tm, *TypeOps::prime_type(tm, *type0))) ); + && TypeOps::maybe_date_time(tm, *type0)) ); } @@ -393,189 +296,237 @@ For each expr E, collect all the variables that are referenced directly by E and its subexpressions. ********************************************************************************/ - -RULE_REWRITE_PRE(MarkFreeVars) -{ - return NULL; -} - -RULE_REWRITE_POST(MarkFreeVars) +expr* MarkFreeVars::apply(RewriterContext& rCtx, expr* node, bool& modified) { expr::FreeVars& freevars = node->getFreeVars(); freevars.clear(); - if (node->get_expr_kind() == var_expr_kind) + switch (node->get_expr_kind()) + { + case var_expr_kind: { var_expr* v = static_cast(node); freevars.insert(v); + + break; } - else + // Get the free vars of each child expr and add them to the free vars of the + // parent. But in case of a flwor expr, do not add any variables defined by + // the flwor expr itself + + case flwor_expr_kind: + case gflwor_expr_kind: { - // Get the free vars of each child expr and add them to the free vars of the - // parent. + flwor_expr* flwor = static_cast (node); + ExprIterator iter(node); while (!iter.done()) { expr* e = **iter; + + apply(rCtx, e, modified); const expr::FreeVars& kfv = e->getFreeVars(); - std::copy(kfv.begin(), - kfv.end(), - inserter(freevars, freevars.begin())); + expr::FreeVars::const_iterator ite = kfv.begin(); + expr::FreeVars::const_iterator end = kfv.end(); + for (; ite != end; ++ite) + { + flwor_clause* c = (*ite)->get_flwor_clause(); + if (c != NULL && c->get_flwor_expr() == flwor) + continue; + + freevars.insert(*ite); + } + iter.next(); } - // For a flwor expr, remove the vars defined by the flwor expr itself from - // the flwor free vars . - if (node->get_expr_kind() == flwor_expr_kind || - node->get_expr_kind() == gflwor_expr_kind) - { - flwor_expr* flwor = dynamic_cast (node); - for (flwor_expr::clause_list_t::const_iterator i = flwor->clause_begin(); - i != flwor->clause_end(); - ++i) - { - const flwor_clause* c = *i; + break; + } + default: + { + ExprIterator iter(node); - if (c->get_kind() == flwor_clause::for_clause) - { - const for_clause* fc = static_cast(c); + while (!iter.done()) + { + expr* e = **iter; - freevars.erase(fc->get_var()); - if (fc->get_pos_var() != NULL) - freevars.erase(fc->get_pos_var()); - } - else if (c->get_kind() == flwor_clause::let_clause) - { - const let_clause* lc = static_cast(c); + apply(rCtx, e, modified); + + const expr::FreeVars& kfv = e->getFreeVars(); + std::copy(kfv.begin(), + kfv.end(), + inserter(freevars, freevars.begin())); + + iter.next(); + } + } + } - freevars.erase(lc->get_var()); - } - else if (c->get_kind() == flwor_clause::window_clause) - { - const window_clause* wc = static_cast(c); + return NULL; +} - freevars.erase(wc->get_var()); - flwor_wincond* startCond = wc->get_win_start(); - flwor_wincond* stopCond = wc->get_win_stop(); +/******************************************************************************* + Execute const exprs that return at most one item as a result. Replace such + exprs by either a const_expr whose value is the returned item, or an empty + fn:concatenate expr, if no item is returned by the evaluation of the const + expr. +********************************************************************************/ +expr* FoldConst::apply(RewriterContext& rCtx, expr* node, bool& modified) +{ + expr_kind_t k = node->get_expr_kind(); + xqtref_t rtype = node->get_return_type(); // DO NOT MOVE THIS !!!! - if (startCond != NULL) - remove_wincond_vars(startCond, freevars); + switch (k) + { + case const_expr_kind: + case match_expr_kind: + case axis_step_expr_kind: + { + break; + } + case fo_expr_kind: + { + fo_expr* fo = static_cast(node); - if (stopCond != NULL) - remove_wincond_vars(stopCond, freevars); - } - else if (c->get_kind() == flwor_clause::group_clause) - { - const group_clause* gc = static_cast(c); + if (fo->get_func()->getKind() == FunctionConsts::OP_CONCATENATE_N && + fo->num_args() == 0) + break; + } + + default: + { + if (node->getFreeVars().empty() && + ! node->isUnfoldable() && + rtype->max_card() <= 1) + { + store::Item_t result; + bool folded = execute(rCtx.getCompilerCB(), node, result); - const flwor_clause::rebind_list_t& gvars = gc->get_grouping_vars(); - csize numGroupVars = gvars.size(); + if (folded) + { + expr* foldedExpr; - for (csize i = 0; i < numGroupVars; ++i) - { - freevars.erase(gvars[i].second); - } - - const flwor_clause::rebind_list_t& ngvars = gc->get_nongrouping_vars(); - csize numNonGroupVars = ngvars.size(); - - for (csize i = 0; i < numNonGroupVars; ++i) - { - freevars.erase(ngvars[i].second); - } + if (result) + { + foldedExpr = rCtx.theEM-> + create_const_expr(node->get_sctx(), node->get_udf(), LOC(node), result); } - else if (c->get_kind() == flwor_clause::count_clause) + else { - const count_clause* cc = static_cast(c); - - freevars.erase(cc->get_var()); + foldedExpr = rCtx.theEM-> + create_seq(node->get_sctx(), node->get_udf(), LOC(node)); } + + modified = true; + return foldedExpr; } } - } - return NULL; -} + break; + } + } + ExprIterator iter(node); -static void remove_wincond_vars( - const flwor_wincond* cond, - expr::FreeVars& freevars) -{ - const flwor_wincond::vars& inVars = cond->get_in_vars(); - const flwor_wincond::vars& outVars = cond->get_out_vars(); + while (!iter.done()) + { + expr* new_e = apply(rCtx, **iter, modified); + if (new_e != NULL) + { + **iter = new_e; + } + + iter.next(); + } - freevars.erase(inVars.posvar); - freevars.erase(inVars.curr); - freevars.erase(inVars.prev); - freevars.erase(inVars.next); - - freevars.erase(outVars.posvar); - freevars.erase(outVars.curr); - freevars.erase(outVars.prev); - freevars.erase(outVars.next); + return NULL; } /******************************************************************************* - Execute const exprs that return at most one item as a result. Replace such - exprs by either a const_expr whose value is the returned item, or an empty - fn:concatenate expr, if no item is returned by the evaluation of the const - expr. -********************************************************************************/ -RULE_REWRITE_PRE(FoldConst) +********************************************************************************/ +static bool execute( + CompilerCB* compilercb, + expr* node, + store::Item_t& result) { - xqtref_t rtype = node->get_return_type(); + ulong nextVarId = 1; + PlanIter_t plan = codegen("const-folded expr", node, compilercb, nextVarId); - if (standalone_expr(node) && - ! already_folded(node, rCtx) && - node->getFreeVars().empty() && - ! node->isUnfoldable() && - rtype->max_card() <= 1) - { - vector result; - expr* folded = execute(rCtx.getCompilerCB(), node, result); - if (folded == NULL) - { - ZORBA_ASSERT (result.size () <= 1); - folded = (result.size () == 1 ? - ((expr*) (rCtx.theEM->create_const_expr(node->get_sctx(), LOC(node), result[0]))) : - ((expr*) (rCtx.theEM->create_seq(node->get_sctx(), LOC(node))))); - } - return folded; - } - return NULL; -} + QueryLoc loc = LOC (node); + store::Item_t item; -RULE_REWRITE_POST(FoldConst) -{ - return NULL; -} + CompilerCB expr_ccb(*compilercb); + expr_ccb.theRootSctx = node->get_sctx(); + try + { + //std::cout << "Const folding expr : " << std::endl; + //node->put(std::cout); + //std::cout << std::endl; -static bool standalone_expr(expr* e) -{ - expr_kind_t k = e->get_expr_kind (); - return k != match_expr_kind && k != axis_step_expr_kind; -} + PlanWrapperHolder pw(new PlanWrapper(plan, + &expr_ccb, + 0, // dynamic ctx + NULL, // xquery + 0, // stack depth + expr_ccb.theHaveTimeout, + expr_ccb.theTimeout)); + if (pw->next(item)) + { + if (item->isError()) + { + node->setUnfoldable(ANNOTATION_TRUE_FIXED); + node->setNonDiscardable(ANNOTATION_TRUE_FIXED); + return false; + } + result.transfer(item); + + ZORBA_ASSERT(!pw->next(item)); + } + else + { + result = NULL; + } -static bool already_folded(expr* e, RewriterContext& rCtx) -{ - if (e->get_expr_kind () == const_expr_kind) return true; - if (e->get_expr_kind () != fo_expr_kind) + } + catch (ZorbaException const&) + { + node->setUnfoldable(ANNOTATION_TRUE_FIXED); + node->setNonDiscardable(ANNOTATION_TRUE_FIXED); return false; - const fo_expr* fo = dynamic_cast(e); - - return (fo->get_func()->getKind() == FunctionConsts::OP_CONCATENATE_N && - fo->num_args() == 0); + // TODO: + // we had to disable folding of errors because the FnErrorIterator + // was erroneously used. It always raises a ZorbaUserError (which is not correct). +#if 0 + Error lErrorCode = e.theErrorCode; + QueryLoc loc; + loc.setLineBegin(e.theQueryLine); + loc.setColumnBegin(e.theQueryColumn); + store::Item_t qname; + ITEM_FACTORY->createQName(qname, + "http://www.w3.org/2005/xqt-errors", + "err", + error::ZorbaError::toString(lErrorCode).c_str()); + expr* err_expr = rCtx.theEM-> + create_fo_expr(node->get_sctx_id(), + loc, + BUILTIN_FUNC(FN_ERROR_2), + rCtx.theEM->create_const_expr(node->get_sctx(), loc, qname), + rCtx.theEM->create_const_expr(node->get_sctx(), loc, e.theDescription)); + err_expr->setUnfoldable(ANNOTATION_TRUE_FIXED); + err_expr->setNonDiscardable(ANNOTATION_TRUE_FIXED); + return err_expr; +#endif + } } @@ -621,11 +572,18 @@ RULE_REWRITE_PRE(PartialEval) { TypeManager* tm = node->get_type_manager(); + static_context* sctx = node->get_sctx(); - // if node is a castable or instance-of expr - const castable_base_expr* cbe = NULL; - if ((cbe = dynamic_cast(node)) != NULL) + switch (node->get_expr_kind()) + { + case instanceof_expr_kind: + case castable_expr_kind: { + const castable_base_expr* cbe = static_cast(node); + + user_function* udf = node->get_udf(); + assert(udf == rCtx.theUDF); + expr* arg = cbe->get_input(); if (arg->isNonDiscardable()) @@ -634,39 +592,51 @@ xqtref_t argType = arg->get_return_type(); xqtref_t targetType = cbe->get_target_type(); - if (TypeOps::is_subtype(tm, *argType, *targetType, node->get_loc())) + try { - return rCtx.theEM->create_const_expr(node->get_sctx(), LOC(node), true); - } - else if (node->get_expr_kind() == instanceof_expr_kind) - { - instanceof_expr* ioExpr = static_cast(node); - - if (ioExpr->getCheckPrimeOnly()) + if (TypeOps::is_subtype(tm, *argType, *targetType, node->get_loc())) { - argType = TypeOps::prime_type(tm, *argType); - targetType = TypeOps::prime_type(tm, *targetType); + return rCtx.theEM->create_const_expr(sctx, udf, LOC(node), true); } + else if (node->get_expr_kind() == instanceof_expr_kind) + { + instanceof_expr* ioExpr = static_cast(node); - return (TypeOps::intersect_type(*argType, *targetType, tm) == - GENV_TYPESYSTEM.NONE_TYPE ? - rCtx.theEM->create_const_expr(node->get_sctx(), LOC(node), false) : - NULL); + if (ioExpr->getCheckPrimeOnly()) + { + argType = TypeOps::prime_type(tm, *argType); + targetType = TypeOps::prime_type(tm, *targetType); + } + + return (TypeOps::intersect_type(*argType, *targetType, tm) == + GENV_TYPESYSTEM.NONE_TYPE ? + rCtx.theEM->create_const_expr(sctx, udf, LOC(node), false) : + NULL); + } + else + { + return NULL; + } } - else + catch (XQueryException& e) { - return NULL; + if (e.diagnostic() == err::XPTY0004) + return NULL; + + throw; } - } - switch (node->get_expr_kind()) - { + break; + } case if_expr_kind: { - if_expr* ite = dynamic_cast (node); - const const_expr* cond = dynamic_cast(ite->get_cond_expr()); - if (cond != NULL) + if_expr* ite = static_cast (node); + expr* condExpr = ite->get_cond_expr(); + + if (condExpr->get_expr_kind() == const_expr_kind) { + const const_expr* cond = static_cast(condExpr); + return (cond->get_val()->getBooleanValue() ? ite->get_then_expr() : ite->get_else_expr()); @@ -676,7 +646,7 @@ case fo_expr_kind: { - return partial_eval_fo(rCtx, dynamic_cast(node)); + return partial_eval_fo(rCtx, static_cast(node)); } default: @@ -686,6 +656,7 @@ return NULL; } + RULE_REWRITE_POST(PartialEval) { return NULL; @@ -696,6 +667,10 @@ { TypeManager* tm = fo->get_type_manager(); + static_context* sctx = fo->get_sctx(); + user_function* udf = fo->get_udf(); + assert(udf == rCtx.theUDF); + const function* f = fo->get_func(); FunctionConsts::FunctionKind fkind = f->getKind(); @@ -726,32 +701,31 @@ if (fkind == FunctionConsts::FN_COUNT_1 && type_cnt != -1) { - return rCtx.theEM->create_const_expr(fo->get_sctx(), - fo->get_loc(), - xs_integer(type_cnt)); + return rCtx.theEM-> + create_const_expr(sctx, udf, fo->get_loc(), xs_integer(type_cnt)); } else if (fkind == FunctionConsts::FN_EMPTY_1) { if (type_cnt == 0) { - return rCtx.theEM->create_const_expr(fo->get_sctx(), fo->get_loc(), true); + return rCtx.theEM->create_const_expr(sctx, udf, fo->get_loc(), true); } else if (argQuant == TypeConstants::QUANT_ONE || argQuant == TypeConstants::QUANT_PLUS) { - return rCtx.theEM->create_const_expr(fo->get_sctx(), fo->get_loc(), false); + return rCtx.theEM->create_const_expr(sctx, udf, fo->get_loc(), false); } } else if (fkind == FunctionConsts::FN_EXISTS_1) { if (type_cnt == 0) { - return rCtx.theEM->create_const_expr(fo->get_sctx(), fo->get_loc(), false); + return rCtx.theEM->create_const_expr(sctx, udf, fo->get_loc(), false); } else if (argQuant == TypeConstants::QUANT_ONE || argQuant == TypeConstants::QUANT_PLUS) { - return rCtx.theEM->create_const_expr(fo->get_sctx(), fo->get_loc(), true); + return rCtx.theEM->create_const_expr(sctx, udf, fo->get_loc(), true); } } } @@ -760,8 +734,8 @@ { bool modified = false; expr* newArg = partial_eval_return_clause(static_cast(arg), - modified, - rCtx); + modified, + rCtx); if (newArg != arg) fo->set_arg(0, newArg); @@ -783,7 +757,7 @@ *GENV_TYPESYSTEM.ANY_NODE_TYPE_PLUS, arg->get_loc())) { - return rCtx.theEM->create_const_expr(fo->get_sctx(), fo->get_loc(), true); + return rCtx.theEM->create_const_expr(sctx, udf, fo->get_loc(), true); } } } @@ -801,22 +775,31 @@ bool shortcircuit_val, RewriterContext& rCtx) { + RootTypeManager& rtm = GENV_TYPESYSTEM; TypeManager* tm = fo->get_type_manager(); + static_context* sctx = fo->get_sctx(); + user_function* udf = fo->get_udf(); + + assert(udf == rCtx.theUDF); long nonConst1 = -1; long nonConst2 = -1; - ulong numArgs = fo->num_args(); + csize numArgs = fo->num_args(); - for (ulong i = 0; i < numArgs; ++i) + for (csize i = 0; i < numArgs; ++i) { const expr* arg = fo->get_arg(i); - const const_expr* constArg = NULL; - if ((constArg = dynamic_cast(arg)) != NULL) + if (arg->get_expr_kind() == const_expr_kind) { + const const_expr* constArg = static_cast(arg); + if (constArg->get_val()->getEBV() == shortcircuit_val) - return rCtx.theEM->create_const_expr(fo->get_sctx(), LOC(fo), (xs_boolean)shortcircuit_val); + { + return rCtx.theEM-> + create_const_expr(sctx, udf, LOC(fo), (xs_boolean)shortcircuit_val); + } } else { @@ -835,7 +818,7 @@ if (nonConst1 < 0) { // All args are constant exprs - return rCtx.theEM->create_const_expr(fo->get_sctx(), LOC(fo), (xs_boolean) ! shortcircuit_val); + return rCtx.theEM->create_const_expr(sctx, udf, LOC(fo), (xs_boolean)!shortcircuit_val); } if (nonConst2 < 0) @@ -847,13 +830,16 @@ if (! TypeOps::is_subtype(tm, *arg->get_return_type(), - *GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE, + *rtm.BOOLEAN_TYPE_ONE, arg->get_loc())) { - arg = expr_tools::fix_annotations(rCtx.theEM->create_fo_expr(fo->get_sctx(), - LOC(fo), - GET_BUILTIN_FUNCTION(FN_BOOLEAN_1), - arg)); + arg = rCtx.theEM->create_fo_expr(sctx, + udf, + LOC(fo), + BUILTIN_FUNC(FN_BOOLEAN_1), + arg); + + arg = expr_tools::fix_annotations(arg); } return arg; @@ -877,12 +863,22 @@ fo_expr* count_expr = NULL; const_expr* val_expr = NULL; + static_context* sctx = fo.get_sctx(); + user_function* udf = fo.get_udf(); + + assert(udf == rCtx.theUDF); + for (i = 0; i < 2; i++) { - if (NULL != (val_expr = dynamic_cast(fo.get_arg(i))) && - NULL != (count_expr = dynamic_cast(fo.get_arg(1-i))) && - count_expr->get_func()->getKind() == FunctionConsts::FN_COUNT_1) - break; + if (fo.get_arg(i)->get_expr_kind() == const_expr_kind && + fo.get_arg(1-i)->get_expr_kind() == fo_expr_kind) + { + val_expr = static_cast(fo.get_arg(i)); + count_expr = static_cast(fo.get_arg(1-i)); + + if (count_expr->get_func()->getKind() == FunctionConsts::FN_COUNT_1) + break; + } } if (i == 2) @@ -898,7 +894,7 @@ *tm->create_named_type(val->getType(), TypeConstants::QUANT_ONE, fo.get_loc(), - err::XPTY0004), + true), *rtm.INTEGER_TYPE_ONE, fo.get_loc())) { @@ -907,41 +903,46 @@ if (ival < 0) { if (!count_expr->isNonDiscardable()) - return rCtx.theEM->create_const_expr(val_expr->get_sctx(), LOC(val_expr), false); + return rCtx.theEM->create_const_expr(sctx, udf, LOC(val_expr), false); } else if (ival == 0) { - return expr_tools::fix_annotations( - rCtx.theEM->create_fo_expr(fo.get_sctx(), fo.get_loc(), - GET_BUILTIN_FUNCTION(FN_EMPTY_1), - count_expr->get_arg(0))); + return expr_tools::fix_annotations(rCtx.theEM-> + create_fo_expr(sctx, + udf, + fo.get_loc(), + BUILTIN_FUNC(FN_EMPTY_1), + count_expr->get_arg(0))); } else if (ival == 1) { - return expr_tools::fix_annotations( - rCtx.theEM->create_fo_expr(fo.get_sctx(), - fo.get_loc(), - GET_BUILTIN_FUNCTION(OP_EXACTLY_ONE_NORAISE_1), - count_expr->get_arg(0))); + return expr_tools::fix_annotations(rCtx.theEM-> + create_fo_expr(sctx, + udf, + fo.get_loc(), + BUILTIN_FUNC(OP_EXACTLY_ONE_NORAISE_1), + count_expr->get_arg(0))); } else { std::vector args(3); args[0] = count_expr->get_arg(0); args[1] = val_expr; - args[2] = rCtx.theEM->create_const_expr(val_expr->get_sctx(), LOC(val_expr), xs_integer(2)); + args[2] = rCtx.theEM->create_const_expr(sctx, udf, LOC(val_expr), xs_integer(2)); - expr* subseq_expr = expr_tools::fix_annotations( - rCtx.theEM->create_fo_expr(count_expr->get_sctx(), - LOC(count_expr), - GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_3), - args)); - - return expr_tools::fix_annotations( - rCtx.theEM->create_fo_expr(fo.get_sctx(), - fo.get_loc(), - GET_BUILTIN_FUNCTION(OP_EXACTLY_ONE_NORAISE_1), - subseq_expr)); + expr* subseq_expr = expr_tools::fix_annotations(rCtx.theEM-> + create_fo_expr(sctx, + udf, + LOC(count_expr), + BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_3), + args)); + + return expr_tools::fix_annotations(rCtx.theEM-> + create_fo_expr(sctx, + udf, + fo.get_loc(), + BUILTIN_FUNC(OP_EXACTLY_ONE_NORAISE_1), + subseq_expr)); } } @@ -952,12 +953,19 @@ /******************************************************************************* ********************************************************************************/ -static expr* partial_eval_return_clause(flwor_expr* flworExpr, - bool& modified, - RewriterContext& rCtx) +static expr* partial_eval_return_clause( + flwor_expr* flworExpr, + bool& modified, + RewriterContext& rCtx) { expr* returnExpr = flworExpr->get_return_expr(); + const QueryLoc& loc = returnExpr->get_loc(); + static_context* sctx = returnExpr->get_sctx(); + user_function* udf = returnExpr->get_udf(); + + assert(udf == rCtx.theUDF); + if (returnExpr->get_expr_kind() == const_expr_kind || (!returnExpr->isNonDiscardable() && returnExpr->get_return_type()->card() == 1)) @@ -970,21 +978,20 @@ if (c->get_kind() == flwor_clause::for_clause) { - return c->get_expr(); + return static_cast(c)->get_expr(); } else { assert(c->get_kind() == flwor_clause::let_clause); - return rCtx.theEM->create_const_expr(returnExpr->get_sctx(), returnExpr->get_loc(), 1); + return rCtx.theEM->create_const_expr(sctx, udf, loc, 1); } } else if (returnExpr->get_expr_kind() != const_expr_kind) { modified = true; - expr* newRet = - rCtx.theEM->create_const_expr(returnExpr->get_sctx(), returnExpr->get_loc(), 1); + expr* newRet = rCtx.theEM->create_const_expr(sctx, udf, loc, 1); flworExpr->set_return_expr(newRet); @@ -1019,59 +1026,48 @@ RULE_REWRITE_POST(InlineFunctions) { - if (node->get_expr_kind () == fo_expr_kind) + if (node->get_expr_kind() == fo_expr_kind) { const fo_expr* fo = static_cast (node); - const user_function* udf = dynamic_cast(fo->get_func()); - expr* body = NULL; - - if (NULL != udf && - //!udf->isSequential() && - (NULL != (body = udf->getBody())) && - !udf->isExiting() && - udf->isLeaf()) + if (fo->get_func()->isUdf()) { - const std::vector& udfArgs = udf->getArgVars(); + assert(fo->get_udf() == rCtx.theUDF); - expr::substitution_t subst; + const user_function* udf = static_cast(fo->get_func()); + expr* body = udf->getBody(); - for (ulong i = 0; i < udfArgs.size(); ++i) + if (//!udf->isSequential() && + body != NULL && + !udf->isExiting() && + udf->isLeaf()) { - var_expr* p = udfArgs[i]; - subst[p] = fo->get_arg(i); + const std::vector& udfArgs = udf->getArgVars(); - if (fo->get_arg(i)->is_sequential()) - return NULL; - } + expr::substitution_t subst; - try - { - expr* body = udf->getBody(); - body = body->clone(subst); - body->clear_annotations(); - if (rCtx.getCompilerCB()->theConfig.opt_level <= CompilerCB::config::O1) + for (csize i = 0; i < udfArgs.size(); ++i) { - function_trace_expr* dummy = rCtx.theEM->create_function_trace_expr(body); - dummy->setFunctionName(udf->getName()); - dummy->setFunctionArity((unsigned int)udf->getArgVars().size()); - dummy->setFunctionCallLocation(node->get_loc()); - dummy->setFunctionLocation(udf->getLoc()); - return dummy; - } - else - { - return body; + var_expr* p = udfArgs[i]; + subst[p] = fo->get_arg(i); + + if (fo->get_arg(i)->is_sequential()) + return NULL; } - } - catch (...) - { - // TODO: this is caught here, because clone is not implemented for all expressions - throw XQUERY_EXCEPTION( - zerr::ZXQP0003_INTERNAL_ERROR, - ERROR_PARAMS( ZED( CloneNotImplemented ) ), - ERROR_LOC( udf->getLoc() ) - ); + + body = body->clone(fo->get_udf(), subst); + + body->clear_annotations(); + + function_trace_expr* dummy = rCtx.theEM-> + create_function_trace_expr(fo->get_udf(), body); + + dummy->setFunctionName(udf->getName()); + dummy->setFunctionArity((unsigned int)udf->getArgVars().size()); + dummy->setFunctionCallLocation(node->get_loc()); + dummy->setFunctionLocation(udf->getLoc()); + + return dummy; } } } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/hoist_rules.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/hoist_rules.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/hoist_rules.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/hoist_rules.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -353,11 +353,17 @@ const ExprVarsMap& freevarMap, struct PathHolder* path) { - if (non_hoistable(e) || e->contains_node_construction()) + if (non_hoistable(e) || e->constructsNodes()) { return NULL; } + const QueryLoc& loc = e->get_loc(); + static_context* sctx = e->get_sctx(); + user_function* udf = e->get_udf(); + + assert(udf == rCtx.theUDF); + std::map::const_iterator fvme = freevarMap.find(e); ZORBA_ASSERT(fvme != freevarMap.end()); const DynamicBitset& varset = fvme->second; @@ -384,7 +390,7 @@ const catch_clause* clause = (*trycatch)[i]; catch_clause::var_map_t& trycatchVars = - const_cast(clause)->get_vars(); + const_cast(clause)->get_vars(); catch_clause::var_map_t::const_iterator ite = trycatchVars.begin(); catch_clause::var_map_t::const_iterator end = trycatchVars.end(); @@ -434,8 +440,8 @@ // cannot be hoisted. for (i = step->clauseCount - 1; i >= 0; --i) { - const forletwin_clause* flc = - static_cast(flwor->get_clause(i)); + const forlet_clause* flc = + static_cast(flwor->get_clause(i)); if (flc->get_expr()->is_sequential()) { @@ -473,18 +479,15 @@ // var: $$temp := op:hoist(e) (b) we place the $$temp declaration right after // variable V, and (c) we replace e with op:unhoist($$temp). - var_expr* letvar(rCtx.createTempVar(e->get_sctx(), e->get_loc(), var_expr::let_var)); + var_expr* letvar(rCtx.createTempVar(sctx, loc, var_expr::let_var)); - expr* hoisted = rCtx.theEM->create_fo_expr(e->get_sctx(), - e->get_loc(), - GET_BUILTIN_FUNCTION(OP_HOIST_1), - e); + expr* hoisted = rCtx.theEM-> + create_fo_expr(sctx, udf, loc, BUILTIN_FUNC(OP_HOIST_1), e); - hoisted->setFlags(e->getFlags()); - letvar->setFlags(e->getFlags()); + hoisted->setAnnotationFlags(e->getAnnotationFlags()); + //letvar->setFlags(e->getFlags()); - let_clause* flref( - rCtx.theEM->create_let_clause(e->get_sctx(), e->get_loc(), letvar, hoisted)); + let_clause* flref(rCtx.theEM->create_let_clause(sctx, loc, letvar, hoisted)); letvar->set_flwor_clause(flref); @@ -492,7 +495,7 @@ { if (step->theExpr == NULL) { - step->theExpr= rCtx.theEM->create_flwor_expr(e->get_sctx(), e->get_loc(), false); + step->theExpr= rCtx.theEM->create_flwor_expr(sctx, udf, loc, false); } static_cast(step->theExpr)->add_clause(flref); } @@ -507,20 +510,20 @@ trycatch_expr* trycatchExpr = static_cast(step->theExpr); - flwor_expr* flwor = rCtx.theEM->create_flwor_expr(e->get_sctx(), e->get_loc(), false); + flwor_expr* flwor = rCtx.theEM->create_flwor_expr(sctx, udf, loc, false); flwor->add_clause(flref); flwor->set_return_expr(trycatchExpr->get_try_expr()); trycatchExpr->set_try_expr(flwor); } - expr* unhoisted = rCtx.theEM->create_fo_expr(e->get_sctx(), - e->get_loc(), - GET_BUILTIN_FUNCTION(OP_UNHOIST_1), - rCtx.theEM->create_wrapper_expr(e->get_sctx(), - e->get_loc(), - letvar)); - unhoisted->setFlags(e->getFlags()); + expr* unhoisted = rCtx.theEM-> + create_fo_expr(sctx, + udf, + loc, + BUILTIN_FUNC(OP_UNHOIST_1), + rCtx.theEM->create_wrapper_expr(sctx, udf, loc, letvar)); + unhoisted->setAnnotationFlags(e->getAnnotationFlags()); return unhoisted; } @@ -561,7 +564,7 @@ k == axis_step_expr_kind || k == match_expr_kind || (k == wrapper_expr_kind && - non_hoistable(static_cast(e)->get_expr())) || + non_hoistable(static_cast(e)->get_input())) || is_already_hoisted(e) || is_enclosed_expr(e) || e->containsRecursiveCall() || diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/index_join_rule.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/index_join_rule.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/index_join_rule.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/index_join_rule.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -131,9 +131,11 @@ if (modified) { - expr* trueExpr = rCtx.theEM->create_const_expr(flworExpr->get_sctx(), - flworExpr->get_loc(), - true); + expr* trueExpr = rCtx.theEM-> + create_const_expr(flworExpr->get_sctx(), + flworExpr->get_udf(), + flworExpr->get_loc(), + true); (**iter) = trueExpr; expr* e = rCtx.theFlworStack.back(); @@ -284,7 +286,7 @@ return false; // The expr that defines the inner var must not depend on the outer var. - expr* innerDomainExpr = predInfo.theInnerVar->get_for_clause()->get_expr(); + expr* innerDomainExpr = predInfo.theInnerVar->get_forlet_clause()->get_expr(); if (checkVarDependency(rCtx, innerDomainExpr, outerVarId)) return false; @@ -307,7 +309,7 @@ { // Normally, other rewrite rules should have added the necessary casting // to the eq operands so that their static types have quantifiers ONE - // or QUESTION and the associated prime types are not xs:untypedAtomic. + // or QUESTION and the associated prime types are not xs:anyAtomicType. // But just in case those rules have been disabled, we check again here // and reject the hashjoin rewrite if these condition are violated. @@ -321,10 +323,11 @@ // The type of the outer/inner operands in the join predicate must not be // xs:untypedAtomic or xs:anyAtomic. + /* if (TypeOps::is_equal(tm, *primeOuterType, *rtm.UNTYPED_ATOMIC_TYPE_ONE, outerLoc) || TypeOps::is_equal(tm, *primeInnerType, *rtm.UNTYPED_ATOMIC_TYPE_ONE, innerLoc)) return false; - + */ if (TypeOps::is_equal(tm, *primeOuterType, *rtm.ANY_ATOMIC_TYPE_ONE, outerLoc) || TypeOps::is_equal(tm, *primeInnerType, *rtm.ANY_ATOMIC_TYPE_ONE, innerLoc)) return false; @@ -428,8 +431,8 @@ std::vector varidSet; bitset.getSet(varidSet); - ulong numVars = (ulong)varidSet.size(); - for (ulong i = 0; i < numVars; ++i) + csize numVars = varidSet.size(); + for (csize i = 0; i < numVars; ++i) { const var_expr* var = (*rCtx.theIdVarMap)[varidSet[i]]; curExpr = var->get_forletwin_clause()->get_expr(); @@ -454,8 +457,10 @@ const QueryLoc& loc = predInfo.thePredicate->get_loc(); static_context* sctx = predInfo.thePredicate->get_sctx(); + user_function* udf = predInfo.thePredicate->get_udf(); + for_clause* fc = predInfo.theInnerVar->get_forlet_clause(); - for_clause* fc = predInfo.theInnerVar->get_for_clause(); + assert(udf == rCtx.theUDF); long maxInnerVarId = -1; @@ -466,7 +471,7 @@ // fc->get_expr should not be modified, because we may discover later that the // rewrite is not possible after all, expr::substitution_t subst; - expr* domainExpr = fc->get_expr()->clone(subst); + expr* domainExpr = fc->get_expr()->clone(udf, subst); if (!expandVars(rCtx, domainExpr, predInfo.theOuterVarId, maxInnerVarId)) return; @@ -480,14 +485,16 @@ store::Item_t qname; GENV_ITEMFACTORY->createQName(qname, "", "", os.str().c_str()); - expr* qnameExpr(rCtx.theEM->create_const_expr(sctx, loc, qname)); + expr* qnameExpr(rCtx.theEM->create_const_expr(sctx, udf, loc, qname)); expr* buildExpr = NULL; - fo_expr* createExpr = rCtx.theEM->create_fo_expr(sctx, - loc, - GET_BUILTIN_FUNCTION(OP_CREATE_INTERNAL_INDEX_2), - qnameExpr, - buildExpr); + fo_expr* createExpr = rCtx.theEM-> + create_fo_expr(sctx, + udf, + loc, + BUILTIN_FUNC(OP_CREATE_INTERNAL_INDEX_2), + qnameExpr, + buildExpr); // // Find where to place the create-index expr @@ -527,7 +534,8 @@ const QueryLoc& nestedLoc = mostInnerVarClause->get_loc(); - flwor_expr* nestedFlwor = rCtx.theEM->create_flwor_expr(sctx, nestedLoc, false); + flwor_expr* nestedFlwor = rCtx.theEM-> + create_flwor_expr(sctx, udf, nestedLoc, false); for (csize i = mostInnerVarPos+1; i < numClauses; ++i) { @@ -545,7 +553,8 @@ args[0] = createExpr; args[1] = nestedFlwor; - block_expr* seqExpr = rCtx.theEM->create_block_expr(sctx, loc, false, args, NULL); + block_expr* seqExpr = rCtx.theEM-> + create_block_expr(sctx, udf, loc, false, args, NULL); innerFlwor->set_return_expr(seqExpr); @@ -582,7 +591,8 @@ args[0] = createExpr; args[1] = returnExpr; - block_expr* seqExpr = rCtx.theEM->create_block_expr(sctx, loc, false, args, NULL); + block_expr* seqExpr = rCtx.theEM-> + create_block_expr(sctx, udf, loc, false, args, NULL); innerFlwor->set_return_expr(seqExpr); } @@ -609,7 +619,8 @@ args[0] = createExpr; args[1] = outerFlworExpr; - block_expr* seqExpr = rCtx.theEM->create_block_expr(sctx, loc, false, args, NULL); + block_expr* seqExpr = rCtx.theEM-> + create_block_expr(sctx, udf, loc, false, args, NULL); rCtx.theFlworStack[outerPosInStack] = seqExpr; } @@ -623,27 +634,30 @@ if (predInfo.theIsGeneral) { - probeExpr = - rCtx.theEM->create_fo_expr(sctx, - loc, - GET_BUILTIN_FUNCTION(FN_ZORBA_XQDDF_PROBE_INDEX_POINT_GENERAL_N), - qnameExpr, - const_cast(predInfo.theOuterOp)); - - probeExpr = - rCtx.theEM->create_fo_expr(sctx, - loc, - GET_BUILTIN_FUNCTION(OP_SORT_DISTINCT_NODES_ASC_1), - probeExpr); + probeExpr = rCtx.theEM-> + create_fo_expr(sctx, + udf, + loc, + BUILTIN_FUNC(FN_ZORBA_XQDDF_PROBE_INDEX_POINT_GENERAL_N), + qnameExpr, + const_cast(predInfo.theOuterOp)); + + probeExpr = rCtx.theEM-> + create_fo_expr(sctx, + udf, + loc, + BUILTIN_FUNC(OP_SORT_DISTINCT_NODES_ASC_1), + probeExpr); } else { - probeExpr = - rCtx.theEM->create_fo_expr(sctx, - loc, - GET_BUILTIN_FUNCTION(FN_ZORBA_XQDDF_PROBE_INDEX_POINT_VALUE_N), - qnameExpr, - const_cast(predInfo.theOuterOp)); + probeExpr = rCtx.theEM-> + create_fo_expr(sctx, + udf, + loc, + BUILTIN_FUNC(FN_ZORBA_XQDDF_PROBE_INDEX_POINT_VALUE_N), + qnameExpr, + const_cast(predInfo.theOuterOp)); } fc->set_expr(probeExpr); @@ -723,9 +737,9 @@ { wrapper_expr* wrapper = reinterpret_cast(subExpr); - if (wrapper->get_expr()->get_expr_kind() == var_expr_kind) + if (wrapper->get_input()->get_expr_kind() == var_expr_kind) { - var_expr* var = reinterpret_cast(wrapper->get_expr()); + var_expr* var = reinterpret_cast(wrapper->get_input()); long varid = -1; if (rCtx.theVarIdMap->find(var) != rCtx.theVarIdMap->end()) @@ -743,7 +757,7 @@ { if (var->get_kind() == var_expr::let_var) { - wrapper->set_expr(var->get_forletwin_clause()->get_expr()); + wrapper->set_expr(var->get_forlet_clause()->get_expr()); return expandVars(rCtx, wrapper, outerVarId, maxVarId); } @@ -754,7 +768,7 @@ #else // TODO: to expand a FOR var, we must make sure that the expr is a // map w.r.t. that var. - wrapper->set_expr(var->get_forletwin_clause()->get_expr()); + wrapper->set_expr(var->get_forlet_clause()->get_expr()); return expandVars(rCtx, wrapper, outerVarId, maxVarId); #endif @@ -810,9 +824,9 @@ if (rCtx.theFlworStack[i]->get_expr_kind() == trycatch_expr_kind) return false; - flworExpr = dynamic_cast(rCtx.theFlworStack[i]); + assert(rCtx.theFlworStack[i]->get_expr_kind() == flwor_expr_kind); - assert(flworExpr != NULL); + flworExpr = static_cast(rCtx.theFlworStack[i]); if (i < numFlwors - 1 && rCtx.theInReturnClause[i] == true && diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/nodeid_rules.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/nodeid_rules.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/nodeid_rules.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/nodeid_rules.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -122,7 +122,7 @@ order_expr* orderExpr = static_cast(node); - rCtx.theIsInOrderedMode = (orderExpr->get_type() == order_expr::ordered ? + rCtx.theIsInOrderedMode = (orderExpr->get_type() == doc_ordered ? true : false); break; } @@ -278,17 +278,17 @@ case wrapper_expr_kind : { - wrapper_expr* we = static_cast(node); - pushdown_ignores_sorted_nodes(node, we->get_expr()); - pushdown_ignores_duplicate_nodes(node, we->get_expr()); + wrapper_expr* e = static_cast(node); + pushdown_ignores_sorted_nodes(node, e->get_input()); + pushdown_ignores_duplicate_nodes(node, e->get_input()); break; } case function_trace_expr_kind : { - function_trace_expr* fte = static_cast(node); - pushdown_ignores_sorted_nodes(node, fte->get_expr()); - pushdown_ignores_duplicate_nodes(node, fte->get_expr()); + function_trace_expr* e = static_cast(node); + pushdown_ignores_sorted_nodes(node, e->get_input()); + pushdown_ignores_duplicate_nodes(node, e->get_input()); break; } @@ -302,6 +302,19 @@ case cast_expr_kind : case castable_expr_kind : + { + cast_or_castable_base_expr* curExpr = + static_cast(node); + + expr* arg = curExpr->get_input(); + xqtref_t targetType = curExpr->get_target_type(); + + set_ignores_sorted_nodes(arg, ANNOTATION_TRUE); + set_ignores_duplicate_nodes(arg, ANNOTATION_FALSE); + + break; + } + case instanceof_expr_kind : { cast_or_castable_base_expr* curExpr = @@ -527,10 +540,9 @@ ********************************************************************************/ RULE_REWRITE_PRE(EliminateNodeOps) { - fo_expr* fo = dynamic_cast(node); - - if (fo != NULL) + if (node->get_expr_kind() == fo_expr_kind) { + fo_expr* fo = static_cast(node); const function* f = fo->get_func(); // ???? @@ -585,7 +597,7 @@ try { - if (rCtx.theCCB->theConfig.for_serialization_only) + if (rCtx.theForSerializationOnly) { // Serialization may or may not be a "safe" op. static_context* sctx = node->get_sctx(); @@ -604,15 +616,14 @@ // out of input nodes and (b) may propagate the extracted nodes to the // query result will be considered as unsafe and thus require that // their input trees are standalone. - markInUnsafeContext(node); + findSourcesForNodeExtractors(node); } } else { // In this case serialization is always unsafe. std::vector sources; - UDFCallChain dummyUdfCaller; - theSourceFinder->findNodeSources(rCtx.theRoot, &dummyUdfCaller, sources); + theSourceFinder->findNodeSources(rCtx.theRoot, sources); markSources(sources); } } @@ -621,13 +632,11 @@ // We have to assume that the result of the "node" expr will be used in an // unsafe op, so it must consist of standalone trees. std::vector sources; - UDFCallChain dummyUdfCaller; - theSourceFinder->findNodeSources(rCtx.theRoot, &dummyUdfCaller, sources); + theSourceFinder->findNodeSources(rCtx.theRoot, sources); markSources(sources); } - UDFCallChain dummyUdfCaller; - applyInternal(rCtx, node, dummyUdfCaller); + applyInternal(node, false); } catch (...) { @@ -645,13 +654,13 @@ /******************************************************************************* - + If "node" is inside a UDF body, then "udfCaller" is the fo expr that invokes + that UDF. ********************************************************************************/ -void MarkNodeCopyProps::applyInternal( - RewriterContext& rCtx, - expr* node, - UDFCallChain& udfCaller) +void MarkNodeCopyProps::applyInternal(expr* node, bool deferred) { + static_context* sctx = node->get_sctx(); + switch (node->get_expr_kind()) { case const_expr_kind: @@ -666,6 +675,13 @@ case text_expr_kind: case pi_expr_kind: { + // If a doc or element constructor needs to copy (and the ns mode is preserve + // and inherit), should it be considered unsafe? The answer is no, because if + // copy is needed, then any other construction done during the "current" one + // will need to copy as well, so the input trees to the current constructor + // will be standalone. This is enforced bhy the findNodeSources() method, + // which drills down inside constructors and will collect as sources any + // nested c onstructors as well. break; } @@ -676,15 +692,13 @@ // TODO improve this json_direct_object_expr* e = static_cast(node); - static_context* sctx = e->get_sctx(); - if (sctx->preserve_ns() && sctx->inherit_ns()) { csize numPairs = e->num_pairs(); for (csize i = 0; i < numPairs; ++i) { std::vector sources; - theSourceFinder->findNodeSources(e->get_value_expr(i), &udfCaller, sources); + theSourceFinder->findNodeSources(e->get_value_expr(i), sources); markSources(sources); } } @@ -693,6 +707,9 @@ } case json_object_expr_kind: { + // The input to this expr is a sequence of other objects, which if they + // contain any nodes, those nodes are in standalone trees. So, copying + // these nodes when the objects are copied is ok. break; } case json_array_expr_kind: @@ -701,12 +718,10 @@ // TODO improve this json_array_expr* e = static_cast(node); - static_context* sctx = e->get_sctx(); - if (sctx->preserve_ns() && sctx->inherit_ns()) { std::vector sources; - theSourceFinder->findNodeSources(e->get_expr(), &udfCaller, sources); + theSourceFinder->findNodeSources(e->get_expr(), sources); markSources(sources); } @@ -718,50 +733,41 @@ { relpath_expr* e = static_cast(node); - if (e->inUnsafeContext()) - { - std::vector sources; - theSourceFinder->findNodeSources((*e)[0], &udfCaller, sources); - markSources(sources); - } - else + std::vector::const_iterator ite = e->begin(); + std::vector::const_iterator end = e->end(); + + for (++ite; ite != end; ++ite) { - std::vector::const_iterator ite = e->begin(); - std::vector::const_iterator end = e->end(); + axis_step_expr* axisExpr = static_cast((*ite)); + axis_kind_t axisKind = axisExpr->getAxis(); - for (++ite; ite != end; ++ite) + if (axisKind != axis_kind_child && + axisKind != axis_kind_descendant && + axisKind != axis_kind_descendant_or_self && + axisKind != axis_kind_self && + axisKind != axis_kind_attribute) { - axis_step_expr* axisExpr = static_cast((*ite)); - axis_kind_t axisKind = axisExpr->getAxis(); - - if (axisKind != axis_kind_child && - axisKind != axis_kind_descendant && - axisKind != axis_kind_descendant_or_self && - axisKind != axis_kind_self && - axisKind != axis_kind_attribute) + std::vector sources; + theSourceFinder->findNodeSources((*e)[0], sources); + markSources(sources); + break; + } + else + { + match_expr* matchExpr = axisExpr->getTest(); + + if (matchExpr->getTypeName() != NULL && + sctx->construction_mode() == StaticContextConsts::cons_strip) { std::vector sources; - theSourceFinder->findNodeSources((*e)[0], &udfCaller, sources); + theSourceFinder->findNodeSources((*e)[0], sources); markSources(sources); break; } - else - { - match_expr* matchExpr = axisExpr->getTest(); - - if (matchExpr->getTypeName() != NULL && - node->get_sctx()->construction_mode() == StaticContextConsts::cons_strip) - { - std::vector sources; - theSourceFinder->findNodeSources((*e)[0], &udfCaller, sources); - markSources(sources); - break; - } - } } } - applyInternal(rCtx, (*e)[0], udfCaller); + applyInternal((*e)[0], deferred); return; } @@ -774,32 +780,49 @@ if (f->isUdf() && static_cast(f)->getBody() != NULL) { user_function* udf = static_cast(f); + user_function* callerUdf = e->get_udf(); - UdfCalls::iterator ite = theProcessedUDFCalls.find(e); + bool recursive = (callerUdf ? callerUdf->isMutuallyRecursiveWith(udf) : false); - if (ite == theProcessedUDFCalls.end()) + if (recursive && !deferred) { - theProcessedUDFCalls.insert(e); - - UDFCallChain nextUdfCall(e, &udfCaller); - - applyInternal(rCtx, udf->getBody(), nextUdfCall); + callerUdf->addRecursiveCall(e); } else { + UdfSet::iterator ite = theProcessedUDFs.find(udf); + + if (ite == theProcessedUDFs.end()) + { + theProcessedUDFs.insert(udf); + + applyInternal(udf->getBody(), deferred); + + if (udf->isRecursive()) + { + std::vector::const_iterator ite = udf->getRecursiveCalls().begin(); + std::vector::const_iterator end = udf->getRecursiveCalls().end(); + for (; ite != end; ++ite) + { + applyInternal(*ite, true); + } + } + } + + // if an arg var of this udf has been marked as a source before, it + // means that that var is consumed in some unsafe operation, so we + // now have to find the sources of the arg expr and mark them. csize numArgs = e->num_args(); + for (csize i = 0; i < numArgs; ++i) { var_expr* argVar = udf->getArgVar(i); - // if an arg var of this udf has been marked as a source before, it - // means that that var is consumed in some "nodeid-sesitive" operation, - // so we now have to find the sources of the arg expr and mark them. if (theSourceFinder->theVarSourcesMap.find(argVar) != theSourceFinder->theVarSourcesMap.end()) { std::vector sources; - theSourceFinder->findNodeSources(e->get_arg(i), &udfCaller, sources); + theSourceFinder->findNodeSources(e->get_arg(i), sources); markSources(sources); } } @@ -813,10 +836,34 @@ if (f->mustCopyInputNodes(e, i)) { std::vector sources; - theSourceFinder->findNodeSources(e->get_arg(i), &udfCaller, sources); + theSourceFinder->findNodeSources(e->get_arg(i), sources); markSources(sources); } } + + FunctionConsts::FunctionKind fkind = f->getKind(); + + switch (fkind) + { + case FunctionConsts::FN_DATA_1: + case FunctionConsts::FN_NILLED_1: + { + if (sctx->construction_mode() == StaticContextConsts::cons_strip) + { + findSourcesForNodeExtractors(e->get_arg(0)); + } + break; + } + case FunctionConsts::FN_BASE_URI_1: + case FunctionConsts::FN_ROOT_1: + // TODO: node-before, node-after + { + findSourcesForNodeExtractors(e->get_arg(0)); + break; + } + default: + break; + } } break; @@ -843,11 +890,11 @@ case instanceof_expr_kind: case treat_expr_kind: { - if (node->get_sctx()->construction_mode() == StaticContextConsts::cons_strip) + if (sctx->construction_mode() == StaticContextConsts::cons_strip) { cast_or_castable_base_expr* e = static_cast(node); - markInUnsafeContext(e->get_input()); + findSourcesForNodeExtractors(e->get_input()); } break; @@ -857,7 +904,7 @@ { validate_expr* e = static_cast(node); std::vector sources; - theSourceFinder->findNodeSources(e->get_expr(), &udfCaller, sources); + theSourceFinder->findNodeSources(e->get_input(), sources); markSources(sources); break; } @@ -868,22 +915,34 @@ case replace_expr_kind: { update_expr_base* e = static_cast(node); + expr_kind_t kind = e->get_expr_kind(); - std::vector sources; - theSourceFinder->findNodeSources(e->getTargetExpr(), &udfCaller, sources); - markSources(sources); - - static_context* sctx = e->get_sctx(); + // The target node cannot be a shared node because the update would be seen + // by multiple trees. For updates that delete nodes (delete and replace), the + // whole tree must be standalone because we have to sum up the reference + // counts of all the nodes in the delete subtree and that won't work if the + // deleted subtree contains shared nodes. + if (kind == replace_expr_kind || kind == delete_expr_kind) + { + std::vector sources; + theSourceFinder->findNodeSources(e->getTargetExpr(), sources); + markSources(sources); + } + else + { + findSourcesForNodeExtractors(node); + } + // TODO: apply no-copy rule to insert and replace updates if (e->getSourceExpr() != NULL && - (e->get_expr_kind() == insert_expr_kind || - (e->get_expr_kind() == replace_expr_kind && + (kind == insert_expr_kind || + (kind == replace_expr_kind && static_cast(e)->getType() == store::UpdateConsts::NODE)) && sctx->inherit_ns() && sctx->preserve_ns()) { std::vector sources; - theSourceFinder->findNodeSources(e->getSourceExpr(), &udfCaller, sources); + theSourceFinder->findNodeSources(e->getSourceExpr(), sources); markSources(sources); } @@ -894,8 +953,6 @@ { transform_expr* e = static_cast(node); - static_context* sctx = e->get_sctx(); - if (sctx->preserve_ns() && sctx->inherit_ns()) { std::vector::const_iterator ite = e->begin(); @@ -904,7 +961,7 @@ for (; ite != end; ++ite) { std::vector sources; - theSourceFinder->findNodeSources((*ite)->getExpr(), &udfCaller, sources); + theSourceFinder->findNodeSources((*ite)->getExpr(), sources); markSources(sources); } } @@ -919,43 +976,8 @@ case flowctl_expr_kind: case exit_expr_kind: case exit_catcher_expr_kind: - { - break; - } - case block_expr_kind: { - block_expr* e = static_cast(node); - - if (e->is_sequential()) - { - csize numChildren = e->size(); - bool haveUpdates = false; - - for (csize i = numChildren; i > 0; --i) - { - expr* child = (*e)[i-1]; - - if (haveUpdates) - { - std::vector sources; - theSourceFinder->findNodeSources(child, &udfCaller, sources); - markSources(sources); - } - else - { - short scriptingKind = child->get_scripting_detail(); - - if (scriptingKind & APPLYING_EXPR || - scriptingKind & EXITING_EXPR || - scriptingKind & SEQUENTIAL_FUNC_EXPR) - { - haveUpdates = true; - } - } - } - } - break; } @@ -973,7 +995,7 @@ expr* arg = e->get_arg_expr(i); std::vector sources; - theSourceFinder->findNodeSources(arg, &udfCaller, sources); + theSourceFinder->findNodeSources(arg, sources); markSources(sources); } @@ -988,10 +1010,13 @@ #ifndef ZORBA_NO_FULL_TEXT case ft_expr_kind: { + // This expr prefrorms whole-tree tokenization. So, its input nodes + // must not be shared nodes. What if the input nodes are not shared? + // if ft_expr safe in that case ???? ftcontains_expr* e = static_cast(node); std::vector sources; - theSourceFinder->findNodeSources(e->get_range(), &udfCaller, sources); + theSourceFinder->findNodeSources(e->get_range(), sources); markSources(sources); break; @@ -1012,7 +1037,7 @@ FOR_EACH(std::vector, ite, args) { std::vector sources; - theSourceFinder->findNodeSources((*ite), &udfCaller, sources); + theSourceFinder->findNodeSources((*ite), sources); markSources(sources); } @@ -1025,9 +1050,7 @@ user_function* udf = static_cast(e->get_function()); - UDFCallChain dummyUdfCaller; - - applyInternal(rCtx, udf->getBody(), dummyUdfCaller); + applyInternal(udf->getBody(), deferred); return; } @@ -1044,7 +1067,7 @@ expr* child = (**iter); if (child != NULL) { - applyInternal(rCtx, child, udfCaller); + applyInternal(child, deferred); } iter.next(); } @@ -1088,20 +1111,21 @@ /******************************************************************************* - This method is called when an expr E1 satisfies a condition that may make a - sub-expr E2 of E1 be unsafe, even though E2 by itself is safe. - - This method marks as being in "unsafe context" any expr that may produce - nodes which may be propagated into the result of E1. + Some expressions are safe when applied to a non-shared node (even is that + node contains shared subtrees), but unsafe on shared nodes. Let E1 be such + an expr. Instead of considering E1 as an unsafe expr uncondiftionally, we + "transfer" its conditional unsafeness to each expr E2 such that E2 contributes + nodes into E1's input, and E2 extracts such nodes from other nodes (and as a + result, the nodes that E2 propagates to E1 may be shared nodes). ********************************************************************************/ -void MarkNodeCopyProps::markInUnsafeContext(expr* node) +void MarkNodeCopyProps::findSourcesForNodeExtractors(expr* node) { TypeManager* tm = node->get_type_manager(); RootTypeManager& rtm = GENV_TYPESYSTEM; xqtref_t retType = node->get_return_type(); - if (TypeOps::is_subtype(tm, *retType, *rtm.ANY_ATOMIC_TYPE_STAR)) + if (TypeOps::is_subtype(tm, *retType, *rtm.ANY_SIMPLE_TYPE)) return; switch (node->get_expr_kind()) @@ -1123,10 +1147,10 @@ case var_expr::wincond_in_var: case var_expr::non_groupby_var: { - if (!e->inUnsafeContext()) + if (!e->isVisited(1)) { - e->setInUnsafeContext(ANNOTATION_TRUE); - markInUnsafeContext(e->get_domain_expr()); + e->setVisitId(1); + findSourcesForNodeExtractors(e->get_domain_expr()); } return; } @@ -1134,40 +1158,30 @@ case var_expr::copy_var: case var_expr::catch_var: { - e->setInUnsafeContext(ANNOTATION_TRUE); return; } case var_expr::arg_var: { - e->setInUnsafeContext(ANNOTATION_TRUE); + e->setVisitId(1); return; } case var_expr::prolog_var: case var_expr::local_var: { - if (!e->inUnsafeContext()) + if (!e->isVisited(1)) { - e->setInUnsafeContext(ANNOTATION_TRUE); + e->setVisitId(1); - std::vector::const_iterator ite = e->setExprsBegin(); - std::vector::const_iterator end = e->setExprsEnd(); + var_expr::VarSetExprs::const_iterator ite = e->setExprsBegin(); + var_expr::VarSetExprs::const_iterator end = e->setExprsEnd(); for (; ite != end; ++ite) { - expr* setExpr = *ite; - - if (setExpr->get_expr_kind() == var_decl_expr_kind) - { - markInUnsafeContext(static_cast(setExpr)->get_init_expr()); - } - else - { - assert(setExpr->get_expr_kind() == var_set_expr_kind); + expr* valueExpr = (*ite)->get_expr(); - markInUnsafeContext(static_cast(setExpr)->get_expr()); - } + findSourcesForNodeExtractors(valueExpr); } } return; @@ -1193,7 +1207,7 @@ case text_expr_kind: case pi_expr_kind: { - break; + return; } #ifdef ZORBA_WITH_JSON @@ -1201,15 +1215,41 @@ case json_direct_object_expr_kind: case json_array_expr_kind: { - break; + return; } #endif case relpath_expr_kind: { relpath_expr* e = static_cast(node); - e->setInUnsafeContext(ANNOTATION_TRUE); - markInUnsafeContext((*e)[0]); + + e->setVisitId(1); + + std::vector::const_iterator ite = e->begin(); + std::vector::const_iterator end = e->end(); + + for (++ite; ite != end; ++ite) + { + axis_step_expr* axisExpr = static_cast((*ite)); + axis_kind_t axisKind = axisExpr->getAxis(); + + if (axisKind != axis_kind_child && + axisKind != axis_kind_descendant && + axisKind != axis_kind_descendant_or_self && + axisKind != axis_kind_self && + axisKind != axis_kind_attribute) + { + break; + } + } + + if (ite == end) + { + std::vector sources; + theSourceFinder->findNodeSources((*e)[0], sources); + markSources(sources); + } + return; } @@ -1217,8 +1257,11 @@ case flwor_expr_kind: { flwor_expr* e = static_cast(node); - e->setInUnsafeContext(ANNOTATION_TRUE); - markInUnsafeContext(e->get_return_expr()); + + e->setVisitId(1); + + findSourcesForNodeExtractors(e->get_return_expr()); + return; } @@ -1233,16 +1276,16 @@ fo_expr* e = static_cast(node); function* f = e->get_func(); - e->setInUnsafeContext(ANNOTATION_TRUE); + e->setVisitId(1); if (f->isUdf() && static_cast(f)->getBody() != NULL) { user_function* udf = static_cast(f); expr* body = udf->getBody(); - if (!body->inUnsafeContext()) + if (!body->isVisited(1)) { - markInUnsafeContext(body); + findSourcesForNodeExtractors(body); } std::vector::const_iterator ite = udf->getArgVars().begin(); @@ -1250,10 +1293,10 @@ for (; ite != end; ++ite) { expr* argVar = (*ite); - if (argVar->inUnsafeContext()) + if (argVar->isVisited(1)) { expr* argExpr = e->get_arg(ite - udf->getArgVars().begin()); - markInUnsafeContext(argExpr); + findSourcesForNodeExtractors(argExpr); } } } // f->isUdf() @@ -1264,7 +1307,7 @@ { if (f->propagatesInputNodes(e, i)) { - markInUnsafeContext(e->get_arg(i)); + findSourcesForNodeExtractors(e->get_arg(i)); } } } @@ -1283,24 +1326,27 @@ case validate_expr_kind: { - node->setInUnsafeContext(ANNOTATION_TRUE); + node->setVisitId(1); return; } case transform_expr_kind: { transform_expr* e = static_cast(node); - e->setInUnsafeContext(ANNOTATION_TRUE); - markInUnsafeContext(e->getReturnExpr()); + + findSourcesForNodeExtractors(e->getReturnExpr()); + return; } case block_expr_kind: { block_expr* e = static_cast(node); - e->setInUnsafeContext(ANNOTATION_TRUE); + expr* lastChild = (*e)[e->size()-1]; - markInUnsafeContext(lastChild); + + findSourcesForNodeExtractors(lastChild); + return; } @@ -1326,7 +1372,7 @@ { exit_expr* ex = static_cast(*ite); - markInUnsafeContext(ex->get_expr()); + findSourcesForNodeExtractors(ex->get_expr()); } break; @@ -1354,7 +1400,7 @@ user_function* udf = static_cast(e->get_function()); - markInUnsafeContext(udf->getBody()); + findSourcesForNodeExtractors(udf->getBody()); return; } @@ -1380,7 +1426,7 @@ ZORBA_ASSERT(false); } - node->setInUnsafeContext(ANNOTATION_TRUE); + node->setVisitId(1); ExprIterator iter(node); while(!iter.done()) @@ -1388,7 +1434,7 @@ expr* child = (**iter); if (child != NULL) { - markInUnsafeContext(child); + findSourcesForNodeExtractors(child); } iter.next(); } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/path_rules.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/path_rules.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/path_rules.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/path_rules.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -26,22 +26,22 @@ RULE_REWRITE_PRE(EliminateExtraneousPathSteps) { - relpath_expr* re = dynamic_cast(node); - if (re != NULL) + if (node->get_expr_kind() == relpath_expr_kind) { + relpath_expr* re = static_cast(node); csize numSteps = re->size(); - for (csize i = 0; i < numSteps - 1; i++) + for (csize i = 1; i < numSteps - 1; ++i) { - axis_step_expr* axisStep = dynamic_cast((*re)[i]); + assert((*re)[i]->get_expr_kind() == axis_step_expr_kind); - if (axisStep != NULL && - axisStep->getAxis() == axis_kind_descendant_or_self && + axis_step_expr* axisStep = static_cast((*re)[i]); + + if (axisStep->getAxis() == axis_kind_descendant_or_self && axisStep->getTest()->getTestKind() == match_anykind_test) { - axis_step_expr* nextStep = dynamic_cast((*re)[i+1]); - if (nextStep != NULL && - nextStep->getAxis() == axis_kind_child) + axis_step_expr* nextStep = static_cast((*re)[i+1]); + if (nextStep->getAxis() == axis_kind_child) { nextStep->setAxis(axis_kind_descendant); (*re).erase(i); @@ -53,7 +53,7 @@ if (numSteps == 1) { - return (*re) [0]; + return (*re)[0]; } } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/ruleset.h zorba-2.8.0-0/src/compiler/rewriter/rules/ruleset.h --- zorba-2.7.0-0/src/compiler/rewriter/rules/ruleset.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/ruleset.h 2013-01-16 18:28:18.000000000 +0000 @@ -41,16 +41,10 @@ PREPOST_RULE(EliminateTypeEnforcingOperations); -PREPOST_RULE(EliminateUnusedLetVars); - PREPOST_RULE(RefactorPredFLWOR); -PREPOST_RULE(MergeFLWOR); - PREPOST_RULE(EliminateExtraneousPathSteps); -PREPOST_RULE(MarkFreeVars); - PREPOST_RULE(InlineFunctions); PREPOST_RULE(PartialEval); @@ -59,23 +53,73 @@ /******************************************************************************* ********************************************************************************/ -class FoldConst : public PrePostRewriteRule +class EliminateUnusedLetVars : public PrePostRewriteRule { protected: - bool theFoldExpensiveOps; + flwor_expr * theFlwor; + std::vector theRefs; public: - FoldConst(bool fold_expensive_ops) + EliminateUnusedLetVars() : - PrePostRewriteRule(RewriteRule::FoldConst, "FoldConst"), - theFoldExpensiveOps(fold_expensive_ops) + PrePostRewriteRule(RewriteRule::EliminateUnusedLetVars, "EliminateUnusedLetVars"), + theFlwor(NULL) { + theRefs.reserve(32); } protected: expr* rewritePre(expr* node, RewriterContext& rCtx); expr* rewritePost(expr* node, RewriterContext& rCtx); + + bool safe_to_fold_var(csize varPos, int& numRefs); + + bool safe_to_fold_var_rec( + expr* node, + csize varPos, + var_expr* var, + bool unsafe, + bool isSafeVar, + int& numRefs); + + void subst_vars( + const RewriterContext& rCtx, + var_expr* var, + expr* subst, + int numRefs); +}; + + +/******************************************************************************* + +********************************************************************************/ +class MergeFLWOR : public RewriteRule +{ +public: + MergeFLWOR() + : + RewriteRule(RewriteRule::MergeFLWOR, "MergeFLWOR") + { + } + + expr* apply(RewriterContext& rCtx, expr* node, bool& modified); +}; + + +/******************************************************************************* + +********************************************************************************/ +class FoldConst : public RewriteRule +{ +public: + FoldConst() + : + RewriteRule(RewriteRule::FoldConst, "FoldConst") + { + } + + expr* apply(RewriterContext& rCtx, expr* node, bool& modified); }; @@ -84,12 +128,38 @@ ********************************************************************************/ class MarkExprs : public RewriteRule { +protected: + bool theIsLocal; + public: - MarkExprs() : RewriteRule(RewriteRule::MarkExprs, "MarkExprs") {} + MarkExprs(bool local = false) + : + RewriteRule(RewriteRule::MarkExprs, "MarkExprs"), + theIsLocal(local) + { + } + + void setLocal(bool v) { theIsLocal = v; } expr* apply(RewriterContext& rCtx, expr* node, bool& modified); }; +#if 1 +/******************************************************************************* + +********************************************************************************/ +class MarkFreeVars : public RewriteRule +{ +public: + MarkFreeVars() + : + RewriteRule(RewriteRule::MarkFreeVars, "MarkFreeVars") + { + } + + expr* apply(RewriterContext& rCtx, expr* node, bool& modified); +}; +#endif /******************************************************************************* @@ -128,12 +198,12 @@ ********************************************************************************/ class MarkNodeCopyProps : public RewriteRule { - typedef std::set UdfCalls; + typedef std::set UdfSet; protected: SourceFinder * theSourceFinder; - UdfCalls theProcessedUDFCalls; + UdfSet theProcessedUDFs; public: MarkNodeCopyProps() @@ -145,11 +215,11 @@ expr* apply(RewriterContext& rCtx, expr* node, bool& modified); protected: - void applyInternal(RewriterContext& rCtx, expr* node, UDFCallChain& udfCaller); + void applyInternal(expr* node, bool deferred); void markSources(const std::vector& sources); - void markInUnsafeContext(expr* node); + void findSourcesForNodeExtractors(expr* node); }; diff -Nru zorba-2.7.0-0/src/compiler/rewriter/rules/type_rules.cpp zorba-2.8.0-0/src/compiler/rewriter/rules/type_rules.cpp --- zorba-2.7.0-0/src/compiler/rewriter/rules/type_rules.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/rules/type_rules.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -67,7 +67,7 @@ return NULL; fo_expr* fo = static_cast(node); - user_function* udf = dynamic_cast(fo->get_func()); + user_function* udf = static_cast(fo->get_func()); if (udf == NULL) return NULL; @@ -103,7 +103,9 @@ TypeManager* tm = sctx->get_typemanager(); RootTypeManager& rtm = GENV_TYPESYSTEM; - if (node->get_expr_kind() == fo_expr_kind) + switch (node->get_expr_kind()) + { + case fo_expr_kind: { fo_expr* fo = static_cast(node); @@ -127,6 +129,7 @@ return NULL; } +#ifdef ZORBA_WITH_JSON if (fo->get_func()->getKind() == FunctionConsts::OP_ZORBA_JSON_BOX_1) { expr* arg = fo->get_arg(0); @@ -140,18 +143,54 @@ store::Item_t null; GENV_STORE.getItemFactory()->createJSONNull(null); - return rCtx.theEM->create_const_expr(sctx, fo->get_loc(), null); + return rCtx.theEM->create_const_expr(sctx, fo->get_udf(), fo->get_loc(), null); } return NULL; } +#endif + + break; } + case cast_expr_kind: + { + cast_expr* e = static_cast(node); + + expr* arg = e->get_input(); + xqtref_t arg_type = arg->get_return_type(); + xqtref_t target_type = e->get_target_type(); - cast_base_expr* pe = NULL; + if (TypeOps::is_equal(tm, *arg_type, *target_type, arg->get_loc())) + return arg; + + if (target_type->isAtomicAny()) + { + xqtref_t arg_ptype = TypeOps::prime_type(tm, *arg_type); + xqtref_t target_ptype = TypeOps::prime_type(tm, *target_type); + + // If the prime types of the arg type and the target type are equal, then + // for a cast expr, we just need to make sure that the cardinality of the + // arg is the correct one. This we can do by turning cast to a treat expr + // that just checks the cardinality. + if (TypeOps::is_equal(tm, *arg_ptype, *target_ptype, arg->get_loc())) + { + return rCtx.theEM->create_treat_expr(sctx, + node->get_udf(), + node->get_loc(), + arg, + target_type, + TREAT_TYPE_MATCH, + false); // do not check the prime types + } + } - // Note: the if cond is true for promote_expr, treat_expr, and cast_expr - if ((pe = dynamic_cast(node)) != NULL) + break; + } + case promote_expr_kind: + case treat_expr_kind: { + cast_base_expr* pe = static_cast(node); + expr* arg = pe->get_input(); xqtref_t arg_type = arg->get_return_type(); xqtref_t target_type = pe->get_target_type(); @@ -166,45 +205,32 @@ } // If arg type is subtype of target type, we can eliminate treat and promote - // (because they are noops in this case), but not cast (which will actually - // create a new item with the target type). - if (TypeOps::is_equal(tm, *arg_type, *target_type, arg->get_loc()) || - (node->get_expr_kind() != cast_expr_kind && - TypeOps::is_subtype(tm, *arg_type, *target_type, arg->get_loc()))) + // (because they are noops in this case). + if (TypeOps::is_subtype(tm, *arg_type, *target_type, arg->get_loc())) return arg; - xqtref_t arg_ptype = TypeOps::prime_type(tm, *arg_type); - xqtref_t target_ptype = TypeOps::prime_type(tm, *target_type); - - // If the prime types of the arg type and the target type are equal, then - // for a cast expr, we just need to make sure that the cardinality of the - // arg is the correct one. This we can do by turning cast to a treat expr - // that just chacks the cardinality. - if (node->get_expr_kind() == cast_expr_kind && - TypeOps::is_equal(tm, *arg_ptype, *target_ptype, arg->get_loc())) - { - return rCtx.theEM->create_treat_expr(sctx, - node->get_loc(), - arg, - target_type, - TreatIterator::TYPE_MATCH, - false); // do not check the prime types - } - if (node->get_expr_kind() == treat_expr_kind) { treat_expr* te = static_cast (pe); - if (te->get_check_prime() && - TypeOps::is_subtype(tm, *arg_ptype, *target_ptype, arg->get_loc())) + if (te->get_check_prime()) { - te->set_check_prime(false); - return node; + xqtref_t arg_ptype = TypeOps::prime_type(tm, *arg_type); + xqtref_t target_ptype = TypeOps::prime_type(tm, *target_type); + + if (TypeOps::is_subtype(tm, *arg_ptype, *target_ptype, arg->get_loc())) + { + te->set_check_prime(false); + return node; + } } } return NULL; } + default: + break; + } return NULL; } @@ -227,12 +253,10 @@ RULE_REWRITE_POST(SpecializeOperations) { - const Properties& props = *Properties::instance(); - RootTypeManager& rtm = GENV_TYPESYSTEM; TypeManager* tm = node->get_type_manager(); - static_context* sctx = node->get_sctx(); + user_function* udf = node->get_udf(); if (node->get_expr_kind() == fo_expr_kind) { @@ -247,7 +271,9 @@ fnKind == FunctionConsts::FN_SUM_2) { expr* argExpr = fo->get_arg(0); + const QueryLoc& argLoc = argExpr->get_loc(); xqtref_t argType = argExpr->get_return_type(); + std::vector argTypes; argTypes.push_back(argType); @@ -256,17 +282,16 @@ { fo->set_func(replacement); - if (TypeOps::is_subtype(tm, - *argType, - *rtm.UNTYPED_ATOMIC_TYPE_STAR, - argExpr->get_loc())) + if (TypeOps::is_subtype(tm, *argType, *rtm.UNTYPED_ATOMIC_TYPE_STAR, argLoc)) { - expr* promoteExpr = rCtx.theEM->create_promote_expr(argExpr->get_sctx(), - argExpr->get_loc(), - argExpr, - rtm.DOUBLE_TYPE_STAR, - PromoteIterator::FUNC_PARAM, - replacement->getName()); + expr* promoteExpr = rCtx.theEM-> + create_promote_expr(sctx, + udf, + argExpr->get_loc(), + argExpr, + rtm.DOUBLE_TYPE_STAR, + PROMOTE_FUNC_PARAM, + replacement->getName()); fo->set_arg(0, promoteExpr); } @@ -320,9 +345,9 @@ TypeOps::is_subtype(tm, *lenType, *rtm.INTEGER_TYPE_ONE, lenLoc)) { if (fnKind == FunctionConsts::FN_SUBSTRING_3) - fo->set_func(GET_BUILTIN_FUNCTION(OP_SUBSTRING_INT_3)); + fo->set_func(BUILTIN_FUNC(OP_SUBSTRING_INT_3)); else - fo->set_func(GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_3)); + fo->set_func(BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_3)); fo->set_arg(1, posExpr); fo->set_arg(1, lenExpr); @@ -331,9 +356,9 @@ else if (TypeOps::is_subtype(tm, *posType, *rtm.INTEGER_TYPE_ONE, posLoc)) { if (fnKind == FunctionConsts::FN_SUBSTRING_2) - fo->set_func(GET_BUILTIN_FUNCTION(OP_SUBSTRING_INT_2)); + fo->set_func(BUILTIN_FUNC(OP_SUBSTRING_INT_2)); else - fo->set_func(GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_2)); + fo->set_func(BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_2)); fo->set_arg(1, posExpr); } @@ -349,7 +374,7 @@ if (t0->max_card() > 1 || t1->max_card() > 1) return NULL; - if (props.specializeNum() && fn->isArithmeticFunction()) + if (fn->isArithmeticFunction()) { if (! TypeOps::is_numeric_or_untyped(tm, *t0) || ! TypeOps::is_numeric_or_untyped(tm, *t1)) @@ -358,13 +383,38 @@ if (specialize_numeric(fo, sctx, rCtx) != NULL) return node; } - else if (props.specializeCmp() && fn->isComparisonFunction()) + else if (fn->isGeneralComparisonFunction()) { - if (fn->isGeneralComparisonFunction()) + std::vector argTypes; + argTypes.push_back(t0); + argTypes.push_back(t1); + function* replacement = fn->specialize(sctx, argTypes); + if (replacement != NULL) + { + fo->set_func(replacement); + return node; + } + } + else if (fn->isValueComparisonFunction()) + { + xqtref_t stringType = rtm.STRING_TYPE_QUESTION; + xqtref_t untypedType = rtm.UNTYPED_ATOMIC_TYPE_QUESTION; + + const QueryLoc& loc0 = arg0->get_loc(); + const QueryLoc& loc1 = arg1->get_loc(); + + bool atomicORstring0 = (TypeOps::is_subtype(tm, *t0, *untypedType, loc0) || + TypeOps::is_subtype(tm, *t0, *stringType, loc0)); + + bool atomicORstring1 = (TypeOps::is_subtype(tm, *t1, *untypedType, loc1) || + TypeOps::is_subtype(tm, *t1, *stringType, loc1)); + + if (atomicORstring0 && atomicORstring1) { std::vector argTypes; - argTypes.push_back(t0); - argTypes.push_back(t1); + argTypes.push_back(stringType); + argTypes.push_back(stringType); + function* replacement = fn->specialize(sctx, argTypes); if (replacement != NULL) { @@ -372,80 +422,34 @@ return node; } } - else if (fn->isValueComparisonFunction()) + else if (TypeOps::is_numeric(tm, *t0) && TypeOps::is_numeric(tm, *t1)) { - xqtref_t string_type = rtm.STRING_TYPE_QUESTION; - bool string_cmp = true; - expr* nargs[2]; - - for (int i = 0; i < 2; ++i) - { - nargs[i] = NULL; - - expr* arg = (i == 0 ? arg0 : arg1); - xqtref_t type = (i == 0 ? t0 : t1); - const QueryLoc& loc = arg->get_loc(); - - if (TypeOps::is_subtype(tm, *type, *rtm.UNTYPED_ATOMIC_TYPE_QUESTION, loc)) - { - nargs[i] = rCtx.theEM->create_cast_expr(arg->get_sctx(), - arg->get_loc(), - arg, - string_type); - } - else if (! TypeOps::is_subtype(tm, *type, *string_type, loc)) - { - string_cmp = false; - break; - } - } - - if (string_cmp) + xqtref_t aType = specialize_numeric(fo, sctx, rCtx); + if (aType != NULL) { - for (int i = 0; i < 2; i++) - { - if (nargs[i] != NULL) - fo->set_arg(i, nargs[i]); - } - - std::vector argTypes; - argTypes.push_back(string_type); - argTypes.push_back(string_type); - function* replacement = fn->specialize(sctx, argTypes); - if (replacement != NULL) + if (TypeOps::is_equal(tm, + *TypeOps::prime_type(tm, *aType), + *rtm.DECIMAL_TYPE_ONE, + fo->get_loc()) && + TypeOps::is_subtype(tm, *t0, *rtm.INTEGER_TYPE_ONE, fo->get_loc())) { - fo->set_func(replacement); - return node; - } - } - else if (TypeOps::is_numeric(tm, *t0) && TypeOps::is_numeric(tm, *t1)) - { - xqtref_t aType = specialize_numeric(fo, sctx, rCtx); - if (aType != NULL) - { - if (TypeOps::is_equal(tm, - *TypeOps::prime_type(tm, *aType), - *rtm.DECIMAL_TYPE_ONE, - fo->get_loc()) && - TypeOps::is_subtype(tm, *t0, *rtm.INTEGER_TYPE_ONE, fo->get_loc())) - { - expr* tmp = fo->get_arg(0); - fo->set_arg(0, fo->get_arg(1)); - fo->set_arg(1, tmp); - fo->set_func(flip_value_cmp(fo->get_func()->getKind())); - } - - return node; + expr* tmp = fo->get_arg(0); + fo->set_arg(0, fo->get_arg(1)); + fo->set_arg(1, tmp); + fo->set_func(flip_value_cmp(fo->get_func()->getKind())); } + + return node; } } } } } +#if 0 else if (node->get_expr_kind() == flwor_expr_kind || node->get_expr_kind() == gflwor_expr_kind) { - flwor_expr* flworExpr = reinterpret_cast(node); + flwor_expr* flworExpr = static_cast(node); bool modified = false; @@ -454,8 +458,8 @@ { if (flworExpr->get_clause(i)->get_kind() == flwor_clause::order_clause) { - orderby_clause* obc = reinterpret_cast - (flworExpr->get_clause(i)); + orderby_clause* obc = + static_cast(flworExpr->get_clause(i)); csize numColumns = obc->num_columns(); for (csize j = 0; j < numColumns; ++j) @@ -468,10 +472,7 @@ TypeOps::is_subtype(tm, *colType, *rtm.UNTYPED_ATOMIC_TYPE_STAR, colLoc)) { expr* castExpr = rCtx.theEM-> - create_cast_expr(colExpr->get_sctx(), - colExpr->get_loc(), - colExpr, - rtm.STRING_TYPE_QUESTION); + create_cast_expr(sctx, udf, colLoc, colExpr, rtm.STRING_TYPE_QUESTION); obc->set_column_expr(j, castExpr); modified = true; @@ -483,6 +484,7 @@ if (modified) return node; } +#endif return NULL; } @@ -561,11 +563,12 @@ } return rCtx.theEM->create_promote_expr(arg->get_sctx(), - arg->get_loc(), - arg, - t, - PromoteIterator::FUNC_PARAM, - fn->getName()); + arg->get_udf(), + arg->get_loc(), + arg, + t, + PROMOTE_FUNC_PARAM, + fn->getName()); } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/tools/dataflow_annotations.cpp zorba-2.8.0-0/src/compiler/rewriter/tools/dataflow_annotations.cpp --- zorba-2.7.0-0/src/compiler/rewriter/tools/dataflow_annotations.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/tools/dataflow_annotations.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -110,16 +110,45 @@ case while_expr_kind: // TODO break; + case promote_expr_kind: + case cast_expr_kind: + case name_cast_expr_kind: + case castable_expr_kind: + case instanceof_expr_kind: + { + default_walk(e); + SORTED_NODES(e); + DISTINCT_NODES(e); + break; + } + + case treat_expr_kind: + { + default_walk(e); + if (!generic_compute(e)) + { + treat_expr* ue = static_cast(e); + PROPOGATE_SORTED_NODES(ue->get_input(), e); + PROPOGATE_DISTINCT_NODES(ue->get_input(), e); + } + break; + } + case wrapper_expr_kind: - compute_wrapper_expr(static_cast(e)); + { + default_walk(e); + wrapper_expr* ue = static_cast(e); + PROPOGATE_SORTED_NODES(ue->get_input(), e); + PROPOGATE_DISTINCT_NODES(ue->get_input(), e); break; + } case function_trace_expr_kind: { default_walk(e); - function_trace_expr* fte = static_cast(e); - PROPOGATE_SORTED_NODES(fte->get_expr(), e); - PROPOGATE_DISTINCT_NODES(fte->get_expr(), e); + function_trace_expr* ue = static_cast(e); + PROPOGATE_SORTED_NODES(ue->get_input(), e); + PROPOGATE_DISTINCT_NODES(ue->get_input(), e); break; } @@ -136,10 +165,6 @@ compute_trycatch_expr(static_cast(e)); break; - case promote_expr_kind: - compute_promote_expr(static_cast(e)); - break; - case if_expr_kind: compute_if_expr(static_cast(e)); break; @@ -148,26 +173,6 @@ compute_fo_expr(static_cast(e)); break; - case instanceof_expr_kind: - compute_instanceof_expr(static_cast(e)); - break; - - case treat_expr_kind: - compute_treat_expr(static_cast(e)); - break; - - case castable_expr_kind: - compute_castable_expr(static_cast(e)); - break; - - case cast_expr_kind: - compute_cast_expr(static_cast(e)); - break; - - case name_cast_expr_kind: - compute_name_cast_expr(static_cast(e)); - break; - case validate_expr_kind: compute_validate_expr(static_cast(e)); break; @@ -286,6 +291,16 @@ return true; } + if (TypeOps::is_subtype(e->get_type_manager(), + *rt, + *GENV_TYPESYSTEM.ANY_SIMPLE_TYPE, + e->get_loc())) + { + SORTED_NODES(e); + DISTINCT_NODES(e); + return true; + } + return false; } @@ -336,25 +351,14 @@ /******************************************************************************* ********************************************************************************/ -void DataflowAnnotationsComputer::compute_wrapper_expr(wrapper_expr* e) -{ - default_walk(e); - PROPOGATE_SORTED_NODES(e->get_expr(), e); - PROPOGATE_DISTINCT_NODES(e->get_expr(), e); -} - - -/******************************************************************************* - -********************************************************************************/ void DataflowAnnotationsComputer::compute_var_expr(var_expr* e) { if (!generic_compute(e)) { if (e->get_kind() == var_expr::let_var) { - PROPOGATE_SORTED_NODES(e->get_forletwin_clause()->get_expr(), e); - PROPOGATE_DISTINCT_NODES(e->get_forletwin_clause()->get_expr(), e); + PROPOGATE_SORTED_NODES(e->get_forlet_clause()->get_expr(), e); + PROPOGATE_DISTINCT_NODES(e->get_forlet_clause()->get_expr(), e); } } } @@ -451,17 +455,6 @@ /******************************************************************************* ********************************************************************************/ -void DataflowAnnotationsComputer::compute_promote_expr(promote_expr* e) -{ - default_walk(e); - PROPOGATE_SORTED_NODES(e->get_input(), e); - PROPOGATE_DISTINCT_NODES(e->get_input(), e); -} - - -/******************************************************************************* - -********************************************************************************/ void DataflowAnnotationsComputer::compute_if_expr(if_expr* e) { default_walk(e); @@ -540,53 +533,7 @@ /******************************************************************************* ********************************************************************************/ -void DataflowAnnotationsComputer::compute_instanceof_expr(instanceof_expr *e) -{ - default_walk(e); - PROPOGATE_SORTED_NODES(e->get_input(), e); - PROPOGATE_DISTINCT_NODES(e->get_input(), e); -} - - -/******************************************************************************* - -********************************************************************************/ -void DataflowAnnotationsComputer::compute_treat_expr(treat_expr *e) -{ - default_walk(e); - if (!generic_compute(e)) - { - PROPOGATE_SORTED_NODES(e->get_input(), e); - PROPOGATE_DISTINCT_NODES(e->get_input(), e); - } -} - - -/******************************************************************************* - -********************************************************************************/ -void DataflowAnnotationsComputer::compute_castable_expr(castable_expr *e) -{ - default_walk(e); - PROPOGATE_SORTED_NODES(e->get_input(), e); - PROPOGATE_DISTINCT_NODES(e->get_input(), e); -} - - -/******************************************************************************* - -********************************************************************************/ -void DataflowAnnotationsComputer::compute_cast_expr(cast_expr* e) -{ - default_walk(e); - if (!generic_compute(e)) - { - PROPOGATE_SORTED_NODES(e->get_input(), e); - PROPOGATE_DISTINCT_NODES(e->get_input(), e); - } -} - -void DataflowAnnotationsComputer::compute_name_cast_expr(name_cast_expr* e) +void DataflowAnnotationsComputer::compute_validate_expr(validate_expr* e) { default_walk(e); if (!generic_compute(e)) @@ -596,16 +543,6 @@ } } -void DataflowAnnotationsComputer::compute_validate_expr(validate_expr* e) -{ - default_walk(e); - if (!generic_compute(e)) - { - PROPOGATE_SORTED_NODES(e->get_expr(), e); - PROPOGATE_DISTINCT_NODES(e->get_expr(), e); - } -} - void DataflowAnnotationsComputer::compute_extension_expr(extension_expr* e) { default_walk(e); @@ -634,8 +571,8 @@ for (csize i = 1; i < num_steps; ++i) { - axis_step_expr* ase = dynamic_cast((*e)[i]); - assert(ase != NULL); + assert((*e)[i]->get_expr_kind() == axis_step_expr_kind); + axis_step_expr* ase = static_cast((*e)[i]); reverse_axes = reverse_axes || ase->is_reverse_axis(); @@ -806,59 +743,23 @@ If "node" is inside a UDF, "udfCaller" contains the fo expr that invoked that UDF. ********************************************************************************/ -void SourceFinder::findNodeSources( - expr* node, - UDFCallChain* udfCaller, - std::vector& sources) +void SourceFinder::findNodeSources(expr* node, std::vector& sources) { - theStartingUdf = NULL; - - if (udfCaller->theFo) - theStartingUdf = static_cast(udfCaller->theFo->get_func()); + user_function* startingUdf = node->get_udf(); - findNodeSourcesRec(node, sources, theStartingUdf); + findNodeSourcesRec(node, sources, startingUdf); for (csize i = 0; i < sources.size(); ++i) { expr* source = sources[i]; - if (source->get_expr_kind() == var_expr_kind) - { - var_expr* varExpr = static_cast(source); - - ZORBA_ASSERT(udfCaller != NULL); - ZORBA_ASSERT(varExpr->get_kind() == var_expr::arg_var); + ZORBA_ASSERT(source->get_expr_kind() == doc_expr_kind || + source->get_expr_kind() == elem_expr_kind); - sources.erase(sources.begin() + i); - --i; - - // Note: If this method is called to find the sources of an expr within the - // body of a function_item, then udfCaller->theFo will be NULL. - while(udfCaller->theFo && varExpr->get_udf() != udfCaller->theFo->get_func()) - { - udfCaller = udfCaller->thePrev; - } - - if (udfCaller->theFo) - { - fo_expr* foExpr = udfCaller->theFo; - expr* foArg = foExpr->get_arg(varExpr->get_param_pos()); - std::vector argSources; - findNodeSources(foArg, udfCaller->thePrev, argSources); + user_function* udf = source->get_udf(); - sources.insert(sources.end(), argSources.begin(), argSources.end()); - } - } - else - { - ZORBA_ASSERT(source->get_expr_kind() == doc_expr_kind || - source->get_expr_kind() == elem_expr_kind); - - user_function* udf = theSourceUdfMap.find(source)->second; - - if (udf) - udf->invalidatePlan(); - } + if (udf) + udf->invalidatePlan(); } } @@ -876,7 +777,7 @@ xqtref_t retType = node->get_return_type(); - if (TypeOps::is_subtype(tm, *retType, *rtm.ANY_ATOMIC_TYPE_STAR, node->get_loc())) + if (TypeOps::is_subtype(tm, *retType, *rtm.ANY_SIMPLE_TYPE, node->get_loc())) return; switch(node->get_expr_kind()) @@ -944,19 +845,6 @@ return; } - case var_expr::arg_var: - { - if (std::find(sources.begin(), sources.end(), node) == sources.end()) - sources.push_back(node); - - std::vector* varSources = new std::vector; - - if (theVarSourcesMap.insert(VarSourcesPair(e, varSources)).second == false) - delete varSources; - - return; - } - case var_expr::prolog_var: case var_expr::local_var: { @@ -969,27 +857,17 @@ varSources = new std::vector;; theVarSourcesMap.insert(VarSourcesPair(e, varSources)); - std::vector::const_iterator ite2 = e->setExprsBegin(); - std::vector::const_iterator end2 = e->setExprsEnd(); + var_expr::VarSetExprs::const_iterator ite2 = e->setExprsBegin(); + var_expr::VarSetExprs::const_iterator end2 = e->setExprsEnd(); for (; ite2 != end2; ++ite2) { - expr* setExpr = *ite2; + var_set_expr* setExpr = *ite2; - if (setExpr->get_expr_kind() == var_decl_expr_kind) - { - findNodeSourcesRec(static_cast(setExpr)->get_init_expr(), - *varSources, - currentUdf); - } - else - { - assert(setExpr->get_expr_kind() == var_set_expr_kind); + if (setExpr->get_udf() != NULL && !setExpr->get_udf()->isOptimized()) + continue; - findNodeSourcesRec(static_cast(setExpr)->get_expr(), - *varSources, - currentUdf); - } + findNodeSourcesRec(setExpr->get_expr(), *varSources, currentUdf); } } else @@ -1016,6 +894,13 @@ return; } + case var_expr::arg_var: + { + theVarSourcesMap.insert(VarSourcesPair(e, nullptr)); + + return; + } + case var_expr::eval_var: default: { @@ -1026,14 +911,98 @@ break; } + case fo_expr_kind: + { + fo_expr* e = static_cast(node); + function* f = e->get_func(); + + if (f->isUdf() && static_cast(f)->getBody() != NULL) + { + user_function* udf = static_cast(f); + + bool recursive = (currentUdf ? currentUdf->isMutuallyRecursiveWith(udf) : false); + + if (recursive) + { + currentUdf->addRecursiveCall(e); + } + else + { + UdfSourcesMap::iterator ite = theUdfSourcesMap.find(udf); + + std::vector* udfSources; + + if (ite == theUdfSourcesMap.end()) + { + // must do this before calling findNodeSourcesRec in order to break + // recursion cycle + udfSources = new std::vector; + theUdfSourcesMap.insert(UdfSourcesPair(udf, udfSources)); + + findNodeSourcesRec(udf->getBody(), *udfSources, udf); + + if (udf->isRecursive()) + { + std::vector::const_iterator ite = udf->getRecursiveCalls().begin(); + std::vector::const_iterator end = udf->getRecursiveCalls().end(); + for (; ite != end; ++ite) + { + findNodeSourcesRec((*ite), *udfSources, NULL); + } + } + } + else + { + udfSources = (*ite).second; + } + + csize numUdfSources = udfSources->size(); + + for (csize i = 0; i < numUdfSources; ++i) + { + expr* source = (*udfSources)[i]; + + if (std::find(sources.begin(), sources.end(), source) == sources.end()) + sources.push_back(source); + } + + // if an arg var of this udf has been marked as a source before, it + // means that that var is consumed in some unsafe operation, so we + // now have to find the sources of the arg exprs and mark them. + csize numArgs = e->num_args(); + + for (csize i = 0; i < numArgs; ++i) + { + var_expr* argVar = udf->getArgVar(i); + + if (theVarSourcesMap.find(argVar) != theVarSourcesMap.end()) + { + findNodeSourcesRec(e->get_arg(i), sources, currentUdf); + } + } + } // not recursive call + } // f->isUdf() + else + { + csize numArgs = e->num_args(); + for (csize i = 0; i < numArgs; ++i) + { + if (f->propagatesInputNodes(e, i)) + { + findNodeSourcesRec(e->get_arg(i), sources, currentUdf); + } + } + } + + return; + } + case doc_expr_kind: case elem_expr_kind: { if (std::find(sources.begin(), sources.end(), node) == sources.end()) { sources.push_back(node); - - theSourceUdfMap.insert(SourceUdfMapPair(node, currentUdf)); } std::vector enclosedExprs; @@ -1102,95 +1071,6 @@ break; } - case fo_expr_kind: - { - fo_expr* e = static_cast(node); - function* f = e->get_func(); - - if (f->isUdf() && static_cast(f)->getBody() != NULL) - { - user_function* udf = static_cast(f); - - bool recursive = (currentUdf ? currentUdf->isMutuallyRecursiveWith(udf) : false); - - if (recursive) - { - currentUdf->addRecursiveCall(node); - } - else - { - UdfSourcesMap::iterator ite = theUdfSourcesMap.find(udf); - - std::vector* udfSources; - - if (ite == theUdfSourcesMap.end()) - { - // must do this before calling findNodeSourcesRec in order to break - // recursion cycle - if (ite == theUdfSourcesMap.end()) - { - udfSources = new std::vector; - theUdfSourcesMap.insert(UdfSourcesPair(udf, udfSources)); - } - else - { - udfSources = (*ite).second; - } - - findNodeSourcesRec(udf->getBody(), *udfSources, udf); - - if (udf->isRecursive()) - { - std::vector::const_iterator ite = udf->getRecursiveCalls().begin(); - std::vector::const_iterator end = udf->getRecursiveCalls().end(); - for (; ite != end; ++ite) - { - findNodeSourcesRec((*ite), *udfSources, NULL); - } - } - } - else - { - udfSources = (*ite).second; - } - - csize numUdfSources = udfSources->size(); - - for (csize i = 0; i < numUdfSources; ++i) - { - expr* source = (*udfSources)[i]; - - if (source->get_expr_kind() == var_expr_kind) - { - var_expr* argVar = static_cast(source); - ZORBA_ASSERT(argVar->get_kind() == var_expr::arg_var); - expr* argExpr = e->get_arg(argVar->get_param_pos()); - - findNodeSourcesRec(argExpr, sources, currentUdf); - } - else - { - if (std::find(sources.begin(), sources.end(), source) == sources.end()) - sources.push_back(source); - } - } - } // not recursive call - } // f->isUdf() - else - { - csize numArgs = e->num_args(); - for (csize i = 0; i < numArgs; ++i) - { - if (f->propagatesInputNodes(e, i)) - { - findNodeSourcesRec(e->get_arg(i), sources, currentUdf); - } - } - } - - return; - } - case promote_expr_kind: case treat_expr_kind: case order_expr_kind: @@ -1322,7 +1202,7 @@ xqtref_t retType = node->get_return_type(); - if (TypeOps::is_subtype(tm, *retType, *rtm.ANY_ATOMIC_TYPE_STAR, node->get_loc())) + if (TypeOps::is_subtype(tm, *retType, *rtm.ANY_SIMPLE_TYPE, node->get_loc())) return; switch(node->get_expr_kind()) @@ -1407,25 +1287,14 @@ varSources = new std::vector;; theVarSourcesMap.insert(VarSourcesPair(e, varSources)); - std::vector::const_iterator ite2 = e->setExprsBegin(); - std::vector::const_iterator end2 = e->setExprsEnd(); + var_expr::VarSetExprs::const_iterator ite2 = e->setExprsBegin(); + var_expr::VarSetExprs::const_iterator end2 = e->setExprsEnd(); for (; ite2 != end2; ++ite2) { - expr* setExpr = *ite2; + var_set_expr* setExpr = *ite2; - if (setExpr->get_expr_kind() == var_decl_expr_kind) - { - findLocalNodeSources(static_cast(setExpr)->get_init_expr(), - *varSources); - } - else - { - assert(setExpr->get_expr_kind() == var_set_expr_kind); - - findLocalNodeSources(static_cast(setExpr)->get_expr(), - *varSources); - } + findLocalNodeSources(setExpr->get_expr(), *varSources); } } else diff -Nru zorba-2.7.0-0/src/compiler/rewriter/tools/dataflow_annotations.h zorba-2.8.0-0/src/compiler/rewriter/tools/dataflow_annotations.h --- zorba-2.7.0-0/src/compiler/rewriter/tools/dataflow_annotations.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/tools/dataflow_annotations.h 2013-01-16 18:28:18.000000000 +0000 @@ -38,18 +38,13 @@ private: void compute_var_decl_expr(var_decl_expr* e); void compute_block_expr(block_expr* e); - void compute_wrapper_expr(wrapper_expr* e); void compute_var_expr(var_expr* e); void compute_var_set_expr(var_set_expr* e); void compute_flwor_expr(flwor_expr* e); void compute_trycatch_expr(trycatch_expr* e); - void compute_promote_expr(promote_expr* e); void compute_if_expr(if_expr* e); void compute_fo_expr(fo_expr* e); - void compute_instanceof_expr(instanceof_expr* e); - void compute_treat_expr(treat_expr* e); void compute_castable_expr(castable_expr* e); - void compute_cast_expr(cast_expr* e); void compute_name_cast_expr(name_cast_expr* e); void compute_validate_expr(validate_expr* e); void compute_extension_expr(extension_expr* e); @@ -82,15 +77,9 @@ typedef std::map* > UdfSourcesMap; typedef std::pair* > UdfSourcesPair; - typedef std::map SourceUdfMap; - typedef std::pair SourceUdfMapPair; - protected: - VarSourcesMap theVarSourcesMap; - UdfSourcesMap theUdfSourcesMap; - SourceUdfMap theSourceUdfMap; - - user_function * theStartingUdf; + VarSourcesMap theVarSourcesMap; + UdfSourcesMap theUdfSourcesMap; protected: void findNodeSourcesRec( @@ -101,14 +90,9 @@ public: ~SourceFinder(); - void findNodeSources( - expr* inExpr, - UDFCallChain* udfChain, - std::vector& sources); - - void findLocalNodeSources( - expr* inExpr, - std::vector& sources); + void findNodeSources(expr* inExpr, std::vector& sources); + + void findLocalNodeSources(expr* inExpr, std::vector& sources); }; diff -Nru zorba-2.7.0-0/src/compiler/rewriter/tools/expr_tools.cpp zorba-2.8.0-0/src/compiler/rewriter/tools/expr_tools.cpp --- zorba-2.7.0-0/src/compiler/rewriter/tools/expr_tools.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/tools/expr_tools.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -48,10 +48,11 @@ /******************************************************************************* ********************************************************************************/ -bool count_variable_uses_rec( - const expr* e, - const var_expr* var, +bool count_var_uses_rec( + expr* e, + var_expr* var, int limit, + std::vector* path, int& count) { if (limit > 0 && count >= limit) @@ -67,35 +68,84 @@ if (e->get_expr_kind() == if_expr_kind) { + ExprIterator iter(e); const if_expr* ifExpr = static_cast(e); - int thenCount = 0; - int elseCount = 0; + if (path && count == 0) + path->push_back(*iter); - if (!count_variable_uses_rec(ifExpr->get_cond_expr(), var, limit, count)) - return false; + bool done = !count_var_uses_rec(ifExpr->get_cond_expr(), var, limit, path, count); + if (done) + { + assert(count > 0); + return false; + } + + if (path && count == 0) + path->pop_back(); + + iter.next(); - if (!count_variable_uses_rec(ifExpr->get_then_expr(), var, limit, thenCount)) + if (path && count == 0) + path->push_back(*iter); + + int thenCount = count; + std::vector* thenPath = (count == 0 ? path : NULL); + + done = !count_var_uses_rec(ifExpr->get_then_expr(), var, limit, thenPath, thenCount); + if (done) { count = thenCount; + assert(count > 0); return false; } - if (!count_variable_uses_rec(ifExpr->get_else_expr(), var, limit, elseCount)) + if (path && count == 0) + path->pop_back(); + + iter.next(); + + if (path && count == 0) + path->push_back(*iter); + + int elseCount = count; + std::vector* elsePath = (count == 0 ? path : NULL); + + done = !count_var_uses_rec(ifExpr->get_else_expr(), var, limit, elsePath, elseCount); + if (done) { count = elseCount; + assert(count > 0); return false; } - count += (thenCount > elseCount ? thenCount : elseCount); + if (path && count == 0) + path->pop_back(); + + count = (thenCount > elseCount ? thenCount : elseCount); } else { - ExprConstIterator iter(e); + ExprIterator iter(e); while (!iter.done()) { - if (!count_variable_uses_rec(iter.get_expr(), var, limit, count)) + if (path && count == 0) + { + path->push_back(*iter); + } + + bool done = ! count_var_uses_rec(**iter, var, limit, path, count); + + if (done) + { + assert(count > 0); return false; + } + + if (path && count == 0) + { + path->pop_back(); + } iter.next(); } @@ -108,11 +158,15 @@ /******************************************************************************* ********************************************************************************/ -int count_variable_uses(const expr* root, const var_expr* var, int limit = 0) +int count_variable_uses( + expr* root, + var_expr* var, + int limit, + std::vector* path) { int count = 0; - count_variable_uses_rec(root, var, limit, count); + count_var_uses_rec(root, var, limit, path, count); return count; } @@ -162,7 +216,7 @@ { wrapper_expr* wrapper = reinterpret_cast(e); - if (wrapper->get_expr() == oldVar) + if (wrapper->get_input() == oldVar) { wrapper->set_expr(newVar); return; @@ -352,7 +406,7 @@ add_var(inVars.prev, numVars, varidmap, idvarmap); add_var(inVars.next, numVars, varidmap, idvarmap); - index_flwor_vars(cond->get_cond(), numVars, varidmap, idvarmap); + index_flwor_vars(cond->get_expr(), numVars, varidmap, idvarmap); add_var(outVars.posvar, numVars, varidmap, idvarmap); add_var(outVars.curr, numVars, varidmap, idvarmap); @@ -555,526 +609,6 @@ } -///////////////////////////////////////////////////////////////////////////////// -// // -// // -// // -///////////////////////////////////////////////////////////////////////////////// - - -#if 0 -/******************************************************************************* - -********************************************************************************/ -static void set_must_copy(expr* target, BoolAnnotationValue v) -{ - assert(v != ANNOTATION_UNKNOWN); - - if (target == NULL) - return; - - switch (target->getMustCopyNodes()) - { - case ANNOTATION_UNKNOWN: - { - target->setMustCopyNodes(v); - return; - } - case ANNOTATION_TRUE_FIXED: - { - return; - } - case ANNOTATION_TRUE: - { - if (v == ANNOTATION_TRUE_FIXED) - target->setMustCopyNodes(v); - - return; - } - case ANNOTATION_FALSE: - { - target->setMustCopyNodes(v); - return; - } - } -} - - -/******************************************************************************* - If the no-node-copy annotation of the target expr is not set to false - already, set it to the value of the no-node-copy annotations of the - source expr. -********************************************************************************/ -static void pushdown_must_copy(expr* src, expr* target) -{ - set_must_copy(target, src->getMustCopyNodes()); -} - - -/******************************************************************************* - -********************************************************************************/ -static void pushdown_window_vars(const flwor_wincond* cond, expr* target) -{ - const flwor_wincond::vars& inVars = cond->get_in_vars(); - - if (inVars.curr) - pushdown_must_copy(inVars.curr, target); - - if (inVars.prev) - pushdown_must_copy(inVars.prev, target); - - if (inVars.next) - pushdown_must_copy(inVars.next, target); - - const flwor_wincond::vars& outVars = cond->get_out_vars(); - - if (outVars.curr) - pushdown_must_copy(outVars.curr, target); - - if (outVars.prev) - pushdown_must_copy(outVars.prev, target); - - if (outVars.next) - pushdown_must_copy(outVars.next, target); -} - - -/******************************************************************************* - -********************************************************************************/ -void computeMustCopyProperty(expr* inExpr) -{ - switch(inExpr->get_expr_kind()) - { - case const_expr_kind: - { - return; - } - - case var_expr_kind: - { - var_expr* e = static_cast(inExpr); - - switch (e->get_kind()) - { - case var_expr::for_var: - case var_expr::let_var: - case var_expr::pos_var: - case var_expr::win_var: - case var_expr::score_var: - case var_expr::wincond_out_var: - case var_expr::wincond_out_pos_var: - case var_expr::wincond_in_var: - case var_expr::wincond_in_pos_var: - case var_expr::count_var: - case var_expr::groupby_var: - case var_expr::non_groupby_var: - case var_expr::copy_var: - { - return; - } - - case var_expr::arg_var: - { - return; - //expr* argExpr = argExprs[e->get_param_pos()]; - //pushdown_no_node_copy(inExpr, argExpr); - } - - case var_expr::prolog_var: - case var_expr::local_var: - { - // TODO: pass into this function a map with one entry per in-scope var. - // The entry maps the var to the most recently encountered assignment - // expr for this var. - return; - } - - case var_expr::catch_var: - { - // TODO: associate the catch var with the try clause and keep track inside the - // try_catch expr of all the fn:error() calls that return an item()* seq. - return; - } - - case var_expr::eval_var: // TODO - default: - { - ZORBA_ASSERT(false); - } - } - - break; - } - - case doc_expr_kind: - { - doc_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->getContent()); - break; - } - - case elem_expr_kind: - { - elem_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->getContent()); - pushdown_must_copy(inExpr, e->getAttrs()); - set_must_copy(e->getQNameExpr(), ANNOTATION_FALSE); - break; - } - - case attr_expr_kind: - { - attr_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->getValueExpr()); - set_must_copy(e->getQNameExpr(), ANNOTATION_FALSE); - break; - } - - case text_expr_kind: - { - text_expr* e = static_cast(inExpr); - set_must_copy(e->get_text(), ANNOTATION_FALSE); - break; - } - - case pi_expr_kind: - { - pi_expr* e = static_cast(inExpr); - set_must_copy(e->get_target_expr(), ANNOTATION_FALSE); - set_must_copy(e->get_content_expr(), ANNOTATION_FALSE); - break; - } - - case relpath_expr_kind: - { - const relpath_expr* e = static_cast(inExpr); - - std::vector::const_iterator ite = e->begin(); - std::vector::const_iterator end = e->end(); - - for (++ite; ite != end; ++ite) - { - axis_step_expr* axisExpr = static_cast((*ite)); - axis_kind_t axisKind = axisExpr->getAxis(); - - if (axisKind != axis_kind_child && - axisKind != axis_kind_descendant && - axisKind != axis_kind_self && - axisKind != axis_kind_attribute) - { - set_must_copy((*e)[0], ANNOTATION_TRUE_FIXED); - break; - } - } - - break; - } - - case flwor_expr_kind: - case gflwor_expr_kind: - { - flwor_expr* e = static_cast(inExpr); - - pushdown_must_copy(inExpr, e->get_return_expr()); - - csize i = e->num_clauses(); - for (; i > 0; --i) - { - flwor_clause* clause = e->get_clause(i-1); - - switch(clause->get_kind()) - { - case flwor_clause::for_clause: - { - for_clause* fc = static_cast(clause); - pushdown_must_copy(fc->get_var(), fc->get_expr()); - computeMustCopyProperty(fc->get_expr()); - break; - } - case flwor_clause::let_clause: - { - let_clause* lc = static_cast(clause); - pushdown_must_copy(lc->get_var(), lc->get_expr()); - computeMustCopyProperty(lc->get_expr()); - break; - } - case flwor_clause::window_clause: - { - window_clause* wc = static_cast(clause); - - pushdown_must_copy(wc->get_var(), wc->get_expr()); - - const flwor_wincond* startCond = wc->get_win_start(); - const flwor_wincond* endCond = wc->get_win_start(); - - if (startCond) - { - set_must_copy(startCond->get_cond(), ANNOTATION_FALSE); - - computeMustCopyProperty(startCond->get_cond()); - - pushdown_window_vars(startCond, wc->get_expr()); - } - - if (endCond) - { - set_must_copy(endCond->get_cond(), ANNOTATION_FALSE); - - computeMustCopyProperty(endCond->get_cond()); - - pushdown_window_vars(endCond, wc->get_expr()); - } - - computeMustCopyProperty(wc->get_expr()); - break; - } - case flwor_clause::where_clause: - { - where_clause* cc = static_cast(clause); - set_must_copy(cc->get_expr(), ANNOTATION_FALSE); - computeMustCopyProperty(cc->get_expr()); - break; - } - case flwor_clause::group_clause: - { - group_clause* gc = static_cast(clause); - - flwor_clause::rebind_list_t::iterator ite = gc->beginGroupVars(); - flwor_clause::rebind_list_t::iterator end = gc->endGroupVars(); - - for (; ite != end; ++ite) - { - pushdown_must_copy((*ite).second, (*ite).first); - } - - ite = gc->beginNonGroupVars(); - end = gc->endNonGroupVars(); - - for (; ite != end; ++ite) - { - pushdown_must_copy((*ite).second, (*ite).first); - } - - break; - } - case flwor_clause::order_clause: - { - orderby_clause* ob = static_cast(clause); - - std::vector::iterator ite = ob->begin(); - std::vector::iterator end = ob->end(); - - for (; ite != end; ++ite) - { - set_must_copy((*ite), ANNOTATION_FALSE); - computeMustCopyProperty(*ite); - } - break; - } - case flwor_clause::count_clause: - { - break; - } - default: - ZORBA_ASSERT(false); - } - } - - return; - } - - case if_expr_kind: - { - if_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->get_cond_expr()); - pushdown_must_copy(inExpr, e->get_then_expr()); - pushdown_must_copy(inExpr, e->get_else_expr()); - break; - } - - case trycatch_expr_kind: - { - trycatch_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->get_try_expr()); - - csize numCatches = e->clause_count(); - for (csize i = 0; i < numCatches; ++i) - { - pushdown_must_copy(inExpr, e->get_catch_expr(i)); - } - break; - } - - case fo_expr_kind: - { - fo_expr* e = static_cast(inExpr); - function* func = e->get_func(); - - csize numArgs = e->num_args(); - - for (csize i = 0; i < numArgs; ++i) - { - set_must_copy(e->get_arg(i), func->mustCopyInputNodes(e, i)); - } - - break; - } - - case dynamic_function_invocation_expr_kind: - case function_item_expr_kind: - { - ZORBA_ASSERT(false); // TODO - } - - case castable_expr_kind: - case instanceof_expr_kind: - case cast_expr_kind: - { - cast_or_castable_base_expr* e = static_cast(inExpr); - set_must_copy(e, ANNOTATION_FALSE); - pushdown_must_copy(inExpr, e->get_input()); - break; - } - - case treat_expr_kind: - case promote_expr_kind: - { - cast_base_expr* e = static_cast(inExpr); - - if (TypeOps::is_subtype(e->get_type_manager(), - *e->get_target_type(), - *GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR)) - { - set_must_copy(e, ANNOTATION_FALSE); - } - - pushdown_must_copy(inExpr, e->get_input()); - break; - } - - case name_cast_expr_kind: - { - name_cast_expr* e = static_cast(inExpr); - set_must_copy(e, ANNOTATION_FALSE); - pushdown_must_copy(inExpr, e->get_input()); - break; - } - - case validate_expr_kind: - { - validate_expr* e = static_cast(inExpr); - set_must_copy(e, ANNOTATION_TRUE_FIXED); - pushdown_must_copy(inExpr, e->get_expr()); - break; - } - - case extension_expr_kind: - { - extension_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->get_expr()); - break; - } - - case order_expr_kind: - { - order_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->get_expr()); - break; - } - - case delete_expr_kind: - case insert_expr_kind: - case rename_expr_kind: - case replace_expr_kind: - { - update_expr_base* e = static_cast(inExpr); - - set_must_copy(e->getTargetExpr(), ANNOTATION_TRUE_FIXED); - - if (e->get_expr_kind() == rename_expr_kind) - { - set_must_copy(e->getSourceExpr(), ANNOTATION_FALSE); - } - else if (e->get_expr_kind() == replace_expr_kind) - { - replace_expr* re = static_cast(inExpr); - - if (re->getType() == store::UpdateConsts::VALUE_OF_NODE) - { - set_must_copy(e->getSourceExpr(), ANNOTATION_FALSE); - } - else - { - set_must_copy(e->getSourceExpr(), ANNOTATION_TRUE_FIXED); - } - } - else - { - set_must_copy(e->getSourceExpr(), ANNOTATION_TRUE_FIXED); - } - - break; - } - -#if 0 - case transform_expr_kind: - - case block_expr_kind: - case var_decl_expr_kind: - case apply_expr_kind: - case exit_expr_kind: - case exit_catcher_expr_kind: - case flowctl_expr_kind: - case while_expr_kind: - - case eval_expr_kind: - case debugger_expr_kind: - -#endif - - case wrapper_expr_kind: - { - wrapper_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->get_expr()); - break; - } - - case function_trace_expr_kind: - { - function_trace_expr* e = static_cast(inExpr); - pushdown_must_copy(inExpr, e->get_expr()); - break; - } - -#ifndef ZORBA_NO_FULL_TEXT - case ft_expr_kind: - { - ft_expr* e = static_cast(inExpr); - set_must_copy(e, ANNOTATION_FALSE); - set_must_copy(e->get_range(), ANNOTATION_TRUE_FIXED); - set_must_copy(e->get_ignore(), ANNOTATION_TRUE_FIXED); - break; - } -#endif /* ZORBA_NO_FULL_TEXT */ - - case axis_step_expr_kind: - case match_expr_kind: - default: - ZORBA_ASSERT(false); - } - - ExprIterator iter(inExpr); - while (!iter.done()) - { - computeMustCopyProperty(*iter); - iter.next(); - } -} -#endif - - } } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/tools/expr_tools.h zorba-2.8.0-0/src/compiler/rewriter/tools/expr_tools.h --- zorba-2.7.0-0/src/compiler/rewriter/tools/expr_tools.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/tools/expr_tools.h 2013-01-16 18:28:18.000000000 +0000 @@ -46,7 +46,11 @@ namespace expr_tools { -int count_variable_uses(const expr* root, const var_expr* var, int limit); +int count_variable_uses( + expr* root, + var_expr* var, + int limit, + std::vector* path); /******************************************************************************* diff -Nru zorba-2.7.0-0/src/compiler/rewriter/tools/udf_graph.cpp zorba-2.8.0-0/src/compiler/rewriter/tools/udf_graph.cpp --- zorba-2.7.0-0/src/compiler/rewriter/tools/udf_graph.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/tools/udf_graph.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -105,12 +105,13 @@ if (kind == fo_expr_kind) { const fo_expr* fo = static_cast(curExpr); - udf = dynamic_cast(fo->get_func()); + if (fo->get_func()->isUdf()) + udf = static_cast(fo->get_func()); } else { const function_item_expr* fi = static_cast(curExpr); - udf = dynamic_cast(fi->get_function()); + udf = static_cast(fi->get_function()); } if (udf != NULL) @@ -274,7 +275,7 @@ bool deterministic = true; - for (ulong i = 0; i < node->theChildren.size(); ++i) + for (csize i = 0; i < node->theChildren.size(); ++i) { if (inferDeterminism(node->theChildren[i], visit) == false) deterministic = false; @@ -330,7 +331,7 @@ o << inc_indent; - for (ulong i = 0; i < node->theChildren.size(); ++i) + for (csize i = 0; i < node->theChildren.size(); ++i) { display(o, node->theChildren[i]); } diff -Nru zorba-2.7.0-0/src/compiler/rewriter/tools/udf_graph.h zorba-2.8.0-0/src/compiler/rewriter/tools/udf_graph.h --- zorba-2.7.0-0/src/compiler/rewriter/tools/udf_graph.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/rewriter/tools/udf_graph.h 2013-01-16 18:28:18.000000000 +0000 @@ -116,8 +116,6 @@ ~UDFGraph(); - void build(const expr* e); - void optimizeUDFs(CompilerCB* ccb); void inferDeterminism(); @@ -125,6 +123,8 @@ void display(std::ostream& o); protected: + void build(const expr* e); + void build(const expr* curExpr, std::vector& callChain); void addEdge(user_function* caller, user_function* callee); diff -Nru zorba-2.7.0-0/src/compiler/translator/prolog_graph.cpp zorba-2.8.0-0/src/compiler/translator/prolog_graph.cpp --- zorba-2.7.0-0/src/compiler/translator/prolog_graph.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/translator/prolog_graph.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -55,7 +55,7 @@ zstring varName = '$' + v1.getVarExpr()->get_name()->getStringValue(); RAISE_ERROR(err::XPST0008, v2.getVarExpr()->get_loc(), - ERROR_PARAMS(varName, ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName)); } addEdge(theGraph, v1, v2); diff -Nru zorba-2.7.0-0/src/compiler/translator/translator.cpp zorba-2.8.0-0/src/compiler/translator/translator.cpp --- zorba-2.7.0-0/src/compiler/translator/translator.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/translator/translator.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -168,6 +168,12 @@ /******************************************************************************* ********************************************************************************/ +#define CREATE(kind) theExprManager->create_##kind##_expr + + +/******************************************************************************* + +********************************************************************************/ #define ZANN_CONTAINS( ann ) theAnnotations->contains(AnnotationInternal::ann) @@ -196,8 +202,9 @@ #define DOT_REF \ theExprManager->create_wrapper_expr(theRootSctx, \ - loc, \ - lookup_ctx_var(DOT_VARNAME, loc)) + theUDF, \ + loc, \ + lookup_ctx_var(DOT_VARNAME, loc)) namespace translator_ns { @@ -584,6 +591,8 @@ ulong thePrintDepth; int theScopeDepth; + user_function * theUDF; + std::list thePrologVars; PrologGraph thePrologGraph; @@ -601,7 +610,7 @@ int theTempVarCounter; - std::stack theNodeStack; + std::stack theNodeStack; #ifndef ZORBA_NO_FULL_TEXT std::stack theFTNodeStack; @@ -609,7 +618,7 @@ std::stack theTypeStack; - std::vector theFlworClausesStack; + std::vector theFlworClausesStack; std::vector theTryStack; @@ -674,6 +683,7 @@ theNSCtx(new namespace_context(theSctx)), thePrintDepth(0), theScopeDepth(0), + theUDF(NULL), thePrologGraph(rootSctx), theHaveUpdatingExitExprs(false), theHaveSequentialExitExprs(false), @@ -707,7 +717,7 @@ xquery_fns_def_dot.set(FunctionConsts::FN_PATH_0); - op_concatenate = GET_BUILTIN_FUNCTION(OP_CONCATENATE_N); + op_concatenate = BUILTIN_FUNC(OP_CONCATENATE_N); assert(op_concatenate != NULL); if (rootTranslator == NULL) @@ -1082,7 +1092,8 @@ var_expr::var_kind kind, xqtref_t type = NULL) { - var_expr* e = theExprManager->create_var_expr(theRootSctx, loc, kind, qname); + var_expr* e = theExprManager-> + create_var_expr(theRootSctx, theUDF, loc, kind, qname); if (kind == var_expr::pos_var || kind == var_expr::count_var || @@ -1138,27 +1149,7 @@ { assert(sctx != NULL); - switch (e->get_kind()) - { - case var_expr::let_var: - { - sctx->bind_var(e, e->get_loc(), err::XQST0039); - break; - } - case var_expr::win_var: - case var_expr::wincond_out_var: - case var_expr::wincond_out_pos_var: - case var_expr::wincond_in_var: - case var_expr::wincond_in_pos_var: - { - sctx->bind_var(e, e->get_loc(), err::XQST0103); - break; - } - default: - { - sctx->bind_var(e, e->get_loc(), err::XQST0049); - } - } + sctx->bind_var(e, e->get_loc()); } @@ -1210,26 +1201,27 @@ ********************************************************************************/ var_expr* lookup_ctx_var(const QName* qname, const QueryLoc& loc) { - if (theIsInIndexDomain) + store::Item_t qnameItem; + expand_no_default_qname(qnameItem, qname, loc); + + VarInfo* var = theSctx->lookup_var(qnameItem.getp()); + + if (var == NULL) { - try + if (theIsInIndexDomain) { - return lookup_var(qname, loc, err::XPDY0002); + RAISE_ERROR(zerr::ZDST0032_INDEX_REFERENCES_CTX_ITEM, loc, + ERROR_PARAMS(theIndexDecl->getName()->getStringValue())); } - catch (ZorbaException const& e) + else { - if (e.diagnostic() == err::XPDY0002) - { - RAISE_ERROR(zerr::ZDST0032_INDEX_REFERENCES_CTX_ITEM, loc, - ERROR_PARAMS(theIndexDecl->getName()->getStringValue())); - } - throw; + zstring varName = static_context::var_name(qnameItem); + RAISE_ERROR(err::XPDY0002, loc, + ERROR_PARAMS(ZED(XPDY0002_ContextUndeclared_2), varName)); } } - else - { - return lookup_var(qname, loc, err::XPDY0002); - } + + return var->getVar(); } @@ -1241,10 +1233,10 @@ If the lexical qname has a prefix for which no namespace binding exists, the method raises error. - If var is not found, the method raises the given error, unless the given error - is zerr::ZXQP0000_NO_ERROR, in which case it returns NULL. + If var is not found, the method raises XPST0008, unless the raiseError param + is alse, in which case it returns NULL. ********************************************************************************/ -var_expr* lookup_var(const QName* qname, const QueryLoc& loc, const Error& err) +var_expr* lookup_var(const QName* qname, const QueryLoc& loc, bool raiseError) { store::Item_t qnameItem; expand_no_default_qname(qnameItem, qname, loc); @@ -1253,12 +1245,11 @@ if (!var) { - if (err != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { zstring varName = static_context::var_name(qnameItem); - throw XQUERY_EXCEPTION_VAR(err, - ERROR_PARAMS(varName, ZED(VariabledUndeclared)), - ERROR_LOC(loc)); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName)); } return NULL; @@ -1273,21 +1264,20 @@ moves upwards the ancestor path until the first instance (if any) of the var is found. - If var is not found, the method raises the given error, unless the given error - is MAX_ZORBA_ERROR_CODE, in which case it returns NULL. + If var is not found, the method raises XPST0008, unless the raiseError param + is alse, in which case it returns NULL. ********************************************************************************/ -var_expr* lookup_var(const store::Item* qname, const QueryLoc& loc, const Error& err) +var_expr* lookup_var(const store::Item* qname, const QueryLoc& loc, bool raiseError) { VarInfo* var = theSctx->lookup_var(qname); if (!var) { - if (err != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { zstring varName = static_context::var_name(qname); - throw XQUERY_EXCEPTION_VAR(err, - ERROR_PARAMS(varName, ZED(VariabledUndeclared)), - ERROR_LOC(loc)); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName)); } return NULL; @@ -1339,7 +1329,7 @@ ********************************************************************************/ fo_expr* create_empty_seq(const QueryLoc& loc) { - return theExprManager->create_seq(theRootSctx, loc); + return theExprManager->create_seq(theRootSctx, theUDF, loc); } @@ -1452,7 +1442,7 @@ { argExpr = wrap_in_type_promotion(argExpr, paramType, - PromoteIterator::FUNC_PARAM, + PROMOTE_FUNC_PARAM, func->getName()); } else @@ -1460,7 +1450,7 @@ argExpr = wrap_in_type_match(argExpr, paramType, loc, - TreatIterator::FUNC_PARAM, + TREAT_FUNC_PARAM, func->getName()); } } @@ -1476,8 +1466,9 @@ expr* wrap_in_atomization(expr* e) { return theExprManager->create_fo_expr(theRootSctx, + theUDF, e->get_loc(), - GET_BUILTIN_FUNCTION(FN_DATA_1), + BUILTIN_FUNC(FN_DATA_1), e); } @@ -1488,12 +1479,13 @@ expr* wrap_in_type_promotion( expr* e, const xqtref_t& type, - PromoteIterator::ErrorKind errorKind, + PromoteErrorKind errorKind, store::Item* qname = NULL) { e = wrap_in_atomization(e); return theExprManager->create_promote_expr(theRootSctx, + theUDF, e->get_loc(), e, type, @@ -1509,7 +1501,7 @@ expr* e, const xqtref_t& type, const QueryLoc& loc, - TreatIterator::ErrorKind errorKind, + TreatErrorKind errorKind, store::Item_t qname = NULL) { TypeManager* tm = e->get_type_manager(); @@ -1523,6 +1515,7 @@ else { return theExprManager->create_treat_expr(theRootSctx, + theUDF, e->get_loc(), e, type, @@ -1539,8 +1532,9 @@ fo_expr* wrap_in_enclosed_expr(expr* contentExpr, const QueryLoc& loc) { return theExprManager->create_fo_expr(theRootSctx, + theUDF, loc, - GET_BUILTIN_FUNCTION(OP_ENCLOSED_1), + BUILTIN_FUNC(OP_ENCLOSED_1), contentExpr); } @@ -1551,8 +1545,9 @@ expr* wrap_in_bev(expr * e) { fo_expr* fo = theExprManager->create_fo_expr(theRootSctx, + theUDF, e->get_loc(), - GET_BUILTIN_FUNCTION(FN_BOOLEAN_1), + BUILTIN_FUNC(FN_BOOLEAN_1), e); return fo; } @@ -1586,10 +1581,13 @@ fkind = FunctionConsts::OP_SORT_DISTINCT_NODES_ASC_1; } - fo_expr* dos = theExprManager->create_fo_expr(theRootSctx, - expr->get_loc(), - BuiltinFunctionLibrary::getFunction(fkind), - expr); + fo_expr* dos = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + expr->get_loc(), + BuiltinFunctionLibrary::getFunction(fkind), + expr); + normalize_fo(dos); return &*dos; @@ -1600,14 +1598,11 @@ Create a LET clause for the given LET variable "lv", with the given expr "e" as its defining expression. ********************************************************************************/ -let_clause* wrap_in_letclause(expr* e, var_expr* lv) +forlet_clause* wrap_in_letclause(expr* e, var_expr* lv) { assert (lv->get_kind () == var_expr::let_var); - return theExprManager->create_let_clause(theRootSctx, - e->get_loc(), - lv, - e); + return theExprManager->create_let_clause(theRootSctx, e->get_loc(), lv, e); } @@ -1616,7 +1611,7 @@ local sctx obj. Then, create a LET clause for this new var_expr, with the given expr "e" as its defining expression. ********************************************************************************/ -let_clause* wrap_in_letclause( +forlet_clause* wrap_in_letclause( expr* e, const QueryLoc& loc, const QName* qname) @@ -1630,7 +1625,7 @@ this new var_expr, with the given expr "e" as its defining expression. NOTE: the internal var is not registered in the sctx. ********************************************************************************/ -let_clause* wrap_in_letclause(expr* e) +forlet_clause* wrap_in_letclause(expr* e) { return wrap_in_letclause(e, create_temp_var(e->get_loc(), var_expr::let_var)); } @@ -1640,7 +1635,7 @@ Create a FOR clause for the given FOR variable "fv" and its associated POS var "pv" (pv may be NULL). Use the given expr "e" as the defining expr for "fv". ********************************************************************************/ -for_clause* wrap_in_forclause(expr* e, var_expr* fv, var_expr* pv) +forlet_clause* wrap_in_forclause(expr* e, var_expr* fv, var_expr* pv) { assert(fv->get_kind () == var_expr::for_var); if (pv != NULL) @@ -1648,11 +1643,7 @@ assert(pv->get_kind() == var_expr::pos_var); } - return theExprManager->create_for_clause(theRootSctx, - e->get_loc(), - fv, - e, - pv); + return theExprManager->create_for_clause(theRootSctx, e->get_loc(), fv, e, pv); } @@ -1662,7 +1653,7 @@ Then, create a FOR clause for these new var_exprs, with the given expr as the defining expression of the FOR var. ********************************************************************************/ -for_clause* wrap_in_forclause( +forlet_clause* wrap_in_forclause( expr* expr, const QueryLoc& loc, const QName* fv_qname, @@ -1679,7 +1670,7 @@ this new var_expr, with the given expr as its defining expression. NOTE: the internal var is not registered in the sctx. ********************************************************************************/ -for_clause* wrap_in_forclause(expr* expr, bool add_posvar) +forlet_clause* wrap_in_forclause(expr* expr, bool add_posvar) { var_expr* fv = create_temp_var(expr->get_loc(), var_expr::for_var); @@ -1704,9 +1695,8 @@ var_expr* lv, expr* retExpr) { - flwor_expr* fe = theExprManager->create_flwor_expr(theRootSctx, - lv->get_loc(), - false); + flwor_expr* fe = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, lv->get_loc(), false); fe->add_clause(wrap_in_letclause(domExpr, lv)); @@ -1738,7 +1728,8 @@ push_scope(); - flwor_expr* flworExpr = theExprManager->create_flwor_expr(theRootSctx, loc, false); + flwor_expr* flworExpr = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); if (withContextSize) { @@ -1746,21 +1737,22 @@ let_clause* lcInputSeq = wrap_in_letclause(inputExpr); // compute the size of the input seq - fo_expr* countExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_COUNT_1), - lcInputSeq->get_var()); + fo_expr* countExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_COUNT_1), + lcInputSeq->get_var()); + normalize_fo(countExpr); - let_clause* lcLast = wrap_in_letclause(countExpr, - loc, - LAST_IDX_VARNAME); + forlet_clause* lcLast = wrap_in_letclause(countExpr, loc, LAST_IDX_VARNAME); // Iterate over the input seq for_clause* fcDot = wrap_in_forclause(lcInputSeq->get_var(), - loc, - DOT_VARNAME, - DOT_POS_VARNAME); + loc, + DOT_VARNAME, + DOT_POS_VARNAME); flworExpr->add_clause(lcInputSeq); flworExpr->add_clause(lcLast); flworExpr->add_clause(fcDot); @@ -1769,9 +1761,9 @@ { // Iterate over the input seq for_clause* fcDot = wrap_in_forclause(inputExpr, - loc, - DOT_VARNAME, - DOT_POS_VARNAME); + loc, + DOT_VARNAME, + DOT_POS_VARNAME); flworExpr->add_clause(fcDot); } @@ -1804,11 +1796,13 @@ #ifdef ZORBA_WITH_DEBUGGER if (theCCB->theDebuggerCommons != NULL) { - std::auto_ptr lExpr(theExprManager->create_debugger_expr(theSctx, - aLoc, - aExpr, - theNSCtx, - aIsVarDeclaration)); + std::auto_ptr lExpr(theExprManager-> + create_debugger_expr(theSctx, + theUDF, + aLoc, + aExpr, + theNSCtx, + aIsVarDeclaration)); // add the breakable expression in the debugger commons as a possible // breakpoint location @@ -1840,9 +1834,12 @@ var_expr::eval_var, NULL); - expr* argExpr = theExprManager->create_wrapper_expr(theRootSctx, - lBreakable.getLocation(), - argVar); + expr* argExpr = theExprManager-> + create_wrapper_expr(theRootSctx, + theUDF, + lBreakable.getLocation(), + argVar); + lExpr->add_var(evalVar, argExpr); } @@ -1891,10 +1888,10 @@ { VarInDecl* varDecl = varDecls[j]; - vars.insert(lookup_var(varDecl->get_var_name(), loc, err::XPST0008)); + vars.insert(lookup_var(varDecl->get_var_name(), loc, true)); if (varDecl->get_posvar() != NULL) - vars.insert(lookup_var(varDecl->get_posvar()->get_name(), loc, err::XPST0008)); + vars.insert(lookup_var(varDecl->get_posvar()->get_name(), loc, true)); } } else if (typeid(c) == typeid(LetClause)) @@ -1904,13 +1901,13 @@ for (int j = (int)lV.size() - 1; j >= 0; --j) { - vars.insert(lookup_var(lV[j]->get_var_name(), loc, err::XPST0008)); + vars.insert(lookup_var(lV[j]->get_var_name(), loc, true)); } } else if (typeid(c) == typeid(WindowClause)) { const WindowClause& wc = *static_cast(&c); - vars.insert(lookup_var(wc.get_var()->get_var_name(), loc, err::XPST0008)); + vars.insert(lookup_var(wc.get_var()->get_var_name(), loc, true)); for (int j = 1; j >= 0; j--) { const FLWORWinCond* cond = &*wc[j]; @@ -1920,13 +1917,13 @@ if (wv != NULL) { if (wv->get_next()) - vars.insert(lookup_var(wv->get_next(), loc, err::XPST0008)); + vars.insert(lookup_var(wv->get_next(), loc, true)); if (wv->get_prev()) - vars.insert(lookup_var(wv->get_prev(), loc, err::XPST0008)); + vars.insert(lookup_var(wv->get_prev(), loc, true)); if (wv->get_curr()) - vars.insert(lookup_var(wv->get_curr(), loc, err::XPST0008)); + vars.insert(lookup_var(wv->get_curr(), loc, true)); if (wv->get_posvar() != NULL) - vars.insert(lookup_var(wv->get_posvar()->get_name(), loc, err::XPST0008)); + vars.insert(lookup_var(wv->get_posvar()->get_name(), loc, true)); } } } @@ -1935,7 +1932,7 @@ { vars.insert(lookup_var(static_cast(&c)->get_varname(), loc, - err::XPST0008)); + true)); } else if (typeid(c) == typeid(OrderByClause)) { @@ -1950,7 +1947,7 @@ { GroupSpec* groupSpec = (*(groupClause.get_spec_list()))[gSpecPos]; if (groupSpec->get_binding_expr() != NULL) - vars.insert(lookup_var(groupSpec->get_var_name(), loc, err::XPST0008)); + vars.insert(lookup_var(groupSpec->get_var_name(), loc, true)); } // Group-by redefines ALL previous variables, but the GroupByClause lists @@ -2010,7 +2007,7 @@ ********************************************************************************/ void declare_var(const GlobalBinding& b, std::vector& stmts) { - function* varGet = GET_BUILTIN_FUNCTION(OP_VAR_GET_1); + function* varGet = BUILTIN_FUNC(OP_VAR_GET_1); expr* initExpr = b.theExpr; var_expr* varExpr = b.theVar; @@ -2028,11 +2025,16 @@ if (initExpr != NULL && varType != NULL && !b.is_extern()) { initExpr = theExprManager-> - create_treat_expr(theRootSctx, loc, initExpr, varType, TreatIterator::TYPE_MATCH); + create_treat_expr(theRootSctx, + theUDF, + loc, + initExpr, + varType, + TREAT_TYPE_MATCH); } expr* declExpr = theExprManager-> - create_var_decl_expr(theRootSctx, loc, varExpr, initExpr); + create_var_decl_expr(theRootSctx, theUDF, loc, varExpr, initExpr); stmts.push_back(declExpr); @@ -2040,10 +2042,15 @@ if (varType != NULL && b.is_extern()) { expr* getExpr = theExprManager-> - create_fo_expr(theRootSctx, loc, varGet, varExpr); + create_fo_expr(theRootSctx, theUDF, loc, varGet, varExpr); expr* treatExpr = theExprManager-> - create_treat_expr(theRootSctx, loc, getExpr, varType, TreatIterator::TYPE_MATCH); + create_treat_expr(theRootSctx, + theUDF, + loc, + getExpr, + varType, + TREAT_TYPE_MATCH); stmts.push_back(treatExpr); } @@ -2092,11 +2099,13 @@ args.push_back(program); } - block_expr* res = theExprManager->create_block_expr(theRootSctx, - program->get_loc(), - theCCB->theIsEval, - args, - &theAssignedVars[0]); + block_expr* res = theExprManager-> + create_block_expr(theRootSctx, + theUDF, + program->get_loc(), + theCCB->theIsEval, + args, + &theAssignedVars[0]); assert(theAssignedVars[0].empty()); @@ -2139,7 +2148,7 @@ theSctx->set_default_elem_type_ns(targetNS, true, loc); if (! pfx.empty()) - theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033); + theSctx->bind_ns(pfx, targetNS, loc); } zstring xsdTNS = zstring(XML_SCHEMA_NS); @@ -2292,11 +2301,12 @@ store::Item_t qname; return theExprManager->create_validate_expr(theRootSctx, - lLoc, - ParseConstants::val_strict, - qname, - aExpr, - theSctx->get_typemanager()); + theUDF, + lLoc, + ParseConstants::val_strict, + qname, + aExpr, + theSctx->get_typemanager()); } @@ -2974,7 +2984,7 @@ ! (pfx == theModulePrefix && targetNS == theModuleNamespace)) { - theSctx->bind_ns(pfx, targetNS, loc, err::XQST0033); + theSctx->bind_ns(pfx, targetNS, loc); } const URILiteralList* atlist = v.get_at_list(); @@ -3298,11 +3308,33 @@ store::Item_t qnameItem; zstring value = opt_decl->get_val().str(); - expand_no_default_qname(qnameItem, opt_decl->get_qname(), loc); + rchandle lQName = opt_decl->get_qname(); + if (theSctx->xquery_version() >= StaticContextConsts::xquery_version_3_0 && + lQName->get_namespace().empty() && lQName->get_prefix().empty()) + { + theSctx->expand_qname( + qnameItem, + static_context::XQUERY_OPTION_NS, + "", + lQName->get_localname(), + lQName->get_location()); + } + else + { + expand_no_default_qname(qnameItem, lQName, loc); + if (qnameItem->getPrefix().empty() && qnameItem->getNamespace().empty()) + { + RAISE_ERROR(err::XPST0081, loc, ERROR_PARAMS(qnameItem->getStringValue())); + } + } - if (qnameItem->getPrefix().empty() && qnameItem->getNamespace().empty()) - RAISE_ERROR(err::XPST0081, loc, ERROR_PARAMS(qnameItem->getStringValue())); + if (qnameItem->getNamespace() == static_context::ZORBA_OPTION_FEATURE_NS && + value == "http-uri-resolution") + { + RAISE_ERROR(zerr::ZXQP0061_DISABLE_HTTP_OPTION_IN_QUERY, loc, + ERROR_PARAMS(value)); + } theSctx->bind_option(qnameItem, value, opt_decl->get_location()); if (qnameItem->getNamespace() == static_context::ZORBA_OPTION_OPTIM_NS && @@ -3445,7 +3477,7 @@ ns == XQUERY_MATH_FN_NS) { RAISE_ERROR(err::XQST0045, func_decl->get_location(), - ERROR_PARAMS(qnameItem->getLocalName())); + ERROR_PARAMS(qnameItem->getLocalName(), ZED(FUNCTION), ns)); } if (! theModuleNamespace.empty() && ns != theModuleNamespace) @@ -3649,10 +3681,14 @@ // is not bound to a namespace). store::Item_t qnameItem; expand_function_qname(qnameItem, v.get_name(), v.get_name()->get_location()); + function* f = theSctx->lookup_fn(qnameItem, v.get_param_count(), false); assert(f); + if (f->isUdf()) + theUDF = static_cast(f); + thePrologGraph.addFuncVertex(f); theCurrentPrologVFDecl = PrologGraphVertex(f); @@ -3689,6 +3725,8 @@ { udf = dynamic_cast(lFunc); + assert(udf == theUDF); + body = pop_nodestack(); wrap_in_debugger_expr(body, v.get_name()->get_location()); @@ -3772,18 +3810,19 @@ if (udf->isExiting()) { - body = theExprManager->create_exit_catcher_expr(theRootSctx, loc, body, theExitExprs); + body = theExprManager-> + create_exit_catcher_expr(theRootSctx, theUDF, loc, body, theExitExprs); } // Wrap the UDF body to the type-related expr that enforce the declared // return type. xqtref_t returnType = udf->getSignature().returnType(); - if (TypeOps::is_builtin_simple(CTX_TM, *returnType)) + if (returnType->isBuiltinAtomicAny()) { body = wrap_in_type_promotion(body, returnType, - PromoteIterator::FUNC_RETURN, + PROMOTE_FUNC_RETURN, udf->getName()); body->set_loc(v.get_return_type()->get_location()); @@ -3793,7 +3832,7 @@ body = wrap_in_type_match(body, returnType, loc, - TreatIterator::FUNC_RETURN, + TREAT_FUNC_RETURN, udf->getName()); } @@ -3815,6 +3854,8 @@ } pop_scope(); + + theUDF = NULL; } @@ -3827,7 +3868,9 @@ if (v.size() > 0) { - flwor_expr* flwor = theExprManager->create_flwor_expr(theRootSctx, loc, false); + flwor_expr* flwor = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); + push_nodestack(flwor); } return no_state; @@ -3871,12 +3914,7 @@ if (inUDFBody()) { //lc->setLazyEval(!f->isSequential()); - - const user_function* udf = - static_cast(theCurrentPrologVFDecl.getFunction()); - arg_var->set_param_pos(flwor->num_clauses()); - arg_var->set_udf(udf); } else { @@ -3929,7 +3967,7 @@ if (theSctx->xquery_version() >= StaticContextConsts::xquery_version_3_0) { - ve = lookup_var(qnameItem, loc, err::XPST0008); + ve = lookup_var(qnameItem, loc, true); assert(ve); } @@ -3999,7 +4037,7 @@ expr::checkSimpleExpr(initExpr); ve->set_has_initializer(true); - if (!ve->is_mutable()) + if (!ve->is_mutable() && !ve->is_external()) { xqtref_t derivedType = initExpr->get_return_type(); @@ -4082,8 +4120,7 @@ if (AnnotationInternal::lookup(lExpandedQName) == AnnotationInternal::zann_end) { RAISE_ERROR(err::XQST0045, loc, - ERROR_PARAMS( "%" + ("\"" + lExpandedQName->getNamespace() + "\"" - + ":" + lExpandedQName->getLocalName()))); + ERROR_PARAMS(lExpandedQName->getLocalName(), ZED(ANNOTATION), annotNS)); } //recognised = true; @@ -4502,13 +4539,13 @@ domainExpr = wrap_in_type_match(domainExpr, theRTM.STRUCTURED_ITEM_TYPE_STAR, loc, - TreatIterator::INDEX_DOMAIN, + TREAT_INDEX_DOMAIN, index->getName()); #else domainExpr = wrap_in_type_match(domainExpr, theRTM.ANY_NODE_TYPE_STAR, loc, - TreatIterator::INDEX_DOMAIN, + TREAT_INDEX_DOMAIN, index->getName()); #endif @@ -4545,10 +4582,12 @@ // and not allow the domain expr to return duplicate nodes. if (index->isGeneral()) { - domainExpr = theExprManager->create_fo_expr(theRootSctx, - domainExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_CHECK_DISTINCT_NODES_1), - domainExpr); + domainExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + domainExpr->get_loc(), + BUILTIN_FUNC(OP_CHECK_DISTINCT_NODES_1), + domainExpr); } std::string msg = "Domain expr for index " + index->getName()->getStringValue().str(); @@ -4560,7 +4599,10 @@ // if (theCCB->theConfig.opt_level == CompilerCB::config::O1) { RewriterContext rCtx(theCCB, domainExpr, NULL, msg, false); + rCtx.setForSerializationOnly(false); + GENV_COMPILERSUBSYS.getDefaultOptimizingRewriter()->rewrite(rCtx); + domainExpr = rCtx.getRoot(); if (theCCB->theConfig.optimize_cb != NULL) @@ -4619,7 +4661,8 @@ if (!index->isGeneral()) { RAISE_ERROR(zerr::ZDST0027_INDEX_BAD_KEY_TYPE, kloc, - ERROR_PARAMS(index->getName()->getStringValue())); + ERROR_PARAMS(index->getName()->getStringValue(), + ZED(ZDST0027_NO_KEY_TYPE_DECL))); } } else @@ -4631,23 +4674,26 @@ if (!TypeOps::is_subtype(tm, *ptype, *theRTM.ANY_ATOMIC_TYPE_STAR, kloc)) { RAISE_ERROR(zerr::ZDST0027_INDEX_BAD_KEY_TYPE, kloc, - ERROR_PARAMS(index->getName()->getStringValue())); + ERROR_PARAMS(index->getName()->getStringValue(), + ZED(ZDST0027_NON_ATOMIC_KEY_TYPE))); } if (!index->isGeneral() && - (TypeOps::is_equal(tm, *ptype, *theRTM.ANY_ATOMIC_TYPE_ONE, kloc) || - TypeOps::is_equal(tm, *ptype, *theRTM.UNTYPED_ATOMIC_TYPE_ONE, kloc))) + quant != TypeConstants::QUANT_ONE && + quant != TypeConstants::QUANT_QUESTION) { RAISE_ERROR(zerr::ZDST0027_INDEX_BAD_KEY_TYPE, kloc, - ERROR_PARAMS(index->getName()->getStringValue())); + ERROR_PARAMS(index->getName()->getStringValue(), + ZED(ZDST0027_MULTI_VALUED_KEY_TYPE_DECL))); } if (!index->isGeneral() && - quant != TypeConstants::QUANT_ONE && - quant != TypeConstants::QUANT_QUESTION) + (TypeOps::is_equal(tm, *ptype, *theRTM.ANY_ATOMIC_TYPE_ONE, kloc) || + TypeOps::is_equal(tm, *ptype, *theRTM.UNTYPED_ATOMIC_TYPE_ONE, kloc))) { RAISE_ERROR(zerr::ZDST0027_INDEX_BAD_KEY_TYPE, kloc, - ERROR_PARAMS(index->getName()->getStringValue())); + ERROR_PARAMS(index->getName()->getStringValue(), + ZED(ZDST0027_NON_SPECIFIC_KEY_TYPE_DECL))); } if (index->getMethod() == IndexDecl::TREE && @@ -4663,13 +4709,15 @@ TypeOps::is_subtype(tm, *ptype, *theRTM.GDAY_TYPE_ONE, kloc))) { RAISE_ERROR(zerr::ZDST0027_INDEX_BAD_KEY_TYPE, kloc, - ERROR_PARAMS(index->getName()->getStringValue())); + ERROR_PARAMS(index->getName()->getStringValue(), + ZED(ZDST0027_NON_ORDERED_KEY_TYPE), + ptype->toSchemaString())); } keyExpr = wrap_in_type_match(keyExpr, type, loc, - TreatIterator::INDEX_KEY, + TREAT_INDEX_KEY, index->getName()); keyTypes[i] = ptype->getBaseBuiltinType(); @@ -4679,10 +4727,12 @@ { // Eliminate duplicate key values, as they don't play any role in a // general comparison predicate. - keyExpr = theExprManager->create_fo_expr(theRootSctx, - keyExpr->get_loc(), - GET_BUILTIN_FUNCTION(FN_DISTINCT_VALUES_1), - keyExpr); + keyExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + keyExpr->get_loc(), + BUILTIN_FUNC(FN_DISTINCT_VALUES_1), + keyExpr); } std::string collationUri; @@ -4715,7 +4765,9 @@ // if (theCCB->theConfig.opt_level == CompilerCB::config::O1) { RewriterContext rCtx(theCCB, keyExpr, NULL, msg.str(), false); + GENV_COMPILERSUBSYS.getDefaultOptimizingRewriter()->rewrite(rCtx); + keyExpr = rCtx.getRoot(); if (theCCB->theConfig.optimize_cb != NULL) @@ -4811,30 +4863,32 @@ // "example:coll1" expr* qnameStrExpr = theExprManager-> - create_const_expr(theRootSctx, loc, ic.getCollName()->get_qname().str()); + create_const_expr(theRootSctx, theUDF, loc, ic.getCollName()->get_qname().str()); zstring prefixStr = ic.getCollName()->get_prefix(); zstring uriStr; theSctx->lookup_ns(uriStr, prefixStr, loc); - expr* uriStrExpr = theExprManager->create_const_expr(theRootSctx, loc, uriStr); + expr* uriStrExpr = theExprManager-> + create_const_expr(theRootSctx, theUDF, loc, uriStr); // fn:QName("uri", "example:coll1") fo_expr* qnameExpr = theExprManager-> create_fo_expr(theRootSctx, + theUDF, loc, - GET_BUILTIN_FUNCTION(FN_QNAME_2), + BUILTIN_FUNC(FN_QNAME_2), uriStrExpr, qnameStrExpr); // dc:collection(xs:QName("example:coll1")) - function* fn_collection = GET_BUILTIN_FUNCTION(STATIC_COLLECTIONS_DML_COLLECTION_1); + function* fn_collection = BUILTIN_FUNC(STATIC_COLLECTIONS_DML_COLLECTION_1); ZORBA_ASSERT(fn_collection != NULL); std::vector argColl; argColl.push_back(qnameExpr); fo_expr* collExpr = theExprManager-> - create_fo_expr(theRootSctx, loc, fn_collection, argColl); + create_fo_expr(theRootSctx, theUDF, loc, fn_collection, argColl); // $x const QName* varQName = ic.getCollVarName(); @@ -4844,7 +4898,9 @@ let_clause* lc = theExprManager-> create_let_clause(theRootSctx, loc, varExpr, collExpr); - flwor_expr* flworExpr = theExprManager->create_flwor_expr(theRootSctx, loc, false); + flwor_expr* flworExpr = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); + flworExpr->add_clause(lc); // flworExpr-> return clause to be set in end_visitor @@ -4885,27 +4941,34 @@ dynamic_cast(v); // "org:employees" - expr* qnameStrExpr = theExprManager->create_const_expr(theRootSctx, - loc, - ic.getCollName()->get_qname().str()); + expr* qnameStrExpr = theExprManager-> + create_const_expr(theRootSctx, + theUDF, + loc, + ic.getCollName()->get_qname().str()); zstring prefixStr = ic.getCollName()->get_prefix(); zstring uriStr; theSctx->lookup_ns(uriStr, prefixStr, loc); - expr* uriStrExpr = theExprManager->create_const_expr(theRootSctx, loc, uriStr); + expr* uriStrExpr = theExprManager-> + create_const_expr(theRootSctx, theUDF, loc, uriStr); // fn:QName("org-uri", "org:employees") - fo_expr* qnameExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_QNAME_2), - uriStrExpr, qnameStrExpr); - + fo_expr* qnameExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_QNAME_2), + uriStrExpr, qnameStrExpr); + // dc:collection(xs:QName("org:employees")) - function* fn_collection = GET_BUILTIN_FUNCTION(STATIC_COLLECTIONS_DML_COLLECTION_1); + function* fn_collection = BUILTIN_FUNC(STATIC_COLLECTIONS_DML_COLLECTION_1); ZORBA_ASSERT(fn_collection != NULL); std::vector argColl; argColl.push_back(qnameExpr); - fo_expr* collExpr = theExprManager->create_fo_expr(theRootSctx, loc, fn_collection, argColl); + fo_expr* collExpr = theExprManager-> + create_fo_expr(theRootSctx, theUDF, loc, fn_collection, argColl); // $x const QName* varQName = ic.getNodeVarName(); @@ -4915,14 +4978,14 @@ // every $x_ in $x satisfies exists ... // every is implemented as a flowr expr push_scope(); - flwor_expr* evFlworExpr = theExprManager->create_flwor_expr(theRootSctx, loc, false); - evFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, loc, true)); + + flwor_expr* evFlworExpr = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); + + evFlworExpr->set_return_expr(CREATE(const)(theRootSctx, theUDF, loc, true)); // $x_ in dc:collection( xs:QName("org:employees") ) - var_expr* evVarExpr = bind_var(loc, - varItem, - var_expr::for_var, - NULL); + var_expr* evVarExpr = bind_var(loc, varItem, var_expr::for_var, NULL); // maybe make one more collExpr? evFlworExpr->add_clause(wrap_in_forclause(collExpr, evVarExpr, NULL)); @@ -4937,13 +5000,11 @@ var_expr::let_var, NULL); - let_clause* letClause = theExprManager->create_let_clause(theRootSctx, - loc, - varExpr, - collExpr); + let_clause* letClause = theExprManager-> + create_let_clause(theRootSctx, loc, varExpr, collExpr); - flwor_expr* flworExpr = theExprManager->create_flwor_expr(theRootSctx, - loc, false); + flwor_expr* flworExpr = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); @@ -4978,33 +5039,43 @@ dynamic_cast(v); // "org:transactions" - expr* qnameStrExpr = theExprManager->create_const_expr(theRootSctx, loc, - ic.getCollName()->get_qname().str()); + expr* qnameStrExpr = theExprManager-> + create_const_expr(theRootSctx, theUDF, loc, ic.getCollName()->get_qname().str()); zstring prefixStr = ic.getCollName()->get_prefix(); zstring uriStr; theSctx->lookup_ns(uriStr, prefixStr, loc); - expr* uriStrExpr = theExprManager->create_const_expr(theRootSctx, loc, uriStr); + expr* uriStrExpr = theExprManager-> + create_const_expr(theRootSctx, theUDF, loc, uriStr); // fn:QName("org-uri", "org:transactions") - fo_expr* qnameExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_QNAME_2), - uriStrExpr, qnameStrExpr); + fo_expr* qnameExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_QNAME_2), + uriStrExpr, + qnameStrExpr); // dc:collection(xs:QName("org:transactions")) - function* fn_collection = GET_BUILTIN_FUNCTION(STATIC_COLLECTIONS_DML_COLLECTION_1); + function* fn_collection = BUILTIN_FUNC(STATIC_COLLECTIONS_DML_COLLECTION_1); ZORBA_ASSERT(fn_collection != NULL); std::vector argColl; argColl.push_back(qnameExpr); - fo_expr* collExpr = theExprManager->create_fo_expr(theRootSctx, loc, fn_collection, argColl); + fo_expr* collExpr = theExprManager-> + create_fo_expr(theRootSctx, theUDF, loc, fn_collection, argColl); // every $x_ in $x satisfies exists ... // every is implemented as a flowr expr //push_scope(); - flwor_expr* evFlworExpr = theExprManager->create_flwor_expr(theRootSctx, loc, false); - evFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, loc, true)); - + flwor_expr* evFlworExpr = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); + + evFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, + theUDF, + loc, + true)); // $x const QName* varQName = ic.getCollVarName(); @@ -5050,74 +5121,96 @@ // TO part // "org:employees" - expr* toQnameStrExpr = theExprManager->create_const_expr(theRootSctx, loc, - ic.getToCollName()->get_qname().str()); + expr* toQnameStrExpr = theExprManager-> + create_const_expr(theRootSctx, theUDF, loc, ic.getToCollName()->get_qname().str()); + zstring toPrefixStr = ic.getToCollName()->get_prefix(); zstring toUriStr; theSctx->lookup_ns(toUriStr, toPrefixStr, loc); - expr* toUriStrExpr = theExprManager->create_const_expr(theRootSctx, loc, toUriStr); + expr* toUriStrExpr = theExprManager-> + create_const_expr(theRootSctx, theUDF, loc, toUriStr); // xs:QName("org:employees") - fo_expr* toQnameExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_QNAME_2), - toUriStrExpr, toQnameStrExpr); + fo_expr* toQnameExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_QNAME_2), + toUriStrExpr, + toQnameStrExpr); // dc:collection(xs:QName("org:employees")) - function* toFnCollection = GET_BUILTIN_FUNCTION(STATIC_COLLECTIONS_DML_COLLECTION_1); + function* toFnCollection = BUILTIN_FUNC(STATIC_COLLECTIONS_DML_COLLECTION_1); ZORBA_ASSERT(toFnCollection != NULL); std::vector toArgColl; toArgColl.push_back(toQnameExpr); - fo_expr* toCollExpr = theExprManager->create_fo_expr(theRootSctx, loc, toFnCollection, - toArgColl); + fo_expr* toCollExpr = theExprManager-> + create_fo_expr(theRootSctx, theUDF, loc, toFnCollection, toArgColl); // some $y in dc:collection( xs:QName("org:employees") ) // satisfies ... eq ... // implemented using flowr - flwor_expr* someFlworExpr = theExprManager->create_flwor_expr(theRootSctx, loc, false); - someFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, loc, true)); - + flwor_expr* someFlworExpr = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); + + someFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, + theUDF, + loc, + true)); // $y const QName* toVarQName = ic.getToNodeVarName(); var_expr* toVarExpr = bind_var(loc, toVarQName, var_expr::for_var, NULL); // for $y in dc:collection(xs:QName("org:employees")) - someFlworExpr->add_clause(wrap_in_forclause(toCollExpr, - toVarExpr, - NULL)); - + someFlworExpr->add_clause(wrap_in_forclause(toCollExpr, toVarExpr, NULL)); // FROM part // "org:transactions" - expr* fromQnameStrExpr = theExprManager->create_const_expr(theRootSctx, loc, - ic.getFromCollName()->get_qname().str()); + expr* fromQnameStrExpr = theExprManager-> + create_const_expr(theRootSctx, + theUDF, + loc, + ic.getFromCollName()->get_qname().str()); zstring fromPrefixStr = ic.getFromCollName()->get_prefix(); zstring fromUriStr; theSctx->lookup_ns(fromUriStr, fromPrefixStr, loc); - expr* fromUriStrExpr = theExprManager->create_const_expr(theRootSctx, loc, fromUriStr); + expr* fromUriStrExpr = theExprManager-> + create_const_expr(theRootSctx, theUDF, loc, fromUriStr); // fn:QName("org-uri", "org:transactions") - fo_expr* fromQnameExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_QNAME_2), - fromUriStrExpr, fromQnameStrExpr); + fo_expr* fromQnameExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_QNAME_2), + fromUriStrExpr, + fromQnameStrExpr); // dc:collection(xs:QName("org:transactions")) - function* fromFnCollection = GET_BUILTIN_FUNCTION(STATIC_COLLECTIONS_DML_COLLECTION_1); + function* fromFnCollection = BUILTIN_FUNC(STATIC_COLLECTIONS_DML_COLLECTION_1); ZORBA_ASSERT(fromFnCollection != NULL); std::vector fromArgColl; fromArgColl.push_back(fromQnameExpr); - fo_expr* fromCollExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - fromFnCollection, - fromArgColl); + fo_expr* fromCollExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + fromFnCollection, + fromArgColl); // every $x in dc:collection( xs:QName("org:transactions") ) // satisfies ... // implemented using flowr - flwor_expr* evFlworExpr = theExprManager->create_flwor_expr(theRootSctx, loc, false); - evFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, loc, true)); + flwor_expr* evFlworExpr = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, false); + + evFlworExpr->set_return_expr(theExprManager->create_const_expr(theRootSctx, + theUDF, + loc, + true)); // $x const QName* fromVarQName = ic.getFromNodeVarName(); @@ -5218,57 +5311,73 @@ expr* atomizedUniKeyExpr = wrap_in_atomization(uniKeyExpr); // exists( $x/@id ) - expr* existsExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_EXISTS_1), - uniKeyExpr); - -#if 0 - zstring commentStr("#trace fnExists"); - expr* comentExpr = theExprManager->create_const_expr(theRootSctx, loc, commentStr); - fo_expr* fnTraceExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_TRACE_2), - existsExpr, comentExpr); -#endif - + expr* existsExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_EXISTS_1), + uniKeyExpr); // every ... satisfies evTestExpr - fo_expr* fnNotExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_NOT_1), - existsExpr); + fo_expr* fnNotExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_NOT_1), + existsExpr); evFlworExpr->add_where(fnNotExpr); - fo_expr* everyExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_EMPTY_1), - evFlworExpr); + fo_expr* everyExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_EMPTY_1), + evFlworExpr); // functx:are-distinct-values( $x/@id ) // implemented as count(distinct-values($seq)) = count($seq) //distinct-values($seq) - fo_expr* distinctValuesExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_DISTINCT_VALUES_1), - atomizedUniKeyExpr); - + fo_expr* distinctValuesExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_DISTINCT_VALUES_1), + atomizedUniKeyExpr); + // count($sec) - fo_expr* countSecExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_COUNT_1), - atomizedUniKeyExpr); + fo_expr* countSecExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_COUNT_1), + atomizedUniKeyExpr); + // count(distinct-values($sec)) - fo_expr* countDVExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_COUNT_1), - distinctValuesExpr); + fo_expr* countDVExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_COUNT_1), + distinctValuesExpr); // countDV = countSec - fo_expr* equalExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(OP_EQUAL_2), - countDVExpr, countSecExpr); + fo_expr* equalExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_EQUAL_2), + countDVExpr, + countSecExpr); + // (...) and (...) - fo_expr* andExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(OP_AND_N), - everyExpr, equalExpr); + fo_expr* andExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_AND_N), + everyExpr, + equalExpr); flworExpr->set_return_expr(andExpr); @@ -5302,19 +5411,23 @@ dynamic_cast(pop_nodestack()); // fn:not - fo_expr* fnNotExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_NOT_1), - evTestExpr); + fo_expr* fnNotExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_NOT_1), + evTestExpr); // where not( exists($x/sale gt 0) ) evFlworExpr->add_where(fnNotExpr); // fn:empty - fo_expr* emptyExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_EMPTY_1), - evFlworExpr); + fo_expr* emptyExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_EMPTY_1), + evFlworExpr); body = emptyExpr; } @@ -5338,11 +5451,14 @@ // maybe add fn:data ? // $y/id eq $x//sale/empid - fo_expr* eqExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(OP_VALUE_EQUAL_2), - toKeyExpr, - fromKeyExpr); + fo_expr* eqExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_VALUE_EQUAL_2), + toKeyExpr, + fromKeyExpr); + normalize_fo(eqExpr); expr* someTestExpr = eqExpr; @@ -5350,22 +5466,29 @@ someFlworExpr->add_where(someTestExpr); // fn:exists - fo_expr* fnExistsExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(FN_EXISTS_1), - someFlworExpr); + fo_expr* fnExistsExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_EXISTS_1), + someFlworExpr); // fn:not() - fo_expr* evFnNotExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_NOT_1), - fnExistsExpr); + fo_expr* evFnNotExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_NOT_1), + fnExistsExpr); evFlworExpr->add_where(evFnNotExpr); // fn:empty - fo_expr* fnEmptyExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_EMPTY_1), - evFlworExpr); + fo_expr* fnEmptyExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_EMPTY_1), + evFlworExpr); body = fnEmptyExpr; @@ -5485,9 +5608,10 @@ if (program->is_updating() && !theCCB->theIsEval) { program = theExprManager->create_apply_expr(theRootSctx, - program->get_loc(), - program, - false); // don't discard XDM + theUDF, + program->get_loc(), + program, + false); // don't discard XDM } push_nodestack(program); @@ -5578,7 +5702,9 @@ // push a dummy block_expr in the node stack so that local var decls can // assert that their parent is a block expr. - expr* dummyBlock = theExprManager->create_block_expr(theRootSctx, loc, false, stmts, NULL); + expr* dummyBlock = theExprManager-> + create_block_expr(theRootSctx, theUDF, loc, false, stmts, NULL); + push_nodestack(dummyBlock); push_scope(); @@ -5618,7 +5744,8 @@ } else { - childExpr = theExprManager->create_apply_expr(theRootSctx, loc, childExpr, false); + childExpr = theExprManager-> + create_apply_expr(theRootSctx, theUDF, loc, childExpr, false); } } @@ -5650,10 +5777,11 @@ std::vector& lastAssignedVars = theAssignedVars[numScopes]; expr* blockExpr = theExprManager->create_block_expr(theRootSctx, - loc, - allowLastUpdating, - stmts, - &lastAssignedVars); + theUDF, + loc, + allowLastUpdating, + stmts, + &lastAssignedVars); push_nodestack(blockExpr); @@ -5786,7 +5914,7 @@ { TRACE_VISIT_OUT(); - var_expr* ve = lookup_var(v.get_name(), loc, err::XPST0008); + var_expr* ve = lookup_var(v.get_name(), loc, true); if ((ve->get_kind() != var_expr::local_var && ve->get_kind() != var_expr::prolog_var) || @@ -5802,12 +5930,17 @@ if (varType != NULL) valueExpr = theExprManager->create_treat_expr(theRootSctx, + theUDF, loc, valueExpr, varType, - TreatIterator::TYPE_MATCH); + TREAT_TYPE_MATCH); - push_nodestack(theExprManager->create_var_set_expr(theRootSctx, loc, ve, valueExpr)); + push_nodestack(theExprManager->create_var_set_expr(theRootSctx, + theUDF, + loc, + ve, + valueExpr)); theAssignedVars.back().push_back(ve); } @@ -5828,9 +5961,10 @@ expr* param = pop_nodestack(); push_nodestack(theExprManager->create_apply_expr(theRootSctx, - param->get_loc(), - param, - true)); // discard XDM + theUDF, + param->get_loc(), + param, + true)); // discard XDM TRACE_VISIT_OUT(); } @@ -5859,7 +5993,8 @@ if (!inUDFBody() && !theCCB->theIsEval) { - childExpr = theExprManager->create_apply_expr(theRootSctx, loc, childExpr, false); + childExpr = theExprManager-> + create_apply_expr(theRootSctx, theUDF, loc, childExpr, false); } } else if (childExpr->is_sequential()) @@ -5867,7 +6002,8 @@ theHaveSequentialExitExprs = true; } - expr* exitExpr = theExprManager->create_exit_expr(theRootSctx, loc, childExpr); + expr* exitExpr = theExprManager-> + create_exit_expr(theRootSctx, theUDF, loc, childExpr); if (inUDFBody()) { @@ -5904,10 +6040,10 @@ expr* condExpr = pop_nodestack(); expr* breakExpr = theExprManager-> - create_flowctl_expr(theRootSctx, loc, flowctl_expr::BREAK); + create_flowctl_expr(theRootSctx, theUDF, loc, FLOW_BREAK); condExpr = theExprManager-> - create_if_expr(theRootSctx, loc, condExpr, create_empty_seq(loc), breakExpr); + create_if_expr(theRootSctx, theUDF, loc, condExpr, create_empty_seq(loc), breakExpr); block_expr* seqBody = NULL; @@ -5917,9 +6053,9 @@ stmts.push_back(bodyExpr); seqBody = theExprManager-> - create_block_expr(bodyExpr->get_sctx(), loc, false, stmts, NULL); + create_block_expr(bodyExpr->get_sctx(), theUDF, loc, false, stmts, NULL); - push_nodestack(theExprManager->create_while_expr(theRootSctx, loc, seqBody)); + push_nodestack(theExprManager->create_while_expr(theRootSctx, theUDF, loc, seqBody)); theInWhileStack.pop(); } @@ -5939,7 +6075,7 @@ { TRACE_VISIT_OUT(); - enum flowctl_expr::action a; + FlowCtlAction a; switch (v.get_action()) { @@ -5949,7 +6085,7 @@ { RAISE_ERROR_NO_PARAMS(zerr::XSST0009, loc); } - a = flowctl_expr::BREAK; + a = FLOW_BREAK; break; } case FlowCtlStatement::CONTINUE: @@ -5958,14 +6094,14 @@ { RAISE_ERROR_NO_PARAMS(zerr::XSST0010, loc); } - a = flowctl_expr::CONTINUE; + a = FLOW_CONTINUE; break; } default: ZORBA_FATAL(false, ""); } - push_nodestack(theExprManager->create_flowctl_expr(theRootSctx, loc, a)); + push_nodestack(CREATE(flowctl)(theRootSctx, theUDF, loc, a)); } @@ -5996,10 +6132,9 @@ args.push_back(e); } - fo_expr* concatExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - op_concatenate, - args); + fo_expr* concatExpr = theExprManager-> + create_fo_expr(theRootSctx, theUDF, loc, op_concatenate, args); + normalize_fo(concatExpr); push_nodestack(concatExpr); @@ -6083,7 +6218,8 @@ ERROR_PARAMS(ZED(XPST0003_XQueryVersionAtLeast30_2), theSctx->xquery_version())); } - flwor_expr* flwor = theExprManager->create_flwor_expr(theRootSctx, loc, v.is_general()); + flwor_expr* flwor = theExprManager-> + create_flwor_expr(theRootSctx, theUDF, loc, v.is_general()); expr* retExpr = pop_nodestack(); @@ -6115,7 +6251,7 @@ { group_clause* gc = static_cast(curClause); - csize numGVars = gc->getNumGroupingVars(); + csize numGVars = gc->numGroupingVars(); for (csize i = 0; i < numGVars; ++i) pop_scope(); @@ -6181,7 +6317,7 @@ if (v.has_allowing_empty()) { if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) - RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_OuterForClause11))); + RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_OuterForClause30))); theFlworClausesStack.push_back(NULL); } @@ -6267,12 +6403,12 @@ } for_clause* fc = theExprManager->create_for_clause(theRootSctx, - loc, - varExpr, - domainExpr, - posVarExpr, - NULL, - v.get_allowing_empty()); + loc, + varExpr, + domainExpr, + posVarExpr, + NULL, + v.get_allowing_empty()); theFlworClausesStack.push_back(fc); } @@ -6355,9 +6491,9 @@ var_expr* varExpr = bind_var(loc, varName, var_expr::let_var, type); let_clause* clause = theExprManager->create_let_clause(theRootSctx, - loc, - varExpr, - domainExpr); + loc, + varExpr, + domainExpr); theFlworClausesStack.push_back(clause); } @@ -6400,7 +6536,7 @@ TRACE_VISIT(); if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) - RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_WindowClause11))); + RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_WindowClause30))); return no_state; } @@ -6414,17 +6550,17 @@ // Pop the window the domain expr. expr* windowDomainExpr = pop_nodestack(); - window_clause::window_t winKind = (v.get_wintype() == WindowClause::tumbling_window ? - window_clause::tumbling_window : - window_clause::sliding_window); + WindowKind winKind = (v.get_wintype() == WindowClause::tumbling_window ? + tumbling_window : + sliding_window); window_clause* clause = theExprManager->create_window_clause(theRootSctx, - v.get_location(), - winKind, - NULL, - windowDomainExpr, - NULL, - NULL); + v.get_location(), + winKind, + NULL, + windowDomainExpr, + NULL, + NULL); theFlworClausesStack.push_back(clause); @@ -6492,11 +6628,11 @@ pop_wincond_vars(vars, inputCondVarExprs[i]); conds[i] = theExprManager->create_flwor_wincond( - theSctx, - cond->is_only(), - inputCondVarExprs[i], - outputCondVarExprs[i], - condExpr); + theSctx, + cond->is_only(), + inputCondVarExprs[i], + outputCondVarExprs[i], + condExpr); } else { @@ -6699,11 +6835,11 @@ if (spec->get_binding_expr() == NULL) { - ve = lookup_var(varname, loc, err::XPST0008); + ve = lookup_var(varname, loc, true); } else { - ve = lookup_var(varname, loc, zerr::ZXQP0000_NO_ERROR); + ve = lookup_var(varname, loc, false); } if (ve != NULL) @@ -6784,23 +6920,21 @@ if (!var) { RAISE_ERROR(err::XPST0008, specLoc, - ERROR_PARAMS(varName->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPST0008_VariableName_2), varName->getStringValue())); } expr* inputExpr = var->getVar(); - if (inputExpr->get_expr_kind() == var_expr_kind) - { - inputExpr = theExprManager-> - create_wrapper_expr(theRootSctx, specLoc, inputExpr); - } + assert(inputExpr->get_expr_kind() == var_expr_kind); + + inputExpr = CREATE(wrapper)(theRootSctx, theUDF, specLoc, inputExpr); inputExpr = wrap_in_atomization(inputExpr); inputExpr = wrap_in_type_match(inputExpr, theRTM.ANY_ATOMIC_TYPE_QUESTION, specLoc, - TreatIterator::MULTI_VALUED_GROUPING_KEY); + TREAT_MULTI_VALUED_GROUPING_KEY); // We need to do this to handle grouping vars with same names but // different collations. @@ -6845,7 +6979,7 @@ bind_var(ngVar, theSctx); expr* inputExpr = - theExprManager->create_wrapper_expr(theRootSctx, loc, inputVar); + theExprManager->create_wrapper_expr(theRootSctx, theUDF, loc, inputVar); nongrouping_rebind.push_back(std::pair(inputExpr, ngVar)); } @@ -6976,11 +7110,13 @@ orderExprs[i] = orderExpr; } - orderby_clause* clause = theExprManager->create_orderby_clause(theRootSctx, - loc, - v.get_stable_bit(), - modifiers, - orderExprs); + orderby_clause* clause = theExprManager-> + create_orderby_clause(theRootSctx, + loc, + v.get_stable_bit(), + modifiers, + orderExprs); + theFlworClausesStack.push_back(clause); } @@ -7093,9 +7229,9 @@ wrap_in_debugger_expr(whereExpr, whereExpr->get_loc()); where_clause* clause = theExprManager->create_where_clause(theRootSctx, - loc, - whereExpr); - + loc, + whereExpr); + theFlworClausesStack.push_back(clause); } @@ -7108,7 +7244,7 @@ TRACE_VISIT (); if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) - RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_CountClause11))); + RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_CountClause30))); return no_state; } @@ -7120,8 +7256,8 @@ var_expr* varExpr = bind_var(loc, v.get_varname(), var_expr::count_var, NULL); count_clause* clause = theExprManager->create_count_clause(theRootSctx, - loc, - varExpr); + loc, + varExpr); theFlworClausesStack.push_back(clause); } @@ -7172,7 +7308,7 @@ if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) { - RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_SwitchExpr11))); + RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_SwitchExpr30))); } v.get_switch_expr()->accept(*this); @@ -7197,17 +7333,21 @@ // else $atomv // return NULL] static_cast(atomizedFlwor)->set_return_expr( - theExprManager->create_if_expr(theRootSctx, - loc, - theExprManager->create_instanceof_expr(theRootSctx, + CREATE(if)(theRootSctx, + theUDF, + loc, + CREATE(instanceof)(theRootSctx, + theUDF, loc, atomv, theRTM.UNTYPED_ATOMIC_TYPE_ONE), - theExprManager->create_cast_expr(theRootSctx, + CREATE(cast)(theRootSctx, + theUDF, loc, atomv, - theRTM.STRING_TYPE_ONE), - atomv)); + theRTM.STRING_TYPE_ONE, + false), + atomv)); // flworExpr = [let $sv := atomizedFlwor return NULL] var_expr* sv = create_temp_var(v.get_switch_expr()->get_location(), var_expr::let_var); @@ -7240,11 +7380,13 @@ expr* operandExpr = pop_nodestack(); operandExpr = wrap_in_atomization(operandExpr); - operandExpr = theExprManager->create_fo_expr(theRootSctx, loc, - GET_BUILTIN_FUNCTION(OP_ATOMIC_VALUES_EQUIVALENT_2), - sv, - operandExpr); - + operandExpr = CREATE(fo)(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_ATOMIC_VALUES_EQUIVALENT_2), + sv, + operandExpr); + condOperands.push_back(operandExpr); } // for @@ -7254,17 +7396,20 @@ } else if (condOperands.size() > 1) { - condExpr = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(OP_OR_N), - condOperands); + condExpr = theExprManager-> + create_fo_expr(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_OR_N), + condOperands); } switchCaseClause->get_return_expr()->accept(*this); expr* caseReturnExpr = pop_nodestack(); // retExpr = [if (condExpr) then caseReturnExpr else retExpr] - retExpr = theExprManager->create_if_expr(theRootSctx, loc, condExpr, caseReturnExpr, retExpr); + retExpr = theExprManager-> + create_if_expr(theRootSctx, theUDF, loc, condExpr, caseReturnExpr, retExpr); } // for @@ -7429,11 +7574,13 @@ caseVar = bind_var(loc, varname, var_expr::let_var); - expr* treatExpr = theExprManager->create_treat_expr(theRootSctx, - loc, - sv, - type, - TreatIterator::TREAT_EXPR); + expr* treatExpr = theExprManager-> + create_treat_expr(theRootSctx, + theUDF, + loc, + sv, + type, + TREAT_EXPR); // clauseExpr = [let $caseVar := treat_as($sv, caseType) return NULL] clauseExpr = wrap_in_let_flwor(treatExpr, caseVar, NULL); @@ -7456,9 +7603,9 @@ } // retExpr = [if (instance_of($sv, type)) then clauseExpr else retExpr] - retExpr = theExprManager->create_if_expr(theRootSctx, + retExpr = theExprManager->create_if_expr(theRootSctx, theUDF, loc, - theExprManager->create_instanceof_expr(theRootSctx, loc, &*sv, type), + theExprManager->create_instanceof_expr(theRootSctx, theUDF, loc, &*sv, type), clauseExpr, retExpr); } @@ -7545,7 +7692,7 @@ wrap_in_debugger_expr(t_h, t_h->get_loc()); wrap_in_debugger_expr(c_h, c_h->get_loc()); - if_expr* ifExpr = theExprManager->create_if_expr(theRootSctx, loc, c_h, t_h, e_h); + if_expr* ifExpr = theExprManager->create_if_expr(theRootSctx, theUDF, loc, c_h, t_h, e_h); push_nodestack(ifExpr); } @@ -7571,7 +7718,7 @@ if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) { - RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_TryCatchExpr11))); + RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_TryCatchExpr30))); } theTryStack.push_back(&v); @@ -7596,7 +7743,7 @@ expr* tryExpr = pop_nodestack(); - trycatch_expr* tce = theExprManager->create_trycatch_expr(theRootSctx, loc, tryExpr); + trycatch_expr* tce = theExprManager->create_trycatch_expr(theRootSctx, theUDF, loc, tryExpr); push_nodestack(tce); @@ -7707,9 +7854,9 @@ { TRACE_VISIT(); - flwor_expr* flwor(theExprManager->create_flwor_expr(theRootSctx, loc, false)); + flwor_expr* flwor(theExprManager->create_flwor_expr(theRootSctx, theUDF, loc, false)); - flwor->set_return_expr(theExprManager->create_const_expr(theRootSctx, loc, true)); + flwor->set_return_expr(theExprManager->create_const_expr(theRootSctx, theUDF, loc, true)); push_nodestack(flwor); @@ -7725,9 +7872,9 @@ if (v.get_qmode() == ParseConstants::quant_every) { - fo_expr* uw = theExprManager->create_fo_expr(theRootSctx, + fo_expr* uw = theExprManager->create_fo_expr(theRootSctx, theUDF, v.get_expr()->get_location(), - GET_BUILTIN_FUNCTION(FN_NOT_1), + BUILTIN_FUNC(FN_NOT_1), testExpr); testExpr = uw; } @@ -7746,11 +7893,11 @@ flworExpr->add_where(testExpr); - fo_expr* quant = theExprManager->create_fo_expr(theRootSctx, + fo_expr* quant = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, v.get_qmode() == ParseConstants::quant_every ? - GET_BUILTIN_FUNCTION(FN_EMPTY_1) : - GET_BUILTIN_FUNCTION(FN_EXISTS_1), + BUILTIN_FUNC(FN_EMPTY_1) : + BUILTIN_FUNC(FN_EXISTS_1), flworExpr); push_nodestack(quant); } @@ -7865,7 +8012,7 @@ args.push_back(e1); } - fo_expr* fo = theExprManager->create_fo_expr(theRootSctx, loc, GET_BUILTIN_FUNCTION(OP_OR_N), args); + fo_expr* fo = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, BUILTIN_FUNC(OP_OR_N), args); push_nodestack(fo); } @@ -7930,7 +8077,7 @@ args.push_back(e1); } - fo_expr* fo = theExprManager->create_fo_expr(theRootSctx, loc, GET_BUILTIN_FUNCTION(OP_AND_N), args); + fo_expr* fo = CREATE(fo)(theRootSctx, theUDF, loc, BUILTIN_FUNC(OP_AND_N), args); push_nodestack(fo); } @@ -7962,22 +8109,22 @@ switch (v.get_gencomp()->get_type()) { case ParseConstants::op_eq: - f = GET_BUILTIN_FUNCTION(OP_EQUAL_2); + f = BUILTIN_FUNC(OP_EQUAL_2); break; case ParseConstants::op_ne: - f = GET_BUILTIN_FUNCTION(OP_NOT_EQUAL_2); + f = BUILTIN_FUNC(OP_NOT_EQUAL_2); break; case ParseConstants::op_lt: - f = GET_BUILTIN_FUNCTION(OP_LESS_2); + f = BUILTIN_FUNC(OP_LESS_2); break; case ParseConstants::op_le: - f = GET_BUILTIN_FUNCTION(OP_LESS_EQUAL_2); + f = BUILTIN_FUNC(OP_LESS_EQUAL_2); break; case ParseConstants::op_gt: - f = GET_BUILTIN_FUNCTION(OP_GREATER_2); + f = BUILTIN_FUNC(OP_GREATER_2); break; case ParseConstants::op_ge: - f = GET_BUILTIN_FUNCTION(OP_GREATER_EQUAL_2); + f = BUILTIN_FUNC(OP_GREATER_EQUAL_2); break; } } @@ -7986,22 +8133,22 @@ switch (v.get_valcomp()->get_type()) { case ParseConstants::op_val_eq: - f = GET_BUILTIN_FUNCTION(OP_VALUE_EQUAL_2); + f = BUILTIN_FUNC(OP_VALUE_EQUAL_2); break; case ParseConstants::op_val_ne: - f = GET_BUILTIN_FUNCTION(OP_VALUE_NOT_EQUAL_2); + f = BUILTIN_FUNC(OP_VALUE_NOT_EQUAL_2); break; case ParseConstants::op_val_lt: - f = GET_BUILTIN_FUNCTION(OP_VALUE_LESS_2); + f = BUILTIN_FUNC(OP_VALUE_LESS_2); break; case ParseConstants::op_val_le: - f = GET_BUILTIN_FUNCTION(OP_VALUE_LESS_EQUAL_2); + f = BUILTIN_FUNC(OP_VALUE_LESS_EQUAL_2); break; case ParseConstants::op_val_gt: - f = GET_BUILTIN_FUNCTION(OP_VALUE_GREATER_2); + f = BUILTIN_FUNC(OP_VALUE_GREATER_2); break; case ParseConstants::op_val_ge: - f = GET_BUILTIN_FUNCTION(OP_VALUE_GREATER_EQUAL_2); + f = BUILTIN_FUNC(OP_VALUE_GREATER_EQUAL_2); break; } } @@ -8010,13 +8157,13 @@ switch (v.get_nodecomp()->get_type()) { case ParseConstants::op_is: - f = GET_BUILTIN_FUNCTION(OP_IS_SAME_NODE_2); + f = BUILTIN_FUNC(OP_IS_SAME_NODE_2); break; case ParseConstants::op_precedes: - f = GET_BUILTIN_FUNCTION(OP_NODE_BEFORE_2); + f = BUILTIN_FUNC(OP_NODE_BEFORE_2); break; case ParseConstants::op_follows: - f = GET_BUILTIN_FUNCTION(OP_NODE_AFTER_2); + f = BUILTIN_FUNC(OP_NODE_AFTER_2); break; } } @@ -8024,7 +8171,7 @@ expr* e1 = pop_nodestack(); expr* e2 = pop_nodestack(); - fo_expr* fo = theExprManager->create_fo_expr(theRootSctx, loc, f, e2, e1); + fo_expr* fo = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, f, e2, e1); normalize_fo(fo); @@ -8095,7 +8242,7 @@ expr* e1 = pop_nodestack(); expr* e2 = pop_nodestack(); - fo_expr* e = theExprManager->create_fo_expr(theRootSctx, loc, GET_BUILTIN_FUNCTION(OP_TO_2), e2, e1); + fo_expr* e = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, BUILTIN_FUNC(OP_TO_2), e2, e1); normalize_fo(e); @@ -8124,14 +8271,14 @@ switch (v.get_add_op()) { case ParseConstants::op_plus: - func = GET_BUILTIN_FUNCTION(OP_ADD_2); + func = BUILTIN_FUNC(OP_ADD_2); break; case ParseConstants::op_minus: - func = GET_BUILTIN_FUNCTION(OP_SUBTRACT_2); + func = BUILTIN_FUNC(OP_SUBTRACT_2); break; } - fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, loc, func, e2, e1); + fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, func, e2, e1); normalize_fo(foExpr); @@ -8159,20 +8306,20 @@ switch (v.get_mult_op()) { case ParseConstants::op_mul: - f = GET_BUILTIN_FUNCTION(OP_MULTIPLY_2); + f = BUILTIN_FUNC(OP_MULTIPLY_2); break; case ParseConstants::op_div: - f = GET_BUILTIN_FUNCTION(OP_DIVIDE_2); + f = BUILTIN_FUNC(OP_DIVIDE_2); break; case ParseConstants::op_idiv: - f = GET_BUILTIN_FUNCTION(OP_INTEGER_DIVIDE_2); + f = BUILTIN_FUNC(OP_INTEGER_DIVIDE_2); break; case ParseConstants::op_mod: - f = GET_BUILTIN_FUNCTION(OP_MOD_2); + f = BUILTIN_FUNC(OP_MOD_2); break; } - fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, loc, f, e2, e1); + fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, f, e2, e1); normalize_fo(foExpr); @@ -8196,9 +8343,9 @@ expr* e1 = pop_nodestack(); expr* e2 = pop_nodestack(); - fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, + fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(OP_UNION_2), + BUILTIN_FUNC(OP_UNION_2), e2, e1); @@ -8206,9 +8353,9 @@ // Union is implemented by a concat iterator, so we have to do node sorting // and duplicate elimi - push_nodestack(theExprManager->create_fo_expr(theRootSctx, + push_nodestack(theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(OP_SORT_DISTINCT_NODES_ASC_1), + BUILTIN_FUNC(OP_SORT_DISTINCT_NODES_ASC_1), foExpr)); } @@ -8234,20 +8381,20 @@ switch (v.get_intex_op()) { case ParseConstants::op_intersect: - f = GET_BUILTIN_FUNCTION(OP_INTERSECT_2); + f = BUILTIN_FUNC(OP_INTERSECT_2); break; case ParseConstants::op_except: - f = GET_BUILTIN_FUNCTION(OP_EXCEPT_2); + f = BUILTIN_FUNC(OP_EXCEPT_2); break; } - fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, loc, f, e2, e1); + fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, f, e2, e1); normalize_fo(foExpr); - push_nodestack(theExprManager->create_fo_expr(theRootSctx, + push_nodestack(theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(OP_SORT_DISTINCT_NODES_ASC_1), + BUILTIN_FUNC(OP_SORT_DISTINCT_NODES_ASC_1), foExpr)); } @@ -8265,10 +8412,10 @@ { TRACE_VISIT_OUT(); - push_nodestack(theExprManager->create_instanceof_expr(theRootSctx, - loc, - pop_nodestack(), - pop_tstack())); + push_nodestack(CREATE(instanceof)(theRootSctx, theUDF, + loc, + pop_nodestack(), + pop_tstack())); } @@ -8285,11 +8432,11 @@ { TRACE_VISIT_OUT(); - push_nodestack(theExprManager->create_treat_expr(theRootSctx, - loc, - pop_nodestack(), - pop_tstack(), - TreatIterator::TREAT_EXPR)); + push_nodestack(CREATE(treat)(theRootSctx, theUDF, + loc, + pop_nodestack(), + pop_tstack(), + TREAT_EXPR)); } @@ -8306,114 +8453,234 @@ { TRACE_VISIT_OUT(); - push_nodestack(create_cast_expr(loc, pop_nodestack(), pop_tstack(), false)); + bool allowsEmpty = v.singletype()->get_hook_bit(); + + expr* castableExpr = + create_cast_expr(loc, pop_nodestack(), pop_tstack(), allowsEmpty, false); + + push_nodestack(castableExpr); } -expr* create_cast_expr(const QueryLoc& loc, expr* node, xqtref_t type, bool isCast) +/******************************************************************************* + CastExpr ::= UnaryExpr ( "cast" "as" SingleType )? +********************************************************************************/ +void* begin_visit(const CastExpr& v) +{ + TRACE_VISIT(); + return no_state; +} + +void end_visit(const CastExpr& v, void* /*visit_state*/) +{ + TRACE_VISIT_OUT(); + + bool allowsEmpty = v.get_singletype()->get_hook_bit(); + + expr* castExpr = + create_cast_expr(loc, pop_nodestack(), pop_tstack(), allowsEmpty, true); + + push_nodestack(castExpr); +} + + +/******************************************************************************* + SingleType ::= SimpleTypeName "?"? + + SimpleTypeName ::= EQNAME +********************************************************************************/ + +void* begin_visit(const SingleType& v) +{ + TRACE_VISIT(); + return no_state; +} + +void end_visit(const SingleType& v, void* /*visit_state*/) +{ + TRACE_VISIT_OUT(); + + if (v.get_hook_bit()) + { + xqtref_t type = pop_tstack(); + + assert(type->get_quantifier() == TypeConstants::QUANT_ONE || + type->get_quantifier() == TypeConstants::QUANT_STAR); + + if (type->get_quantifier() == TypeConstants::QUANT_ONE) + { + theTypeStack.push(CTX_TM->create_type(*type, TypeConstants::QUANT_QUESTION)); + } + } + // else leave type as it is on tstack +} + + +/******************************************************************************* + SimpleTypeName ::= EQNAME +********************************************************************************/ +void* begin_visit(const SimpleType& v) +{ + TRACE_VISIT(); + return no_state; +} + +void end_visit(const SimpleType& v, void* /*visit_state*/) +{ + TRACE_VISIT_OUT(); + + rchandle qname = v.get_qname(); + store::Item_t qnameItem; + expand_elem_qname(qnameItem, qname, loc); + + xqtref_t t = CTX_TM->create_named_simple_type(qnameItem); + if (t == NULL) + { + if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) + { + RAISE_ERROR(err::XPST0051, loc, ERROR_PARAMS(qname->get_qname())); + } + else + { + RAISE_ERROR(err::XQST0052, loc, ERROR_PARAMS(qname->get_qname())); + } + } + else + { + theTypeStack.push(t); + } +} + + +/******************************************************************************* + +********************************************************************************/ +expr* create_cast_expr( + const QueryLoc& loc, + expr* node, + const xqtref_t& type, + bool allowsEmpty, + bool isCast) { TypeManager* tm = CTX_TM; - if (TypeOps::is_equal(tm, *type, *GENV_TYPESYSTEM.NOTATION_TYPE_ONE, loc) || - TypeOps::is_equal(tm, *type, *GENV_TYPESYSTEM.NOTATION_TYPE_QUESTION, loc) || - TypeOps::is_equal(tm, *type, *GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, loc) || - TypeOps::is_equal(tm, *type, *GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, loc)) + if (!type->isAtomicAny()) { - RAISE_ERROR(err::XPST0080, loc, ERROR_PARAMS(type->toString())); + if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) + { + RAISE_ERROR(err::XPST0051, loc, ERROR_PARAMS(type->get_qname())); + } } - if (TypeOps::is_subtype(tm, *type, *GENV_TYPESYSTEM.QNAME_TYPE_QUESTION, loc)) + if (TypeOps::is_equal(tm, *type, *theRTM.NOTATION_TYPE_ONE, loc) || + TypeOps::is_equal(tm, *type, *theRTM.NOTATION_TYPE_QUESTION, loc) || + TypeOps::is_equal(tm, *type, *theRTM.ANY_ATOMIC_TYPE_ONE, loc) || + TypeOps::is_equal(tm, *type, *theRTM.ANY_ATOMIC_TYPE_QUESTION, loc)) { - const const_expr* ce = dynamic_cast(node); + RAISE_ERROR(err::XPST0080, loc, ERROR_PARAMS(type->toString())); + } - if (ce != NULL && - TypeOps::is_equal(tm, - *tm->create_value_type(ce->get_val()), - *GENV_TYPESYSTEM.STRING_TYPE_ONE, - loc)) + if (TypeOps::is_subtype(tm, *type, *theRTM.QNAME_TYPE_QUESTION, loc)) + { + if (node->get_expr_kind() == const_expr_kind) { - store::Item_t castLiteral; - try - { - GenericCast::instance()->castToQName(castLiteral, - ce->get_val(), - theNSCtx, - false, - CTX_TM, - loc); - } - catch (ZorbaException& e) + const const_expr* ce = static_cast(node); + + if (ce->get_val()->getTypeCode() == store::XS_STRING) { - if (isCast) + store::Item_t result; + try { - throw; + GenericCast::castToQName(result, ce->get_val(), theNSCtx, false, tm, loc); } - else + catch (ZorbaException& e) { - if (e.diagnostic() == err::FORG0001) - throw;// XQUERY_EXCEPTION(err::XPST0003, ERROR_LOC(loc)); + if (isCast) + { + throw; + } else - RAISE_ERROR(err::XPST0081, loc, - ERROR_PARAMS(castLiteral->getStringValue())); + { + if (e.diagnostic() == err::FORG0001) + throw;// XQUERY_EXCEPTION(err::XPST0003, ERROR_LOC(loc)); + else + RAISE_ERROR(err::XPST0081, loc, + ERROR_PARAMS(ce->get_val()->getStringValue())); + } + } + + if (type->type_kind() == XQType::USER_DEFINED_KIND) + { + const UserDefinedXQType* udt = + static_cast(type.getp()); + + store::Item_t tmp = result; + store::Item_t typeName = udt->get_qname(); + GENV_ITEMFACTORY->createUserTypedAtomicItem(result, tmp, typeName); } + + assert(result != NULL || ! isCast); + return (isCast ? + CREATE(const)(theRootSctx, theUDF, loc, result) : + CREATE(const)(theRootSctx, theUDF, loc, result != NULL)); } + } - assert(castLiteral != NULL || ! isCast); + xqtref_t inputType = node->get_return_type(); + if (theSctx->xquery_version() < StaticContextConsts::xquery_version_3_0) + { + // when casting to type T, where T is QName or subtype of, and the input + // is not a const expr, then the input MUST be of type T or subtype of. if (isCast) - return theExprManager->create_const_expr(theRootSctx, loc, castLiteral); + { + if (TypeOps::is_subtype(tm, *inputType, *theRTM.QNAME_TYPE_STAR, loc)) + { + return CREATE(cast)(theRootSctx, theUDF, loc, node, type, allowsEmpty); + } + else + { + return CREATE(treat)(theRootSctx, theUDF, loc, node, type, TREAT_TYPE_MATCH); + } + } else - return theExprManager->create_const_expr(theRootSctx, loc, castLiteral != NULL); + { + return CREATE(instanceof)(theRootSctx, theUDF, loc, node, type); + } } - else - { - xqtref_t qnameType = (type->get_quantifier() == TypeConstants::QUANT_ONE ? - GENV_TYPESYSTEM.QNAME_TYPE_ONE : - GENV_TYPESYSTEM.QNAME_TYPE_QUESTION); - // when casting to type T, where T is QName or subtype of, and the input - // is not a const expr, then the input MUST be of type T or subtype of. + expr* input = wrap_in_atomization(node); + + if (TypeOps::is_subtype(tm, *inputType, *theRTM.ANY_NODE_TYPE_PLUS, loc)) + { if (isCast) - // This was previously a treat_expr() with TYPE_MATCH. It was changed to - // cast_expr() in order to allow dynamically computed strings to be cast - // to xs:QName. - return theExprManager-> - create_cast_expr(theRootSctx, loc, wrap_in_atomization(node), qnameType); + { + RAISE_ERROR(err::XPTY0117, loc, ERROR_PARAMS(ZED(XPTY0117_NodeCast))); + } else - return theExprManager-> - create_instanceof_expr(theRootSctx, loc, node, qnameType); + { + return CREATE(const)(theRootSctx, theUDF, loc, false); + } } + + if (isCast) + return CREATE(cast)(theRootSctx, theUDF, loc, input, type, allowsEmpty); + else + return CREATE(castable)(theRootSctx, theUDF, loc, input, type, allowsEmpty); } else { + expr* input = wrap_in_atomization(node); + if (isCast) - return theExprManager-> - create_cast_expr(theRootSctx, loc, wrap_in_atomization(node), type); + return CREATE(cast)(theRootSctx, theUDF, loc, input, type, allowsEmpty); else - return theExprManager-> - create_castable_expr(theRootSctx, loc, wrap_in_atomization(node), type); + return CREATE(castable)(theRootSctx, theUDF, loc, input, type, allowsEmpty); } } /******************************************************************************* - CastExpr ::= UnaryExpr ( "cast" "as" SingleType )? -********************************************************************************/ -void* begin_visit(const CastExpr& v) -{ - TRACE_VISIT(); - return no_state; -} - -void end_visit(const CastExpr& v, void* /*visit_state*/) -{ - TRACE_VISIT_OUT(); - - push_nodestack(create_cast_expr(loc, pop_nodestack(), pop_tstack(), true)); -} - - -/******************************************************************************* UnaryExpr ::= ("-" | "+")* ValueExpr ********************************************************************************/ void* begin_visit(const UnaryExpr& v) @@ -8428,11 +8695,11 @@ expr* e1 = pop_nodestack(); - fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, + fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, (v.get_signlist()->get_sign() ? - GET_BUILTIN_FUNCTION(OP_UNARY_PLUS_1) : - GET_BUILTIN_FUNCTION(OP_UNARY_MINUS_1)), + BUILTIN_FUNC(OP_UNARY_PLUS_1) : + BUILTIN_FUNC(OP_UNARY_MINUS_1)), e1); normalize_fo(foExpr); @@ -8484,7 +8751,7 @@ v.get_type_name()->get_localname().c_str()); } - push_nodestack(theExprManager->create_validate_expr(theRootSctx, + push_nodestack(theExprManager->create_validate_expr(theRootSctx, theUDF, loc, v.get_valmode(), qname, @@ -8794,19 +9061,19 @@ if (lLocal == "true") { - push_nodestack(theExprManager->create_const_expr(theRootSctx, loc, true)); + push_nodestack(theExprManager->create_const_expr(theRootSctx, theUDF, loc, true)); return (void*)1; } else if (lLocal == "false") { - push_nodestack(theExprManager->create_const_expr(theRootSctx, loc, false)); + push_nodestack(theExprManager->create_const_expr(theRootSctx, theUDF, loc, false)); return (void*)1; } else if (lLocal == "null") { store::Item_t lNull; GENV_ITEMFACTORY->createJSONNull(lNull); - push_nodestack(theExprManager->create_const_expr(theRootSctx, loc, lNull)); + push_nodestack(theExprManager->create_const_expr(theRootSctx, theUDF, loc, lNull)); return (void*)1; } } @@ -8827,7 +9094,7 @@ // In cases 2, 3, and 4 create a new empty relpath_expr if (pe_type != ParseConstants::path_leading_lone_slash) { - pathExpr = theExprManager->create_relpath_expr(theRootSctx, loc); + pathExpr = theExprManager->create_relpath_expr(theRootSctx, theUDF, loc); } // If path expr starts with / or // (cases 1, 2, or 3), create an expr @@ -8841,28 +9108,29 @@ if (pe_type != ParseConstants::path_relative) { - relpath_expr* ctx_path_expr = theExprManager->create_relpath_expr(theRootSctx, loc); + relpath_expr* ctx_path_expr = theExprManager->create_relpath_expr(theRootSctx, theUDF, loc); - expr* sourceExpr = theExprManager->create_treat_expr(theRootSctx, + expr* sourceExpr = theExprManager->create_treat_expr(theRootSctx, theUDF, loc, DOT_REF, GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, - TreatIterator::PATH_DOT); + TREAT_PATH_DOT); ctx_path_expr->add_back(sourceExpr); - match_expr* me = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* me = CREATE(match)(theRootSctx, theUDF, loc); me->setTestKind(match_anykind_test); - axis_step_expr* ase = theExprManager->create_axis_step_expr(theRootSctx, loc); + axis_step_expr* ase = CREATE(axis_step)(theRootSctx, theUDF, loc); ase->setAxis(axis_kind_self); ase->setTest(me); ctx_path_expr->add_back(&*ase); - fo_expr* fnroot = theExprManager->create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(FN_ROOT_1), - ctx_path_expr); + fo_expr* fnroot = CREATE(fo)(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(FN_ROOT_1), + ctx_path_expr); normalize_fo(fnroot); if (pathExpr != NULL) @@ -8876,11 +9144,12 @@ else { // case 1 - expr* result = theExprManager->create_treat_expr(theRootSctx, - loc, - fnroot, - GENV_TYPESYSTEM.DOCUMENT_TYPE_ONE, - TreatIterator::TREAT_EXPR); + expr* result = CREATE(treat)(theRootSctx, + theUDF, + loc, + fnroot, + GENV_TYPESYSTEM.DOCUMENT_TYPE_ONE, + TREAT_EXPR); push_nodestack(result); } } @@ -8916,9 +9185,9 @@ else { fo_expr* checkExpr = - theExprManager->create_fo_expr(theRootSctx, + theExprManager->create_fo_expr(theRootSctx, theUDF, arg2->get_loc(), - GET_BUILTIN_FUNCTION(OP_EITHER_NODES_OR_ATOMICS_1), + BUILTIN_FUNC(OP_EITHER_NODES_OR_ATOMICS_1), arg2); push_nodestack(checkExpr); @@ -8967,11 +9236,11 @@ // then the input expr to the this path expr is "treat . as node()" if (axisStep != NULL) { - expr* sourceExpr = theExprManager->create_treat_expr(theRootSctx, + expr* sourceExpr = theExprManager->create_treat_expr(theRootSctx, theUDF, loc, DOT_REF, GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, - TreatIterator::PATH_DOT); + TREAT_PATH_DOT); pathExpr->add_back(sourceExpr); if (axisStep->get_predicate_list() == NULL) @@ -9044,17 +9313,16 @@ #ifdef NODE_SORT_OPT if (pathExpr->size() == 0) { - TreatIterator::ErrorKind errKind = TreatIterator::PATH_STEP; + TreatErrorKind errKind = TREAT_PATH_STEP; if (stepExpr->get_expr_kind() == wrapper_expr_kind) { - wrapper_expr* tmp = static_cast(stepExpr); - var_expr* dotVar = lookup_var(DOT_VARNAME, loc, zerr::ZXQP0000_NO_ERROR); - if (tmp->get_expr() == dotVar) - errKind = TreatIterator::PATH_DOT; + var_expr* dotVar = lookup_var(DOT_VARNAME, loc, false); + if (static_cast(stepExpr)->get_input() == dotVar) + errKind = TREAT_PATH_DOT; } - expr* sourceExpr = theExprManager->create_treat_expr(theRootSctx, + expr* sourceExpr = theExprManager->create_treat_expr(theRootSctx, theUDF, stepExpr->get_loc(), stepExpr, GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR, @@ -9085,7 +9353,7 @@ flworExpr->set_return_expr(stepExpr); pop_scope(); - pathExpr = theExprManager->create_relpath_expr(theRootSctx, loc); + pathExpr = theExprManager->create_relpath_expr(theRootSctx, theUDF, loc); expr* sourceExpr = flworExpr; @@ -9108,8 +9376,8 @@ // Convert // to /descendant-or-self::node()/ if (rpe.get_step_type() == ParseConstants::st_slashslash) { - axis_step_expr* ase = theExprManager->create_axis_step_expr(theRootSctx, loc); - match_expr* me = theExprManager->create_match_expr(theRootSctx, loc); + axis_step_expr* ase = theExprManager->create_axis_step_expr(theRootSctx, theUDF, loc); + match_expr* me = theExprManager->create_match_expr(theRootSctx, theUDF, loc); me->setTestKind(match_anykind_test); ase->setAxis(axis_kind_descendant_or_self); ase->setTest(me); @@ -9202,7 +9470,7 @@ { TRACE_VISIT(); - axis_step_expr* ase = theExprManager->create_axis_step_expr(theRootSctx, loc); + axis_step_expr* ase = theExprManager->create_axis_step_expr(theRootSctx, theUDF, loc); push_nodestack(ase); theNodeSortStack.top().theNumSteps++; @@ -9258,8 +9526,8 @@ // // The flworExpr as well as the $$predInput varExpr are pushed to the nodestack. const for_clause* fcOuterDot = static_cast(flworExpr->get_clause(0)); - relpath_expr* predPathExpr = theExprManager->create_relpath_expr(theRootSctx, loc); - predPathExpr->add_back(theExprManager->create_wrapper_expr(theRootSctx, loc, fcOuterDot->get_var())); + relpath_expr* predPathExpr = theExprManager->create_relpath_expr(theRootSctx, theUDF, loc); + predPathExpr->add_back(theExprManager->create_wrapper_expr(theRootSctx, theUDF, loc, fcOuterDot->get_var())); predPathExpr->add_back(axisExpr); expr* predInputExpr = predPathExpr; @@ -9490,7 +9758,7 @@ if ((axisExpr = dynamic_cast(top)) != NULL) { // Construct name-test match expr - match_expr* matchExpr = theExprManager->create_match_expr(theRootSctx, loc);; + match_expr* matchExpr = theExprManager->create_match_expr(theRootSctx, theUDF, loc); matchExpr->setTestKind(match_name_test); if (v.getQName() != NULL) @@ -9769,19 +10037,20 @@ var_expr* posVar = dotClause->get_pos_var(); var_expr* dotVar = dotClause->get_var(); - if (expr_tools::count_variable_uses(predExpr, posVar, 1) == 0 && - expr_tools::count_variable_uses(predExpr, dotVar, 1) == 0) + if (expr_tools::count_variable_uses(predExpr, posVar, 1, NULL) == 0 && + expr_tools::count_variable_uses(predExpr, dotVar, 1, NULL) == 0) { flworExpr->remove_clause(2); - if (expr_tools::count_variable_uses(predExpr, sizeVar, 1) == 0) + if (expr_tools::count_variable_uses(predExpr, sizeVar, 1, NULL) == 0) { expr* sourceExpr = sourceClause->get_expr(); fo_expr* pointExpr = theExprManager-> create_fo_expr(sourceExpr->get_sctx(), + theUDF, sourceExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_SEQUENCE_POINT_ACCESS_2), + BUILTIN_FUNC(OP_ZORBA_SEQUENCE_POINT_ACCESS_2), sourceExpr, predExpr); @@ -9793,8 +10062,9 @@ fo_expr* pointExpr = theExprManager-> create_fo_expr(sourceExpr->get_sctx(), + theUDF, sourceExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_SEQUENCE_POINT_ACCESS_2), + BUILTIN_FUNC(OP_ZORBA_SEQUENCE_POINT_ACCESS_2), sourceExpr, predExpr); @@ -9814,15 +10084,16 @@ // return if ($$dot eq $$predVar) then $$dot else () fo_expr* eqExpr = theExprManager-> create_fo_expr(theRootSctx, + theUDF, loc, - GET_BUILTIN_FUNCTION(OP_VALUE_EQUAL_2), + BUILTIN_FUNC(OP_VALUE_EQUAL_2), lookup_ctx_var(DOT_POS_VARNAME, loc), predvar); normalize_fo(eqExpr); expr* retExpr = theExprManager-> - create_if_expr(theRootSctx, loc, eqExpr, DOT_REF, create_empty_seq(loc)); + create_if_expr(theRootSctx, theUDF, loc, eqExpr, DOT_REF, create_empty_seq(loc)); flworExpr->set_return_expr(retExpr); @@ -9855,39 +10126,40 @@ std::vector condOperands(3); condOperands[0] = theExprManager-> - create_instanceof_expr(theRootSctx, loc, predvar, rtm.DECIMAL_TYPE_QUESTION, true); + create_instanceof_expr(theRootSctx, theUDF, loc, predvar, rtm.DECIMAL_TYPE_QUESTION, true); condOperands[1] = theExprManager-> - create_instanceof_expr(theRootSctx, loc, predvar, rtm.DOUBLE_TYPE_QUESTION, true); + create_instanceof_expr(theRootSctx, theUDF, loc, predvar, rtm.DOUBLE_TYPE_QUESTION, true); condOperands[2] = theExprManager-> - create_instanceof_expr(theRootSctx, loc, predvar, rtm.FLOAT_TYPE_QUESTION, true); + create_instanceof_expr(theRootSctx, theUDF, loc, predvar, rtm.FLOAT_TYPE_QUESTION, true); condExpr = theExprManager-> - create_fo_expr(theRootSctx, loc, GET_BUILTIN_FUNCTION(OP_OR_N), condOperands); + create_fo_expr(theRootSctx, theUDF, loc, BUILTIN_FUNC(OP_OR_N), condOperands); // If so: return $dot if the value of the pred expr is equal to the value // of $dot_pos var, otherwise return the empty seq. fo_expr* eqExpr = theExprManager-> create_fo_expr(theRootSctx, + theUDF, loc, - GET_BUILTIN_FUNCTION(OP_VALUE_EQUAL_2), + BUILTIN_FUNC(OP_VALUE_EQUAL_2), lookup_ctx_var(DOT_POS_VARNAME, loc), predvar); normalize_fo(eqExpr); expr* thenExpr = theExprManager-> - create_if_expr(theRootSctx, loc, eqExpr, DOT_REF, create_empty_seq(loc)); + create_if_expr(theRootSctx, theUDF, loc, eqExpr, DOT_REF, create_empty_seq(loc)); // Else, return $dot if the the value of the pred expr is true, otherwise // return the empty seq. expr* elseExpr = theExprManager-> - create_if_expr(theRootSctx, loc, predvar, DOT_REF, create_empty_seq(loc)); + create_if_expr(theRootSctx, theUDF, loc, predvar, DOT_REF, create_empty_seq(loc)); // The outer if expr* ifExpr = theExprManager-> - create_if_expr(theRootSctx, loc, condExpr, thenExpr, elseExpr); + create_if_expr(theRootSctx, theUDF, loc, condExpr, thenExpr, elseExpr); flworExpr->set_return_expr(ifExpr); @@ -9955,17 +10227,17 @@ { case ParseConstants::num_integer: { - push_nodestack(theExprManager->create_const_expr(theRootSctx, loc, v.get())); + push_nodestack(theExprManager->create_const_expr(theRootSctx, theUDF, loc, v.get())); break; } case ParseConstants::num_decimal: { - push_nodestack(theExprManager->create_const_expr(theRootSctx, loc, v.get())); + push_nodestack(theExprManager->create_const_expr(theRootSctx, theUDF, loc, v.get())); break; } case ParseConstants::num_double: { - push_nodestack(theExprManager->create_const_expr(theRootSctx, loc, v.get())); + push_nodestack(theExprManager->create_const_expr(theRootSctx, theUDF, loc, v.get())); break; } } @@ -10002,7 +10274,7 @@ { TRACE_VISIT_OUT(); - push_nodestack(theExprManager->create_const_expr(theRootSctx, loc,v.get_strval().str())); + push_nodestack(theExprManager->create_const_expr(theRootSctx, theUDF, loc, v.get_strval().str())); } /******************************************************************************* @@ -10028,7 +10300,7 @@ if(right->get_expr_kind() == fo_expr_kind) { fo_expr* lFoExpr = dynamic_cast(right); - if(lFoExpr->get_func() == GET_BUILTIN_FUNCTION(FN_CONCAT_N)) + if(lFoExpr->get_func() == BUILTIN_FUNC(FN_CONCAT_N)) { rightLeafIsConcatExpr = true; csize i = 0; @@ -10046,8 +10318,9 @@ expr* concat = theExprManager->create_fo_expr(theRootSctx, + theUDF, loc, - GET_BUILTIN_FUNCTION(FN_CONCAT_N), + BUILTIN_FUNC(FN_CONCAT_N), concat_args); push_nodestack(concat); } @@ -10070,7 +10343,7 @@ try { - ve = lookup_var(v.get_name(), loc, err::XPST0008); + ve = lookup_var(v.get_name(), loc, true); } catch (const ZorbaException& e) { @@ -10103,33 +10376,48 @@ xqtref_t declaredType = ve->get_type(); - if (declaredType != NULL && !TypeOps::is_in_scope(tm, *declaredType)) + if (declaredType != NULL && !TypeOps::is_in_scope(tm, *declaredType) && + theSctx->xquery_version() == StaticContextConsts::xquery_version_1_0) { - const Error& error = (declaredType->get_manager() == tm ? - err::XPTY0004 : err::XQST0036); - - if (theModuleNamespace.empty()) + if (declaredType->get_manager() == tm) { - throw XQUERY_EXCEPTION_VAR( - error, + if (theModuleNamespace.empty()) + { + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(ZED(BadType_23o), + *declaredType, + ZED(NoTypeInMainModule_4), + ve->get_name()->getStringValue())); + } + else + { + RAISE_ERROR(err::XPTY0004, loc, ERROR_PARAMS(ZED(BadType_23o), *declaredType, - ZED( NoTypeInMainModule_4 ), - ve->get_name()->getStringValue()), - ERROR_LOC( loc ) - ); + ZED(NoTypeInModule_45), + ve->get_name()->getStringValue(), + theModuleNamespace)); + } } else { - throw XQUERY_EXCEPTION_VAR( - error, + if (theModuleNamespace.empty()) + { + RAISE_ERROR(err::XQST0036, loc, ERROR_PARAMS(ZED(BadType_23o), *declaredType, - ZED( NoTypeInModule_45 ), + ZED(NoTypeInMainModule_4), + ve->get_name()->getStringValue())); + } + else + { + RAISE_ERROR(err::XQST0036, loc, + ERROR_PARAMS(ZED(BadType_23o), + *declaredType, + ZED(NoTypeInModule_45), ve->get_name()->getStringValue(), - theModuleNamespace), - ERROR_LOC( loc ) - ); + theModuleNamespace)); + } } } @@ -10139,7 +10427,7 @@ } } - push_nodestack(theExprManager->create_wrapper_expr(theRootSctx, + push_nodestack(theExprManager->create_wrapper_expr(theRootSctx, theUDF, loc, ve)); } @@ -10206,9 +10494,9 @@ { TRACE_VISIT_OUT(); - push_nodestack(theExprManager->create_order_expr(theRootSctx, + push_nodestack(theExprManager->create_order_expr(theRootSctx, theUDF, loc, - order_expr::ordered, + doc_ordered, pop_nodestack())); } @@ -10227,9 +10515,9 @@ { TRACE_VISIT_OUT(); - push_nodestack(theExprManager->create_order_expr(theRootSctx, + push_nodestack(theExprManager->create_order_expr(theRootSctx, theUDF, loc, - order_expr::unordered, + doc_unordered, pop_nodestack())); } @@ -10277,7 +10565,8 @@ xqtref_t retType = sign.returnType(); - if (!TypeOps::is_in_scope(tm, *retType)) + if (!TypeOps::is_in_scope(tm, *retType) && + theSctx->xquery_version() == StaticContextConsts::xquery_version_1_0) { if (theModuleNamespace.empty()) { @@ -10303,7 +10592,9 @@ for (csize i = 0; i < numParams; ++i) { xqtref_t type = sign[i]; - if (!TypeOps::is_in_scope(tm, *type)) + + if (!TypeOps::is_in_scope(tm, *type) && + theSctx->xquery_version() == StaticContextConsts::xquery_version_1_0) { if (theModuleNamespace.empty()) { @@ -10381,15 +10672,15 @@ case FunctionConsts::FN_HEAD_1: { arguments.push_back(theExprManager-> - create_const_expr(theRootSctx, loc, xs_integer::one())); + create_const_expr(theRootSctx, theUDF, loc, xs_integer::one())); arguments.push_back(theExprManager-> - create_const_expr(theRootSctx, loc, xs_integer::one())); + create_const_expr(theRootSctx, theUDF, loc, xs_integer::one())); - function* f = GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_3); + function* f = BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_3); fo_expr* foExpr = theExprManager-> - create_fo_expr(theRootSctx, loc, f, arguments); + create_fo_expr(theRootSctx, theUDF, loc, f, arguments); normalize_fo(foExpr); @@ -10399,12 +10690,12 @@ case FunctionConsts::FN_TAIL_1: { arguments.push_back(theExprManager-> - create_const_expr(theRootSctx, loc, xs_integer(2))); + create_const_expr(theRootSctx, theUDF, loc, xs_integer(2))); - function* f = GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_2); + function* f = BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_2); fo_expr* foExpr = theExprManager-> - create_fo_expr(theRootSctx, loc, f, arguments); + create_fo_expr(theRootSctx, theUDF, loc, f, arguments); normalize_fo(foExpr); @@ -10425,9 +10716,9 @@ if (TypeOps::is_subtype(tm, *posType, *theRTM.INTEGER_TYPE_STAR, loc)) { if (f->getKind() == FunctionConsts::FN_SUBSTRING_2) - f = GET_BUILTIN_FUNCTION(OP_SUBSTRING_INT_2); + f = BUILTIN_FUNC(OP_SUBSTRING_INT_2); else - f = GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_2); + f = BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_2); } } else @@ -10438,14 +10729,14 @@ TypeOps::is_subtype(tm, *lenType, *theRTM.INTEGER_TYPE_STAR, loc)) { if (f->getKind() == FunctionConsts::FN_SUBSTRING_3) - f = GET_BUILTIN_FUNCTION(OP_SUBSTRING_INT_3); + f = BUILTIN_FUNC(OP_SUBSTRING_INT_3); else - f = GET_BUILTIN_FUNCTION(OP_ZORBA_SUBSEQUENCE_INT_3); + f = BUILTIN_FUNC(OP_ZORBA_SUBSEQUENCE_INT_3); } } fo_expr* foExpr = theExprManager-> - create_fo_expr(theRootSctx, loc, f, arguments); + create_fo_expr(theRootSctx, theUDF, loc, f, arguments); normalize_fo(foExpr); push_nodestack(foExpr); @@ -10469,7 +10760,7 @@ case 0: { arguments.push_back(DOT_REF); - f = GET_BUILTIN_FUNCTION(FN_NUMBER_1); + f = BUILTIN_FUNC(FN_NUMBER_1); break; } case 1: @@ -10481,21 +10772,27 @@ var_expr* tv = create_temp_var(loc, var_expr::let_var); - expr* nanExpr = theExprManager->create_const_expr(theRootSctx, loc, xs_double::nan()); + expr* nanExpr = CREATE(const)(theRootSctx, theUDF, loc, xs_double::nan()); - expr* condExpr = theExprManager->create_castable_expr(theRootSctx, loc, &*tv, theRTM.DOUBLE_TYPE_ONE); + expr* condExpr = CREATE(castable)(theRootSctx, + theUDF, + loc, + tv, + theRTM.DOUBLE_TYPE_ONE, + false); - expr* castExpr = create_cast_expr(loc, tv, theRTM.DOUBLE_TYPE_ONE, true); + expr* castExpr = create_cast_expr(loc, tv, theRTM.DOUBLE_TYPE_ONE, false, true); - expr* ret = theExprManager->create_if_expr(theRootSctx, loc, condExpr, castExpr, nanExpr); + expr* ret = CREATE(if)(theRootSctx, theUDF, loc, condExpr, castExpr, nanExpr); expr* data_expr = wrap_in_atomization(arguments[0]); - push_nodestack(wrap_in_let_flwor(theExprManager->create_treat_expr(theRootSctx, - loc, - data_expr, - theRTM.ANY_ATOMIC_TYPE_QUESTION, - TreatIterator::TYPE_MATCH), + push_nodestack(wrap_in_let_flwor(CREATE(treat)(theRootSctx, + theUDF, + loc, + data_expr, + theRTM.ANY_ATOMIC_TYPE_QUESTION, + TREAT_TYPE_MATCH), tv, ret)); return; @@ -10503,19 +10800,21 @@ case FunctionConsts::FN_STATIC_BASE_URI_0: { if (numArgs != 0) + { RAISE_ERROR(err::XPST0017, loc, ERROR_PARAMS("fn:static-base-uri", ZED(FunctionUndeclared_3), numArgs)); + } zstring baseuri = theSctx->get_base_uri(); if (baseuri.empty()) push_nodestack(create_empty_seq(loc)); else - push_nodestack(theExprManager->create_cast_expr(theRootSctx, - loc, - theExprManager->create_const_expr(theRootSctx, loc, baseuri), - theRTM.ANY_URI_TYPE_ONE)); + push_nodestack(CREATE(cast)(theRootSctx, theUDF, + loc, + CREATE(const)(theRootSctx, theUDF, loc, baseuri), + theRTM.ANY_URI_TYPE_ONE, false)); return; } case FunctionConsts::FN_ID_1: @@ -10539,17 +10838,17 @@ fo_expr* normExpr = NULL; fo_expr* tokenExpr = NULL; zstring space(" "); - const_expr* constExpr = theExprManager->create_const_expr(theRootSctx, loc, space); + const_expr* constExpr = theExprManager->create_const_expr(theRootSctx, theUDF, loc, space); - normExpr = theExprManager->create_fo_expr(theRootSctx, + normExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(FN_NORMALIZE_SPACE_1), + BUILTIN_FUNC(FN_NORMALIZE_SPACE_1), flworVarExpr); normalize_fo(normExpr); - tokenExpr = theExprManager->create_fo_expr(theRootSctx, + tokenExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(FN_TOKENIZE_2), + BUILTIN_FUNC(FN_TOKENIZE_2), normExpr, constExpr); normalize_fo(tokenExpr); @@ -10564,20 +10863,20 @@ case FunctionConsts::FN_IDREF_1: { arguments.insert(arguments.begin(), DOT_REF); - f = GET_BUILTIN_FUNCTION(FN_IDREF_2); + f = BUILTIN_FUNC(FN_IDREF_2); break; } case FunctionConsts::FN_LANG_1: { arguments.insert(arguments.begin(), DOT_REF); - f = GET_BUILTIN_FUNCTION(FN_LANG_2); + f = BUILTIN_FUNC(FN_LANG_2); break; } case FunctionConsts::FN_RESOLVE_URI_1: { zstring baseUri = theSctx->get_base_uri(); - arguments.insert(arguments.begin(), theExprManager->create_const_expr(theRootSctx, loc, baseUri)); - f = GET_BUILTIN_FUNCTION(FN_RESOLVE_URI_2); + arguments.insert(arguments.begin(), theExprManager->create_const_expr(theRootSctx, theUDF, loc, baseUri)); + f = BUILTIN_FUNC(FN_RESOLVE_URI_2); break; } case FunctionConsts::FN_CONCAT_N: @@ -10623,7 +10922,7 @@ if (f != NULL && f->getKind() == FunctionConsts::FN_APPLY_1) { expr* applyExpr = theExprManager-> - create_apply_expr(theRootSctx, loc, arguments[0], false); + create_apply_expr(theRootSctx, theUDF, loc, arguments[0], false); push_nodestack(applyExpr); return; @@ -10672,7 +10971,7 @@ ERROR_PARAMS(qname->get_qname(), ZED(FunctionUndeclared_3), numArgs)); } - push_nodestack(create_cast_expr(loc, arguments[0], type, true)); + push_nodestack(create_cast_expr(loc, arguments[0], type, true, true)); } // It is not a builtin constructor function @@ -10715,7 +11014,7 @@ // Create and normalize the fo expr std::reverse(arguments.begin(), arguments.end()); - fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, loc, f, arguments); + fo_expr* foExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, f, arguments); normalize_fo(foExpr); @@ -10728,7 +11027,7 @@ resultExpr = wrap_in_type_match(foExpr, resultType, loc, - TreatIterator::FUNC_RETURN, + TREAT_FUNC_RETURN, f->getName()); } @@ -10741,7 +11040,7 @@ { FunctionConsts::FunctionKind fkind = FunctionConsts::OP_SORT_DISTINCT_NODES_ASC_1; - resultExpr = theExprManager->create_fo_expr(theRootSctx, + resultExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, foExpr->get_loc(), BuiltinFunctionLibrary::getFunction(fkind), foExpr); @@ -10789,6 +11088,7 @@ eval_expr* evalExpr = theExprManager-> create_eval_expr(theRootSctx, + theUDF, loc, foExpr->get_arg(0), scriptingKind, @@ -10856,12 +11156,12 @@ // create a flwor with LETs to hold the parameters flwor_expr* flworExpr = theExprManager-> - create_flwor_expr(theRootSctx, loc, false); + create_flwor_expr(theRootSctx, theUDF, loc, false); // wrap function's QName expr* qnameExpr = wrap_in_type_promotion(arguments[0], theRTM.QNAME_TYPE_ONE, - PromoteIterator::TYPE_PROMOTION); + PROMOTE_TYPE_PROMOTION); for (csize i = 0; i < numArgs ; ++i) { @@ -10876,7 +11176,7 @@ ztd::to_string(theTempVarCounter++); GENV_ITEMFACTORY->createQName(qnameItem, "", "", localName.c_str()); } - while (lookup_var(qnameItem, loc, zerr::ZXQP0000_NO_ERROR) != NULL); + while (lookup_var(qnameItem, loc, false) != NULL); var_expr* var = create_var(loc, qnameItem, var_expr::let_var); temp_vars.push_back(var); @@ -10899,26 +11199,26 @@ // Expanded QName's namespace URI expr* namespaceExpr = - theExprManager->create_fo_expr(theRootSctx, + theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(FN_NAMESPACE_URI_FROM_QNAME_1), + BUILTIN_FUNC(FN_NAMESPACE_URI_FROM_QNAME_1), temp_vars[0]); namespaceExpr = - theExprManager->create_fo_expr(theRootSctx, + theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(FN_STRING_1), + BUILTIN_FUNC(FN_STRING_1), namespaceExpr); // Expanded QName's local name expr* localExpr = - theExprManager->create_fo_expr(theRootSctx, + theExprManager->create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(FN_LOCAL_NAME_FROM_QNAME_1), + BUILTIN_FUNC(FN_LOCAL_NAME_FROM_QNAME_1), temp_vars[0]); localExpr = theExprManager-> - create_fo_expr(theRootSctx, loc, GET_BUILTIN_FUNCTION(FN_STRING_1), localExpr); + create_fo_expr(theRootSctx, theUDF, loc, BUILTIN_FUNC(FN_STRING_1), localExpr); // qnameExpr := concat("Q{", // namespaceExpr, @@ -10926,20 +11226,20 @@ // localExpr, // "($temp_invoke_var2, $temp_invoke_var3,...)") std::vector concat_args; - concat_args.push_back(theExprManager->create_const_expr(theRootSctx, loc, "Q{")); + concat_args.push_back(theExprManager->create_const_expr(theRootSctx, theUDF, loc, "Q{")); concat_args.push_back(namespaceExpr); - concat_args.push_back(theExprManager->create_const_expr(theRootSctx, loc, "}")); + concat_args.push_back(theExprManager->create_const_expr(theRootSctx, theUDF, loc, "}")); concat_args.push_back(localExpr); - concat_args.push_back(theExprManager->create_const_expr(theRootSctx, loc, query_params)); + concat_args.push_back(theExprManager->create_const_expr(theRootSctx, theUDF, loc, query_params)); qnameExpr = theExprManager-> - create_fo_expr(theRootSctx, + create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(FN_CONCAT_N), + BUILTIN_FUNC(FN_CONCAT_N), concat_args); eval_expr* evalExpr = theExprManager-> - create_eval_expr(theRootSctx, + create_eval_expr(theRootSctx, theUDF, loc, qnameExpr, scriptingKind, @@ -11045,18 +11345,18 @@ if (TypeOps::is_subtype(tm, *srcType, *theRTM.JSON_ARRAY_TYPE_STAR)) { - func = GET_BUILTIN_FUNCTION(FN_JSONIQ_MEMBER_2); + func = BUILTIN_FUNC(FN_JSONIQ_MEMBER_2); } else if (TypeOps::is_subtype(tm, *srcType, *theRTM.JSON_OBJECT_TYPE_STAR)) { - func = GET_BUILTIN_FUNCTION(FN_JSONIQ_VALUE_2); + func = BUILTIN_FUNC(FN_JSONIQ_VALUE_2); } else { - func = GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_ITEM_ACCESSOR_2); + func = BUILTIN_FUNC(OP_ZORBA_JSON_ITEM_ACCESSOR_2); } - accessorExpr = theExprManager->create_fo_expr(theRootSctx, + accessorExpr = theExprManager->create_fo_expr(theRootSctx, theUDF, loc, func, flworVarExpr, @@ -11081,7 +11381,7 @@ } expr* dynFuncInvocation = - theExprManager->create_dynamic_function_invocation_expr(theRootSctx, + theExprManager->create_dynamic_function_invocation_expr(theRootSctx, theUDF, loc, sourceExpr, arguments); @@ -11150,13 +11450,12 @@ var_expr* argVar = create_temp_var(loc, var_expr::arg_var); argVar->set_param_pos(i); - argVar->set_udf(udf); udfArgs[i] = argVar; foArgs[i] = argVar; } - expr* body = theExprManager->create_fo_expr(theRootSctx, loc, fn, foArgs); + expr* body = theExprManager->create_fo_expr(theRootSctx, udf, loc, fn, foArgs); udf->setArgVars(udfArgs); udf->setBody(body); @@ -11164,7 +11463,7 @@ fn = udf; } - expr* fiExpr = theExprManager->create_function_item_expr(theRootSctx, loc, fn->getName(), fn, arity); + expr* fiExpr = theExprManager->create_function_item_expr(theRootSctx, theUDF, loc, fn->getName(), fn, arity); push_nodestack(fiExpr); } @@ -11180,11 +11479,8 @@ if ( !theSctx->is_feature_set(feature::hof) ) { - throw XQUERY_EXCEPTION( - zerr::ZXQP0050_FEATURE_NOT_AVAILABLE, - ERROR_PARAMS( "higher-order functions (hof)" ), - ERROR_LOC( v.get_location() ) - ); + RAISE_ERROR(zerr::ZXQP0050_FEATURE_NOT_AVAILABLE, loc, + ERROR_PARAMS("higher-order functions (hof)")); } // Get the in-scope vars of the scope before opening the new scope for the @@ -11194,10 +11490,52 @@ push_scope(); - function_item_expr* fiExpr = theExprManager->create_function_item_expr(theRootSctx, loc); + function_item_expr* fiExpr = + theExprManager->create_function_item_expr(theRootSctx, theUDF, loc); push_nodestack(fiExpr); + // Translate the return tyoe + xqtref_t returnType = GENV_TYPESYSTEM.ITEM_TYPE_STAR; + if (v.getReturnType() != 0) + { + v.getReturnType()->accept(*this); + returnType = pop_tstack(); + } + + // Translate the type declarations for the function params + rchandle params = v.getParamList(); + std::vector paramTypes; + + if (params != 0) + { + std::vector >::const_iterator lIt = params->begin(); + for(; lIt != params->end(); ++lIt) + { + const Param* param = lIt->getp(); + const SequenceType* paramType = param->get_typedecl(); + if (paramType == 0) + { + paramTypes.push_back(GENV_TYPESYSTEM.ITEM_TYPE_STAR); + } + else + { + paramType->accept(*this); + paramTypes.push_back(pop_tstack()); + } + } + } + + // Create the udf obj. + user_function_t udf(new user_function(loc, + signature(0, paramTypes, returnType), + NULL, + SIMPLE_EXPR, + theCCB)); + fiExpr->set_function(udf); + + theUDF = udf; + flwor_expr* flwor = NULL; // Handle function parameters. Translation of the params, if any, results to @@ -11208,7 +11546,6 @@ // let $xN as TN := _xN // // where each _xi is an arg var. - rchandle params = v.getParamList(); if (params) { params->accept(*this); @@ -11217,7 +11554,7 @@ } else { - flwor = theExprManager->create_flwor_expr(theRootSctx, loc, false); + flwor = theExprManager->create_flwor_expr(theRootSctx, theUDF, loc, false); } // Handle inscope variables. For each inscope var, a let binding is added to @@ -11268,29 +11605,33 @@ std::vector argVars; - // Get the return tyoe - xqtref_t returnType = GENV_TYPESYSTEM.ITEM_TYPE_STAR; - if(v.getReturnType() != 0) - { - returnType = pop_tstack(); - } - - // Get the inline function body and wrap it in appropriate type op. + // Get the inline function body. expr* body = pop_nodestack(); ZORBA_ASSERT(body != 0); - if (TypeOps::is_builtin_simple(CTX_TM, *returnType)) + // Get the flwor expr that defines the arg vars + flwor_expr* flwor = static_cast(pop_nodestack()); + + // Get the function item + function_item_expr* fiExpr = dynamic_cast( + theNodeStack.top()); + assert(fiExpr != NULL); + + user_function* udf = fiExpr->get_function(); + + xqtref_t returnType = udf->getSignature().returnType(); + + // Wrap the body in appropriate type op. + if (returnType->isBuiltinAtomicAny()) { - body = wrap_in_type_promotion(body, returnType, PromoteIterator::TYPE_PROMOTION); + body = wrap_in_type_promotion(body, returnType, PROMOTE_TYPE_PROMOTION); } else { - body = wrap_in_type_match(body, returnType, loc, TreatIterator::TYPE_MATCH); + body = wrap_in_type_match(body, returnType, loc, TREAT_TYPE_MATCH); } // Make the body be the return expr of the flwor that binds the function params. - flwor_expr* flwor = static_cast(pop_nodestack()); - if (flwor != NULL) { flwor->set_return_expr(body); @@ -11315,53 +11656,22 @@ { RewriterContext rCtx(theCCB, body, - NULL, + theUDF, "Inline function", (theSctx->ordering_mode() == StaticContextConsts::ordered)); GENV_COMPILERSUBSYS.getDefaultOptimizingRewriter()->rewrite(rCtx); body = rCtx.getRoot(); } - // Translate the type declarations for the function params - std::vector paramTypes; - rchandle params = v.getParamList(); - if (params != 0) - { - std::vector >::const_iterator lIt = params->begin(); - for(; lIt != params->end(); ++lIt) - { - const Param* param = lIt->getp(); - const SequenceType* paramType = param->get_typedecl(); - if(paramType == 0) - { - paramTypes.push_back(GENV_TYPESYSTEM.ITEM_TYPE_STAR); - } - else - { - paramType->accept(*this); - paramTypes.push_back(pop_tstack()); - } - } - } - - // Create the udf obj. - user_function_t udf(new user_function(loc, - signature(0, paramTypes, returnType), - body, - body->get_scripting_detail(), - theCCB)); + udf->setBody(body); + udf->setScriptingKind(body->get_scripting_detail()); udf->setArgVars(argVars); udf->setOptimized(true); - // Get the function_item_expr and set its function to the udf created above. - function_item_expr* fiExpr = dynamic_cast( - theNodeStack.top()); - assert(fiExpr != NULL); - - fiExpr->set_function(udf); - // pop the scope. pop_scope(); + + theUDF = fiExpr->get_udf(); } @@ -11403,7 +11713,7 @@ contentExpr = pop_nodestack(); } - push_nodestack(theExprManager->create_json_array_expr(theRootSctx, loc, contentExpr)); + push_nodestack(theExprManager->create_json_array_expr(theRootSctx, theUDF, loc, contentExpr)); #endif } @@ -11435,18 +11745,21 @@ { contentExpr = pop_nodestack(); - contentExpr = theExprManager-> - create_treat_expr(theRootSctx, - contentExpr->get_loc(), - contentExpr, - GENV_TYPESYSTEM.JSON_OBJECT_TYPE_STAR, - TreatIterator::TYPE_MATCH, - true, - NULL); + contentExpr = CREATE(treat)(theRootSctx, + theUDF, + contentExpr->get_loc(), + contentExpr, + GENV_TYPESYSTEM.JSON_OBJECT_TYPE_STAR, + TREAT_TYPE_MATCH, + true, + NULL); } - expr* jo = theExprManager-> - create_json_object_expr(theRootSctx, loc, contentExpr, v.get_accumulate()); + expr* jo = CREATE(json_object)(theRootSctx, + theUDF, + loc, + contentExpr, + v.get_accumulate()); push_nodestack(jo); #endif @@ -11483,7 +11796,7 @@ } expr* jo = theExprManager-> - create_json_direct_object_expr(theRootSctx, loc, names, values); + create_json_direct_object_expr(theRootSctx, theUDF, loc, names, values); push_nodestack(jo); #endif @@ -11537,17 +11850,18 @@ nameExpr = wrap_in_atomization(nameExpr); - nameExpr = theExprManager-> - create_cast_expr(theRootSctx, - nameExpr->get_loc(), - nameExpr, - GENV_TYPESYSTEM.STRING_TYPE_ONE); - - valueExpr = theExprManager-> - create_fo_expr(theRootSctx, - valueExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_BOX_1), - valueExpr); + nameExpr = CREATE(cast)(theRootSctx, + theUDF, + nameExpr->get_loc(), + nameExpr, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + false); + + valueExpr = CREATE(fo)(theRootSctx, + theUDF, + valueExpr->get_loc(), + BUILTIN_FUNC(OP_ZORBA_JSON_BOX_1), + valueExpr); push_nodestack(valueExpr); push_nodestack(nameExpr); @@ -11634,12 +11948,12 @@ store::Item_t qnameItem; expand_elem_qname(qnameItem, v.get_elem_name(), loc); - nameExpr = theExprManager->create_const_expr(theRootSctx, loc, qnameItem); + nameExpr = theExprManager->create_const_expr(theRootSctx, theUDF, loc, qnameItem); bool copyNodes = (theCCB->theConfig.opt_level < CompilerCB::config::O1 || !Properties::instance()->noCopyOptim()); - push_nodestack(theExprManager->create_elem_expr(theRootSctx, + push_nodestack(theExprManager->create_elem_expr(theRootSctx, theUDF, loc, nameExpr, attrExpr, @@ -11652,7 +11966,7 @@ /******************************************************************************* - [120] DirAttributeList ::= DirAttr | DirAttributeList DirAttr + [120] DirAttributeList ::= DirAttr | DirAttributeList DirAttr ********************************************************************************/ void* begin_visit(const DirAttributeList& v) { @@ -11674,7 +11988,7 @@ } } - unsigned long numAttrs = 0; + csize numAttrs = 0; std::vector attributes; while(true) { @@ -11685,7 +11999,7 @@ attr_expr* attrExpr = dynamic_cast(expr); const store::Item* attExprName = attrExpr->getQName(); - for (unsigned long i = 0; i < numAttrs; ++i) + for (csize i = 0; i < numAttrs; ++i) { const store::Item* attName = attributes[i]->getQName(); if (attName->equals(attExprName)) @@ -11710,8 +12024,8 @@ args.push_back((*it)); } - fo_expr* expr_list = - theExprManager->create_fo_expr(theRootSctx, loc, op_concatenate, args); + fo_expr* expr_list = + CREATE(fo)(theRootSctx, theUDF, loc, op_concatenate, args); normalize_fo(expr_list); @@ -11721,6 +12035,7 @@ return NULL; // reject visitor -- everything done } + void end_visit(const DirAttributeList& v, void* /*visit_state*/) { // begin_visit() rejects visitor @@ -11765,15 +12080,13 @@ prefix = qname->get_localname(); if (ZSTREQ(prefix, "xmlns")) - throw XQUERY_EXCEPTION( - err::XQST0070, - ERROR_PARAMS( prefix, ZED( NoRebindPrefix ) ), - ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XQST0070, loc, + ERROR_PARAMS(prefix, ZED(NoRebindPrefix))); } const_expr* constValueExpr = dynamic_cast(valueExpr); fo_expr* foExpr = dynamic_cast(valueExpr); + if (foExpr != NULL && foExpr->get_func() != op_concatenate) foExpr = NULL; @@ -11784,7 +12097,7 @@ } else if (foExpr != NULL) { - for (unsigned int i=0; inum_args(); i++) + for (csize i = 0; i < foExpr->num_args(); ++i) { const_expr* constValueExpr = dynamic_cast(foExpr->get_arg(i)); if (constValueExpr != NULL) @@ -11819,7 +12132,7 @@ RAISE_ERROR(err::XQST0070, loc, ERROR_PARAMS(uri, ZED(NoBindURI))); } - theSctx->bind_ns(prefix, uri, loc, err::XQST0071); + theSctx->bind_ns(prefix, uri, loc); theNSCtx->bind_ns(prefix, uri); if (prefix.empty()) @@ -11835,7 +12148,7 @@ // unbind the prefix zstring empty; - theSctx->bind_ns(prefix, empty, loc, err::XQST0071); + theSctx->bind_ns(prefix, empty, loc); theNSCtx->bind_ns(prefix, empty); if (prefix.empty()) @@ -11846,13 +12159,13 @@ throw XQUERY_EXCEPTION(err::XQST0022, ERROR_LOC(loc)); } } - else // Plain direct attribute + else { store::Item_t qnameItem; expand_no_default_qname(qnameItem, qname, qname->get_location()); - expr* nameExpr = theExprManager->create_const_expr(theRootSctx, loc, qnameItem); + expr* nameExpr = CREATE(const)(theRootSctx, theUDF, loc, qnameItem); fo_expr* foExpr = NULL; if ((foExpr = dynamic_cast(valueExpr)) != NULL && @@ -11865,7 +12178,7 @@ valueExpr = wrap_in_atomization(valueExpr); } - expr* attrExpr = theExprManager->create_attr_expr(theRootSctx, loc, nameExpr, valueExpr); + expr* attrExpr = theExprManager->create_attr_expr(theRootSctx, theUDF, loc, nameExpr, valueExpr); push_nodestack(attrExpr); } @@ -11904,7 +12217,7 @@ else { fo_expr* expr_list = theExprManager-> - create_fo_expr(theRootSctx, loc, op_concatenate, args); + create_fo_expr(theRootSctx, theUDF, loc, op_concatenate, args); normalize_fo(expr_list); @@ -11938,11 +12251,9 @@ { if (!v.isStripped()) { - expr* content = theExprManager->create_const_expr(theRootSctx, loc, v.get_elem_content().str()); + expr* content = CREATE(const)(theRootSctx, theUDF, loc, v.get_elem_content().str()); - push_nodestack(theExprManager->create_text_expr(theRootSctx, loc, - text_expr::text_constructor, - content)); + push_nodestack(CREATE(text)(theRootSctx, theUDF, loc, text_constructor, content)); } } } @@ -11970,6 +12281,7 @@ void check_boundary_whitespace(const DirElemContent& v) { v.setIsStripped(false); + if (theSctx->boundary_space_mode() == StaticContextConsts::strip_space) { bool lPrevIsBoundary = translator_ns::pop_stack (theIsWSBoundaryStack); @@ -12044,8 +12356,8 @@ // Skip empty CDATA sections if(!lCDATA_content.empty()) { - expr* content = theExprManager->create_const_expr(theRootSctx, loc, lCDATA_content); - push_nodestack(theExprManager->create_text_expr(theRootSctx, loc, text_expr::text_constructor, content)); + expr* content = CREATE(const)(theRootSctx, theUDF, loc, lCDATA_content); + push_nodestack(CREATE(text)(theRootSctx, theUDF, loc, text_constructor, content)); } } @@ -12081,7 +12393,7 @@ else if (args.size() > 1) { fo_expr* expr_list = theExprManager-> - create_fo_expr(theRootSctx, loc, op_concatenate, args); + create_fo_expr(theRootSctx, theUDF, loc, op_concatenate, args); normalize_fo(expr_list); @@ -12124,7 +12436,7 @@ { if (cc == NULL) { - push_nodestack(theExprManager->create_const_expr (theRootSctx, loc, content)); + push_nodestack(theExprManager->create_const_expr (theRootSctx, theUDF, loc, content)); } else { @@ -12203,7 +12515,7 @@ curRef++; } - expr* lConstExpr = theExprManager->create_const_expr(theRootSctx, loc, content); + expr* lConstExpr = theExprManager->create_const_expr(theRootSctx, theUDF, loc, content); push_nodestack(lConstExpr); break; } @@ -12212,7 +12524,7 @@ // we always create a text node here because if we are in an attribute, we atomice // the text node into its string value zstring content("{"); - expr* lConstExpr = theExprManager->create_const_expr(theRootSctx, loc, content); + expr* lConstExpr = theExprManager->create_const_expr(theRootSctx, theUDF, loc, content); push_nodestack ( lConstExpr ); break; } @@ -12221,7 +12533,7 @@ // we always create a text node here because if we are in an attribute, we atomice // the text node into its string value zstring content("}"); - expr* lConstExpr = theExprManager->create_const_expr(theRootSctx, loc, content); + expr* lConstExpr = CREATE(const)(theRootSctx, theUDF, loc, content); push_nodestack ( lConstExpr ); break; } @@ -12244,10 +12556,13 @@ TRACE_VISIT_OUT(); zstring str = v.get_comment().str(); - expr* content = theExprManager->create_const_expr (theRootSctx, loc, str); - push_nodestack (theExprManager->create_text_expr(theRootSctx, loc, - text_expr::comment_constructor, - content)); + expr* content = CREATE(const)(theRootSctx, theUDF, loc, str); + + push_nodestack (CREATE(text)(theRootSctx, + theUDF, + loc, + comment_constructor, + content)); } @@ -12268,10 +12583,10 @@ if (target_upper == "XML") RAISE_ERROR(err::XPST0003, loc, ERROR_PARAMS(ZED(XPST0003_PiTarget))); - expr* target = theExprManager->create_const_expr(theRootSctx, loc, target_str); - expr* content = theExprManager->create_const_expr(theRootSctx, loc, v.get_pi_content().str()); + expr* target = theExprManager->create_const_expr(theRootSctx, theUDF, loc, target_str); + expr* content = theExprManager->create_const_expr(theRootSctx, theUDF, loc, v.get_pi_content().str()); - push_nodestack(theExprManager->create_pi_expr(theRootSctx, loc, target, content)); + push_nodestack(theExprManager->create_pi_expr(theRootSctx, theUDF, loc, target, content)); } @@ -12292,7 +12607,7 @@ bool copyNodes = (theCCB->theConfig.opt_level < CompilerCB::config::O1 || !Properties::instance()->noCopyOptim()); - push_nodestack(theExprManager->create_doc_expr(theRootSctx, loc, lEnclosed, copyNodes)); + push_nodestack(theExprManager->create_doc_expr(theRootSctx, theUDF, loc, lEnclosed, copyNodes)); } @@ -12325,14 +12640,14 @@ store::Item_t qnameItem; expand_elem_qname(qnameItem, constQName, loc); - nameExpr = theExprManager->create_const_expr(theRootSctx, loc, qnameItem); + nameExpr = theExprManager->create_const_expr(theRootSctx, theUDF, loc, qnameItem); } else { nameExpr = pop_nodestack(); expr* atomExpr = wrap_in_atomization(nameExpr); - nameExpr = theExprManager->create_name_cast_expr(theRootSctx, + nameExpr = theExprManager->create_name_cast_expr(theRootSctx, theUDF, loc, atomExpr, theNSCtx, @@ -12342,7 +12657,7 @@ bool copyNodes = (theCCB->theConfig.opt_level < CompilerCB::config::O1 || !Properties::instance()->noCopyOptim()); - push_nodestack(theExprManager->create_elem_expr(theRootSctx, + push_nodestack(theExprManager->create_elem_expr(theRootSctx, theUDF, loc, nameExpr, contentExpr, @@ -12379,20 +12694,20 @@ store::Item_t qnameItem; expand_no_default_qname(qnameItem, constQName, constQName->get_location()); - nameExpr = theExprManager->create_const_expr(theRootSctx, loc, qnameItem); + nameExpr = theExprManager->create_const_expr(theRootSctx, theUDF, loc, qnameItem); } else { nameExpr = pop_nodestack(); expr* atomExpr = wrap_in_atomization(nameExpr); - nameExpr = theExprManager->create_name_cast_expr(theRootSctx, + nameExpr = theExprManager->create_name_cast_expr(theRootSctx, theUDF, loc, atomExpr, theNSCtx, true); } - attrExpr = theExprManager->create_attr_expr(theRootSctx, loc, nameExpr, valueExpr); + attrExpr = theExprManager->create_attr_expr(theRootSctx, theUDF, loc, nameExpr, valueExpr); push_nodestack(attrExpr); } @@ -12412,9 +12727,9 @@ fo_expr* enclosedExpr = wrap_in_enclosed_expr(inputExpr, loc); - expr* textExpr = theExprManager->create_text_expr(theRootSctx, loc, - text_expr::comment_constructor, - enclosedExpr); + expr* textExpr = theExprManager->create_text_expr(theRootSctx, theUDF, loc, + comment_constructor, + enclosedExpr); push_nodestack(textExpr); } @@ -12448,14 +12763,14 @@ { target = pop_nodestack(); - expr* castExpr = create_cast_expr(loc, target, theRTM.NCNAME_TYPE_ONE, true); + expr* castExpr = create_cast_expr(loc, target, theRTM.NCNAME_TYPE_ONE, false, true); target = wrap_in_enclosed_expr(castExpr, loc); } expr* e = (v.get_target_expr () != NULL ? - theExprManager->create_pi_expr(theRootSctx, loc, target, content) : - theExprManager->create_pi_expr(theRootSctx, loc, theExprManager->create_const_expr(theRootSctx, loc, v.get_target().str()), content)); + theExprManager->create_pi_expr(theRootSctx, theUDF, loc, target, content) : + theExprManager->create_pi_expr(theRootSctx, theUDF, loc, theExprManager->create_const_expr(theRootSctx, theUDF, loc, v.get_target().str()), content)); push_nodestack (e); } @@ -12475,34 +12790,15 @@ fo_expr* enclosedExpr = wrap_in_enclosed_expr(inputExpr, loc); - expr* textExpr = theExprManager->create_text_expr(theRootSctx, + expr* textExpr = theExprManager->create_text_expr(theRootSctx, theUDF, loc, - text_expr::text_constructor, + text_constructor, enclosedExpr); push_nodestack(textExpr); } -/******************************************************************************* - -********************************************************************************/ - -void* begin_visit(const SingleType& v) -{ - TRACE_VISIT(); - return no_state; -} - -void end_visit(const SingleType& v, void* /*visit_state*/) -{ - TRACE_VISIT_OUT(); - if (v.get_hook_bit()) - theTypeStack.push(CTX_TM->create_type(*pop_tstack(), TypeConstants::QUANT_QUESTION)); - // else leave type as it is on tstack -} - - void* begin_visit(const TypeName& v) { TRACE_VISIT(); @@ -12597,7 +12893,8 @@ xqtref_t t = CTX_TM->create_named_atomic_type(qnameItem, TypeConstants::QUANT_ONE, - loc); + loc, + false); // some types that should never be parsed, like xs:untyped, are; // we catch them with is_simple() @@ -12607,7 +12904,7 @@ } else { - theTypeStack.push (t); + theTypeStack.push(t); } } @@ -12732,7 +13029,7 @@ dynamic_cast(peek_nodestk_or_null()); if (axisExpr != NULL) { - match_expr* me = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* me = theExprManager->create_match_expr(theRootSctx, theUDF, loc); me->setTestKind(match_anykind_test); axisExpr->setTest(me); } @@ -12769,7 +13066,7 @@ { if (axisExpr != NULL) { - match = theExprManager->create_match_expr(theRootSctx, loc); + match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); match->setTestKind(match_doc_test); axisExpr->setTest(match); @@ -12853,7 +13150,7 @@ if (axisExpr != NULL) { - match_expr* me = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* me = theExprManager->create_match_expr(theRootSctx, theUDF, loc); me->setTestKind(match_elem_test); me->setQName(elemNameItem); me->setTypeName(typeNameItem); @@ -12901,7 +13198,7 @@ store::Item_t typeQNameItem; CTX_TM->get_schema_element_typename(elemQNameItem, typeQNameItem, loc); - match_expr* match = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); match->setTestKind(match_xs_elem_test); match->setQName(elemQNameItem); match->setTypeName(typeQNameItem); @@ -12962,11 +13259,8 @@ if (contentType == NULL) { - throw XQUERY_EXCEPTION( - err::XPST0008, - ERROR_PARAMS( typeNameItem->getStringValue(), ZED( AttributeName ) ), - ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(typeNameItem->getStringValue(), ZED(AttributeName))); } } @@ -12975,7 +13269,7 @@ dynamic_cast (peek_nodestk_or_null()); if (axisExpr != NULL) { - match_expr* match = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); match->setTestKind(match_attr_test); if (attrName != NULL) @@ -13018,7 +13312,7 @@ store::Item_t typeQNameItem; CTX_TM->get_schema_attribute_typename(attrQNameItem, typeQNameItem, loc); - match_expr* match = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); match->setTestKind(match_xs_attr_test); match->setQName(attrQNameItem); match->setTypeName(typeQNameItem); @@ -13067,7 +13361,7 @@ dynamic_cast (peek_nodestk_or_null ()); if (axisExpr != NULL) { - match_expr* match = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); match->setTestKind(match_text_test); axisExpr->setTest(match); } @@ -13094,7 +13388,7 @@ dynamic_cast (peek_nodestk_or_null ()); if (axisExpr != NULL) { - match_expr* match = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); match->setTestKind(match_comment_test); axisExpr->setTest(match); } @@ -13148,7 +13442,7 @@ if (axisExpr != NULL) { - match_expr* match = theExprManager->create_match_expr(theRootSctx, loc); + match_expr* match = theExprManager->create_match_expr(theRootSctx, theUDF, loc); match->setTestKind(match_pi_test); if (target != "") match->setQName(qname); @@ -13278,28 +13572,24 @@ targetExpr = wrap_in_type_match(targetExpr, rtm.JSON_OBJECT_TYPE_ONE, loc, - TreatIterator::JSONIQ_OBJECT_UPDATE_TARGET, // JNUP0008 + TREAT_JSONIQ_OBJECT_UPDATE_TARGET, // JNUP0008 NULL); contentExpr = wrap_in_type_match(contentExpr, rtm.JSON_OBJECT_TYPE_STAR, loc, - TreatIterator::JSONIQ_OBJECT_UPDATE_CONTENT, // JNUP0019 + TREAT_JSONIQ_OBJECT_UPDATE_CONTENT, // JNUP0019 NULL); std::vector args(2); args[0] = targetExpr; - args[1] = theExprManager->create_json_object_expr( - theRootSctx, - loc, - contentExpr, - false); + args[1] = CREATE(json_object)(theRootSctx, theUDF, loc, contentExpr, false); - expr* updExpr = theExprManager-> - create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_OBJECT_INSERT_2), - args); + expr* updExpr = CREATE(fo)(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_ZORBA_JSON_OBJECT_INSERT_2), + args); push_nodestack(updExpr); #endif @@ -13333,12 +13623,12 @@ posExpr = wrap_in_type_promotion(posExpr, rtm.INTEGER_TYPE_ONE, - PromoteIterator::JSONIQ_ARRAY_SELECTOR); // JNUP0007 + PROMOTE_JSONIQ_ARRAY_SELECTOR); // JNUP0007 targetExpr = wrap_in_type_match(targetExpr, rtm.JSON_ARRAY_TYPE_ONE, loc, - TreatIterator::JSONIQ_ARRAY_UPDATE_TARGET, // JNUP0008 + TREAT_JSONIQ_ARRAY_UPDATE_TARGET, // JNUP0008 NULL); std::vector args(3); @@ -13347,9 +13637,9 @@ args[2] = sourceExpr; fo_expr* updExpr = theExprManager-> - create_fo_expr(theRootSctx, + create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_ARRAY_INSERT_3), + BUILTIN_FUNC(OP_ZORBA_JSON_ARRAY_INSERT_3), args); normalize_fo(updExpr); @@ -13383,15 +13673,15 @@ targetExpr = wrap_in_type_match(targetExpr, theRTM.JSON_ARRAY_TYPE_ONE, loc, - TreatIterator::JSONIQ_ARRAY_UPDATE_TARGET, // JNUP0008 + TREAT_JSONIQ_ARRAY_UPDATE_TARGET, // JNUP0008 NULL); - fo_expr* updExpr = theExprManager-> - create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_ARRAY_APPEND_2), - targetExpr, - contentExpr); + fo_expr* updExpr = CREATE(fo)(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_ZORBA_JSON_ARRAY_APPEND_2), + targetExpr, + contentExpr); normalize_fo(updExpr); @@ -13433,19 +13723,19 @@ selExpr = wrap_in_type_promotion(selExpr, theRTM.ANY_ATOMIC_TYPE_ONE, - PromoteIterator::JSONIQ_SELECTOR, // JNUP0007 + PROMOTE_JSONIQ_SELECTOR, // JNUP0007 NULL); targetExpr = wrap_in_type_match(targetExpr, theRTM.JSON_ITEM_TYPE_ONE, loc, - TreatIterator::JSONIQ_UPDATE_TARGET, // JNUP0008 + TREAT_JSONIQ_UPDATE_TARGET, // JNUP0008 NULL); fo_expr* updExpr = theExprManager-> - create_fo_expr(theRootSctx, + create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_DELETE_2), + BUILTIN_FUNC(OP_ZORBA_JSON_DELETE_2), targetExpr, selExpr); @@ -13481,23 +13771,23 @@ args[0] = wrap_in_type_match(targetExpr, theRTM.JSON_ITEM_TYPE_ONE, loc, - TreatIterator::JSONIQ_UPDATE_TARGET, // JNUP0008 + TREAT_JSONIQ_UPDATE_TARGET, // JNUP0008 NULL); args[1] = wrap_in_type_promotion(selExpr, theRTM.ANY_ATOMIC_TYPE_ONE, - PromoteIterator::JSONIQ_SELECTOR, // JNUP0007 + PROMOTE_JSONIQ_SELECTOR, // JNUP0007 NULL); - args[2] = theExprManager->create_fo_expr(theRootSctx, + args[2] = theExprManager->create_fo_expr(theRootSctx, theUDF, valueExpr->get_loc(), - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_BOX_1), + BUILTIN_FUNC(OP_ZORBA_JSON_BOX_1), valueExpr); fo_expr* updExpr = theExprManager-> - create_fo_expr(theRootSctx, + create_fo_expr(theRootSctx, theUDF, loc, - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_REPLACE_VALUE_3), + BUILTIN_FUNC(OP_ZORBA_JSON_REPLACE_VALUE_3), args); push_nodestack(updExpr); @@ -13532,22 +13822,22 @@ args[0] = wrap_in_type_match(targetExpr, theRTM.JSON_OBJECT_TYPE_ONE, loc, - TreatIterator::JSONIQ_OBJECT_UPDATE_TARGET, // JNUP0008 + TREAT_JSONIQ_OBJECT_UPDATE_TARGET, // JNUP0008 NULL); args[1] = wrap_in_type_promotion(nameExpr, theRTM.STRING_TYPE_ONE, - PromoteIterator::JSONIQ_OBJECT_SELECTOR); // JNUP0007 + PROMOTE_JSONIQ_OBJECT_SELECTOR); // JNUP0007 args[2] = wrap_in_type_promotion(newNameExpr, theRTM.STRING_TYPE_ONE, - PromoteIterator::JSONIQ_OBJECT_SELECTOR); // JNUP0007 + PROMOTE_JSONIQ_OBJECT_SELECTOR); // JNUP0007 - fo_expr* updExpr = theExprManager-> - create_fo_expr(theRootSctx, - loc, - GET_BUILTIN_FUNCTION(OP_ZORBA_JSON_RENAME_3), - args); + fo_expr* updExpr = CREATE(fo)(theRootSctx, + theUDF, + loc, + BUILTIN_FUNC(OP_ZORBA_JSON_RENAME_3), + args); push_nodestack(updExpr); #endif @@ -13569,7 +13859,7 @@ expr* lTarget = pop_nodestack(); - expr* aDelete = theExprManager->create_delete_expr(theRootSctx, loc, lTarget); + expr* aDelete = theExprManager->create_delete_expr(theRootSctx, theUDF, loc, lTarget); push_nodestack(aDelete); } @@ -13589,7 +13879,7 @@ lSource = wrap_in_enclosed_expr(lSource, loc); expr* lInsert = theExprManager-> - create_insert_expr(theRootSctx, loc, v.getType(), lSource, lTarget); + create_insert_expr(theRootSctx, theUDF, loc, v.getType(), lSource, lTarget); push_nodestack(lInsert); } @@ -13614,10 +13904,10 @@ // we are not going to generate a NameCastIterator, because we don't always know at // compile time whether the target will an element or an attribute node. nameExpr = theExprManager-> - create_name_cast_expr(theRootSctx, loc, nameExpr, theNSCtx, false); + create_name_cast_expr(theRootSctx, theUDF, loc, nameExpr, theNSCtx, false); expr* renameExpr = theExprManager-> - create_rename_expr(theRootSctx, loc, targetExpr, nameExpr); + create_rename_expr(theRootSctx, theUDF, loc, targetExpr, nameExpr); push_nodestack(renameExpr); } @@ -13642,7 +13932,7 @@ } expr* lReplace = theExprManager-> - create_replace_expr(theRootSctx, loc, v.getType(), lTarget, lReplacement); + create_replace_expr(theRootSctx, theUDF, loc, v.getType(), lTarget, lReplacement); push_nodestack(lReplace); } @@ -13653,7 +13943,7 @@ TRACE_VISIT(); transform_expr* transformExpr = - theExprManager->create_transform_expr(theRootSctx, loc); + theExprManager->create_transform_expr(theRootSctx, theUDF, loc); push_nodestack(transformExpr); @@ -13862,7 +14152,7 @@ ZORBA_ASSERT( range ); ftcontains_expr *const e = - theExprManager->create_ftcontains_expr( theRootSctx, loc, range, selection, ftignore ); + theExprManager->create_ftcontains_expr(theRootSctx, theUDF, loc, range, selection, ftignore ); push_nodestack( e ); #endif /* ZORBA_NO_FULL_TEXT */ } @@ -13965,7 +14255,7 @@ push_nodestack( wrap_in_type_match(e, theRTM.ANY_NODE_TYPE_STAR, e->get_loc(), - TreatIterator::TYPE_MATCH)); + TREAT_TYPE_MATCH)); #endif /* ZORBA_NO_FULL_TEXT */ } @@ -14142,12 +14432,12 @@ if ( e1 ) { e1 = wrap_in_type_promotion(e1, theRTM.INTEGER_TYPE_ONE, - PromoteIterator::TYPE_PROMOTION); + PROMOTE_TYPE_PROMOTION); } if ( e2 ) { e2 = wrap_in_type_promotion(e2, theRTM.INTEGER_TYPE_ONE, - PromoteIterator::TYPE_PROMOTION); + PROMOTE_TYPE_PROMOTION); } ftrange *const r = new ftrange( loc, v.get_mode(), e1, e2 ); @@ -14407,7 +14697,7 @@ expr* e( pop_nodestack() ); e = wrap_in_type_promotion(e, theRTM.DOUBLE_TYPE_ONE, - PromoteIterator::TYPE_PROMOTION); + PROMOTE_TYPE_PROMOTION); push_ftstack( new ftweight( loc, e ) ); #endif /* ZORBA_NO_FULL_TEXT */ } @@ -14443,7 +14733,7 @@ expr* e( pop_nodestack() ); e = wrap_in_type_promotion(e, theRTM.INTEGER_TYPE_ONE, - PromoteIterator::TYPE_PROMOTION); + PROMOTE_TYPE_PROMOTION); push_ftstack( new ftwindow_filter( loc, e, v.get_unit()->get_unit() ) ); #endif /* ZORBA_NO_FULL_TEXT */ } @@ -14460,7 +14750,7 @@ expr* e( pop_nodestack() ); e = wrap_in_type_promotion(e, theRTM.STRING_TYPE_STAR, - PromoteIterator::TYPE_PROMOTION); + PROMOTE_TYPE_PROMOTION); push_ftstack( new ftwords( loc, e, v.get_any_all_option()->get_option() ) ); #endif /* ZORBA_NO_FULL_TEXT */ } diff -Nru zorba-2.7.0-0/src/compiler/xqddf/value_index.cpp zorba-2.8.0-0/src/compiler/xqddf/value_index.cpp --- zorba-2.7.0-0/src/compiler/xqddf/value_index.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/xqddf/value_index.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -29,6 +29,7 @@ #include "compiler/expression/script_exprs.h" #include "compiler/expression/expr.h" #include "compiler/expression/expr_iter.h" +#include "compiler/expression/expr_manager.h" #include "compiler/codegen/plan_visitor.h" #include "runtime/base/plan_iterator.h" @@ -275,7 +276,7 @@ void IndexDecl::analyze(CompilerCB* ccb) { store::Item_t dotQName; - GENV_ITEMFACTORY->createQName(dotQName, "", "", "$$dot"); + GENV_ITEMFACTORY->createQName(dotQName, "", "", static_context::DOT_VAR_NAME); expr* dotVar = NULL; // Get the var_expr representing the context item, if it is defined @@ -284,7 +285,7 @@ if (var) dotVar = var->getVar(); - std::vector varExprs; + expr::FreeVars varExprs; // Check constraints on the domain expr analyzeExprInternal(getDomainExpr(), @@ -293,8 +294,6 @@ varExprs, dotVar); - varExprs.clear(); - std::vector keySources; csize numKeys = theKeyExprs.size(); @@ -308,6 +307,8 @@ // Check constraints on the key exprs for (csize i = 0; i < numKeys; ++i) { + varExprs.clear(); + analyzeExprInternal(theKeyExprs[i], theSourceNames, keySources, @@ -365,7 +366,7 @@ expr* e, std::vector& sourceNames, std::vector& sourceExprs, - std::vector& varExprs, + FreeVars& varExprs, expr* dotVar) { if (e->get_expr_kind() == fo_expr_kind) @@ -411,12 +412,12 @@ ZORBA_ASSERT(varExpr->get_kind() == var_expr::local_var); - varExprs.push_back(varExpr); + varExprs.insert(varExpr); } else if (e->get_expr_kind() == flwor_expr_kind || e->get_expr_kind() == gflwor_expr_kind) { - static_cast(e)->get_vars_defined(varExprs); + static_cast(e)->get_vars(varExprs); } else if (e->get_expr_kind() == var_expr_kind) { @@ -427,7 +428,7 @@ } if (e != getDomainVariable() && - std::find(varExprs.begin(), varExprs.end(), e) == varExprs.end()) + varExprs.find(static_cast(e)) == varExprs.end()) { RAISE_ERROR(zerr::ZDST0031_INDEX_HAS_FREE_VARS, e->get_loc(), ERROR_PARAMS(theName->getStringValue())); @@ -468,6 +469,10 @@ var_expr* dot = getDomainVariable(); var_expr* pos = getDomainPositionVariable(); static_context* sctx = domainExpr->get_sctx(); + user_function* udf = domainExpr->get_udf(); + + assert(theIsTemp || udf == NULL); + const QueryLoc& dotloc = dot->get_loc(); csize numKeys = theKeyExprs.size(); @@ -477,17 +482,17 @@ // Clone the domain expr. // expr::substitution_t subst; - expr* newdom = domainExpr->clone(subst); + expr* newdom = domainExpr->clone(udf, subst); // // Clone the domain variable and the domain pos variable. These vars are // referenced by the key exprs. // var_expr* newdot = theCCB->theEM-> - create_var_expr(sctx, dotloc, dot->get_kind(), dot->get_name()); + create_var_expr(sctx, udf, dotloc, dot->get_kind(), dot->get_name()); var_expr* newpos = theCCB->theEM-> - create_var_expr(sctx, dotloc, pos->get_kind(), pos->get_name()); + create_var_expr(sctx, udf, dotloc, pos->get_kind(), pos->get_name()); // // Create for clause (this has to be done here so that the cloned dot var gets @@ -496,8 +501,8 @@ // // for $newdot at $newpos in new_domain_expr // - for_clause* fc = - theCCB->theEM->create_for_clause(sctx, dotloc, newdot, newdom, newpos); + for_clause* fc = theCCB->theEM-> + create_for_clause(sctx, dotloc, newdot, newdom, newpos); // // Clone the key exprs, replacing their references to the 2 domain variables @@ -509,7 +514,7 @@ subst[dot] = newdot; subst[pos] = newpos; - clonedExprs[i+1] = theKeyExprs[i]->clone(subst); + clonedExprs[i+1] = theKeyExprs[i]->clone(udf, subst); } // @@ -519,22 +524,22 @@ // return index-entry-builder($$newdot, new_key1_expr, ..., new_keyN_expr) // - expr* domainVarExpr(theCCB->theEM->create_wrapper_expr(sctx, loc, newdot)); + expr* domainVarExpr(theCCB->theEM->create_wrapper_expr(sctx, udf, loc, newdot)); clonedExprs[0] = domainVarExpr; function* f = NULL; if (theIsGeneral) - f = GET_BUILTIN_FUNCTION(OP_GENERAL_INDEX_ENTRY_BUILDER_N); + f = BUILTIN_FUNC(OP_GENERAL_INDEX_ENTRY_BUILDER_N); else - f = GET_BUILTIN_FUNCTION(OP_VALUE_INDEX_ENTRY_BUILDER_N); + f = BUILTIN_FUNC(OP_VALUE_INDEX_ENTRY_BUILDER_N); ZORBA_ASSERT(f != NULL); - fo_expr* returnExpr = theCCB->theEM->create_fo_expr(sctx, loc, f, clonedExprs); + fo_expr* returnExpr = theCCB->theEM->create_fo_expr(sctx, udf, loc, f, clonedExprs); - flwor_expr* flworExpr = theCCB->theEM->create_flwor_expr(sctx, loc, false); + flwor_expr* flworExpr = theCCB->theEM->create_flwor_expr(sctx, udf, loc, false); flworExpr->set_return_expr(returnExpr); flworExpr->add_clause(fc); @@ -602,6 +607,9 @@ var_expr* pos = getDomainPositionVariable(); static_context* sctx = domainExpr->get_sctx(); + user_function* udf = domainExpr->get_udf(); + + assert(udf == NULL); const QueryLoc& dotloc = dot->get_loc(); @@ -613,14 +621,14 @@ // during the apply-updates. // - var_expr* docVar = theCCB->theEM->create_var_expr(sctx, - dot->get_loc(), - var_expr::prolog_var, - docVarName); + var_expr* docVar = theCCB->theEM-> + create_var_expr(sctx, udf, dot->get_loc(), var_expr::prolog_var, docVarName); + docVar->set_unique_id(1); ulong nextVarId = 2; - expr* wrapperExpr = theCCB->theEM->create_wrapper_expr(sctx, dot->get_loc(), docVar); + expr* wrapperExpr = theCCB->theEM-> + create_wrapper_expr(sctx, udf, dot->get_loc(), docVar); docVar->set_type(domainExpr->get_return_type()); @@ -628,17 +636,17 @@ subst[theDomainSourceExprs[0]] = wrapperExpr; - expr* newdom = domainExpr->clone(subst); + expr* newdom = domainExpr->clone(udf, subst); // // Clone the domain variable and the domain pos variable. These vars are // referenced by the key exprs. // var_expr* newdot = theCCB->theEM-> - create_var_expr(sctx, dotloc, dot->get_kind(), dot->get_name()); + create_var_expr(sctx, udf, dotloc, dot->get_kind(), dot->get_name()); var_expr* newpos = theCCB->theEM-> - create_var_expr(sctx, dotloc, pos->get_kind(), pos->get_name()); + create_var_expr(sctx, udf, dotloc, pos->get_kind(), pos->get_name()); // // Create for clause (this has to be done here so that the cloned dot var gets @@ -647,8 +655,8 @@ // // for $newdot at $newpos in new_domain_expr // - for_clause* fc = - theCCB->theEM->create_for_clause(sctx, dotloc, newdot, newdom, newpos); + for_clause* fc = theCCB->theEM-> + create_for_clause(sctx, dotloc, newdot, newdom, newpos); // // Clone the key exprs, replacing their references to the 2 domain variables @@ -660,7 +668,7 @@ subst[dot] = newdot; subst[pos] = newpos; - clonedExprs[i+1] = theKeyExprs[i]->clone(subst); + clonedExprs[i+1] = theKeyExprs[i]->clone(udf, subst); } // @@ -670,22 +678,22 @@ // return index-entry-builder($$newdot, new_key1_expr, ..., new_keyN_expr) // - expr* domainVarExpr = theCCB->theEM->create_wrapper_expr(sctx, loc, newdot); + expr* domainVarExpr = theCCB->theEM->create_wrapper_expr(sctx, udf, loc, newdot); clonedExprs[0] = domainVarExpr; function* f = NULL; if (theIsGeneral) - f = GET_BUILTIN_FUNCTION(OP_GENERAL_INDEX_ENTRY_BUILDER_N); + f = BUILTIN_FUNC(OP_GENERAL_INDEX_ENTRY_BUILDER_N); else - f = GET_BUILTIN_FUNCTION(OP_VALUE_INDEX_ENTRY_BUILDER_N); + f = BUILTIN_FUNC(OP_VALUE_INDEX_ENTRY_BUILDER_N); ZORBA_ASSERT(f != NULL); - fo_expr* returnExpr = theCCB->theEM->create_fo_expr(sctx, loc, f, clonedExprs); + fo_expr* returnExpr = theCCB->theEM->create_fo_expr(sctx, udf, loc, f, clonedExprs); - flwor_expr* flworExpr = theCCB->theEM->create_flwor_expr(sctx, loc, false); + flwor_expr* flworExpr = theCCB->theEM->create_flwor_expr(sctx, udf, loc, false); flworExpr->set_return_expr(returnExpr); flworExpr->add_clause(fc); diff -Nru zorba-2.7.0-0/src/compiler/xqddf/value_index.h zorba-2.8.0-0/src/compiler/xqddf/value_index.h --- zorba-2.7.0-0/src/compiler/xqddf/value_index.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/compiler/xqddf/value_index.h 2013-01-16 18:28:18.000000000 +0000 @@ -234,6 +234,8 @@ ********************************************************************************/ class IndexDecl : public SimpleRCObject { + typedef std::set FreeVars; + public: typedef enum { @@ -355,7 +357,7 @@ const store::Item* getSourceName(csize i) const { return theSourceNames[i]; } - expr* getDomainSourceExpr(csize i) const { return theDomainSourceExprs[i]; } + const expr* getDomainSourceExpr(csize i) const { return theDomainSourceExprs[i]; } void analyze(CompilerCB* ccb); @@ -370,9 +372,9 @@ private: void analyzeExprInternal( expr* e, - std::vector& sourceNames, + std::vector& sourceNames, std::vector& sourceExprs, - std::vector& varExprs, + FreeVars& varExprs, expr* dotVar); }; diff -Nru zorba-2.7.0-0/src/context/default_uri_mappers.cpp zorba-2.8.0-0/src/context/default_uri_mappers.cpp --- zorba-2.7.0-0/src/context/default_uri_mappers.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/default_uri_mappers.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -17,6 +17,7 @@ #include "stdafx.h" #include +#include #include #include #include @@ -192,7 +193,14 @@ // Finally, append the original URI, so that it will be resolved // as-is if there's nothing appropriate on the local filesystem. - oUris.push_back(aUri); + // Note: For module or schema imports, don't do this if it's a + // network (HTTP) URI and the "http_resolution" feature is disabled + // on this context. + if ( (lKind != EntityData::MODULE && lKind != EntityData::SCHEMA) || + aSctx.is_feature_set(feature::http_resolution) || + (HTTPURLResolver::isHTTPScheme(aUri) == false) ) { + oUris.push_back(aUri); + } } ZorbaCollectionURIMapper::~ZorbaCollectionURIMapper() diff -Nru zorba-2.7.0-0/src/context/default_uri_mappers.h zorba-2.8.0-0/src/context/default_uri_mappers.h --- zorba-2.7.0-0/src/context/default_uri_mappers.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/default_uri_mappers.h 2013-01-16 18:28:18.000000000 +0000 @@ -91,10 +91,10 @@ virtual void mapURI(zstring const& aUri, EntityData const* aEntityData, static_context const& aSctx, - std::vector& oUrls); + std::vector& oUris); }; -} /* namespace zorba::impl */ +} /* namespace zorba::internal */ } /* namespace zorba */ diff -Nru zorba-2.7.0-0/src/context/default_url_resolvers.cpp zorba-2.8.0-0/src/context/default_url_resolvers.cpp --- zorba-2.7.0-0/src/context/default_url_resolvers.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/default_url_resolvers.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -34,6 +34,24 @@ namespace internal { +/** + * Utility function that identifies URL schemes that will be handled + * by the HttpStream class. + */ +bool +HTTPURLResolver::isHTTPScheme(zstring const& aUrl) +{ + uri::scheme lScheme = uri::get_scheme(aUrl); + switch (lScheme) { + case uri::http: + case uri::https: + case uri::ftp: + return true; + default: + return false; + } +} + /****** * http: (and https: and ftp:) URL resolver. ******/ @@ -52,16 +70,8 @@ break; } - uri::scheme lScheme = uri::get_scheme(aUrl); - switch (lScheme) { - case uri::http: - case uri::https: - case uri::ftp: - // Fall through to actual implementation - break; - default: - // We don't implement other schemes - return NULL; + if (!isHTTPScheme(aUrl)) { + return nullptr; } try { std::auto_ptr lStream(new HttpStream(aUrl)); @@ -76,7 +86,6 @@ } } - /****** * file: URL resolver. ******/ diff -Nru zorba-2.7.0-0/src/context/default_url_resolvers.h zorba-2.8.0-0/src/context/default_url_resolvers.h --- zorba-2.7.0-0/src/context/default_url_resolvers.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/default_url_resolvers.h 2013-01-16 18:28:18.000000000 +0000 @@ -42,6 +42,8 @@ { public: + static bool isHTTPScheme(zstring const& aUrl); + virtual Resource* resolveURL(zstring const& aUrl, EntityData const* aEntityData); }; diff -Nru zorba-2.7.0-0/src/context/dynamic_context.cpp zorba-2.8.0-0/src/context/dynamic_context.cpp --- zorba-2.7.0-0/src/context/dynamic_context.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/dynamic_context.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -15,6 +15,10 @@ */ #include "stdafx.h" +#ifdef WIN32 +#include +#include +#endif #include "common/common.h" #include #include @@ -23,7 +27,6 @@ #include #include #endif - #include "store/api/iterator.h" #include "store/api/temp_seq.h" #include "store/api/item_factory.h" @@ -459,7 +462,7 @@ theVarValues[varid].theState == VarValue::undeclared) { RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(varname->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varname->getStringValue())); } valueIter->open(); @@ -513,7 +516,7 @@ theVarValues[varid].theState == VarValue::undeclared) { RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(varname->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varname->getStringValue())); } VarValue& var = theVarValues[varid]; @@ -556,7 +559,7 @@ theVarValues[varid].theState == VarValue::undeclared) { RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(varname->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varname->getStringValue())); } VarValue& var = theVarValues[varid]; @@ -603,14 +606,14 @@ { zstring varName = static_context::var_name(varname.getp()); RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(varName, ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), varName)); } if (theVarValues[varid].theState == VarValue::declared) { zstring varName = static_context::var_name(varname.getp()); RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(varName, ZED(VariabledHasNoValue))); + ERROR_PARAMS(ZED(XPDY0002_VariableHasNoValue_2), varName)); } const VarValue& var = theVarValues[varid]; @@ -891,7 +894,7 @@ ********************************************************************************/ bool dynamic_context::addExternalFunctionParameter( const std::string& aName, - ExternalFunctionParameter* aValue) + ExternalFunctionParameter* aValue) const { if (!keymap) { diff -Nru zorba-2.7.0-0/src/context/dynamic_context.h zorba-2.8.0-0/src/context/dynamic_context.h --- zorba-2.7.0-0/src/context/dynamic_context.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/dynamic_context.h 2013-01-16 18:28:18.000000000 +0000 @@ -55,7 +55,13 @@ public: - static enum ID_VARS { IDVAR_CONTEXT_ITEM=1, IDVAR_CONTEXT_ITEM_POSITION, IDVAR_CONTEXT_ITEM_SIZE, MAX_IDVARS_RESERVED } IDVARS_RESERVED; + static enum ID_VARS + { + IDVAR_CONTEXT_ITEM=1, + IDVAR_CONTEXT_ITEM_POSITION, + IDVAR_CONTEXT_ITEM_SIZE, + MAX_IDVARS_RESERVED + } IDVARS_RESERVED; struct VarValue { @@ -69,8 +75,8 @@ union { - store::Item* item; - store::TempSeq* temp_seq; + store::Item * item; + store::TempSeq * temp_seq; } theValue; ValueState theState; @@ -102,8 +108,8 @@ ext_func_param_typed } val_type_t; - val_type_t type; - void* func_param; + val_type_t type; + void * func_param; }; ZSTRING_HASH_MAP(dctx_value_t, ValueMap); @@ -116,19 +122,20 @@ dynamic_context * theParent; store::Item_t theCurrentDateTime; + long theTimezone; store::Item_t theDefaultCollectionUri; std::vector theVarValues; - ValueMap * keymap; + mutable ValueMap * keymap; IndexMap * theAvailableIndices; IndexMap * theAvailableMaps; - //MODIFY + //MODIFY EnvVarMap * theEnvironmentVariables; public: @@ -234,7 +241,7 @@ bool addExternalFunctionParameter( const std::string& aName, - ExternalFunctionParameter* aValue); + ExternalFunctionParameter* aValue) const; ExternalFunctionParameter* getExternalFunctionParameter( const std::string& aName) const; diff -Nru zorba-2.7.0-0/src/context/features.cpp zorba-2.8.0-0/src/context/features.cpp --- zorba-2.7.0-0/src/context/features.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/features.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -49,6 +49,11 @@ res = dtd; return true; } + else if ( ztd::equals(s, "http-uri-resolution") ) + { + res = http_resolution; + return true; + } return false; } } diff -Nru zorba-2.7.0-0/src/context/features.h zorba-2.8.0-0/src/context/features.h --- zorba-2.7.0-0/src/context/features.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/features.h 2013-01-16 18:28:18.000000000 +0000 @@ -30,7 +30,8 @@ scripting = 4, hof = 8, trace = 16, - dtd = 32 + dtd = 32, + http_resolution = 64, }; bool kind_for( char const*, kind& ); diff -Nru zorba-2.7.0-0/src/context/namespace_context.cpp zorba-2.8.0-0/src/context/namespace_context.cpp --- zorba-2.7.0-0/src/context/namespace_context.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/namespace_context.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -75,7 +75,7 @@ ********************************************************************************/ bool namespace_context::findBinding( const zstring& aPrefix, - zstring& aNamespace) + zstring& aNamespace) const { store::NsBindings::const_iterator lIter = m_bindings.begin(); store::NsBindings::const_iterator lEnd = m_bindings.end(); @@ -101,7 +101,7 @@ else { QueryLoc loc; - bool found = m_sctx->lookup_ns(aNamespace, aPrefix, loc, zerr::ZXQP0000_NO_ERROR); + bool found = m_sctx->lookup_ns(aNamespace, aPrefix, loc, false); if (!found && aPrefix.empty()) { diff -Nru zorba-2.7.0-0/src/context/namespace_context.h zorba-2.8.0-0/src/context/namespace_context.h --- zorba-2.7.0-0/src/context/namespace_context.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/namespace_context.h 2013-01-16 18:28:18.000000000 +0000 @@ -49,6 +49,8 @@ void serialize(::zorba::serialization::Archiver& ar); public: + namespace_context() : m_sctx(NULL) {} + namespace_context(const static_context* sctx) : m_sctx(const_cast(sctx)) @@ -64,6 +66,8 @@ { } + void setStaticContext(static_context* sctx) { m_sctx = sctx; } + rchandle get_parent() const { return m_parent; } const static_context* get_context() const { return m_sctx; } @@ -74,7 +78,7 @@ void getAllBindings(store::NsBindings& bindings) const; - bool findBinding(const zstring& aPrefix, zstring& aNamespace); + bool findBinding(const zstring& aPrefix, zstring& aNamespace) const; }; } diff -Nru zorba-2.7.0-0/src/context/root_static_context.cpp zorba-2.8.0-0/src/context/root_static_context.cpp --- zorba-2.7.0-0/src/context/root_static_context.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/root_static_context.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -31,11 +31,19 @@ #include "store/api/item_factory.h" +#ifdef WIN32 +#include +#endif //WIN32 + + +// DEFINE ENVIRONMENT VARIABLES namespace zorba { #ifdef WIN32 +#define MAX_VAR_SIZE 32767 + static void append_to_path( std::vector& aPath, zstring& zorba_root, @@ -47,6 +55,63 @@ full_path.append("\\"); aPath.push_back(full_path); } + +static void append_env_var( + wchar_t const * env_var_name, + std::vector& pathsVector, + zstring& core_path, + zstring& noncore_path + ) +{ + wchar_t env_var[MAX_VAR_SIZE]; + DWORD path_size; + // get a relative path from the environment for LIB + path_size = GetEnvironmentVariableW (env_var_name, + env_var, + MAX_VAR_SIZE ); + if (path_size) + { + char dll_path[MAX_VAR_SIZE]; + WideCharToMultiByte(CP_UTF8, + 0, + env_var, + -1, + dll_path, + MAX_VAR_SIZE, + NULL, + NULL); + char * str_env = std::strtok(dll_path, ";"); + while (str_env !=NULL) { + zstring zorba_env_dir(str_env); + if (str_env[strlen(str_env)-1] != '\\') + { + zorba_env_dir.append("\\"); + } + append_to_path(pathsVector, zorba_env_dir, core_path); + append_to_path(pathsVector, zorba_env_dir, noncore_path); + str_env = std::strtok(NULL, ";"); + } + } +} +#else + static void append_env_var + ( + const char * env_var_name, + std::vector& pathsVector + ) +{ + char* dll_path = getenv(env_var_name); + char* str_env = std::strtok(dll_path, ";"); + while (str_env !=NULL) { + zstring zorba_env_dir(str_env); + if (str_env[strlen(str_env)-1] != '/') + { + zorba_env_dir.append("/"); + } + pathsVector.push_back(zorba_env_dir); + str_env = std::strtok(NULL, ";"); + } +} #endif @@ -133,7 +198,8 @@ // compute the relative path to zorba_simplestore.dll (this dll) WCHAR wdll_path[1024]; DWORD dll_path_size; - dll_path_size = GetModuleFileNameW(NULL, + HMODULE h_module = GetModuleHandleW (_T(ZORBA_STORE_NAME)); + dll_path_size = GetModuleFileNameW(h_module, wdll_path, sizeof(wdll_path)/sizeof(wdll_path[0])); if(dll_path_size) @@ -167,6 +233,7 @@ } } #endif + const char ** lURIPathIter = get_builtin_uri_path(); for (; *lURIPathIter != 0; ++lURIPathIter) { @@ -185,6 +252,22 @@ set_feature( feature::ddl ); set_feature( feature::scripting ); set_feature( feature::trace ); + set_feature( feature::http_resolution ); + +#ifdef WIN32 + // get a relative path from the environment for URI + append_env_var (L"ZORBA_MODULE_PATH", lRootURIPath, zstring(ZORBA_CORE_URI_DIR), zstring(ZORBA_NONCORE_URI_DIR)); + append_env_var (L"ZORBA_MODULE_PATH", lRootLibPath, zstring(ZORBA_CORE_LIB_DIR), zstring(ZORBA_NONCORE_LIB_DIR)); + + append_env_var (L"ZORBA_URI_PATH", lRootURIPath, zstring(ZORBA_CORE_URI_DIR), zstring(ZORBA_NONCORE_URI_DIR)); + append_env_var (L"ZORBA_LIB_PATH", lRootLibPath, zstring(ZORBA_CORE_LIB_DIR), zstring(ZORBA_NONCORE_LIB_DIR)); + +#else + append_env_var ("ZORBA_URI_PATH", lRootURIPath); + append_env_var ("ZORBA_LIB_PATH", lRootLibPath); + +#endif + } diff -Nru zorba-2.7.0-0/src/context/static_context.cpp zorba-2.8.0-0/src/context/static_context.cpp --- zorba-2.7.0-0/src/context/static_context.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/static_context.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -284,7 +284,7 @@ if (!module) { throw ZORBA_EXCEPTION(zerr::ZCSE0013_UNABLE_TO_LOAD_QUERY, - ERROR_PARAMS(ZED(NoExternalModuleFromDLL), lURI)); + ERROR_PARAMS(ZED(NoExternalModuleFromDLL_2), lURI)); } } else @@ -351,6 +351,10 @@ "http://www.zorba-xquery.com/modules/node-reference"; const char* +static_context::ZORBA_REFERENCE_FN_NS = +"http://www.zorba-xquery.com/modules/reference"; + +const char* static_context::ZORBA_NODEPOS_FN_NS = "http://www.zorba-xquery.com/modules/node-position"; @@ -461,6 +465,10 @@ #endif /* ZORBA_NO_FULL_TEXT */ const char* +static_context::ZORBA_DATETIME_FN_NS = +"http://www.zorba-xquery.com/modules/datetime"; + +const char* static_context::ZORBA_XML_FN_OPTIONS_NS = "http://www.zorba-xquery.com/modules/xml-options"; @@ -495,6 +503,10 @@ "http://www.zorba-xquery.com/options/optimizer"; const char* +static_context::XQUERY_OPTION_NS = +"http://www.w3.org/2011/xquery-options"; + +const char* static_context::ZORBA_VERSIONING_NS = "http://www.zorba-xquery.com/options/versioning"; @@ -510,6 +522,7 @@ return (ns == ZORBA_MATH_FN_NS || ns == ZORBA_BASE64_FN_NS || ns == ZORBA_NODEREF_FN_NS || + ns == ZORBA_REFERENCE_FN_NS || ns == ZORBA_NODEPOS_FN_NS || ns == ZORBA_STORE_DYNAMIC_DOCUMENTS_FN_NS || @@ -538,6 +551,7 @@ #ifndef ZORBA_NO_FULL_TEXT ns == ZORBA_FULL_TEXT_FN_NS || #endif /* ZORBA_NO_FULL_TEXT */ + ns == ZORBA_DATETIME_FN_NS || #ifdef ZORBA_WITH_JSON ns == JSONIQ_FN_NS || #endif /* ZORBA_WITH_JSON */ @@ -590,14 +604,11 @@ { return (ns == ZORBA_MATH_FN_NS || ns == ZORBA_INTROSP_SCTX_FN_NS || - ns == ZORBA_STRING_FN_NS || ns == ZORBA_JSON_FN_NS || ns == ZORBA_XQDOC_FN_NS || -#ifdef ZORBA_WITH_JSON - ns == JSONIQ_FN_NS || -#endif ns == ZORBA_URI_FN_NS || ns == ZORBA_RANDOM_FN_NS || + ns == ZORBA_DATETIME_FN_NS || ns == ZORBA_FETCH_FN_NS || #ifndef ZORBA_NO_FULL_TEXT ns == ZORBA_FULL_TEXT_FN_NS || @@ -2045,8 +2056,7 @@ void static_context::bind_ns( const zstring& prefix, const zstring& ns, - const QueryLoc& loc, - const Error& err) + const QueryLoc& loc) { if (theNamespaceBindings == NULL) { @@ -2057,9 +2067,7 @@ if (!theNamespaceBindings->insert(prefix, temp)) { - throw XQUERY_EXCEPTION_VAR(err, - ERROR_PARAMS(prefix, temp), - ERROR_LOC(loc)); + RAISE_ERROR(err::XQST0033, loc, ERROR_PARAMS(prefix, ns)); } } @@ -2075,19 +2083,17 @@ zstring& ns, const zstring& prefix, const QueryLoc& loc, - const Error& err) const + bool raiseError) const { if (theNamespaceBindings == NULL || !theNamespaceBindings->get(prefix, ns)) { if (theParent != NULL) { - return theParent->lookup_ns(ns, prefix, loc, err); + return theParent->lookup_ns(ns, prefix, loc, raiseError); } - else if (err != zerr::ZXQP0000_NO_ERROR) + else if (raiseError) { - throw XQUERY_EXCEPTION_VAR( - err, ERROR_PARAMS( prefix ), ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0081, loc, ERROR_PARAMS(prefix)); } else { @@ -2096,11 +2102,9 @@ } else if (!prefix.empty() && ns.empty()) { - if (err != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { - throw XQUERY_EXCEPTION_VAR( - err, ERROR_PARAMS( prefix ), ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0081, loc, ERROR_PARAMS(prefix)); } else { @@ -2188,10 +2192,7 @@ /***************************************************************************//** ********************************************************************************/ -void static_context::bind_var( - var_expr* varExpr, - const QueryLoc& loc, - const Error& err) +void static_context::bind_var(var_expr* varExpr, const QueryLoc& loc) { if (theVariablesMap == NULL) { @@ -2208,8 +2209,7 @@ if (!theVariablesMap->insert(qname, vi)) { - throw XQUERY_EXCEPTION_VAR(err, - ERROR_PARAMS(qname->getStringValue()), ERROR_LOC(loc)); + goto error; } if (varExpr->get_kind() == var_expr::prolog_var) @@ -2219,10 +2219,32 @@ { if (!theVariablesMap->insert(qname, vi)) { - throw XQUERY_EXCEPTION_VAR(err, - ERROR_PARAMS(qname->getStringValue()), ERROR_LOC(loc)); + goto error; } } + + return; + + error: + switch (varExpr->get_kind()) + { + case var_expr::let_var: + { + RAISE_ERROR(err::XQST0039, loc, ERROR_PARAMS(qname->getStringValue())); + } + case var_expr::win_var: + case var_expr::wincond_out_var: + case var_expr::wincond_out_pos_var: + case var_expr::wincond_in_var: + case var_expr::wincond_in_pos_var: + { + RAISE_ERROR(err::XQST0103, loc, ERROR_PARAMS(qname->getStringValue())); + } + default: + { + RAISE_ERROR(err::XQST0049, loc, ERROR_PARAMS(qname->getStringValue())); + } + } } @@ -3460,11 +3482,13 @@ { theOptionMap->insert(qname2, option); } - } -store::Item_t -static_context::parse_and_expand_qname( + +/***************************************************************************//** + +********************************************************************************/ +store::Item_t static_context::parse_and_expand_qname( const zstring& value, const char* default_ns, const QueryLoc& loc) const @@ -3502,7 +3526,7 @@ std::vector::iterator lIter; - if ( name == "error" ) + if (name == "error") { if ( lQName->getLocalName() == "all" ) { @@ -3513,11 +3537,12 @@ lIter != theWarningsAreErrors.end(); ++lIter ) { - if ( lQName->equals( (*lIter) ) ) + if (lQName->equals((*lIter))) { return; } } + theWarningsAreErrors.push_back( lQName ); } else if ( name == "disable" ) @@ -4082,7 +4107,7 @@ if (!ve->is_private()) { - bind_var(ve, loc, err::XQST0049); + bind_var(ve, loc); } else { diff -Nru zorba-2.7.0-0/src/context/static_context.h zorba-2.8.0-0/src/context/static_context.h --- zorba-2.7.0-0/src/context/static_context.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/context/static_context.h 2013-01-16 18:28:18.000000000 +0000 @@ -42,6 +42,7 @@ #include "zorbautils/hashmap_zstring.h" #include "zorbautils/hashmap_itemp.h" +#include "zorbautils/checked_vector.h" #include "common/shared_types.h" @@ -513,6 +514,7 @@ static const char* ZORBA_JSON_FN_NS; static const char* ZORBA_NODEREF_FN_NS; + static const char* ZORBA_REFERENCE_FN_NS; static const char* ZORBA_NODEPOS_FN_NS; static const char* ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS; static const char* ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS; @@ -545,6 +547,7 @@ #ifndef ZORBA_NO_FULL_TEXT static const char* ZORBA_FULL_TEXT_FN_NS; #endif /* ZORBA_NO_FULL_TEXT */ + static const char* ZORBA_DATETIME_FN_NS; static const char* ZORBA_XML_FN_OPTIONS_NS; // Namespaces of virtual modules declaring zorba builtin functions @@ -561,6 +564,7 @@ static const char* ZORBA_OPTION_WARN_NS; static const char* ZORBA_OPTION_FEATURE_NS; static const char* ZORBA_OPTION_OPTIM_NS; + static const char* XQUERY_OPTION_NS; static const char* ZORBA_VERSIONING_NS; protected: @@ -726,13 +730,11 @@ void compute_base_uri(); - zstring - resolve_relative_uri( + zstring resolve_relative_uri( const zstring& aUri, bool aValidate = true) const; - zstring - resolve_relative_uri( + zstring resolve_relative_uri( const zstring& aRelativeUri, const zstring& aBaseUri, bool validate = true) const; @@ -757,33 +759,39 @@ * Given a URI, return a Resource for that URI. * @param aEntityKind the expected kind of entity expected at this aUri */ - std::auto_ptr resolve_uri - (zstring const& aUri, internal::EntityData::Kind aEntityKind, zstring& oErrorMessage) const; + std::auto_ptr resolve_uri( + const zstring& aUri, + internal::EntityData::Kind aEntityKind, + zstring& oErrorMessage) const; /** * Given a URI, return a Resource for that URI. * @param aEntityData an EntityData object to pass to the mappers/resolvers. */ - std::auto_ptr resolve_uri - (zstring const& aUri, internal::EntityData const& aEntityData, zstring& oErrorMessage) const; + std::auto_ptr resolve_uri( + const zstring& aUri, + const internal::EntityData& aEntityData, + zstring& oErrorMessage) const; /** * Given a URI, populate a vector with a list of component URIs. If * no component URIs are available, the vector will be populated * with (only) the input URI. */ - void get_component_uris - (zstring const& aUri, internal::EntityData::Kind aEntityKind, - std::vector& oComponents) const; + void get_component_uris( + const zstring& aUri, + internal::EntityData::Kind aEntityKind, + std::vector& oComponents) const; /** * Given a URI, populate a vector with a list of candidate URIs. If * no candidate URIs are available, the vector will be populated * with (only) the input URI. */ - void get_candidate_uris - (zstring const& aUri, internal::EntityData::Kind aEntityKind, - std::vector& oComponents) const; + void get_candidate_uris( + const zstring& aUri, + internal::EntityData::Kind aEntityKind, + std::vector& oComponents) const; void set_uri_path(const std::vector& aURIPath); @@ -847,14 +855,13 @@ void bind_ns( const zstring& prefix, const zstring& ns, - const QueryLoc& loc, - const Error& err = err::XQST0033); + const QueryLoc& loc); bool lookup_ns( zstring& ns, const zstring& prefix, const QueryLoc& loc, - const Error& err = err::XPST0081) const; + bool raiseError = true) const; void expand_qname( store::Item_t& qname, @@ -868,7 +875,7 @@ // // Variables // - void bind_var(var_expr* expr, const QueryLoc& loc, const Error& err); + void bind_var(var_expr* expr, const QueryLoc& loc); VarInfo* lookup_var(const store::Item* qname) const; @@ -990,6 +997,8 @@ bool lookup_option(const store::Item* qname, zstring& option) const; + bool is_feature_set(feature::kind k) const { return (theFeatures & k) != 0; } + protected: void process_feature_option( const zstring& value, @@ -1010,8 +1019,11 @@ parse_and_expand_qname( const zstring& value, const char* default_ns, - const QueryLoc& loc - ) const; + const QueryLoc& loc) const; + + void set_feature(feature::kind k) { theFeatures |= k; } + + void unset_feature(feature::kind k) { theFeatures &= ~k; } public: @@ -1069,19 +1081,15 @@ DecimalFormat_t get_decimal_format(const store::Item_t& qname); #ifndef ZORBA_NO_FULL_TEXT - ftmatch_options const* get_match_options() const { - return theFTMatchOptions; - } + ftmatch_options const* get_match_options() const { return theFTMatchOptions; } - void set_match_options( ftmatch_options *mo ) { - theFTMatchOptions = mo; - } + void set_match_options(ftmatch_options* mo) { theFTMatchOptions = mo; } #endif /* ZORBA_NO_FULL_TEXT */ // // Merge in the static context of a module // - void import_module (const static_context* module, const QueryLoc& loc); + void import_module(const static_context* module, const QueryLoc& loc); // // Warnings @@ -1115,32 +1123,17 @@ private: - void apply_uri_mappers(zstring const& aUri, - internal::EntityData const* aEntityData, - internal::URIMapper::Kind aMapperKind, - std::vector& oUris) const; - - void apply_url_resolvers(std::vector& aUrls, - internal::EntityData const* aEntityData, - std::auto_ptr& oResource, - zstring& oErrorMessage) const; - -public: - bool is_feature_set( feature::kind k ) const - { - return (theFeatures & k) != 0; - } - - void set_feature( feature::kind k ) - { - theFeatures |= k; - } - - void unset_feature( feature::kind k ) - { - theFeatures &= ~k; - } - + void apply_uri_mappers( + zstring const& aUri, + internal::EntityData const* aEntityData, + internal::URIMapper::Kind aMapperKind, + std::vector& oUris) const; + + void apply_url_resolvers( + std::vector& aUrls, + internal::EntityData const* aEntityData, + std::auto_ptr& oResource, + zstring& oErrorMessage) const; }; diff -Nru zorba-2.7.0-0/src/diagnostics/CMakeLists.txt zorba-2.8.0-0/src/diagnostics/CMakeLists.txt --- zorba-2.7.0-0/src/diagnostics/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -25,6 +25,7 @@ xquery_stack_trace.cpp user_error.cpp user_exception.cpp + dict_zed_keys.h ) ZORBA_DIAGNOSTIC_GENERATOR( @@ -32,21 +33,24 @@ "input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml" "diagnostic_en.xml" "" - "${CMAKE_BINARY_DIR}/include/zorba/diagnostic_list.h") + "${CMAKE_BINARY_DIR}/include/zorba/diagnostic_list.h" +) ZORBA_DIAGNOSTIC_GENERATOR( "${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_list_cpp.xq" "input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml" "diagnostic_en.xml" "${CMAKE_BINARY_DIR}/include/zorba/diagnostic_list.h" - "${CMAKE_BINARY_DIR}/src/diagnostics/diagnostic_list.cpp") + "${CMAKE_BINARY_DIR}/src/diagnostics/diagnostic_list.cpp" +) ZORBA_DIAGNOSTIC_GENERATOR( "${CMAKE_SOURCE_DIR}/src/diagnostics/dict_XX_cpp.xq" "input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml" "diagnostic_en.xml" "" - "${CMAKE_BINARY_DIR}/src/diagnostics/dict_en.cpp") + "${CMAKE_BINARY_DIR}/src/diagnostics/dict_en.cpp" +) ZORBA_DIAGNOSTIC_GENERATOR( "${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_list_xq.xq" @@ -56,6 +60,14 @@ "${CMAKE_BINARY_DIR}/modules/w3c/xqt-errors.xq" ) +ZORBA_DIAGNOSTIC_GENERATOR( + "${CMAKE_SOURCE_DIR}/src/diagnostics/dict_zed_keys_h.xq" + "input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml" + "diagnostic_en.xml" + "" + "${CMAKE_BINARY_DIR}/src/diagnostics/dict_zed_keys.h" +) + IF(ZORBA_WITH_JSON) ZORBA_DIAGNOSTIC_GENERATOR( "${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_list_xq.xq" @@ -79,8 +91,7 @@ "input=${CMAKE_SOURCE_DIR}/src/diagnostics/diagnostic_en.xml;ns:=zwarn" "diagnostic_en.xml" "" - "${CMAKE_BINARY_DIR}/modules/com/zorba-xquery/www/modules/warnings.xq" -) + "${CMAKE_BINARY_DIR}/modules/com/zorba-xquery/www/modules/warnings.xq") SET(DIAG_MODULES ${CMAKE_BINARY_DIR}/modules/com/zorba-xquery/www/modules/warnings.xq diff -Nru zorba-2.7.0-0/src/diagnostics/diagnostic.cpp zorba-2.8.0-0/src/diagnostics/diagnostic.cpp --- zorba-2.7.0-0/src/diagnostics/diagnostic.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/diagnostic.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -127,6 +127,7 @@ case XQUERY_USER_DEFINED : o << "user-defined" ; break; case ZORBA_API : o << "Zorba API" ; break; + case ZORBA_CORE_MODULE : o << "Zorba core module" ; break; case ZORBA_DDF : o << "Zorba data-definition" ; break; case ZORBA_DEBUGGER : o << "Zorba debugger" ; break; case ZORBA_OS : o << "operating system" ; break; diff -Nru zorba-2.7.0-0/src/diagnostics/diagnostic.h zorba-2.8.0-0/src/diagnostics/diagnostic.h --- zorba-2.7.0-0/src/diagnostics/diagnostic.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/diagnostic.h 2013-01-16 18:28:18.000000000 +0000 @@ -19,6 +19,7 @@ #define ZORBA_DIAGNOSTIC_H #include +#include #include "compiler/parser/query_loc.h" #include "store/api/item.h" @@ -71,16 +72,41 @@ /** * Makes a location. * - * @param file The name of the file where the error occurred. - * @param line The line number of the file where the error occurred. - * @param column The column number, if any, of the file where the error + * @param file The name of the file where the expression causing the error * occurred. + * @param line The line number of the file where the expression causing the + * error begins. + * @param column The column number, if any, of the file where the expression + * causing the error begins. + * @param line_end The end line number, if any, of the file where the + * expression causing the error ends. + * @param column_end The end column number, if any, of the file where the + * expression causing the error ends. * @return Returns a new location. */ inline internal::diagnostic::location make_location( char const *file, internal::diagnostic::location::line_type line, - internal::diagnostic::location::column_type column = 0 ) { - return internal::diagnostic::location( file, line, column ); + internal::diagnostic::location::column_type column = 0, + internal::diagnostic::location::line_type line_end = 0, + internal::diagnostic::location::column_type column_end = 0 ) { + return internal::diagnostic::location( + file, line, column, line_end, column_end + ); +} + +/** + * Makes a location. + * + * @param e The XQueryException to copy the location from. + * @return Returns a new location. + */ +inline internal::diagnostic::location +make_location( XQueryException const &e ) { + return internal::diagnostic::location( + e.source_uri(), + e.source_line(), e.source_column(), + e.source_line_end(), e.source_column_end() + ); } /** diff -Nru zorba-2.7.0-0/src/diagnostics/diagnostic_en.xml zorba-2.8.0-0/src/diagnostics/diagnostic_en.xml --- zorba-2.7.0-0/src/diagnostics/diagnostic_en.xml 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/diagnostic_en.xml 2013-01-16 18:28:18.000000000 +0000 @@ -14,6 +14,45 @@ ! limitations under the License. --> + + @@ -47,27 +86,27 @@ "$2": XQuery version must be at least 3.0 - + "outer-for" clause only available in XQuery 3.0 or later - + "window" clause only available in XQuery 3.0 or later - + "count" clause only available in XQuery 3.0 or later - + "switch" expressions only available in XQuery 3.0 or later - + "try/catch" expressions only available in XQuery 3.0 or later - + function and variable annotations only available in XQuery 3.0 or later @@ -97,7 +136,19 @@ that is not defined in the static context, except for an ElementName in an ElementTest or an AttributeName in an AttributeTest. - "$1": undefined $2 + $1 + + + "$2": undeclared variable + + + + "$2": undefined schema-attribute name + + + + "$2": undefined schema-element name + @@ -156,32 +207,32 @@ $1 - + $2 can not be promoted to return type $3 of function $4() - + $2 can not be promoted to parameter type $3 of function $4() - + $2 can not be promoted to type $3 - + sequence of more than one item can not be promoted to type $2 - + $2 can not be treated as type $3 - the first parameter to the format-number() function is of type $2, which is not allowed + first parameter to format-number() function is type $2 that is not allowed - Cannot atomize and/or cast value of type $2 to a string. + can not atomize and/or cast value of type $2 to string @@ -214,6 +265,24 @@ context item in axis step is not a node + + + Attempt to cast to a namespace-sensitive type failed because the namespace + bindings for the result can not be determined. + + + $1 + + + Cannot cast node to xs:QName + + + + $2 can not be promoted to parameter type xs:NOTATION of function $3() + + + + It is a type error if the content sequence in an element constructor @@ -377,7 +446,7 @@ http://www.w3.org/2001/XMLSchema-instance, http://www.w3.org/2005/xpath-functions. - "$1": invalid function or annotation namespace + "$1": $2 declared in reserved namespace${ 3} @@ -386,6 +455,10 @@ is of nonzero length and is not in the lexical space of \c xs:anyURI. ${"1": }invalid URI literal${: 2} + + + '$3': invalid hexedecimal digit + @@ -412,6 +485,14 @@ "$1": duplicate variable declaration + + + The type must be the name of a type defined in the in-scope schema types, + and the {variety} of the type must be simple. + + "$1": not defined as simple type + + It is a static error if a variable depends on itself. @@ -649,7 +730,19 @@ It is a dynamic error if evaluation of an expression relies on some part of the dynamic context that has not been assigned a value. - "$1": $2 + $1 + + + "$2": variable has no value + + + + "$2": undeclared variable + + + + $2 not declared + @@ -931,7 +1024,20 @@ Invalid lexical value. - "$1": invalid lexical value${: 2} + $1 + + + "$2": value is not a valid lexical QName + + + + no namespace URI provided for prefix in lexical QName "$2" + + + + "$2": value of type $3 is not castable to type $4 + + @@ -1064,7 +1170,7 @@ Invalid timezone value. - "$1": invalid timezone value + "$1": invalid timezone value (in seconds) @@ -1099,7 +1205,52 @@ Invalid value for cast/constructor. - ${"1": }invalid value for cast/constructor${: 2} + + $1 + + + "$2": value of type $3 is not castable to type $4 + + + + "$2": value is not castable to type $3${: 4} + + + + "$2": local name in qname is not an xs:NCName + + + + "$2": prefix in qname is not an xs:NCName + + + + "$2": name is not an xs:NCName + + + + "$2": prefix has no known namespace binding + + + + "$2": invalid Base64 character + + + + Base64 data must be a multiple of 4 characters + + + + HexBinary value must contain an even number of characters + + + + '$2': invalid hexedecimal digit + + + + "$2": type no defined in current context + @@ -1209,23 +1360,23 @@ An argument to \c fn:deep-equal() contains a function item. "$1": argument to fn:deep-equal() contains a function item - - + + Identifier cannot be used to retrive a resource containing text "$1": error retrieving resource containing text - + - Retrieved resource contains octets that cannot be decoded into Unicode - using the specified encoding, the resulting characters are not + Retrieved resource contains octets that cannot be decoded into Unicode + using the specified encoding, the resulting characters are not permitted XML characters or requested encoding not supported "$1": can not decode resource retrieved - + @@ -1248,7 +1399,7 @@ specified. $1 - + comma expression with updating and non-updating branches @@ -1436,7 +1587,11 @@ [XQuery 1.0 and XPath 2.0 Data Model]. In this case, none of the updates in the query are made effective. - updates violate constraint + $1${ 2} + + + "$3": attribute with the same name already exists + @@ -1453,7 +1608,7 @@ affects an element node by introducing a new namespace binding that conflicts with one of its existing namespace bindings. - "$1": namespace binding conflicts with $2=$3 + "$1": qname causes namespace binding conflict: prefix $2 cannot be bound to both $3 and $4 @@ -1725,6 +1880,14 @@ "$1": builtin sequential function not implemented as sequential + + "$1": invalid locale + + + + "$1": unknown locale + + FxCharHeap error: $1 ($2) @@ -1808,7 +1971,11 @@ - "$1": unkown option + "$1": unknown option + + + + "$1": this option cannot be specified in a query, it must be set via C++ API or command-line parameter XQuery not compiled in debug mode - - - "$1": undefined $2 + + + "$1": undeclared variable - + "$1": invalid argument${: 2} @@ -1950,7 +2117,7 @@ "$1": reference already present in the store - + node has no current reference @@ -1983,12 +2150,12 @@ "$1": invalid serialization method for SAX - - can not retrieve node-reference for a node that is not in a collection. + + can not retrieve reference for a JSON object or array that is not in a collection - + - a non root element cannot be validated in place. + non root element cannot be validated in place @@ -2208,6 +2375,22 @@ attempt to delete non-root node from collection "$1" + + "$1": illegal edit in append-only collection + + + + "$1": illegal edit from queue collection + + + + attempt to edit non-root node in collection "$1" + + + + attempt to edit an item with a template of a different kind (for example an object with a node). + + "$1": collection already declared @@ -2257,7 +2440,29 @@ - "$1": index bad key type + + "$1": $2 + + + value index missing key type declaration + + + + value index can not have xs:untypedAtomic or xs:anyAtomicType in key type declaration + + + + value index can not have a key type declaration with * or + quantifier + + + + index has non-atomic key type declaration + + + + range index can not have type $3 in key type declaration + + @@ -2367,6 +2572,10 @@ stream transcoding error ($1) + + "$1": unsupported locale + + @@ -2462,7 +2671,7 @@ - $1: does not reference a node in collection $2. + $1: does not reference a node in collection $2 @@ -2498,6 +2707,28 @@ "continue loop" statement not inside while statement + + + + '$1': invalid % conversion specification + + + + "$1": insufficient value to parse for "$2" + + + + "$1": invalid value for conversion specification(s) %$2 + + + + '$1': literal character mismatched '$2' + + + + '$1': incomplete date, time, or dateTime format + + @@ -2535,6 +2766,7 @@ illegal empty string + JsonML (array form) must start with '[' @@ -2577,21 +2809,21 @@ - + It is a type error if the right-hand-side expression of a pair constructor does not return exactly one item. - Pair value returns no, or more than one, item. + pair value returns no, or more than one, item - + It is a dynamic error if two pairs in an object constructor or in a simple object union have the same name. - "$1": pair with the same name already exists in object. + "$1": pair with the same name already exists in object - + It is a type error to call fn:data on a sequence containing an array or an object. - Cannot atomize an $1 item. An $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item). + can not atomize an $1 item: an $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item) @@ -2600,19 +2832,19 @@ "$1": duplicate pair to insert - + It is a dynamic error if upd:applyUpdates causes an object to contain two pairs with the same name. - "$1": pair to insert already exists in object. + "$1": pair to insert already exists in object - + It is a type error if, in an updating expression, an array selector cannot be cast to xs:integer or if an object selector cannot be cast to xs:string. - - $1 - wrong type for object/array selector in update expression. - + + "$1": wrong type for object/array selector in update expression + "$2": can not be promoted to type xs:string @@ -2626,7 +2858,7 @@ - + It is a dynamic error if the target of a deleting or replacing expression is not an array or an object. It is a dynamic error if the target of a renaming expression is not an object. @@ -2637,7 +2869,7 @@ $1 - "$2": target of a renaming expression or of a non-position-inserting expression is not an object. + "$2": target of a renaming expression or of a non-position-inserting expression is not an object @@ -2645,26 +2877,26 @@ - "$2": target of a deleting or replacing expression is not a JSON item. + "$2": target of a deleting or replacing expression is not a JSON item - + It is a dynamic error if a pending update list contains two replacing update primitives on the same object or array, and with the same selector. "$1": duplicate pair to replace - + It is a dynamic error if a pending update list contains two renaming update primitives on the same object and with the same selector. "$1": duplicate pair to rename - + It is a type error if the content sequence in a node constructor or in an XQUF insert or replace update expression contains an object or an array. JSON item cannot appear in content sequence of node constructor or updating expression - + It is a dynamic error to serialize a sequence of less or more than one item with the JSON output method if the @@ -2674,6 +2906,15 @@ can not serialize multiple top-level items as JSON + + It is a dynamic error to serialize an atomic value not + supported by JSON or a node with the JSON output method and with + the jsoniq-serialization-extensions serialization parameter + set to false. + + can not serialize value as JSON: $1 + + It is a dynamic error to serialize a function or a node with the JSON output method. @@ -2684,48 +2925,46 @@ It is a dynamic error to serialize a sequence that does not exist of exactly one document node with XML, HTML, XHTML, Text. - $1: invalid serialization method for item type ($2) + "$1": invalid serialization method for item type ($2) It is a dynamic error if it is attempted to create a replace, delete or rename update primitive with a selector that cannot be resolved against the target array or object. $1 - + - "$2": selector cannot be resolved against supplied object. + "$2": selector cannot be resolved against supplied object - "$2": selector cannot be resolved against supplied array. + "$2": selector cannot be resolved against supplied array - + It is a dynamic error if the value in a replace expression is not exactly a single item. - Cannot replace with less or more than an item. + can not replace with less or more than an item - + It is a dynamic error if there is not exactly one supplied parameter for an object or array selector. - - Object or array selection needs exactly one parameter. + + object or array selection needs exactly one parameter - + It is a dynamic error if the content expression, in an object insert expression, does not evaluate to a sequence of objects. - - The content of an insert expression must evaluate to a sequence of objects. + + "$1": invalid type (content of insert expression must evaluate to a sequence of objects) - + - It is a type error if the prefix is not a string or if the + It is a type error if the prefix is not a string or if the serialization parameters are not an element. $1: value of "$2" is not a $3 - - objects or arrays don't have a string value $1 items do not have string value @@ -2739,7 +2978,32 @@ parser error raised by jn:parse-json $1 + + '$2': illegal JSON character + + + "$2": illegal Unicode code-point + + + '\\$2': illegal JSON character escape + + + illegal JSON literal + + + illegal JSON number + + + "$2": unexpected JSON token + + + unterminated JSON string + + + unexpected extra content at the end of the document (consider using the jsoniq-multiple-top-level-items option) + + @@ -2761,7 +3025,7 @@ - Sequential FLWOR expr may not have the semantics you expect + sequential FLWOR expr may not have the semantics you expect @@ -2809,6 +3073,10 @@ already specified + + applied at + + arithmetic operation not defined between types "$2" and "$3" @@ -2857,10 +3125,6 @@ "$2": invalid authority for "file" scheme - - '$3': invalid hexedecimal digit - - invalid hexedecimal sequence @@ -2928,7 +3192,7 @@ malformed XML document${ at "2"} - + closing tag without matching opening tag @@ -2941,14 +3205,6 @@ unsupported XQuery version - - invalid Base64 character - - - - Base64 data must be a multiple of 4 characters - - base URI @@ -2957,10 +3213,6 @@ box condition has more columns than index - - $3 to $4 cast failed - - '$3' expected @@ -2977,6 +3229,10 @@ collection iterator not open + + default collection + + default collation @@ -3081,11 +3337,11 @@ full-text was not enabled in this build - + $2 failed (error $3): $4 - + $2 failed${: 3} @@ -3109,10 +3365,6 @@ valid values are: yes, no, omit - - HexBinary value must contain an even number of characters - - incomplete key during index build @@ -3133,10 +3385,6 @@ must be absolute - - must be an xs:NCName - - document node must not contain attribute nodes @@ -3245,6 +3493,14 @@ document, collection, or module resolver required but no SerializationCallback given + + "$2": external function not found + + + + required external module "$2" not found + + no SerializationCallback for required external module "$2" @@ -3261,10 +3517,6 @@ can not treat as "$4" - - undefined type in current context - - type of variable "$4" is not among the in-scope types of the main module @@ -3385,14 +3637,6 @@ the standalone attribute has a value other than "omit" - - schema-attribute name - - - - schema-element name - - OutOfMemoryException during parsing @@ -3642,18 +3886,6 @@ "$2": variable value must be single item - - variable - - - - variable has no value - - - - undeclared variable - - XML schema @@ -3674,6 +3906,10 @@ Zorba API error + + Zorba core module error + + Zorba data-definition error @@ -3733,43 +3969,43 @@ JSONIQ error - + JSONIQ type error - + JSONIQ static error - + JSONIQ dynamic error - + JSONIQ serialization error - + JSONIQ warning - + JSONIQ type warning - + JSONIQ static warning - + JSONIQ dynamic warning - + JSONIQ serialization warning - + dynamic error @@ -3917,74 +4153,49 @@ only one of the <schema-validate/>, <DTD-validate/> or <parse-external-parsed-entity/> options can be specified - + invalid options passed to the parse-xml:parse() function, the element must be in the schema target namespace - + a DOCTYPE declaration is not allowed - + a DOCTYPE declaration must appear before any element or text node, and at most once - + : a sub-picture must not contain more than one of the "$3" sign - + : a sub-picture must not contain a grouping-separator-sign adjacent to a decimal-separator-sign - + : the integer part of a sub-picture must not contain a member of the decimal-digit-family that is followed by an optional-digit-sign - + : the fractional part of a sub-picture must not contain an optional-digit-sign that is followed by a member of the decimal-digit-family - + : a sub-picture must not contain more than one percent-sign or per-mille-sign, and it must not contain one of each - + : a sub-picture must contain at least one character that is an optional-digit-sign or a member of the decimal-digit-family - - - - '$2': illegal JSON character${ at 3} - - - - "$2": illegal Unicode code-point${ at 3} - - - - '\\$2': illegal JSON character escape${ at 3} - - - - illegal JSON literal${ at 2} - - - - illegal JSON number${ at 2} - - - - "$2": unexpected JSON token${ at 3} - - - unterminated JSON string${ at 2} + + function - - unexpected extra content at the end of the document (consider using the jsoniq-multiple-top-level-items option) + + annotation diff -Nru zorba-2.7.0-0/src/diagnostics/dict.h zorba-2.8.0-0/src/diagnostics/dict.h --- zorba-2.7.0-0/src/diagnostics/dict.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/dict.h 2013-01-16 18:28:18.000000000 +0000 @@ -17,6 +17,8 @@ #ifndef ZORBA_DIAGNOSTIC_DICT_H #define ZORBA_DIAGNOSTIC_DICT_H +#include "diagnostics/dict_zed_keys.h" + namespace zorba { namespace diagnostic { namespace dict { @@ -40,7 +42,7 @@ * \endcode * \hideinitializer */ -#define ZED(DICT_KEY) ZED_PREFIX #DICT_KEY +#define ZED(DICT_KEY) ZED_##DICT_KEY /** * Looks up the given key in the language dictionary. diff -Nru zorba-2.7.0-0/src/diagnostics/dict_zed_keys_h.xq zorba-2.8.0-0/src/diagnostics/dict_zed_keys_h.xq --- zorba-2.7.0-0/src/diagnostics/dict_zed_keys_h.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/dict_zed_keys_h.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,55 @@ +(: + : Copyright 2006-2009 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. +:) + +import module namespace util = "http://www.zorba-xquery.com/diagnostic/util" at "diagnostic_util.xq"; + +declare function local:make-zed-defines( $doc ) as xs:string* +{ + for $entry in ( $doc//entry ) + let $key := $entry/@key + return + if ( contains( $key, ' ' ) ) + then () + else + let $full_key := + if ( $entry/parent::diagnostic ) + then concat( $entry/parent::diagnostic/@code, "_", $key ) + else $key + return concat( "#define ZED_", $full_key, ' "~', $full_key, '"' ) +}; + +declare variable $input external; + +string-join( + ( util:copyright(), + '#ifndef ZORBA_DIAGNOSTICS_ZED_KEYS', + '#define ZORBA_DIAGNOSTICS_ZED_KEYS', + '', + local:make-zed-defines( $input ), + '', + '#endif /* ZORBA_DIAGNOSTICS_ZED_KEYS */', + '/*', + ' * Local variables:', + ' * mode: c++', + ' * End:', + ' */', + '/* vim:set et sw=2 ts=2: */' + ), + $util:newline +), +$util:newline + +(: vim:set syntax=xquery et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/src/diagnostics/pregenerated/diagnostic_list.cpp zorba-2.8.0-0/src/diagnostics/pregenerated/diagnostic_list.cpp --- zorba-2.7.0-0/src/diagnostics/pregenerated/diagnostic_list.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/pregenerated/diagnostic_list.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -67,6 +67,9 @@ XQueryErrorCode XPTY0020( "XPTY0020" ); +XQueryErrorCode XPTY0117( "XPTY0117" ); + + XQueryErrorCode XQTY0024( "XQTY0024" ); @@ -130,6 +133,9 @@ XQueryErrorCode XQST0049( "XQST0049" ); +XQueryErrorCode XQST0052( "XQST0052" ); + + XQueryErrorCode XQST0054( "XQST0054" ); @@ -595,6 +601,12 @@ ZorbaErrorCode ZXQP0010_FUNCTION_NOT_SEQUENTIAL( "ZXQP0010" ); +ZorbaErrorCode ZXQP0011_INVALID_LOCALE( "ZXQP0011" ); + + +ZorbaErrorCode ZXQP0012_UNKNOWN_LOCALE( "ZXQP0012" ); + + ZorbaErrorCode ZXQP0013_FXCHARHEAP_EXCEPTION( "ZXQP0013" ); @@ -655,6 +667,9 @@ ZorbaErrorCode ZXQP0060_OPTION_NOT_KNOWN( "ZXQP0060" ); +ZorbaErrorCode ZXQP0061_DISABLE_HTTP_OPTION_IN_QUERY( "ZXQP0061" ); + + #if !defined(ZORBA_NO_FULL_TEXT) ZorbaErrorCode ZXQP8401_THESAURUS_VERSION_MISMATCH( "ZXQP8401" ); @@ -708,7 +723,7 @@ ZorbaErrorCode ZAPI0009_XQUERY_NOT_COMPILED_IN_DEBUG_MODE( "ZAPI0009" ); -ZorbaErrorCode ZAPI0011_ELEMENT_NOT_DECLARED( "ZAPI0011" ); +ZorbaErrorCode ZAPI0011_VARIABLE_NOT_DECLARED( "ZAPI0011" ); ZorbaErrorCode ZAPI0014_INVALID_ARGUMENT( "ZAPI0014" ); @@ -771,7 +786,7 @@ ZorbaErrorCode ZAPI0070_INVALID_SERIALIZATION_METHOD_FOR_SAX( "ZAPI0070" ); -ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_NODE_REFERENCE( "ZAPI0080" ); +ZorbaErrorCode ZAPI0080_CANNOT_RETRIEVE_REFERENCE( "ZAPI0080" ); ZorbaErrorCode ZAPI0090_CANNOT_VALIDATE_NON_ROOT( "ZAPI0090" ); @@ -936,6 +951,18 @@ ZorbaErrorCode ZDDY0036_NON_ROOT_NODE_DELETION( "ZDDY0036" ); +ZorbaErrorCode ZDDY0037_COLLECTION_APPEND_BAD_EDIT( "ZDDY0037" ); + + +ZorbaErrorCode ZDDY0038_COLLECTION_QUEUE_BAD_EDIT( "ZDDY0038" ); + + +ZorbaErrorCode ZDDY0039_NON_ROOT_NODE_EDIT( "ZDDY0039" ); + + +ZorbaErrorCode ZDDY0040_INCONSISTENT_EDIT( "ZDDY0040" ); + + ZorbaErrorCode ZDST0001_COLLECTION_ALREADY_DECLARED( "ZDST0001" ); @@ -1049,6 +1076,9 @@ ZorbaErrorCode ZOSE0006_TRANSCODING_ERROR( "ZOSE0006" ); +ZorbaErrorCode ZOSE0007_UNSUPPORTED_LOCALE( "ZOSE0007" ); + + ZorbaErrorCode ZSTR0001_INDEX_ALREADY_EXISTS( "ZSTR0001" ); @@ -1151,6 +1181,21 @@ ZorbaErrorCode XSST0010( "XSST0010" ); +ZorbaErrorCode ZDTP0001_INVALID_SPECIFICATION( "ZDTP0001" ); + + +ZorbaErrorCode ZDTP0002_INSUFFICIENT_BUFFER( "ZDTP0002" ); + + +ZorbaErrorCode ZDTP0003_INVALID_VALUE( "ZDTP0003" ); + + +ZorbaErrorCode ZDTP0004_LITERAL_MISMATCH( "ZDTP0004" ); + + +ZorbaErrorCode ZDTP0005_INCOMPLETE_DATE_OR_TIME( "ZDTP0005" ); + + ZorbaErrorCode ZJPE0001_ILLEGAL_CHARACTER( "ZJPE0001" ); @@ -1243,6 +1288,9 @@ JSONiqErrorCode JNSE0012( "JNSE0012" ); +JSONiqErrorCode JNSE0013( "JNSE0013" ); + + JSONiqErrorCode JNSE0014( "JNSE0014" ); diff -Nru zorba-2.7.0-0/src/diagnostics/pregenerated/dict_en.cpp zorba-2.8.0-0/src/diagnostics/pregenerated/dict_en.cpp --- zorba-2.7.0-0/src/diagnostics/pregenerated/dict_en.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/pregenerated/dict_en.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -31,7 +31,7 @@ { "FOAR0001", "division by zero" }, { "FOAR0002", "numeric operation overflow/underflow${: 1}" }, { "FOCA0001", "\"$1\": value too large for decimal" }, - { "FOCA0002", "\"$1\": invalid lexical value${: 2}" }, + { "FOCA0002", "$1" }, { "FOCA0003", "\"$1\": value too large for integer" }, { "FOCA0005", "NaN supplied as float/double value" }, { "FOCA0006", "\"$1\": string to be cast to decimal has too many digits of precision" }, @@ -50,13 +50,13 @@ { "FODF1310", "\"$1\": invalid fn:format-number() picture string$2" }, { "FODT0001", "overflow/underflow in date/time operation" }, { "FODT0002", "overflow/underflow in duration operation" }, - { "FODT0003", "\"$1\": invalid timezone value" }, + { "FODT0003", "\"$1\": invalid timezone value (in seconds)" }, { "FOER0000", "unidentifier error" }, { "FOFI0001", "\"$1\": not castable to xs:language" }, { "FOFI0002", "invalid argument in format-integer: $1" }, { "FONS0004", "\"$1\": no namespace found for prefix" }, { "FONS0005", "base-URI not defined in the static context" }, - { "FORG0001", "${\"1\": }invalid value for cast/constructor${: 2}" }, + { "FORG0001", "$1" }, { "FORG0002", "\"$1\": invalid argument to fn:resolve-uri()${: 2}" }, { "FORG0003", "fn:zero-or-one() called with a sequnce containing more than one item" }, { "FORG0004", "fn:one-or-more() called with a sequence containing no items" }, @@ -98,7 +98,7 @@ { "FTST0019", "\"$1\": match option specified more than once" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNDY0003", "\"$1\": pair with the same name already exists in object." }, + { "JNDY0003", "\"$1\": pair with the same name already exists in object" }, #endif #if defined(ZORBA_WITH_JSON) { "JNDY0021", "$1" }, @@ -107,22 +107,25 @@ { "JNSE0012", "can not serialize multiple top-level items as JSON" }, #endif #if defined(ZORBA_WITH_JSON) + { "JNSE0013", "can not serialize value as JSON: $1" }, +#endif +#if defined(ZORBA_WITH_JSON) { "JNSE0014", "can not serialize a node or function item as JSON" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNSE0022", "$1: invalid serialization method for item type ($2)" }, + { "JNSE0022", "\"$1\": invalid serialization method for item type ($2)" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNTY0002", "Pair value returns no, or more than one, item." }, + { "JNTY0002", "pair value returns no, or more than one, item" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNTY0004", "Cannot atomize an $1 item. An $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)." }, + { "JNTY0004", "can not atomize an $1 item: an $1 has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item)" }, #endif #if defined(ZORBA_WITH_JSON) { "JNTY0011", "JSON item cannot appear in content sequence of node constructor or updating expression" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNTY0018", "Object or array selection needs exactly one parameter." }, + { "JNTY0018", "object or array selection needs exactly one parameter" }, #endif #if defined(ZORBA_WITH_JSON) { "JNTY0020", "$1: invalid option type for option $2 (expected $3)" }, @@ -137,10 +140,10 @@ { "JNUP0005", "\"$1\": duplicate pair to insert" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNUP0006", "\"$1\": pair to insert already exists in object." }, + { "JNUP0006", "\"$1\": pair to insert already exists in object" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNUP0007", "$1 - wrong type for object/array selector in update expression." }, + { "JNUP0007", "\"$1\": wrong type for object/array selector in update expression" }, #endif #if defined(ZORBA_WITH_JSON) { "JNUP0008", "$1" }, @@ -155,10 +158,10 @@ { "JNUP0016", "$1" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNUP0017", "Cannot replace with less or more than an item." }, + { "JNUP0017", "can not replace with less or more than an item" }, #endif #if defined(ZORBA_WITH_JSON) - { "JNUP0019", "The content of an insert expression must evaluate to a sequence of objects." }, + { "JNUP0019", "\"$1\": invalid type (content of insert expression must evaluate to a sequence of objects)" }, #endif { "SENR0001", "\"$1\": can not serialize $2" }, { "SEPM0004", "doctype-system parameter, or standalone parameter with a value other than \"omit\", specified" }, @@ -175,12 +178,12 @@ { "SESU0007", "\"$1\": unsupported encoding" }, { "SESU0011", "\"$1\": unsupported normalization form" }, { "SESU0013", "\"$1\": unsupported $2 version; supported versions are: $3" }, - { "XPDY0002", "\"$1\": $2" }, + { "XPDY0002", "$1" }, { "XPDY0050", "\"$1\" cannot be treated as type $2" }, { "XPST0001", "${\"1\": }undefined value${: 2}" }, { "XPST0003", "invalid expression${: 1}" }, { "XPST0005", "static type must not be empty-sequence()" }, - { "XPST0008", "\"$1\": undefined $2" }, + { "XPST0008", "$1" }, { "XPST0017", "\"$1\": $2" }, { "XPST0051", "\"$1\": not defined as atomic type${: 2}" }, { "XPST0080", "\"$1\": invalid type for \"cast\" or \"castable\" exression" }, @@ -190,6 +193,7 @@ { "XPTY0018", "path expression last step must not have nodes and atomic values" }, { "XPTY0019", "a non-last axis step produces non-node items" }, { "XPTY0020", "context item in axis step is not a node" }, + { "XPTY0117", "$1" }, { "XQDY0025", "\"$1\": duplicate attribute name" }, { "XQDY0026", "computed processing instrucion must not contain \"?>\"" }, { "XQDY0027", "\"$1\": unexpected validity property${: 2}" }, @@ -216,11 +220,12 @@ { "XQST0038", "multiple default collation declarations" }, { "XQST0039", "\"$1\": duplicate parameter name" }, { "XQST0040", "\"$1\": non-distinct expanded attribute QName" }, - { "XQST0045", "\"$1\": invalid function or annotation namespace" }, + { "XQST0045", "\"$1\": $2 declared in reserved namespace${ 3}" }, { "XQST0046", "${\"1\": }invalid URI literal${: 2}" }, { "XQST0047", "\"$1\": duplicate target namespace" }, { "XQST0048", "\"$1\": not in library namespace" }, { "XQST0049", "\"$1\": duplicate variable declaration" }, + { "XQST0052", "\"$1\": not defined as simple type" }, { "XQST0054", "${\"1\": }variable must not depend on itself" }, { "XQST0055", "multiple copy-namespaces declarations" }, { "XQST0057", "empty target namespace" }, @@ -270,8 +275,8 @@ { "XUDY0017", "node is target of multiple \"replace value of\" expressions in same query" }, { "XUDY0018", "\"$1\": function declared external, non-updating returns non-empty pending update list" }, { "XUDY0019", "\"$1\": function declated external, updating returns non-empty data model instance" }, - { "XUDY0021", "updates violate constraint" }, - { "XUDY0023", "\"$1\": namespace binding conflicts with $2=$3" }, + { "XUDY0021", "$1${ 2}" }, + { "XUDY0023", "\"$1\": qname causes namespace binding conflict: prefix $2 cannot be bound to both $3 and $4" }, { "XUDY0024", "\"$1\": namespace binding conflicts with $2=$3" }, { "XUDY0027", "target expression is empty sequence" }, { "XUDY0029", "node has no parent in \"insert\" expression (with \"before\" or \"after\")" }, @@ -299,7 +304,7 @@ { "ZAPI0007", "cannot serialize pul" }, { "ZAPI0008", "can not execute a non-updating XQuery" }, { "ZAPI0009", "XQuery not compiled in debug mode" }, - { "ZAPI0011", "\"$1\": undefined $2" }, + { "ZAPI0011", "\"$1\": undeclared variable" }, { "ZAPI0014", "\"$1\": invalid argument${: 2}" }, { "ZAPI0015", "\"$1\": createModule() function not found${: 2}" }, { "ZAPI0019", "\"$1\": external module already registered" }, @@ -320,8 +325,8 @@ { "ZAPI0043", "cannot serialize JSON item using current output method" }, { "ZAPI0045", "cannot serialize sequence containing both JSON and XML items" }, { "ZAPI0070", "\"$1\": invalid serialization method for SAX" }, - { "ZAPI0080", "can not retrieve node-reference for a node that is not in a collection." }, - { "ZAPI0090", "a non root element cannot be validated in place." }, + { "ZAPI0080", "can not retrieve reference for a JSON object or array that is not in a collection" }, + { "ZAPI0090", "non root element cannot be validated in place" }, { "ZCSE0001", "\"$1\": nonexistent input field" }, { "ZCSE0002", "\"$1\": incompatible input field${: type=2}${, class=3}" }, { "ZCSE0003", "\"$1\": unrecognized class field" }, @@ -375,6 +380,10 @@ { "ZDDY0034", "\"$1\": index range-value probe has search keys with incompatible types" }, { "ZDDY0035", "\"$1\": index inserting more than one key not allowed for general index" }, { "ZDDY0036", "attempt to delete non-root node from collection \"$1\"" }, + { "ZDDY0037", "\"$1\": illegal edit in append-only collection" }, + { "ZDDY0038", "\"$1\": illegal edit from queue collection" }, + { "ZDDY0039", "attempt to edit non-root node in collection \"$1\"" }, + { "ZDDY0040", "attempt to edit an item with a template of a different kind (for example an object with a node)." }, { "ZDST0001", "\"$1\": collection already declared" }, { "ZDST0002", "\"$1\": collection already imported into module \"$2\"" }, { "ZDST0003", "\"$1\": collection declaration not allowed in main module" }, @@ -387,7 +396,7 @@ { "ZDST0024", "index multiple property values" }, { "ZDST0025", "\"$1\": index cannot be declared as unique" }, { "ZDST0026", "index invalid property value" }, - { "ZDST0027", "\"$1\": index bad key type" }, + { "ZDST0027", "\"$1\": $2" }, { "ZDST0028", "\"$1\": index not deterministic" }, { "ZDST0029", "\"$1\": index invalid data source" }, { "ZDST0030", "\"$1\": index non-constant data source" }, @@ -401,6 +410,11 @@ { "ZDST0044", "\"$1\": integrity constraint declaration not allowed in main module" }, { "ZDST0048", "\"$1\": integrity constraint declaration in foreign module" }, { "ZDST0060", "\"$1\": feature not supported; $2" }, + { "ZDTP0001", "'$1': invalid % conversion specification" }, + { "ZDTP0002", "\"$1\": insufficient value to parse for \"$2\"" }, + { "ZDTP0003", "\"$1\": invalid value for conversion specification(s) %$2" }, + { "ZDTP0004", "'$1': literal character mismatched '$2'" }, + { "ZDTP0005", "'$1': incomplete date, time, or dateTime format" }, { "ZDTY0001", "\"$1\": invalid item type in collection \"$2\"" }, { "ZDTY0010", "non-node item in domain expression of index $1" }, { "ZDTY0011", "item type \"$1\" does not match declared type \"$2\" for key expression of index $3" }, @@ -432,6 +446,7 @@ { "ZOSE0004", "${\"1\": }I/O error${: 2}" }, { "ZOSE0005", "\"$1\": error loading dynamic library${: 2}" }, { "ZOSE0006", "stream transcoding error ($1)" }, + { "ZOSE0007", "\"$1\": unsupported locale" }, { "ZSTR0001", "\"$1\": index already exists" }, { "ZSTR0002", "\"$1\": index does not exist" }, { "ZSTR0003", "\"$1\": partial key insertion into index \"$2\"" }, @@ -455,10 +470,10 @@ { "ZSTR0055", "streamable string has already been consumed" }, { "ZSTR0060", "out of range: $1" }, { "ZSTR0065", "Zorba did not close properly, objects may still in memory.\n$1 referenced URI(s) remain in the string pool.\nFor help avoiding this message please refer to http://www.zorba-xquery.com/html/documentation in section General Architecture -> Memory Leaks." }, - { "ZSTR0066", "$1: does not reference a node in collection $2." }, + { "ZSTR0066", "$1: does not reference a node in collection $2" }, { "ZWST0002", "\"$1\": unknown or unsupported annotation" }, { "ZWST0003", "\"$1\": function declared sequential, but has non-sequential body" }, - { "ZWST0004", "Sequential FLWOR expr may not have the semantics you expect" }, + { "ZWST0004", "sequential FLWOR expr may not have the semantics you expect" }, { "ZWST0005", "\"$1\": function caching not possible; $2" }, { "ZWST0006", "\"$1\": function caching might not give the intended result because the function is declared as $2" }, { "ZXQD0001", "\"$1\": prefix not declared when calling function \"$2\" from $3" }, @@ -478,6 +493,8 @@ { "ZXQP0008", "\"$1\": function implementation not found" }, { "ZXQP0009", "\"$1\": function referred to by this local-name has the local-name \"$2\" instead" }, { "ZXQP0010", "\"$1\": builtin sequential function not implemented as sequential" }, + { "ZXQP0011", "\"$1\": invalid locale" }, + { "ZXQP0012", "\"$1\": unknown locale" }, { "ZXQP0013", "FxCharHeap error: $1 ($2)" }, { "ZXQP0016", "\"$1\": reserved module target namespace" }, { "ZXQP0017", "file access disabled" }, @@ -497,7 +514,8 @@ { "ZXQP0039", "\"$1\": invalid version specification" }, { "ZXQP0040", "\"$1\": function invokes a nondeterministic function but is missing the nondeterministic annotation" }, { "ZXQP0050", "\"$1\": feature not available" }, - { "ZXQP0060", "\"$1\": unkown option" }, + { "ZXQP0060", "\"$1\": unknown option" }, + { "ZXQP0061", "\"$1\": this option cannot be specified in a query, it must be set via C++ API or command-line parameter" }, #if !defined(ZORBA_NO_FULL_TEXT) { "ZXQP8401", "\"$1\": wrong WordNet file version; should be \"$2\"" }, #endif @@ -507,8 +525,10 @@ #if !defined(ZORBA_NO_FULL_TEXT) { "ZXQP8403", "thesaurus data error${: 1}" }, #endif + { "~ANNOTATION", "annotation" }, { "~AllMatchesHasExcludes", "AllMatches contains StringExclude" }, { "~AlreadySpecified", "already specified" }, + { "~AppliedAt", "applied at" }, { "~ArithOpNotDefinedBetween_23", "arithmetic operation not defined between types \"$2\" and \"$3\"" }, { "~AtomizationHasMoreThanOneValue", "atomization has more than one value" }, { "~AttributeName", "attribute name" }, @@ -525,7 +545,6 @@ { "~BadCharInBraces_3", "'$3': illegal character within { }" }, { "~BadDecDigit_3", "'$3': invalid decimal digit" }, { "~BadFileURIAuthority_2", "\"$2\": invalid authority for \"file\" scheme" }, - { "~BadHexDigit_3", "'$3': invalid hexedecimal digit" }, { "~BadHexSequence", "invalid hexedecimal sequence" }, { "~BadItem", "invalid item" }, { "~BadIterator", "invalid iterator" }, @@ -548,16 +567,14 @@ { "~BadXMLForXQDoc_3", "can not parse as XML for xqdoc: $3" }, { "~BadXMLNoOpeningTag", "closing tag without matching opening tag" }, { "~BadXQueryVersion", "unsupported XQuery version" }, - { "~Base64BadChar", "invalid Base64 character" }, - { "~Base64Multiple4", "Base64 data must be a multiple of 4 characters" }, { "~BaseURI", "base URI" }, { "~BoxCondTooManyColumns", "box condition has more columns than index" }, - { "~CastFromToFailed_34", "$3 to $4 cast failed" }, { "~CharExpected_3", "'$3' expected" }, { "~CloneNotImplemented", "clone() not implemented for expression" }, { "~ClosingBraceWithoutOpen", "'}' encountered without '{' first" }, { "~CollectionIteratorNotOpen", "collection iterator not open" }, { "~DefaultCollation", "default collation" }, + { "~DefaultCollection", "default collection" }, { "~DivisionNoINF", "division can not have +-INF dividend" }, { "~DivisionNoNaN", "division can not involve NaN" }, { "~DocNodeMultipleElements", "document node has more than one element" }, @@ -579,10 +596,25 @@ { "~ExprReturnsTooManyUpdateLists", "expression does not return a pending update list" }, { "~ExternFnDeterministic", "only external functions may be declared deterministic" }, { "~ExternFnNondeterministic", "only external functions may be declared nondeterministic" }, + { "~FOCA0002_BadLexicalQName_2", "\"$2\": value is not a valid lexical QName" }, + { "~FOCA0002_NoCastTo_234", "\"$2\": value of type $3 is not castable to type $4" }, + { "~FOCA0002_NoURIforPrefix_2", "no namespace URI provided for prefix in lexical QName \"$2\"" }, + { "~FORG0001_BadHexDigit_2", "'$2': invalid hexedecimal digit" }, + { "~FORG0001_Base64BadChar_2", "\"$2\": invalid Base64 character" }, + { "~FORG0001_Base64Multiple4", "Base64 data must be a multiple of 4 characters" }, + { "~FORG0001_HexBinaryMustBeEven", "HexBinary value must contain an even number of characters" }, + { "~FORG0001_LocalNotNCName_2", "\"$2\": local name in qname is not an xs:NCName" }, + { "~FORG0001_NameNotNCName_2", "\"$2\": name is not an xs:NCName" }, + { "~FORG0001_NoCastTo_234", "\"$2\": value of type $3 is not castable to type $4" }, + { "~FORG0001_NoCastTo_234o", "\"$2\": value is not castable to type $3${: 4}" }, + { "~FORG0001_NoTypeInCtx_2", "\"$2\": type no defined in current context" }, + { "~FORG0001_PrefixNotBound_2", "\"$2\": prefix has no known namespace binding" }, + { "~FORG0001_PrefixNotNCName_2", "\"$2\": prefix in qname is not an xs:NCName" }, { "~FTST0009_BadStemmerLang", "for current stemmer" }, { "~FTST0009_BadStopWordsLang", "for current stop words" }, { "~FTST0009_BadThesaurusLang", "for given thesaurus" }, { "~FTST0009_BadTokenizerLang", "for current tokenizer" }, + { "~FUNCTION", "function" }, { "~FileNotFoundOrReadable", "file not found or readable" }, { "~FnNilledArgNotNode", "fn:nilled() argument not a node" }, { "~FnOnlyInXQueryVersion_3", "function only available in XQuery $3" }, @@ -593,34 +625,33 @@ { "~FormatNumberIntegerPart", ": the integer part of a sub-picture must not contain a member of the decimal-digit-family that is followed by an optional-digit-sign" }, { "~FormatNumberPercentPermille", ": a sub-picture must not contain more than one percent-sign or per-mille-sign, and it must not contain one of each" }, { "~FullTextNotEnabled", "full-text was not enabled in this build" }, - { "~FunctionFailedErrorCodeMessage_123", "$2 failed (error $3): $4" }, - { "~FunctionFailed_12o", "$2 failed${: 3}" }, + { "~FunctionFailedErrorCodeMessage_234", "$2 failed (error $3): $4" }, + { "~FunctionFailed_23o", "$2 failed${: 3}" }, { "~FunctionUndeclared_3", "function with arity $3 not declared" }, { "~GoodValuesAreUTF8", "valid values are: UTF-8, UTF-16" }, { "~GoodValuesAreXMLEtc", "valid values are: xml, html, xhtml, text, binary, json, jsoniq" }, { "~GoodValuesAreYesNo", "valid values are: yes, no" }, { "~GoodValuesAreYesNoOmit", "valid values are: yes, no, omit" }, - { "~HexBinaryMustBeEven", "HexBinary value must contain an even number of characters" }, { "~IncompleteKeyInIndexBuild", "incomplete key during index build" }, { "~IncompleteKeyInIndexRefresh", "incomplete key during index refresh" }, + { "~JNDY0021_IllegalCharacter_2", "'$2': illegal JSON character" }, + { "~JNDY0021_IllegalCodepoint_2", "\"$2\": illegal Unicode code-point" }, + { "~JNDY0021_IllegalEscape_2", "'\\$2': illegal JSON character escape" }, + { "~JNDY0021_IllegalLiteral", "illegal JSON literal" }, + { "~JNDY0021_IllegalNumber", "illegal JSON number" }, + { "~JNDY0021_UnexpectedExtraContent", "unexpected extra content at the end of the document (consider using the jsoniq-multiple-top-level-items option)" }, + { "~JNDY0021_UnexpectedToken_2", "\"$2\": unexpected JSON token" }, + { "~JNDY0021_UnterminatedString", "unterminated JSON string" }, { "~JNUP0007_Array", "\"$2\": can not be promoted to type xs:integer" }, { "~JNUP0007_Object", "\"$2\": can not be promoted to type xs:string" }, { "~JNUP0007_ObjectArray", "\"$2\": can not be promoted to type xs:anyAtomicType" }, { "~JNUP0008_Array", "\"$2\": target of an appending expression or of a position-inserting expression is not an array" }, - { "~JNUP0008_Object", "\"$2\": target of a renaming expression or of a non-position-inserting expression is not an object." }, - { "~JNUP0008_ObjectArray", "\"$2\": target of a deleting or replacing expression is not a JSON item." }, - { "~JNUP0016_Array", "\"$2\": selector cannot be resolved against supplied array." }, - { "~JNUP0016_Object", "\"$2\": selector cannot be resolved against supplied object." }, + { "~JNUP0008_Object", "\"$2\": target of a renaming expression or of a non-position-inserting expression is not an object" }, + { "~JNUP0008_ObjectArray", "\"$2\": target of a deleting or replacing expression is not a JSON item" }, + { "~JNUP0016_Array", "\"$2\": selector cannot be resolved against supplied array" }, + { "~JNUP0016_Object", "\"$2\": selector cannot be resolved against supplied object" }, { "~JSON parser error", "JSON parser error" }, { "~JSON serialization error", "JSON serialization error" }, - { "~JSON_ILLEGAL_CHARACTER", "'$2': illegal JSON character${ at 3}" }, - { "~JSON_ILLEGAL_CODEPOINT", "\"$2\": illegal Unicode code-point${ at 3}" }, - { "~JSON_ILLEGAL_ESCAPE", "'\\$2': illegal JSON character escape${ at 3}" }, - { "~JSON_ILLEGAL_LITERAL", "illegal JSON literal${ at 2}" }, - { "~JSON_ILLEGAL_NUMBER", "illegal JSON number${ at 2}" }, - { "~JSON_UNEXPECTED_EXTRA_CONTENT", "unexpected extra content at the end of the document (consider using the jsoniq-multiple-top-level-items option)" }, - { "~JSON_UNEXPECTED_TOKEN", "\"$2\": unexpected JSON token${ at 3}" }, - { "~JSON_UNTERMINATED_STRING", "unterminated JSON string${ at 2}" }, { "~JSONiq dynamic error", "JSONIQ dynamic error" }, { "~JSONiq dynamic warning", "JSONIQ dynamic warning" }, { "~JSONiq error", "JSONIQ error" }, @@ -634,7 +665,6 @@ { "~LibModVersionMismatch_3", "XQuery library version can not be imported by a $3 version module" }, { "~ModuleNotFound", "module not found" }, { "~MustBeAbsoluteURI", "must be absolute" }, - { "~MustBeNCName", "must be an xs:NCName" }, { "~NoAttrNodesInDocument", "document node must not contain attribute nodes" }, { "~NoBindURI", "namespace URI can not be bound to prefix" }, { "~NoCastToCInt_2", "\"$2\": 2nd operand can not be cast from \"xs:integer\" to C++ \"int\"" }, @@ -646,6 +676,8 @@ { "~NoEmptyLocalname", "local-name can not be empty" }, { "~NoEmptySeqAsBaseURI", "can't treat empty sequence as base URI" }, { "~NoEmptySeqAsCollationParam", "empty-sequence not allowed as collation parameter" }, + { "~NoExternalFunction_2", "\"$2\": external function not found" }, + { "~NoExternalModuleFromDLL_2", "required external module \"$2\" not found" }, { "~NoHashItemOfType_2", "can not hash item of type \"$2\"" }, { "~NoInputData", "no input data" }, { "~NoModuleURIResolver", "no module URI resolver could be retrieved using SerializationCallback" }, @@ -666,7 +698,6 @@ { "~NoSerializationCallbackForTraceStream", "no SerializationCallback for required trace stream" }, { "~NoSourceURI", "no URI" }, { "~NoTreatAs_4", "can not treat as \"$4\"" }, - { "~NoTypeInCtx", "undefined type in current context" }, { "~NoTypeInMainModule_4", "type of variable \"$4\" is not among the in-scope types of the main module" }, { "~NoTypeInModule_45", "type of variable \"$4\" is not among the in-scope types module \"$5\"" }, { "~NoURIAuthority", "no authority" }, @@ -768,8 +799,6 @@ #endif { "~SEPM0009_Not10", "the version parameter has a value other than \"1.0\" and the doctype-system parameter is specified" }, { "~SEPM0009_NotOmit", "the standalone attribute has a value other than \"omit\"" }, - { "~SchemaAttributeName", "schema-attribute name" }, - { "~SchemaElementName", "schema-element name" }, { "~SchemaOutOfMemory", "OutOfMemoryException during parsing" }, { "~SchemaParseError", "error during parsing" }, { "~SchemaUnexpected", "unexpected exception during parsing" }, @@ -855,31 +884,38 @@ #endif { "~UnexpectedElement", "unexpected element" }, { "~VarValMustBeSingleItem_2", "\"$2\": variable value must be single item" }, - { "~Variable", "variable" }, - { "~VariabledHasNoValue", "variable has no value" }, - { "~VariabledUndeclared", "undeclared variable" }, { "~XMLSchema", "XML schema" }, - { "~XPST0003_Anotations", "function and variable annotations only available in XQuery 3.0 or later" }, - { "~XPST0003_CountClause11", "\"count\" clause only available in XQuery 3.0 or later" }, + { "~XPDY0002_ContextUndeclared_2", "$2 not declared" }, + { "~XPDY0002_VariableHasNoValue_2", "\"$2\": variable has no value" }, + { "~XPDY0002_VariableUndeclared_2", "\"$2\": undeclared variable" }, + { "~XPST0003_Annotations", "function and variable annotations only available in XQuery 3.0 or later" }, + { "~XPST0003_CountClause30", "\"count\" clause only available in XQuery 3.0 or later" }, { "~XPST0003_ModuleDeclNotInMain", "module declaration must not be in main module" }, - { "~XPST0003_OuterForClause11", "\"outer-for\" clause only available in XQuery 3.0 or later" }, + { "~XPST0003_OuterForClause30", "\"outer-for\" clause only available in XQuery 3.0 or later" }, { "~XPST0003_PiTarget", "\"XML\" not allowed as target of a direct processing-instruction constructor" }, { "~XPST0003_Scripting", "scripting feature not available" }, { "~XPST0003_StartEndTagMismatch_23", "start tag \"$2\" does not match end tag \"$3\"" }, - { "~XPST0003_SwitchExpr11", "\"switch\" expressions only available in XQuery 3.0 or later" }, - { "~XPST0003_TryCatchExpr11", "\"try/catch\" expressions only available in XQuery 3.0 or later" }, - { "~XPST0003_WindowClause11", "\"window\" clause only available in XQuery 3.0 or later" }, + { "~XPST0003_SwitchExpr30", "\"switch\" expressions only available in XQuery 3.0 or later" }, + { "~XPST0003_TryCatchExpr30", "\"try/catch\" expressions only available in XQuery 3.0 or later" }, + { "~XPST0003_WindowClause30", "\"window\" clause only available in XQuery 3.0 or later" }, { "~XPST0003_XQueryVersionAtLeast30_2", "\"$2\": XQuery version must be at least 3.0" }, - { "~XPTY0004_FormatNumber_2", "the first parameter to the format-number() function is of type $2, which is not allowed" }, - { "~XPTY0004_FuncParam", "$2 can not be promoted to parameter type $3 of function $4()" }, - { "~XPTY0004_FuncReturn", "$2 can not be promoted to return type $3 of function $4()" }, - { "~XPTY0004_JSONIQ_SELECTOR", "Cannot atomize and/or cast value of type $2 to a string." }, + { "~XPST0008_SchemaAttributeName_2", "\"$2\": undefined schema-attribute name" }, + { "~XPST0008_SchemaElementName_2", "\"$2\": undefined schema-element name" }, + { "~XPST0008_VariableName_2", "\"$2\": undeclared variable" }, + { "~XPTY0004_FormatNumber_2", "first parameter to format-number() function is type $2 that is not allowed" }, + { "~XPTY0004_JSONIQ_SELECTOR", "can not atomize and/or cast value of type $2 to string" }, { "~XPTY0004_MultiValuedGroupingKey", "atomization of grouping variable produces more than one item" }, - { "~XPTY0004_NoMultiSeqTypePromotion", "sequence of more than one item can not be promoted to type $2" }, - { "~XPTY0004_TypeMatch", "$2 can not be treated as type $3" }, - { "~XPTY0004_TypePromotion", "$2 can not be promoted to type $3" }, + { "~XPTY0004_NoMultiSeqTypePromotion_2", "sequence of more than one item can not be promoted to type $2" }, + { "~XPTY0004_NoParamTypePromote_234", "$2 can not be promoted to parameter type $3 of function $4()" }, + { "~XPTY0004_NoReturnTypePromote_234", "$2 can not be promoted to return type $3 of function $4()" }, + { "~XPTY0004_NoTreatAs_23", "$2 can not be treated as type $3" }, + { "~XPTY0004_NoTypePromote_23", "$2 can not be promoted to type $3" }, + { "~XPTY0117_NodeCast", "Cannot cast node to xs:QName" }, + { "~XPTY0117_NotationParam_23", "$2 can not be promoted to parameter type xs:NOTATION of function $3()" }, + { "~XQST0046_BadHexDigit_3", "'$3': invalid hexedecimal digit" }, { "~XQST0106_CONFLICTING", "conflicting" }, { "~XQST0106_THE_SAME", "the same" }, + { "~XUDY0021_AttributeName", "\"$3\": attribute with the same name already exists" }, { "~XUST0001_CONCAT", "comma expression with updating and non-updating branches" }, { "~XUST0001_Generic", "updating expression illegal here" }, { "~XUST0001_IF", "conditional expression with updating and non-updating branch" }, @@ -887,6 +923,11 @@ { "~XUST0001_UDF_2", "\"$2\": function declared simple but body is updating" }, { "~XUST0002_Transform", "transform expression witn non-updating or vacuous modify clause" }, { "~XUST0002_UDF_2", "\"$2\": function declared updating but body is not updating or vacuous" }, + { "~ZDST0027_MULTI_VALUED_KEY_TYPE_DECL", "value index can not have a key type declaration with * or + quantifier" }, + { "~ZDST0027_NON_ATOMIC_KEY_TYPE", "index has non-atomic key type declaration" }, + { "~ZDST0027_NON_ORDERED_KEY_TYPE", "range index can not have type $3 in key type declaration" }, + { "~ZDST0027_NON_SPECIFIC_KEY_TYPE_DECL", "value index can not have xs:untypedAtomic or xs:anyAtomicType in key type declaration" }, + { "~ZDST0027_NO_KEY_TYPE_DECL", "value index missing key type declaration" }, { "~ZDST0060_unknown_localname", "unknown localname ($3)" }, { "~ZDST0060_unknown_namespace", "unknown namespace ($3)" }, { "~ZWST0005_PARAM_TYPE", "type of parameter $3 is $4 which is not a subtype of xs:anyAtomicType" }, @@ -899,6 +940,7 @@ { "~ZXQP0025_RESOURCE_NOT_FOUND", "resource not found" }, { "~ZeroLenURI", "zero-length URI (and no base URI given)" }, { "~Zorba API error", "Zorba API error" }, + { "~Zorba core module error", "Zorba core module error" }, { "~Zorba data-definition error", "Zorba data-definition error" }, { "~Zorba dynamic error", "Zorba dynamic error" }, { "~Zorba dynamic warning", "Zorba dynamic warning" }, diff -Nru zorba-2.7.0-0/src/diagnostics/pregenerated/dict_zed_keys.h zorba-2.8.0-0/src/diagnostics/pregenerated/dict_zed_keys.h --- zorba-2.7.0-0/src/diagnostics/pregenerated/dict_zed_keys.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/pregenerated/dict_zed_keys.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,349 @@ +/** + * Copyright 2006-2011 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /* + * THIS FILE IS GENERATED. + * PLEASE DO NOT EDIT. + */ + +#ifndef ZORBA_DIAGNOSTICS_ZED_KEYS +#define ZORBA_DIAGNOSTICS_ZED_KEYS + +#define ZED_XPST0003_StartEndTagMismatch_23 "~XPST0003_StartEndTagMismatch_23" +#define ZED_XPST0003_ModuleDeclNotInMain "~XPST0003_ModuleDeclNotInMain" +#define ZED_XPST0003_XQueryVersionAtLeast30_2 "~XPST0003_XQueryVersionAtLeast30_2" +#define ZED_XPST0003_OuterForClause30 "~XPST0003_OuterForClause30" +#define ZED_XPST0003_WindowClause30 "~XPST0003_WindowClause30" +#define ZED_XPST0003_CountClause30 "~XPST0003_CountClause30" +#define ZED_XPST0003_SwitchExpr30 "~XPST0003_SwitchExpr30" +#define ZED_XPST0003_TryCatchExpr30 "~XPST0003_TryCatchExpr30" +#define ZED_XPST0003_Annotations "~XPST0003_Annotations" +#define ZED_XPST0003_Scripting "~XPST0003_Scripting" +#define ZED_XPST0003_PiTarget "~XPST0003_PiTarget" +#define ZED_XPST0008_VariableName_2 "~XPST0008_VariableName_2" +#define ZED_XPST0008_SchemaAttributeName_2 "~XPST0008_SchemaAttributeName_2" +#define ZED_XPST0008_SchemaElementName_2 "~XPST0008_SchemaElementName_2" +#define ZED_XPTY0004_NoReturnTypePromote_234 "~XPTY0004_NoReturnTypePromote_234" +#define ZED_XPTY0004_NoParamTypePromote_234 "~XPTY0004_NoParamTypePromote_234" +#define ZED_XPTY0004_NoTypePromote_23 "~XPTY0004_NoTypePromote_23" +#define ZED_XPTY0004_NoMultiSeqTypePromotion_2 "~XPTY0004_NoMultiSeqTypePromotion_2" +#define ZED_XPTY0004_NoTreatAs_23 "~XPTY0004_NoTreatAs_23" +#define ZED_XPTY0004_FormatNumber_2 "~XPTY0004_FormatNumber_2" +#define ZED_XPTY0004_JSONIQ_SELECTOR "~XPTY0004_JSONIQ_SELECTOR" +#define ZED_XPTY0004_MultiValuedGroupingKey "~XPTY0004_MultiValuedGroupingKey" +#define ZED_XPTY0117_NodeCast "~XPTY0117_NodeCast" +#define ZED_XPTY0117_NotationParam_23 "~XPTY0117_NotationParam_23" +#define ZED_XQST0046_BadHexDigit_3 "~XQST0046_BadHexDigit_3" +#define ZED_XQST0106_THE_SAME "~XQST0106_THE_SAME" +#define ZED_XQST0106_CONFLICTING "~XQST0106_CONFLICTING" +#define ZED_XPDY0002_VariableHasNoValue_2 "~XPDY0002_VariableHasNoValue_2" +#define ZED_XPDY0002_VariableUndeclared_2 "~XPDY0002_VariableUndeclared_2" +#define ZED_XPDY0002_ContextUndeclared_2 "~XPDY0002_ContextUndeclared_2" +#define ZED_FTST0009_BadStopWordsLang "~FTST0009_BadStopWordsLang" +#define ZED_FTST0009_BadStemmerLang "~FTST0009_BadStemmerLang" +#define ZED_FTST0009_BadThesaurusLang "~FTST0009_BadThesaurusLang" +#define ZED_FTST0009_BadTokenizerLang "~FTST0009_BadTokenizerLang" +#define ZED_FOCA0002_BadLexicalQName_2 "~FOCA0002_BadLexicalQName_2" +#define ZED_FOCA0002_NoURIforPrefix_2 "~FOCA0002_NoURIforPrefix_2" +#define ZED_FOCA0002_NoCastTo_234 "~FOCA0002_NoCastTo_234" +#define ZED_FORG0001_NoCastTo_234 "~FORG0001_NoCastTo_234" +#define ZED_FORG0001_NoCastTo_234o "~FORG0001_NoCastTo_234o" +#define ZED_FORG0001_LocalNotNCName_2 "~FORG0001_LocalNotNCName_2" +#define ZED_FORG0001_PrefixNotNCName_2 "~FORG0001_PrefixNotNCName_2" +#define ZED_FORG0001_NameNotNCName_2 "~FORG0001_NameNotNCName_2" +#define ZED_FORG0001_PrefixNotBound_2 "~FORG0001_PrefixNotBound_2" +#define ZED_FORG0001_Base64BadChar_2 "~FORG0001_Base64BadChar_2" +#define ZED_FORG0001_Base64Multiple4 "~FORG0001_Base64Multiple4" +#define ZED_FORG0001_HexBinaryMustBeEven "~FORG0001_HexBinaryMustBeEven" +#define ZED_FORG0001_BadHexDigit_2 "~FORG0001_BadHexDigit_2" +#define ZED_FORG0001_NoTypeInCtx_2 "~FORG0001_NoTypeInCtx_2" +#define ZED_XUST0001_CONCAT "~XUST0001_CONCAT" +#define ZED_XUST0001_TRYCATCH "~XUST0001_TRYCATCH" +#define ZED_XUST0001_Generic "~XUST0001_Generic" +#define ZED_XUST0001_IF "~XUST0001_IF" +#define ZED_XUST0001_UDF_2 "~XUST0001_UDF_2" +#define ZED_XUDY0021_AttributeName "~XUDY0021_AttributeName" +#define ZED_ZXQP0004_TypeOps_is_in_scope_ForFunctionItemTypes "~ZXQP0004_TypeOps_is_in_scope_ForFunctionItemTypes" +#define ZED_ZXQP0025_RESOURCE_NOT_FOUND "~ZXQP0025_RESOURCE_NOT_FOUND" +#define ZED_ZXQD0004_NON_NEGATIVE "~ZXQD0004_NON_NEGATIVE" +#define ZED_ZXQD0004_NOT_WITHIN_RANGE "~ZXQD0004_NOT_WITHIN_RANGE" +#define ZED_ZDST0027_NO_KEY_TYPE_DECL "~ZDST0027_NO_KEY_TYPE_DECL" +#define ZED_ZDST0027_NON_SPECIFIC_KEY_TYPE_DECL "~ZDST0027_NON_SPECIFIC_KEY_TYPE_DECL" +#define ZED_ZDST0027_MULTI_VALUED_KEY_TYPE_DECL "~ZDST0027_MULTI_VALUED_KEY_TYPE_DECL" +#define ZED_ZDST0027_NON_ATOMIC_KEY_TYPE "~ZDST0027_NON_ATOMIC_KEY_TYPE" +#define ZED_ZDST0027_NON_ORDERED_KEY_TYPE "~ZDST0027_NON_ORDERED_KEY_TYPE" +#define ZED_ZDST0060_unknown_namespace "~ZDST0060_unknown_namespace" +#define ZED_ZDST0060_unknown_localname "~ZDST0060_unknown_localname" +#define ZED_JNUP0007_Object "~JNUP0007_Object" +#define ZED_JNUP0007_Array "~JNUP0007_Array" +#define ZED_JNUP0007_ObjectArray "~JNUP0007_ObjectArray" +#define ZED_JNUP0008_Object "~JNUP0008_Object" +#define ZED_JNUP0008_Array "~JNUP0008_Array" +#define ZED_JNUP0008_ObjectArray "~JNUP0008_ObjectArray" +#define ZED_JNUP0016_Object "~JNUP0016_Object" +#define ZED_JNUP0016_Array "~JNUP0016_Array" +#define ZED_JNDY0021_IllegalCharacter_2 "~JNDY0021_IllegalCharacter_2" +#define ZED_JNDY0021_IllegalCodepoint_2 "~JNDY0021_IllegalCodepoint_2" +#define ZED_JNDY0021_IllegalEscape_2 "~JNDY0021_IllegalEscape_2" +#define ZED_JNDY0021_IllegalLiteral "~JNDY0021_IllegalLiteral" +#define ZED_JNDY0021_IllegalNumber "~JNDY0021_IllegalNumber" +#define ZED_JNDY0021_UnexpectedToken_2 "~JNDY0021_UnexpectedToken_2" +#define ZED_JNDY0021_UnterminatedString "~JNDY0021_UnterminatedString" +#define ZED_JNDY0021_UnexpectedExtraContent "~JNDY0021_UnexpectedExtraContent" +#define ZED_ZWST0005_RETURN_TYPE "~ZWST0005_RETURN_TYPE" +#define ZED_ZWST0005_PARAM_TYPE "~ZWST0005_PARAM_TYPE" +#define ZED_ZWST0005_UPDATING "~ZWST0005_UPDATING" +#define ZED_ZWST0005_VARIADIC "~ZWST0005_VARIADIC" +#define ZED_AllMatchesHasExcludes "~AllMatchesHasExcludes" +#define ZED_AlreadySpecified "~AlreadySpecified" +#define ZED_AppliedAt "~AppliedAt" +#define ZED_ArithOpNotDefinedBetween_23 "~ArithOpNotDefinedBetween_23" +#define ZED_AtomizationHasMoreThanOneValue "~AtomizationHasMoreThanOneValue" +#define ZED_AttributeName "~AttributeName" +#define ZED_AttributeNode "~AttributeNode" +#define ZED_BackRef0Illegal "~BackRef0Illegal" +#define ZED_BackRefIllegalInCharClass "~BackRefIllegalInCharClass" +#define ZED_BadAnyURI "~BadAnyURI" +#define ZED_BadArgTypeForFn_2o34o "~BadArgTypeForFn_2o34o" +#define ZED_BadCharAfter_34 "~BadCharAfter_34" +#define ZED_BadCharInBraces_3 "~BadCharInBraces_3" +#define ZED_BadDecDigit_3 "~BadDecDigit_3" +#define ZED_BadFileURIAuthority_2 "~BadFileURIAuthority_2" +#define ZED_BadHexSequence "~BadHexSequence" +#define ZED_BadItem "~BadItem" +#define ZED_BadIterator "~BadIterator" +#define ZED_BadLibraryModule "~BadLibraryModule" +#define ZED_BadRegexEscape_3 "~BadRegexEscape_3" +#define ZED_BadPath "~BadPath" +#define ZED_BadStreamState "~BadStreamState" +#define ZED_BadTokenInBraces_3 "~BadTokenInBraces_3" +#define ZED_BadTraceStream "~BadTraceStream" +#define ZED_BadTypeFor_23 "~BadTypeFor_23" +#define ZED_BadType_23o "~BadType_23o" +#define ZED_BadURIScheme_3 "~BadURIScheme_3" +#define ZED_BadURISyntaxForScheme_3 "~BadURISyntaxForScheme_3" +#define ZED_BadUnicodeChar_3 "~BadUnicodeChar_3" +#define ZED_BadWordNetPartOfSpeech_2 "~BadWordNetPartOfSpeech_2" +#define ZED_BadWordNetPtr_2 "~BadWordNetPtr_2" +#define ZED_BadXMLDocument_2o "~BadXMLDocument_2o" +#define ZED_BadXMLNoOpeningTag "~BadXMLNoOpeningTag" +#define ZED_BadXMLForXQDoc_3 "~BadXMLForXQDoc_3" +#define ZED_BadXQueryVersion "~BadXQueryVersion" +#define ZED_BaseURI "~BaseURI" +#define ZED_BoxCondTooManyColumns "~BoxCondTooManyColumns" +#define ZED_CharExpected_3 "~CharExpected_3" +#define ZED_CloneNotImplemented "~CloneNotImplemented" +#define ZED_ClosingBraceWithoutOpen "~ClosingBraceWithoutOpen" +#define ZED_CollectionIteratorNotOpen "~CollectionIteratorNotOpen" +#define ZED_DefaultCollection "~DefaultCollection" +#define ZED_DefaultCollation "~DefaultCollation" +#define ZED_DivisionNoINF "~DivisionNoINF" +#define ZED_DivisionNoNaN "~DivisionNoNaN" +#define ZED_DocNodeMultipleElements "~DocNodeMultipleElements" +#define ZED_EBVNotDefSeq_5 "~EBVNotDefSeq_5" +#define ZED_EffectiveBooleanValue "~EffectiveBooleanValue" +#define ZED_ElementName "~ElementName" +#define ZED_ElementNode "~ElementNode" +#define ZED_EmptyPath "~EmptyPath" +#define ZED_EmptySeqNoCastToQName "~EmptySeqNoCastToQName" +#define ZED_EmptySeqNoCastToTypeWithQuantOne "~EmptySeqNoCastToTypeWithQuantOne" +#define ZED_EmptySeqNoFnRemoveArg "~EmptySeqNoFnRemoveArg" +#define ZED_EmptySeqNoSearchItem "~EmptySeqNoSearchItem" +#define ZED_EmptySequence "~EmptySequence" +#define ZED_ErrorCodeMessage_12 "~ErrorCodeMessage_12" +#define ZED_ExpectedNumericOrDurationType "~ExpectedNumericOrDurationType" +#define ZED_ExpectedNumericType "~ExpectedNumericType" +#define ZED_ExpectedType_5 "~ExpectedType_5" +#define ZED_ExprNoReturnUpdateList "~ExprNoReturnUpdateList" +#define ZED_ExprReturnsTooManyUpdateLists "~ExprReturnsTooManyUpdateLists" +#define ZED_ExternFnDeterministic "~ExternFnDeterministic" +#define ZED_ExternFnNondeterministic "~ExternFnNondeterministic" +#define ZED_FileNotFoundOrReadable "~FileNotFoundOrReadable" +#define ZED_FnNilledArgNotNode "~FnNilledArgNotNode" +#define ZED_FnOnlyInXQueryVersion_3 "~FnOnlyInXQueryVersion_3" +#define ZED_FullTextNotEnabled "~FullTextNotEnabled" +#define ZED_FunctionFailedErrorCodeMessage_234 "~FunctionFailedErrorCodeMessage_234" +#define ZED_FunctionFailed_23o "~FunctionFailed_23o" +#define ZED_FunctionUndeclared_3 "~FunctionUndeclared_3" +#define ZED_GoodValuesAreUTF8 "~GoodValuesAreUTF8" +#define ZED_GoodValuesAreXMLEtc "~GoodValuesAreXMLEtc" +#define ZED_GoodValuesAreYesNo "~GoodValuesAreYesNo" +#define ZED_GoodValuesAreYesNoOmit "~GoodValuesAreYesNoOmit" +#define ZED_IncompleteKeyInIndexBuild "~IncompleteKeyInIndexBuild" +#define ZED_IncompleteKeyInIndexRefresh "~IncompleteKeyInIndexRefresh" +#define ZED_LibModVersionMismatch_3 "~LibModVersionMismatch_3" +#define ZED_ModuleNotFound "~ModuleNotFound" +#define ZED_MustBeAbsoluteURI "~MustBeAbsoluteURI" +#define ZED_NoAttrNodesInDocument "~NoAttrNodesInDocument" +#define ZED_NoBindURI "~NoBindURI" +#define ZED_NoCastToCInt_2 "~NoCastToCInt_2" +#define ZED_NoCastTo_34o "~NoCastTo_34o" +#define ZED_NoCastTo_45o "~NoCastTo_45o" +#define ZED_NoCompareTypes_23 "~NoCompareTypes_23" +#define ZED_NoCompareWithType_4 "~NoCompareWithType_4" +#define ZED_NoDriveSpecification "~NoDriveSpecification" +#define ZED_NoEmptyLocalname "~NoEmptyLocalname" +#define ZED_NoEmptySeqAsBaseURI "~NoEmptySeqAsBaseURI" +#define ZED_NoEmptySeqAsCollationParam "~NoEmptySeqAsCollationParam" +#define ZED_NoHashItemOfType_2 "~NoHashItemOfType_2" +#define ZED_NoInputData "~NoInputData" +#define ZED_NoModuleURIResolver "~NoModuleURIResolver" +#define ZED_NoMultiKeyNodeValues_2 "~NoMultiKeyNodeValues_2" +#define ZED_NoParseFnArity "~NoParseFnArity" +#define ZED_NoRebindPrefix "~NoRebindPrefix" +#define ZED_NoRegisteredSerializationCallback_2 "~NoRegisteredSerializationCallback_2" +#define ZED_NoResolveRelativeURI "~NoResolveRelativeURI" +#define ZED_NoSeqAsArithOp "~NoSeqAsArithOp" +#define ZED_NoSeqAsCollationParam "~NoSeqAsCollationParam" +#define ZED_NoSeqCastToTypeWithQuantOneOrQuestion "~NoSeqCastToTypeWithQuantOneOrQuestion" +#define ZED_NoSeqForFnOp_2 "~NoSeqForFnOp_2" +#define ZED_NoSeqForConcat "~NoSeqForConcat" +#define ZED_NoSeqInValueComp "~NoSeqInValueComp" +#define ZED_NoSeqTestedForAtomicEquiv "~NoSeqTestedForAtomicEquiv" +#define ZED_NoSerializationCallbackForDocColMod "~NoSerializationCallbackForDocColMod" +#define ZED_NoExternalFunction_2 "~NoExternalFunction_2" +#define ZED_NoExternalModuleFromDLL_2 "~NoExternalModuleFromDLL_2" +#define ZED_NoSerializationCallbackForModule "~NoSerializationCallbackForModule" +#define ZED_NoSerializationCallbackForTraceStream "~NoSerializationCallbackForTraceStream" +#define ZED_NoSourceURI "~NoSourceURI" +#define ZED_NoTreatAs_4 "~NoTreatAs_4" +#define ZED_NoTypeInMainModule_4 "~NoTypeInMainModule_4" +#define ZED_NoTypeInModule_45 "~NoTypeInModule_45" +#define ZED_NoURIAuthority "~NoURIAuthority" +#define ZED_NoURIInStore "~NoURIInStore" +#define ZED_NoURIScheme "~NoURIScheme" +#define ZED_NoUntypedKeyNodeValue_2 "~NoUntypedKeyNodeValue_2" +#define ZED_NodeIDNeedsBytes_2 "~NodeIDNeedsBytes_2" +#define ZED_NodeIDTooBig "~NodeIDTooBig" +#define ZED_NonClosedBackRef_3 "~NonClosedBackRef_3" +#define ZED_NonFileThesaurusURI "~NonFileThesaurusURI" +#define ZED_NonLocalhostAuthority "~NonLocalhostAuthority" +#define ZED_NonexistentBackRef_3 "~NonexistentBackRef_3" +#define ZED_NotAllowedForTypeName "~NotAllowedForTypeName" +#define ZED_NotAmongInScopeSchemaTypes "~NotAmongInScopeSchemaTypes" +#define ZED_NotDefInDynamicCtx "~NotDefInDynamicCtx" +#define ZED_NotDocOrElementNode "~NotDocOrElementNode" +#define ZED_NotInStaticCtx "~NotInStaticCtx" +#define ZED_NotPlainFile "~NotPlainFile" +#define ZED_NotSpecified "~NotSpecified" +#define ZED_OpIsSameNodeMustHaveNodes "~OpIsSameNodeMustHaveNodes" +#define ZED_OpNodeAfterMustHaveNodes "~OpNodeAfterMustHaveNodes" +#define ZED_OpNodeBeforeMustHaveNodes "~OpNodeBeforeMustHaveNodes" +#define ZED_OperationNotDef_23 "~OperationNotDef_23" +#define ZED_OperationNotPossibleWithTypes_234 "~OperationNotPossibleWithTypes_234" +#define ZED_ParserInitFailed "~ParserInitFailed" +#define ZED_ParserNoCreateTree "~ParserNoCreateTree" +#define ZED_PromotionImpossible "~PromotionImpossible" +#define ZED_QuotedColon_23 "~QuotedColon_23" +#define ZED_SEPM0009_Not10 "~SEPM0009_Not10" +#define ZED_SEPM0009_NotOmit "~SEPM0009_NotOmit" +#define ZED_SchemaOutOfMemory "~SchemaOutOfMemory" +#define ZED_SchemaParseError "~SchemaParseError" +#define ZED_SchemaUnexpected "~SchemaUnexpected" +#define ZED_SearchKeyTypeMismatch_234 "~SearchKeyTypeMismatch_234" +#define ZED_SearchKeyTypeNoProbeIndex_23 "~SearchKeyTypeNoProbeIndex_23" +#define ZED_SeqFnBody "~SeqFnBody" +#define ZED_SeqNoCastToQName "~SeqNoCastToQName" +#define ZED_SingletonExpected_2o "~SingletonExpected_2o" +#define ZED_StackOverflow "~StackOverflow" +#define ZED_StingLiteral "~StingLiteral" +#define ZED_StringValue "~StringValue" +#define ZED_SumImpossibleWithTypes_23 "~SumImpossibleWithTypes_23" +#define ZED_TrailingChar_3 "~TrailingChar_3" +#define ZED_TwoDecimalFormatsSameName_2 "~TwoDecimalFormatsSameName_2" +#define ZED_TwoDefaultDecimalFormats "~TwoDefaultDecimalFormats" +#define ZED_TypeIsNotSubtype "~TypeIsNotSubtype" +#define ZED_U_REGEX_BAD_ESCAPE_SEQUENCE "~U_REGEX_BAD_ESCAPE_SEQUENCE" +#define ZED_U_REGEX_BAD_INTERVAL "~U_REGEX_BAD_INTERVAL" +#define ZED_U_REGEX_INTERNAL_ERROR "~U_REGEX_INTERNAL_ERROR" +#define ZED_U_REGEX_INVALID_BACK_REF "~U_REGEX_INVALID_BACK_REF" +#define ZED_U_REGEX_INVALID_FLAG "~U_REGEX_INVALID_FLAG" +#define ZED_U_REGEX_INVALID_RANGE "~U_REGEX_INVALID_RANGE" +#define ZED_U_REGEX_INVALID_STATE "~U_REGEX_INVALID_STATE" +#define ZED_U_REGEX_LOOK_BEHIND_LIMIT "~U_REGEX_LOOK_BEHIND_LIMIT" +#define ZED_U_REGEX_MAX_LT_MIN "~U_REGEX_MAX_LT_MIN" +#define ZED_U_REGEX_MISMATCHED_PAREN "~U_REGEX_MISMATCHED_PAREN" +#define ZED_U_REGEX_MISSING_CLOSE_BRACKET "~U_REGEX_MISSING_CLOSE_BRACKET" +#define ZED_U_REGEX_NUMBER_TOO_BIG "~U_REGEX_NUMBER_TOO_BIG" +#define ZED_U_REGEX_OCTAL_TOO_BIG "~U_REGEX_OCTAL_TOO_BIG" +#define ZED_U_REGEX_PROPERTY_SYNTAX "~U_REGEX_PROPERTY_SYNTAX" +#define ZED_U_REGEX_RULE_SYNTAX "~U_REGEX_RULE_SYNTAX" +#define ZED_U_REGEX_SET_CONTAINS_STRING "~U_REGEX_SET_CONTAINS_STRING" +#define ZED_U_REGEX_STACK_OVERFLOW "~U_REGEX_STACK_OVERFLOW" +#define ZED_U_REGEX_STOPPED_BY_CALLER "~U_REGEX_STOPPED_BY_CALLER" +#define ZED_U_REGEX_TIME_OUT "~U_REGEX_TIME_OUT" +#define ZED_U_REGEX_UNIMPLEMENTED "~U_REGEX_UNIMPLEMENTED" +#define ZED_REGEX_UNIMPLEMENTED "~REGEX_UNIMPLEMENTED" +#define ZED_REGEX_MISMATCHED_PAREN "~REGEX_MISMATCHED_PAREN" +#define ZED_REGEX_BROKEN_P_CONSTRUCT "~REGEX_BROKEN_P_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PL_CONSTRUCT "~REGEX_UNKNOWN_PL_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PM_CONSTRUCT "~REGEX_UNKNOWN_PM_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PN_CONSTRUCT "~REGEX_UNKNOWN_PN_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PP_CONSTRUCT "~REGEX_UNKNOWN_PP_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PZ_CONSTRUCT "~REGEX_UNKNOWN_PZ_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PS_CONSTRUCT "~REGEX_UNKNOWN_PS_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PC_CONSTRUCT "~REGEX_UNKNOWN_PC_CONSTRUCT" +#define ZED_REGEX_BROKEN_PIs_CONSTRUCT "~REGEX_BROKEN_PIs_CONSTRUCT" +#define ZED_REGEX_UNKNOWN_PIs_CONSTRUCT "~REGEX_UNKNOWN_PIs_CONSTRUCT" +#define ZED_REGEX_INVALID_UNICODE_CODEPOINT_u "~REGEX_INVALID_UNICODE_CODEPOINT_u" +#define ZED_REGEX_UNKNOWN_ESC_CHAR "~REGEX_UNKNOWN_ESC_CHAR" +#define ZED_REGEX_INVALID_BACK_REF "~REGEX_INVALID_BACK_REF" +#define ZED_REGEX_INVALID_ATOM_CHAR "~REGEX_INVALID_ATOM_CHAR" +#define ZED_REGEX_INVALID_SUBCLASS "~REGEX_INVALID_SUBCLASS" +#define ZED_REGEX_INVALID_USE_OF_SUBCLASS "~REGEX_INVALID_USE_OF_SUBCLASS" +#define ZED_REGEX_MULTICHAR_IN_CHAR_RANGE "~REGEX_MULTICHAR_IN_CHAR_RANGE" +#define ZED_REGEX_MISSING_CLOSE_BRACKET "~REGEX_MISSING_CLOSE_BRACKET" +#define ZED_REGEX_MAX_LT_MIN "~REGEX_MAX_LT_MIN" +#define ZED_UnaryArithOp "~UnaryArithOp" +#define ZED_UnbalancedChar_3 "~UnbalancedChar_3" +#define ZED_UnescapedChar_3 "~UnescapedChar_3" +#define ZED_UnexpectedElement "~UnexpectedElement" +#define ZED_VarValMustBeSingleItem_2 "~VarValMustBeSingleItem_2" +#define ZED_XMLSchema "~XMLSchema" +#define ZED_XUST0002_Transform "~XUST0002_Transform" +#define ZED_XUST0002_UDF_2 "~XUST0002_UDF_2" +#define ZED_ZeroLenURI "~ZeroLenURI" +#define ZED_error "~error" +#define ZED_format_integer_bad_picture_format "~format_integer_bad_picture_format" +#define ZED_format_integer_duplicated_optional_format_modifier "~format_integer_duplicated_optional_format_modifier" +#define ZED_format_integer_optional_format_modifier_not_closed "~format_integer_optional_format_modifier_not_closed" +#define ZED_format_integer_picture_empty "~format_integer_picture_empty" +#define ZED_format_integer_unknown_optional_format_modifier_character "~format_integer_unknown_optional_format_modifier_character" +#define ZED_format_integer_value_1_10 "~format_integer_value_1_10" +#define ZED_format_integer_value_1_20 "~format_integer_value_1_20" +#define ZED_format_integer_value_gt_3000 "~format_integer_value_gt_3000" +#define ZED_warning "~warning" +#define ZED_xqueryx_empty_content "~xqueryx_empty_content" +#define ZED_ParseFragmentOptionCombinationNotAllowed "~ParseFragmentOptionCombinationNotAllowed" +#define ZED_ParseFragmentInvalidOptions "~ParseFragmentInvalidOptions" +#define ZED_ParseFragmentDoctypeNotAllowed "~ParseFragmentDoctypeNotAllowed" +#define ZED_ParseFragmentDoctypeNotAllowedHere "~ParseFragmentDoctypeNotAllowedHere" +#define ZED_FormatNumberDuplicates "~FormatNumberDuplicates" +#define ZED_FormatNumberGroupingAdjacentToDecimal "~FormatNumberGroupingAdjacentToDecimal" +#define ZED_FormatNumberIntegerPart "~FormatNumberIntegerPart" +#define ZED_FormatNumberFractionalPart "~FormatNumberFractionalPart" +#define ZED_FormatNumberPercentPermille "~FormatNumberPercentPermille" +#define ZED_FormatNumberAtLeastOneOptionalOrDecimal "~FormatNumberAtLeastOneOptionalOrDecimal" +#define ZED_FUNCTION "~FUNCTION" +#define ZED_ANNOTATION "~ANNOTATION" + +#endif /* ZORBA_DIAGNOSTICS_ZED_KEYS */ +/* + * Local variables: + * mode: c++ + * End: + */ +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/diagnostics/qname.cpp zorba-2.8.0-0/src/diagnostics/qname.cpp --- zorba-2.7.0-0/src/diagnostics/qname.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/qname.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -112,7 +112,10 @@ switch ( name[1] ) { case 'A': return ZORBA_API; case 'C': return ZORBA_SERIALIZATION; - case 'D': return ZORBA_DDF; + case 'D': switch ( name[3] ) { + case 'P': return ZORBA_CORE_MODULE; + default : return ZORBA_DDF; + } case 'G': return ZORBA_DEBUGGER; case 'J': switch ( name[2] ) { case 'P': return JSON_PARSER; diff -Nru zorba-2.7.0-0/src/diagnostics/xquery_diagnostics.h zorba-2.8.0-0/src/diagnostics/xquery_diagnostics.h --- zorba-2.7.0-0/src/diagnostics/xquery_diagnostics.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/xquery_diagnostics.h 2013-01-16 18:28:18.000000000 +0000 @@ -95,8 +95,8 @@ /** * Adds a warning to the list of warnings. * - * @param exception The exception to add. The %XQueryDiagnostics takes - * ownership of the exception. + * @param warning The warning to add. The %XQueryDiagnostics takes ownership + * of the warning. */ void add_warning( XQueryWarning const *warning ) { warnings_.push_back( warning ); diff -Nru zorba-2.7.0-0/src/diagnostics/xquery_exception.cpp zorba-2.8.0-0/src/diagnostics/xquery_exception.cpp --- zorba-2.7.0-0/src/diagnostics/xquery_exception.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/xquery_exception.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -16,9 +16,14 @@ #include "stdafx.h" -#include -#include +// standard +#include +// Zorba +#include "util/fs_util.h" +#include "util/uri_util.h" + +// local #include "dict.h" #include "xquery_exception.h" @@ -72,11 +77,21 @@ return unique_ptr( new XQueryException( *this ) ); } +void XQueryException::set_applied( char const *uri, + line_type line, + column_type col, + line_type line_end, + column_type col_end ) { + if ( !uri || !*uri ) + uri = source_loc_.file(); + applied_loc_.set( uri, line, col, line_end, col_end ); +} + void XQueryException::set_source( char const *uri, line_type line, column_type col, line_type line_end, - column_type col_end) { + column_type col_end ) { source_loc_.set( uri, line, col, line_end, col_end ); } @@ -84,36 +99,48 @@ throw *this; } +static bool print_uri( ostream &o, char const *uri ) { + if ( uri && *uri ) { + switch ( uri::get_scheme( uri ) ) { + case uri::none: + case uri::file: + try { + o << '<' << fs::get_normalized_path( uri ) << '>'; + break; + } + catch ( ... ) { + // fall back to printing as a URI + } + // no break; + default: + o << '<' << uri << '>'; + } + return true; + } + return false; +} + ostream& XQueryException::print( ostream &o ) const { if ( has_source() ) { - - char const *const u = source_uri(); - if ( u && *u ) { - switch ( uri::get_scheme( u ) ) { - case uri::none: - case uri::file: - try { - o << '<' << fs::get_normalized_path( u ) << '>'; - break; - } - catch ( ... ) { - // fall back to printing as a URI - } - // no break; - default: - o << '<' << u << '>'; - } - } else + if ( !print_uri( o, source_uri() ) ) o << '(' << diagnostic::dict::lookup( ZED( NoSourceURI ) ) << ')'; - - if ( source_line() ) { - o << ':' << source_line(); - if ( source_column() ) - o << ',' << source_column(); - o << ':'; + o << ':' << source_line(); + if ( source_column() ) + o << ',' << source_column(); + + if ( has_applied() ) { + o << " (" << diagnostic::dict::lookup( ZED( AppliedAt ) ) << ' '; + if ( applied_uri() && ::strcmp( applied_uri(), source_uri() ) != 0 ) { + if ( print_uri( o, applied_uri() ) ) + o << ':'; + } + o << applied_line(); + if ( applied_column() ) + o << ',' << applied_column(); + o << ')'; } - o << ' '; + o << ": "; } return ZorbaException::print( o ); } @@ -131,11 +158,8 @@ XQueryException xe( diagnostic, raise_file, raise_line, message.c_str() ); if ( loc ) xe.set_source( - loc.file(), - loc.line(), - loc.column(), - loc.line_end(), - loc.column_end() ); + loc.file(), loc.line(), loc.column(), loc.line_end(), loc.column_end() + ); return xe; } @@ -151,14 +175,29 @@ new XQueryException( diagnostic, raise_file, raise_line, message.c_str() ); if ( loc ) xe->set_source( - loc.file(), - loc.line(), - loc.column(), - loc.line_end(), - loc.column_end() ); + loc.file(), loc.line(), loc.column(), loc.line_end(), loc.column_end() + ); return xe; } +void set_applied( ZorbaException &ze, char const *file, + XQueryException::line_type line, + XQueryException::column_type col, + XQueryException::line_type line_end, + XQueryException::column_type col_end, + bool overwrite ) { + if ( XQueryException *const xe = dynamic_cast( &ze ) ) { + if ( !xe->has_applied() || overwrite ) + xe->set_applied( file, line, col, line_end, col_end ); + } else { + XQueryException new_xe( + ze.diagnostic(), ze.raise_file(), ze.raise_line(), ze.what() + ); + new_xe.set_applied( file, line, col, line_end, col_end ); + throw new_xe; + } +} + void set_source( ZorbaException &ze, char const *file, XQueryException::line_type line, XQueryException::column_type col, diff -Nru zorba-2.7.0-0/src/diagnostics/xquery_exception.h zorba-2.8.0-0/src/diagnostics/xquery_exception.h --- zorba-2.7.0-0/src/diagnostics/xquery_exception.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/xquery_exception.h 2013-01-16 18:28:18.000000000 +0000 @@ -232,6 +232,106 @@ } } +////////// XQuery diagnostic "applied at" location //////////////////////////// + +/** + * Sets the XQuery source location of the given ZorbaException but only if it's + * actually an XQueryException. If it's actually a ZorbaException, constructs + * a new XQueryException (copying the information from the ZorbaException) and + * throws it. + * + * @param ze The ZorbaException to set the location of. + * @param file The XQuery file name. + * @param line The line number. + * @param col The column number. + * @param line_end The end line number. + * @param col_end The end column number. + * @param overwrite If \c false, sets the location only if the exception + * doesn't already have one; if \c true, always sets the location even if the + * exception already has one. + */ +void set_applied( ZorbaException &ze, char const *file, + XQueryException::line_type line, + XQueryException::column_type col, + XQueryException::line_type line_end, + XQueryException::column_type col_end, + bool overwrite = true ); + +/** + * Sets the XQuery source location of the given ZorbaException but only if it's + * actually an XQueryException. + * + * @tparam StringType The \a file string type. + * @param ze The ZorbaException to set the location of. + * @param file The XQuery file name. + * @param line The line number. + * @param col The column number. + * @param line_end The end line number. + * @param col_end The end column number. + * @param overwrite If \c false, sets the location only if the exception + * doesn't already have one; if \c true, always sets the location even if the + * exception already has one. + */ +template inline +void set_applied( ZorbaException &ze, StringType const &file, + XQueryException::line_type line, + XQueryException::column_type col, + XQueryException::line_type line_end, + XQueryException::column_type col_end, + bool overwrite = true ) { + set_applied( ze, file.c_str(), line, col, line_end, col_end, overwrite ); +} + +/** + * Sets the XQuery source location of the given ZorbaException but only if it's + * actually an XQueryException. + * + * @param ze The ZorbaException to set the location of. + * @param loc The query location. + * @param overwrite If \c false, sets the location only if the exception + * doesn't already have one; if \c true, always sets the location even if the + * exception already has one. + */ +inline void set_applied( ZorbaException &ze, QueryLoc const &loc, + bool overwrite = true ) { + set_applied( + ze, + loc.getFilename(), + loc.getLineBegin(), + loc.getColumnBegin(), + loc.getLineEnd(), + loc.getColumnEnd(), + overwrite + ); +} + +/** + * Sets the XQuery source location of the given ZorbaException but only if it's + * actually an XQueryException. + * + * @param to The ZorbaException to set the location of. + * @param from The ZorbaException to get the location from but only if it's + * actually an XQueryException. + * @param overwrite If \c false, sets the location only if the exception + * doesn't already have one; if \c true, always sets the location even if the + * exception already has one. + */ +inline void set_applied( ZorbaException &to, ZorbaException const &from, + bool overwrite = true ) { + if ( XQueryException const *const xe = + dynamic_cast( &from ) ) { + set_applied( + to, + xe->source_uri(), + xe->source_line(), + xe->source_column(), + xe->source_line_end(), + xe->source_column_end(), + overwrite + ); + } +} + /////////////////////////////////////////////////////////////////////////////// } // namespace zorba diff -Nru zorba-2.7.0-0/src/diagnostics/xquery_stack_trace.cpp zorba-2.8.0-0/src/diagnostics/xquery_stack_trace.cpp --- zorba-2.7.0-0/src/diagnostics/xquery_stack_trace.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/diagnostics/xquery_stack_trace.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -15,12 +15,16 @@ */ #include "stdafx.h" +#include "xquery_stack_trace.h" + #include +#include +#include +#include #include #include "diagnostic.h" -#include "xquery_stack_trace.h" namespace zorba { @@ -56,6 +60,17 @@ XQueryStackTrace::fn_arity_type fn_arity, ZorbaException &ze ) { + store::Item_t lPrintedFunctionName; + if (fn_name == NULL) + { + GENV_STORE.getItemFactory()->createQName( + lPrintedFunctionName, + "", + "inline", + "anonymous"); + } else { + lPrintedFunctionName = fn_name; + } if ( XQueryException *const xe = dynamic_cast( &ze ) ) { XQueryStackTrace &trace = xe->query_trace(); @@ -77,7 +92,7 @@ trace.push( XQueryStackTrace::Entry( - diagnostic::to_QName( fn_name ), + diagnostic::to_QName( lPrintedFunctionName ), fn_arity, call_loc.getFilename().c_str(), call_loc.getLineBegin(), diff -Nru zorba-2.7.0-0/src/functions/func_accessors_impl.cpp zorba-2.8.0-0/src/functions/func_accessors_impl.cpp --- zorba-2.7.0-0/src/functions/func_accessors_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_accessors_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -64,14 +64,6 @@ } -bool fn_data::mustCopyInputNodes(expr* fo, csize input) const -{ - static_context* sctx = fo->get_sctx(); - - return (sctx->construction_mode() != StaticContextConsts::cons_preserve); -} - - xqtref_t fn_data::getReturnType(const fo_expr* caller) const { const QueryLoc& loc = caller->get_loc(); @@ -113,6 +105,10 @@ getListItemType(); return tm->create_type(*itemType, TypeConstants::QUANT_STAR); } + else if (TypeOps::is_equal(tm, *cType, *RTM.UNTYPED_ATOMIC_TYPE_ONE)) + { + return tm->create_builtin_atomic_type(store::XS_UNTYPED_ATOMIC, q); + } else if (TypeOps::is_equal(tm, *cType, *RTM.UNTYPED_TYPE)) { return tm->create_builtin_atomic_type(store::XS_UNTYPED_ATOMIC, q); diff -Nru zorba-2.7.0-0/src/functions/func_arithmetic.cpp zorba-2.8.0-0/src/functions/func_arithmetic.cpp --- zorba-2.7.0-0/src/functions/func_arithmetic.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_arithmetic.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -126,22 +126,22 @@ switch (theKind) { case FunctionConsts::OP_ADD_2: - f1 = GET_BUILTIN_FUNCTION(OP_NUMERIC_ADD_2); + f1 = BUILTIN_FUNC(OP_NUMERIC_ADD_2); break; case FunctionConsts::OP_SUBTRACT_2: - f1 = GET_BUILTIN_FUNCTION(OP_NUMERIC_SUBTRACT_2); + f1 = BUILTIN_FUNC(OP_NUMERIC_SUBTRACT_2); break; case FunctionConsts::OP_MULTIPLY_2: - f1 = GET_BUILTIN_FUNCTION(OP_NUMERIC_MULTIPLY_2); + f1 = BUILTIN_FUNC(OP_NUMERIC_MULTIPLY_2); break; case FunctionConsts::OP_DIVIDE_2: - f1 = GET_BUILTIN_FUNCTION(OP_NUMERIC_DIVIDE_2); + f1 = BUILTIN_FUNC(OP_NUMERIC_DIVIDE_2); break; case FunctionConsts::OP_INTEGER_DIVIDE_2: - f1 = GET_BUILTIN_FUNCTION(OP_NUMERIC_INTEGER_DIVIDE_2); + f1 = BUILTIN_FUNC(OP_NUMERIC_INTEGER_DIVIDE_2); break; case FunctionConsts::OP_MOD_2: - f1 = GET_BUILTIN_FUNCTION(OP_NUMERIC_MOD_2); + f1 = BUILTIN_FUNC(OP_NUMERIC_MOD_2); break; default: ZORBA_ASSERT(false); diff -Nru zorba-2.7.0-0/src/functions/func_booleans_impl.cpp zorba-2.8.0-0/src/functions/func_booleans_impl.cpp --- zorba-2.7.0-0/src/functions/func_booleans_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_booleans_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -47,10 +47,9 @@ : function(sig, kind) { + setFlag(FunctionConsts::IsComparison); } - bool isComparisonFunction() const { return true; } - virtual const char* comparison_name() const { return ""; } virtual function* toValueComp(static_context *) const { return NULL; } @@ -94,11 +93,10 @@ static_context* sctx, const std::vector& argTypes) const { - const TypeManager* tm = sctx->get_typemanager(); xqtref_t t0 = argTypes[0]; xqtref_t t1 = argTypes[1]; - if (! (TypeOps::is_builtin_atomic(tm, *t0) && TypeOps::is_builtin_atomic(tm, *t1))) + if (! (t0->isBuiltinAtomicOne() && t1->isBuiltinAtomicOne())) return NULL; store::SchemaTypeCode tc0 = TypeOps::get_atomic_type_code(*t0); @@ -168,22 +166,22 @@ switch (kind) \ { \ case FunctionConsts::OP_VALUE_EQUAL_2: \ - return GET_BUILTIN_FUNCTION(OP_VALUE_EQUAL_##type##_2); \ + return BUILTIN_FUNC(OP_VALUE_EQUAL_##type##_2); \ \ case FunctionConsts::OP_VALUE_NOT_EQUAL_2: \ - return GET_BUILTIN_FUNCTION(OP_VALUE_NOT_EQUAL_##type##_2); \ + return BUILTIN_FUNC(OP_VALUE_NOT_EQUAL_##type##_2); \ \ case FunctionConsts::OP_VALUE_LESS_EQUAL_2: \ - return GET_BUILTIN_FUNCTION(OP_VALUE_LESS_EQUAL_##type##_2); \ + return BUILTIN_FUNC(OP_VALUE_LESS_EQUAL_##type##_2); \ \ case FunctionConsts::OP_VALUE_LESS_2: \ - return GET_BUILTIN_FUNCTION(OP_VALUE_LESS_##type##_2); \ + return BUILTIN_FUNC(OP_VALUE_LESS_##type##_2); \ \ case FunctionConsts::OP_VALUE_GREATER_EQUAL_2: \ - return GET_BUILTIN_FUNCTION(OP_VALUE_GREATER_EQUAL_##type##_2); \ + return BUILTIN_FUNC(OP_VALUE_GREATER_EQUAL_##type##_2); \ \ case FunctionConsts::OP_VALUE_GREATER_2: \ - return GET_BUILTIN_FUNCTION(OP_VALUE_GREATER_##type##_2); \ + return BUILTIN_FUNC(OP_VALUE_GREATER_##type##_2); \ \ default: \ ZORBA_ASSERT(false); \ @@ -194,11 +192,10 @@ static_context* sctx, const std::vector& argTypes) const { - const TypeManager* tm = sctx->get_typemanager(); xqtref_t t0 = argTypes[0]; xqtref_t t1 = argTypes[1]; - if (TypeOps::is_builtin_simple(tm, *t0) && TypeOps::is_builtin_simple(tm, *t1)) + if (t0->isBuiltinAtomicAny() && t1->isBuiltinAtomicAny()) { store::SchemaTypeCode tc0 = TypeOps::get_atomic_type_code(*t0); store::SchemaTypeCode tc1 = TypeOps::get_atomic_type_code(*t1); @@ -389,7 +386,7 @@ function* toValueComp(static_context* sctx) const { - return GET_BUILTIN_FUNCTION(OP_VALUE_EQUAL_2); + return BUILTIN_FUNC(OP_VALUE_EQUAL_2); } CompareConsts::CompareType comparisonKind() const @@ -427,7 +424,7 @@ function* toValueComp(static_context* sctx) const { - return GET_BUILTIN_FUNCTION(OP_VALUE_NOT_EQUAL_2); + return BUILTIN_FUNC(OP_VALUE_NOT_EQUAL_2); } }; @@ -460,7 +457,7 @@ function* toValueComp(static_context* sctx) const { - return GET_BUILTIN_FUNCTION(OP_VALUE_LESS_EQUAL_2); + return BUILTIN_FUNC(OP_VALUE_LESS_EQUAL_2); } }; @@ -493,7 +490,7 @@ function* toValueComp(static_context* sctx) const { - return GET_BUILTIN_FUNCTION(OP_VALUE_LESS_2); + return BUILTIN_FUNC(OP_VALUE_LESS_2); } }; @@ -526,7 +523,7 @@ function* toValueComp(static_context* sctx) const { - return GET_BUILTIN_FUNCTION(OP_VALUE_GREATER_EQUAL_2); + return BUILTIN_FUNC(OP_VALUE_GREATER_EQUAL_2); } }; @@ -559,7 +556,7 @@ function* toValueComp(static_context* sctx) const { - return GET_BUILTIN_FUNCTION(OP_VALUE_GREATER_2); + return BUILTIN_FUNC(OP_VALUE_GREATER_2); } }; diff -Nru zorba-2.7.0-0/src/functions/func_collections_impl.cpp zorba-2.8.0-0/src/functions/func_collections_impl.cpp --- zorba-2.7.0-0/src/functions/func_collections_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_collections_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -20,9 +20,14 @@ #include "compiler/expression/expr_consts.h" #include "compiler/expression/expr_base.h" +#include "compiler/expression/fo_expr.h" + #include "compiler/expression/pragma.h" #include "compiler/api/compilercb.h" +#include "zorbamisc/ns_consts.h" + + namespace zorba { @@ -63,6 +68,39 @@ /******************************************************************************* ********************************************************************************/ +xqtref_t static_collections_dml_collection::getReturnType(const fo_expr* caller) const +{ + if (getName()->getNamespace() == + static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS) + { + return theSignature.returnType(); + } + + static_context* sctx = caller->get_sctx(); + + const store::Item* qname = caller->get_arg(0)->getQName(sctx); + + if (qname != NULL) + { + const StaticallyKnownCollection* collection = sctx->lookup_collection(qname); + + if (collection != NULL) + { + return collection->getCollectionType(); + } + else + { + RAISE_ERROR(zerr::ZDDY0001_COLLECTION_NOT_DECLARED, caller->get_loc(), + ERROR_PARAMS(qname->getStringValue())); + } + } + else + { + return theSignature.returnType(); + } +} + + PlanIter_t static_collections_dml_collection::codegen( CompilerCB*, static_context* sctx, @@ -139,14 +177,14 @@ /******************************************************************************* ********************************************************************************/ -void -zorba::static_collections_dml_insert_nodes::processPragma( +void zorba::static_collections_dml_insert_nodes::processPragma( zorba::expr* e, const std::vector& p) const { processPragmaInternal(e, p); } + PlanIter_t static_collections_dml_insert_nodes::codegen( CompilerCB* cb, static_context* sctx, @@ -366,6 +404,7 @@ processPragmaInternal(e, p); } + PlanIter_t static_collections_dml_apply_insert_nodes_last::codegen( CompilerCB* cb, static_context* sctx, @@ -547,6 +586,35 @@ /******************************************************************************* ********************************************************************************/ +PlanIter_t static_collections_dml_edit::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + const zstring& ns = getName()->getNamespace(); + + bool const lDynamic = + ns == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS; + + bool const lCopy = !hasNoCopyPragma(ann); + + return new ZorbaEditNodesIterator(sctx, loc, argv, lDynamic, lCopy); +} + + +void +zorba::static_collections_dml_edit::processPragma( + zorba::expr* e, + const std::vector& p) const +{ + processPragmaInternal(e, p); +} + +/******************************************************************************* + +********************************************************************************/ PlanIter_t static_collections_dml_truncate::codegen( CompilerCB*, static_context* sctx, diff -Nru zorba-2.7.0-0/src/functions/func_ft_module_impl.h zorba-2.8.0-0/src/functions/func_ft_module_impl.h --- zorba-2.7.0-0/src/functions/func_ft_module_impl.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_ft_module_impl.h 2013-01-16 18:28:18.000000000 +0000 @@ -33,11 +33,12 @@ class full_text_tokenize_node : public function { public: - full_text_tokenize_node(const signature& sig, - FunctionConsts::FunctionKind kind) : + full_text_tokenize_node( + const signature& sig, + FunctionConsts::FunctionKind kind) + : function(sig, kind) { - } // Mark the function as accessing the dyn ctx so that it won't be @@ -45,6 +46,8 @@ // uses the store to get access to the tokenizer provider. bool accessesDynCtx() const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 0; } + CODEGEN_DECL(); }; @@ -53,11 +56,12 @@ class full_text_tokenize_nodes : public function { public: - full_text_tokenize_nodes(const signature& sig, - FunctionConsts::FunctionKind kind) : + full_text_tokenize_nodes( + const signature& sig, + FunctionConsts::FunctionKind kind) + : function(sig, kind) { - } // Mark the function as accessing the dyn ctx so that it won't be @@ -65,6 +69,8 @@ // uses the store to get access to the tokenizer provider. bool accessesDynCtx() const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + CODEGEN_DECL(); }; @@ -73,11 +79,12 @@ class full_text_tokenizer_properties : public function { public: - full_text_tokenizer_properties(const signature& sig, FunctionConsts::FunctionKind kind) + full_text_tokenizer_properties( + const signature& sig, + FunctionConsts::FunctionKind kind) : function(sig, kind) { - } // Mark the function as accessing the dyn ctx so that it won't be @@ -93,11 +100,12 @@ class full_text_current_compare_options : public function { public: - full_text_current_compare_options(const signature& sig, FunctionConsts::FunctionKind kind) + full_text_current_compare_options( + const signature& sig, + FunctionConsts::FunctionKind kind) : function(sig, kind) { - } CODEGEN_DECL(); diff -Nru zorba-2.7.0-0/src/functions/func_jsoniq_functions_impl.cpp zorba-2.8.0-0/src/functions/func_jsoniq_functions_impl.cpp --- zorba-2.7.0-0/src/functions/func_jsoniq_functions_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_jsoniq_functions_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -41,9 +41,7 @@ { static_context* sctx = fo->get_sctx(); - if (producer == 2 && - (sctx->preserve_ns() || - sctx->construction_mode() != StaticContextConsts::cons_preserve)) + if (producer == 2 && sctx->preserve_ns() && sctx->inherit_ns()) { return true; } @@ -57,7 +55,7 @@ ********************************************************************************/ bool op_zorba_json_object_insert::mustCopyInputNodes(expr* fo, csize producer) const { - if (producer == 2 && fo->get_sctx()->preserve_ns()) + if (producer == 2 && fo->get_sctx()->preserve_ns() && fo->get_sctx()->inherit_ns()) { return true; } @@ -73,9 +71,7 @@ { static_context* sctx = fo->get_sctx(); - if (producer == 2 && - (sctx->preserve_ns() || - sctx->construction_mode() != StaticContextConsts::cons_preserve)) + if (producer == 2 && sctx->preserve_ns() && sctx->inherit_ns()) { return true; } @@ -105,9 +101,7 @@ { static_context* sctx = fo->get_sctx(); - if (producer == 2 && - (sctx->preserve_ns() || - sctx->construction_mode() != StaticContextConsts::cons_preserve)) + if (producer == 2 && sctx->preserve_ns() && sctx->inherit_ns()) { return true; } diff -Nru zorba-2.7.0-0/src/functions/func_jsoniq_functions_impl.h zorba-2.8.0-0/src/functions/func_jsoniq_functions_impl.h --- zorba-2.7.0-0/src/functions/func_jsoniq_functions_impl.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_jsoniq_functions_impl.h 2013-01-16 18:28:18.000000000 +0000 @@ -30,6 +30,11 @@ void populate_context_jsoniq_functions_impl(static_context* sctx); +/******************************************************************************* + jn:object($objs as object()*) as object() + + It performs object construction by unioning the input objects. +********************************************************************************/ class jn_object : public function { public: @@ -39,7 +44,7 @@ { } - bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } CODEGEN_DECL(); }; diff -Nru zorba-2.7.0-0/src/functions/func_node_sort_distinct.cpp zorba-2.8.0-0/src/functions/func_node_sort_distinct.cpp --- zorba-2.7.0-0/src/functions/func_node_sort_distinct.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_node_sort_distinct.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -115,17 +115,17 @@ { if (distinct && noa) { - return GET_BUILTIN_FUNCTION(OP_DISTINCT_NODES_OR_ATOMICS_1); + return BUILTIN_FUNC(OP_DISTINCT_NODES_OR_ATOMICS_1); } else if (distinct) { return (getKind() == FunctionConsts::OP_CHECK_DISTINCT_NODES_1 ? - GET_BUILTIN_FUNCTION(OP_CHECK_DISTINCT_NODES_1) : - GET_BUILTIN_FUNCTION(OP_DISTINCT_NODES_1)); + BUILTIN_FUNC(OP_CHECK_DISTINCT_NODES_1) : + BUILTIN_FUNC(OP_DISTINCT_NODES_1)); } else if (noa) { - return GET_BUILTIN_FUNCTION(OP_EITHER_NODES_OR_ATOMICS_1); + return BUILTIN_FUNC(OP_EITHER_NODES_OR_ATOMICS_1); } else { @@ -135,26 +135,26 @@ else if (distinct && noa) { return (myActions[SORT_ASC] ? - GET_BUILTIN_FUNCTION(OP_SORT_DISTINCT_NODES_ASC_OR_ATOMICS_1) : - GET_BUILTIN_FUNCTION(OP_SORT_DISTINCT_NODES_DESC_OR_ATOMICS_1)); + BUILTIN_FUNC(OP_SORT_DISTINCT_NODES_ASC_OR_ATOMICS_1) : + BUILTIN_FUNC(OP_SORT_DISTINCT_NODES_DESC_OR_ATOMICS_1)); } else if (distinct) { return (myActions[SORT_ASC] ? - GET_BUILTIN_FUNCTION(OP_SORT_DISTINCT_NODES_ASC_1) : - GET_BUILTIN_FUNCTION(OP_SORT_DISTINCT_NODES_DESC_1)); + BUILTIN_FUNC(OP_SORT_DISTINCT_NODES_ASC_1) : + BUILTIN_FUNC(OP_SORT_DISTINCT_NODES_DESC_1)); } else if (noa) { return (myActions[SORT_ASC] ? - GET_BUILTIN_FUNCTION(OP_SORT_NODES_ASC_OR_ATOMICS_1) : - GET_BUILTIN_FUNCTION(OP_SORT_NODES_DESC_OR_ATOMICS_1)); + BUILTIN_FUNC(OP_SORT_NODES_ASC_OR_ATOMICS_1) : + BUILTIN_FUNC(OP_SORT_NODES_DESC_OR_ATOMICS_1)); } else { return (myActions[SORT_ASC] ? - GET_BUILTIN_FUNCTION(OP_SORT_NODES_ASC_1) : - GET_BUILTIN_FUNCTION(OP_SORT_NODES_DESC_1)); + BUILTIN_FUNC(OP_SORT_NODES_ASC_1) : + BUILTIN_FUNC(OP_SORT_NODES_DESC_1)); } } diff -Nru zorba-2.7.0-0/src/functions/func_nodes_impl.cpp zorba-2.8.0-0/src/functions/func_nodes_impl.cpp --- zorba-2.7.0-0/src/functions/func_nodes_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_nodes_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -45,10 +45,8 @@ ********************************************************************************/ bool fn_zorba_node_copy::mustCopyInputNodes(expr* fo, csize input) const { - static_context* lSctx = fo->get_sctx(); - return - (lSctx->preserve_ns() == false || - lSctx->construction_mode() == StaticContextConsts::cons_strip); + static_context* sctx = fo->get_sctx(); + return (sctx->preserve_ns() && sctx->inherit_ns()); } } /* namespace zorba */ diff -Nru zorba-2.7.0-0/src/functions/func_numerics_impl.cpp zorba-2.8.0-0/src/functions/func_numerics_impl.cpp --- zorba-2.7.0-0/src/functions/func_numerics_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_numerics_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -34,16 +34,16 @@ switch (kind) \ { \ case FunctionConsts::OP_NUMERIC_ADD_2: \ - return GET_BUILTIN_FUNCTION(OP_NUMERIC_ADD_##type##_2); \ + return BUILTIN_FUNC(OP_NUMERIC_ADD_##type##_2); \ \ case FunctionConsts::OP_NUMERIC_SUBTRACT_2: \ - return GET_BUILTIN_FUNCTION(OP_NUMERIC_SUBTRACT_##type##_2); \ + return BUILTIN_FUNC(OP_NUMERIC_SUBTRACT_##type##_2); \ \ case FunctionConsts::OP_NUMERIC_MULTIPLY_2: \ - return GET_BUILTIN_FUNCTION(OP_NUMERIC_MULTIPLY_##type##_2); \ + return BUILTIN_FUNC(OP_NUMERIC_MULTIPLY_##type##_2); \ \ case FunctionConsts::OP_NUMERIC_DIVIDE_2: \ - return GET_BUILTIN_FUNCTION(OP_NUMERIC_DIVIDE_##type##_2); \ + return BUILTIN_FUNC(OP_NUMERIC_DIVIDE_##type##_2); \ \ default: \ ZORBA_ASSERT(false); \ @@ -586,14 +586,14 @@ { if (TypeOps::is_subtype(tm, *argType, *rtm.DOUBLE_TYPE_ONE)) { - return GET_BUILTIN_FUNCTION(OP_DOUBLE_UNARY_PLUS_1); + return BUILTIN_FUNC(OP_DOUBLE_UNARY_PLUS_1); } } else if (getKind() == FunctionConsts::OP_UNARY_MINUS_1) { if (TypeOps::is_subtype(tm, *argType, *rtm.DOUBLE_TYPE_ONE)) { - return GET_BUILTIN_FUNCTION(OP_DOUBLE_UNARY_MINUS_1); + return BUILTIN_FUNC(OP_DOUBLE_UNARY_MINUS_1); } } diff -Nru zorba-2.7.0-0/src/functions/func_schema_impl.cpp zorba-2.8.0-0/src/functions/func_schema_impl.cpp --- zorba-2.7.0-0/src/functions/func_schema_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_schema_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -14,6 +14,7 @@ * limitations under the License. */ +#include "stdafx.h" #include "functions/func_schema.h" #include "compiler/expression/expr_base.h" @@ -33,4 +34,13 @@ } +/******************************************************************************* + +********************************************************************************/ +bool fn_zorba_schema_is_validated::mustCopyInputNodes(expr* fo, csize producer) const +{ + return (fo->get_sctx()->construction_mode() == StaticContextConsts::cons_strip); +} + + } diff -Nru zorba-2.7.0-0/src/functions/func_sequences_impl.cpp zorba-2.8.0-0/src/functions/func_sequences_impl.cpp --- zorba-2.7.0-0/src/functions/func_sequences_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_sequences_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -32,6 +32,7 @@ #include "compiler/expression/expr.h" #include "compiler/expression/fo_expr.h" +#include "compiler/expression/var_expr.h" #include "compiler/expression/path_expr.h" #include "types/typeops.h" @@ -43,6 +44,148 @@ /******************************************************************************* ********************************************************************************/ +xqtref_t fn_unordered::getReturnType(const fo_expr* caller) const +{ + return caller->get_arg(0)->get_return_type(); +} + + +BoolAnnotationValue fn_unordered::ignoresSortedNodes(expr* fo, csize input) const +{ + return ANNOTATION_TRUE; +} + + +BoolAnnotationValue fn_unordered::ignoresDuplicateNodes(expr* fo, csize input) const +{ + return fo->getIgnoresDuplicateNodes(); +} + + +PlanIter_t fn_unordered::codegen( + CompilerCB* /*cb*/, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ) const +{ + return argv[0]; +} + + +/******************************************************************************* + +********************************************************************************/ +xqtref_t fn_exactly_one_noraise::getReturnType(const fo_expr* caller) const +{ + TypeManager* tm = caller->get_type_manager(); + + xqtref_t srcType = caller->get_arg(0)->get_return_type(); + + if (theRaiseError) + return TypeOps::prime_type(tm, *srcType); + else + return function::getReturnType(caller); +} + + +PlanIter_t fn_exactly_one_noraise::codegen( + CompilerCB* aCb, + static_context* aSctx, + const QueryLoc& aLoc, + std::vector& aArgs, + expr& aAnn) const +{ + return new FnExactlyOneIterator(aSctx, + aLoc, + aArgs, + theRaiseError, + testFlag(FunctionConsts::DoDistinct)); +} + + +/******************************************************************************* + +********************************************************************************/ +PlanIter_t fn_union::codegen( + CompilerCB* /*cb*/, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new FnConcatIterator(sctx, loc, argv); +} + + +/******************************************************************************* + +********************************************************************************/ +BoolAnnotationValue fn_intersect::ignoresSortedNodes(expr* fo, csize input) const +{ + if (input == 0) + return fo->getIgnoresSortedNodes(); + + return ANNOTATION_TRUE; +} + + +BoolAnnotationValue fn_intersect::ignoresDuplicateNodes(expr* fo, csize input) const +{ + if (input == 0) + return fo->getIgnoresDuplicateNodes(); + + return ANNOTATION_TRUE; +} + + +PlanIter_t fn_intersect::codegen( + CompilerCB* /*cb*/, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new HashSemiJoinIterator(sctx, loc, argv); +} + + +/******************************************************************************* + +********************************************************************************/ +BoolAnnotationValue fn_except::ignoresSortedNodes(expr* fo, csize input) const +{ + if (input == 0) + return fo->getIgnoresSortedNodes(); + + return ANNOTATION_TRUE; +} + + +BoolAnnotationValue fn_except::ignoresDuplicateNodes(expr* fo, csize input) const +{ + if (input == 0) + return fo->getIgnoresDuplicateNodes(); + + return ANNOTATION_TRUE; +} + + +PlanIter_t fn_except::codegen( + CompilerCB* /*cb*/, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + // TODO: use SortAntiJoinIterator when available (trac ticket 254) + return new HashSemiJoinIterator(sctx, loc, argv, true); +} + + +/******************************************************************************* + +********************************************************************************/ xqtref_t op_concatenate::getReturnType(const fo_expr* caller) const { TypeManager* tm = caller->get_type_manager(); @@ -608,32 +751,6 @@ /******************************************************************************* ********************************************************************************/ -BoolAnnotationValue fn_unordered::ignoresSortedNodes(expr* fo, csize input) const -{ - return ANNOTATION_TRUE; -} - - -BoolAnnotationValue fn_unordered::ignoresDuplicateNodes(expr* fo, csize input) const -{ - return fo->getIgnoresDuplicateNodes(); -} - - -PlanIter_t fn_unordered::codegen( - CompilerCB* /*cb*/, - static_context* sctx, - const QueryLoc& loc, - std::vector& argv, - expr& ) const -{ - return argv[0]; -} - - -/******************************************************************************* - -********************************************************************************/ xqtref_t fn_zero_or_one::getReturnType(const fo_expr* caller) const { TypeManager* tm = caller->get_type_manager(); @@ -693,85 +810,10 @@ /******************************************************************************* ********************************************************************************/ -xqtref_t fn_exactly_one_noraise::getReturnType(const fo_expr* caller) const -{ - TypeManager* tm = caller->get_type_manager(); - - xqtref_t srcType = caller->get_arg(0)->get_return_type(); - - if (theRaiseError) - return TypeOps::prime_type(tm, *srcType); - else - return function::getReturnType(caller); -} - - -PlanIter_t fn_exactly_one_noraise::codegen( - CompilerCB* aCb, - static_context* aSctx, - const QueryLoc& aLoc, - std::vector& aArgs, - expr& aAnn) const -{ - return new FnExactlyOneIterator(aSctx, - aLoc, - aArgs, - theRaiseError, - testFlag(FunctionConsts::DoDistinct)); -} - - -/******************************************************************************* - -********************************************************************************/ -PlanIter_t fn_union::codegen( - CompilerCB* /*cb*/, - static_context* sctx, - const QueryLoc& loc, - std::vector& argv, - expr& ann) const +bool fn_deep_equal::mustCopyInputNodes(expr* fo, csize producer) const { - return new FnConcatIterator(sctx, loc, argv); -} - - -/******************************************************************************* - -********************************************************************************/ -PlanIter_t fn_intersect::codegen( - CompilerCB* /*cb*/, - static_context* sctx, - const QueryLoc& loc, - std::vector& argv, - expr& ann) const -{ -#if 0 // we can't access PRODUCES_* from the inputs, must rethink - bool distinct = ann.get_annotation (Annotations::IGNORES_DUP_NODES) != TSVAnnotationValue::TRUE_VAL; - bool sort = ann.get_annotation (Annotations::IGNORES_SORTED_NODES) != TSVAnnotationValue::TRUE_VAL; - - std::vector inputs; - for (std::vector::iterator i = argv.begin (); - i != argv.end (); i++) - inputs.push_back (new NodeSortIterator (loc, *i, true, distinct, false)); - return new SortSemiJoinIterator(loc, inputs); -#endif - - return new HashSemiJoinIterator(sctx, loc, argv); -} - - -/******************************************************************************* - -********************************************************************************/ -PlanIter_t fn_except::codegen( - CompilerCB* /*cb*/, - static_context* sctx, - const QueryLoc& loc, - std::vector& argv, - expr& ann) const -{ - // TODO: use SortAntiJoinIterator when available (trac ticket 254) - return new HashSemiJoinIterator(sctx, loc, argv, true); + return (producer < 2 && + fo->get_sctx()->construction_mode() == StaticContextConsts::cons_strip); } @@ -845,32 +887,32 @@ if (TypeOps::is_subtype(tm, *argType, *rtm.UNTYPED_ATOMIC_TYPE_STAR)) { return (getArity() == 1 ? - GET_BUILTIN_FUNCTION(OP_SUM_DOUBLE_1) : - GET_BUILTIN_FUNCTION(OP_SUM_DOUBLE_2)); + BUILTIN_FUNC(OP_SUM_DOUBLE_1) : + BUILTIN_FUNC(OP_SUM_DOUBLE_2)); } else if (TypeOps::is_subtype(tm, *argType, *rtm.DOUBLE_TYPE_STAR)) { return (getArity() == 1 ? - GET_BUILTIN_FUNCTION(OP_SUM_DOUBLE_1) : - GET_BUILTIN_FUNCTION(OP_SUM_DOUBLE_2)); + BUILTIN_FUNC(OP_SUM_DOUBLE_1) : + BUILTIN_FUNC(OP_SUM_DOUBLE_2)); } else if (TypeOps::is_subtype(tm, *argType, *rtm.FLOAT_TYPE_STAR)) { return (getArity() == 1 ? - GET_BUILTIN_FUNCTION(OP_SUM_FLOAT_1) : - GET_BUILTIN_FUNCTION(OP_SUM_FLOAT_2)); + BUILTIN_FUNC(OP_SUM_FLOAT_1) : + BUILTIN_FUNC(OP_SUM_FLOAT_2)); } else if (TypeOps::is_subtype(tm, *argType, *rtm.INTEGER_TYPE_STAR)) { return (getArity() == 1 ? - GET_BUILTIN_FUNCTION(OP_SUM_INTEGER_1) : - GET_BUILTIN_FUNCTION(OP_SUM_INTEGER_2)); + BUILTIN_FUNC(OP_SUM_INTEGER_1) : + BUILTIN_FUNC(OP_SUM_INTEGER_2)); } else if (TypeOps::is_subtype(tm, *argType, *rtm.DECIMAL_TYPE_STAR)) { return (getArity() == 1 ? - GET_BUILTIN_FUNCTION(OP_SUM_DECIMAL_1) : - GET_BUILTIN_FUNCTION(OP_SUM_DECIMAL_2)); + BUILTIN_FUNC(OP_SUM_DECIMAL_1) : + BUILTIN_FUNC(OP_SUM_DECIMAL_2)); } else { diff -Nru zorba-2.7.0-0/src/functions/func_sequences_impl.h zorba-2.8.0-0/src/functions/func_sequences_impl.h --- zorba-2.7.0-0/src/functions/func_sequences_impl.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/func_sequences_impl.h 2013-01-16 18:28:18.000000000 +0000 @@ -21,9 +21,8 @@ #include "functions/function_impl.h" -#include "compiler/expression/fo_expr.h" - -namespace zorba { +namespace zorba +{ void populate_context_sequences_impl(static_context* sctx); @@ -40,10 +39,7 @@ { } - xqtref_t getReturnType(const fo_expr* caller) const - { - return caller->get_arg(0)->get_return_type(); - } + xqtref_t getReturnType(const fo_expr* caller) const; bool isMap(csize input) const { @@ -206,21 +202,9 @@ return producer == 0; } - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize input) const - { - if (input == 0) - return fo->getIgnoresSortedNodes(); - - return ANNOTATION_TRUE; - } - - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize input) const - { - if (input == 0) - return fo->getIgnoresDuplicateNodes(); + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize input) const; - return ANNOTATION_TRUE; - } + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize input) const; bool propagatesInputNodes(expr* fo, csize input) const { @@ -258,21 +242,9 @@ return producer == 0; } - BoolAnnotationValue ignoresSortedNodes(expr* fo, csize input) const - { - if (input == 0) - return fo->getIgnoresSortedNodes(); - - return ANNOTATION_TRUE; - } - - BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize input) const - { - if (input == 0) - return fo->getIgnoresDuplicateNodes(); + BoolAnnotationValue ignoresSortedNodes(expr* fo, csize input) const; - return ANNOTATION_TRUE; - } + BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize input) const; bool propagatesInputNodes(expr* fo, csize input) const { diff -Nru zorba-2.7.0-0/src/functions/function.h zorba-2.8.0-0/src/functions/function.h --- zorba-2.7.0-0/src/functions/function.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/function.h 2013-01-16 18:28:18.000000000 +0000 @@ -145,6 +145,8 @@ resetFlag(FunctionConsts::isPrivate); } + bool isComparisonFunction() const { return testFlag(FunctionConsts::IsComparison); } + bool isDeterministic() const { // Note: For udfs, the flag is set before the udf is optimized (see call @@ -201,8 +203,6 @@ return ArithmeticConsts::UNKNOWN; } - virtual bool isComparisonFunction() const { return false; } - virtual bool isValueComparisonFunction() const { return false; } virtual bool isGeneralComparisonFunction() const { return false; } diff -Nru zorba-2.7.0-0/src/functions/function_consts.h zorba-2.8.0-0/src/functions/function_consts.h --- zorba-2.7.0-0/src/functions/function_consts.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/function_consts.h 2013-01-16 18:28:18.000000000 +0000 @@ -261,15 +261,18 @@ typedef enum { - DoDistinct = 1, // Used by fn:zore-or-one and fn:exaclty-one - SkipCodeGen = 2, - isDeterministic = 4, - isPrivate = 8, - isBuiltin = 16, - isUDF = 32, + DoDistinct = 1, // Used by fn:zore-or-one and fn:exaclty-one + SkipCodeGen = 2, + isDeterministic = 4, + isPrivate = 8, + isBuiltin = 16, + isUDF = 32, propagatesInputNodes = 64, - mustCopyInputNodes = 128, - AccessesDynCtx = 256 + mustCopyInputNodes = 128, + AccessesDynCtx = 256, + ConstructsNodes = 512, + DereferencesNodes = 1024, + IsComparison = 2048 } AnnotationFlags; }; diff -Nru zorba-2.7.0-0/src/functions/library.cpp zorba-2.8.0-0/src/functions/library.cpp --- zorba-2.7.0-0/src/functions/library.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/library.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -27,33 +27,43 @@ #include "functions/func_accessors.h" #include "functions/func_accessors_impl.h" #include "functions/func_any_uri.h" +#include "functions/func_apply.h" #include "functions/func_arithmetic.h" #include "functions/func_base64.h" #include "functions/func_booleans.h" #include "functions/func_booleans_impl.h" #include "functions/func_collections.h" #include "functions/func_context.h" -#include "functions/func_other_diagnostics.h" +#include "functions/func_datetime.h" +#include "functions/func_documents.h" #include "functions/func_durations_dates_times.h" #include "functions/func_durations_dates_times_impl.h" #include "functions/func_enclosed.h" #include "functions/func_errors_and_diagnostics.h" +#include "functions/func_eval.h" +#include "functions/func_fetch.h" #include "functions/func_fnput.h" #include "functions/func_hoist.h" +#include "functions/func_ic_ddl.h" #include "functions/func_index_ddl.h" #include "functions/func_index_func.h" -#include "functions/func_ic_ddl.h" +#include "functions/func_json.h" +#include "functions/func_maps.h" #include "functions/func_maths.h" #include "functions/func_nodes.h" +#include "functions/func_reference.h" #include "functions/func_node_position.h" #include "functions/func_node_sort_distinct.h" +#include "functions/func_nodes.h" #include "functions/func_numerics.h" #include "functions/func_numerics_impl.h" -#include "functions/func_parsing_and_serializing.h" +#include "functions/func_other_diagnostics.h" #include "functions/func_parse_fragment.h" #include "functions/func_parse_fragment_impl.h" +#include "functions/func_parsing_and_serializing.h" #include "functions/func_qnames.h" #include "functions/func_random.h" +#include "functions/func_reflection.h" #include "functions/func_schema.h" #include "functions/func_sctx.h" #include "functions/func_sequences.h" @@ -61,15 +71,8 @@ #include "functions/func_strings.h" #include "functions/func_strings_impl.h" #include "functions/func_uris.h" -#include "functions/func_json.h" #include "functions/func_var_decl.h" #include "functions/func_xqdoc.h" -#include "functions/func_documents.h" -#include "functions/func_maps.h" -#include "functions/func_eval.h" -#include "functions/func_reflection.h" -#include "functions/func_apply.h" -#include "functions/func_fetch.h" #ifndef ZORBA_NO_FULL_TEXT #include "functions/func_ft_module.h" #include "runtime/full_text/ft_module_impl.h" @@ -118,6 +121,7 @@ populate_context_booleans_impl(sctx); populate_context_collections(sctx); populate_context_context(sctx); + populate_context_datetime(sctx); populate_context_durations_dates_times(sctx); populate_context_durations_dates_times_impl(sctx); populate_context_errors_and_diagnostics(sctx); @@ -128,6 +132,7 @@ populate_context_json(sctx); populate_context_maths(sctx); populate_context_nodes(sctx); + populate_context_reference(sctx); populate_context_node_position(sctx); populate_context_numerics(sctx); populate_context_other_diagnostics(sctx); diff -Nru zorba-2.7.0-0/src/functions/library.h zorba-2.8.0-0/src/functions/library.h --- zorba-2.7.0-0/src/functions/library.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/library.h 2013-01-16 18:28:18.000000000 +0000 @@ -48,7 +48,7 @@ -#define GET_BUILTIN_FUNCTION(func_code) \ +#define BUILTIN_FUNC(func_code) \ BuiltinFunctionLibrary::getFunction(FunctionConsts::func_code) diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_accessors.h zorba-2.8.0-0/src/functions/pregenerated/func_accessors.h --- zorba-2.7.0-0/src/functions/pregenerated/func_accessors.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_accessors.h 2013-01-16 18:28:18.000000000 +0000 @@ -82,7 +82,7 @@ theXQueryVersion = StaticContextConsts::xquery_version_3_0; } - bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } CODEGEN_DECL(); }; @@ -98,7 +98,7 @@ } - bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } CODEGEN_DECL(); }; @@ -140,7 +140,7 @@ BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const; - bool mustCopyInputNodes(expr* fo, csize producer) const; + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } CODEGEN_DECL(); }; @@ -157,7 +157,7 @@ } - bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } CODEGEN_DECL(); }; @@ -207,7 +207,7 @@ } - bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } CODEGEN_DECL(); }; diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_collections.cpp zorba-2.8.0-0/src/functions/pregenerated/func_collections.cpp --- zorba-2.7.0-0/src/functions/pregenerated/func_collections.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_collections.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -71,6 +71,7 @@ + PlanIter_t zorba_store_indexes_static_ddl_is_available_index::codegen( CompilerCB*, static_context* sctx, @@ -1187,6 +1188,32 @@ { + DECL_WITH_KIND(sctx, static_collections_dml_edit, + (createQName("http://www.zorba-xquery.com/modules/store/static/collections/dml","","edit"), + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_ONE, + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_ONE, + GENV_TYPESYSTEM.EMPTY_TYPE), + FunctionConsts::STATIC_COLLECTIONS_DML_EDIT_2); + + } + + + + + { + DECL_WITH_KIND(sctx, static_collections_dml_edit, + (createQName("http://www.zorba-xquery.com/modules/store/dynamic/collections/dml","","edit"), + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_ONE, + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_ONE, + GENV_TYPESYSTEM.EMPTY_TYPE), + FunctionConsts::DYNAMIC_COLLECTIONS_DML_EDIT_2); + + } + + + + + { DECL_WITH_KIND(sctx, static_collections_dml_truncate, (createQName("http://www.zorba-xquery.com/modules/store/static/collections/dml","","truncate"), GENV_TYPESYSTEM.QNAME_TYPE_ONE, diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_collections.h zorba-2.8.0-0/src/functions/pregenerated/func_collections.h --- zorba-2.7.0-0/src/functions/pregenerated/func_collections.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_collections.h 2013-01-16 18:28:18.000000000 +0000 @@ -146,6 +146,8 @@ bool accessesDynCtx() const { return true; } + xqtref_t getReturnType(const fo_expr* caller) const; + bool isSource() const { return true; } FunctionConsts::AnnotationValue producesDistinctNodes() const @@ -507,6 +509,29 @@ }; +//static-collections-dml:edit +class static_collections_dml_edit : public function +{ +public: + static_collections_dml_edit(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + unsigned short getScriptingKind() const { return UPDATING_EXPR; } + + bool accessesDynCtx() const { return true; } + + bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; } + + void processPragma(expr*, const std::vector&) const; + + CODEGEN_DECL(); +}; + + //static-collections-dml:truncate class static_collections_dml_truncate : public function { diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_datetime.cpp zorba-2.8.0-0/src/functions/pregenerated/func_datetime.cpp --- zorba-2.7.0-0/src/functions/pregenerated/func_datetime.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_datetime.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,257 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** + + +#include "stdafx.h" +#include "runtime/datetime/datetime.h" +#include "functions/func_datetime.h" + + +namespace zorba{ + + + +PlanIter_t fn_zorba_dateTime_current_date::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new CurrentDate(sctx, loc, argv); +} + +PlanIter_t fn_zorba_dateTime_current_dateTime::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new CurrentDateTime(sctx, loc, argv); +} + +PlanIter_t fn_zorba_dateTime_current_time::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new CurrentTime(sctx, loc, argv); +} + +PlanIter_t fn_zorba_dateTime_parse_date::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new ParseDate(sctx, loc, argv); +} + +PlanIter_t fn_zorba_dateTime_parse_dateTime::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new ParseDateTime(sctx, loc, argv); +} + +PlanIter_t fn_zorba_dateTime_parse_time::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new ParseTime(sctx, loc, argv); +} + +PlanIter_t fn_zorba_dateTime_timestamp::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new Timestamp(sctx, loc, argv); +} + +PlanIter_t fn_zorba_dateTime_utc_offset::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new UTCOffset(sctx, loc, argv); +} + +void populate_context_datetime(static_context* sctx) +{ + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_current_date, + (createQName("http://www.zorba-xquery.com/modules/datetime","","current-date"), + GENV_TYPESYSTEM.DATE_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_CURRENT_DATE_0); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_current_dateTime, + (createQName("http://www.zorba-xquery.com/modules/datetime","","current-dateTime"), + GENV_TYPESYSTEM.DATETIME_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_CURRENT_DATETIME_0); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_current_time, + (createQName("http://www.zorba-xquery.com/modules/datetime","","current-time"), + GENV_TYPESYSTEM.TIME_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_CURRENT_TIME_0); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_parse_date, + (createQName("http://www.zorba-xquery.com/modules/datetime","","parse-date"), + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.DATE_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_PARSE_DATE_2); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_parse_date, + (createQName("http://www.zorba-xquery.com/modules/datetime","","parse-date"), + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.DATE_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_PARSE_DATE_3); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_parse_dateTime, + (createQName("http://www.zorba-xquery.com/modules/datetime","","parse-dateTime"), + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.DATETIME_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_PARSE_DATETIME_2); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_parse_dateTime, + (createQName("http://www.zorba-xquery.com/modules/datetime","","parse-dateTime"), + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.DATETIME_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_PARSE_DATETIME_3); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_parse_time, + (createQName("http://www.zorba-xquery.com/modules/datetime","","parse-time"), + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.TIME_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_PARSE_TIME_2); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_parse_time, + (createQName("http://www.zorba-xquery.com/modules/datetime","","parse-time"), + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.TIME_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_PARSE_TIME_3); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_timestamp, + (createQName("http://www.zorba-xquery.com/modules/datetime","","timestamp"), + GENV_TYPESYSTEM.LONG_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_TIMESTAMP_0); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_zorba_dateTime_utc_offset, + (createQName("http://www.zorba-xquery.com/modules/datetime","","utc-offset"), + GENV_TYPESYSTEM.LONG_TYPE_ONE), + FunctionConsts::FN_ZORBA_DATETIME_UTC_OFFSET_0); + + } + +} + + +} + + + diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_datetime.h zorba-2.8.0-0/src/functions/pregenerated/func_datetime.h --- zorba-2.7.0-0/src/functions/pregenerated/func_datetime.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_datetime.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** + + +#ifndef ZORBA_FUNCTIONS_DATETIME_H +#define ZORBA_FUNCTIONS_DATETIME_H + + +#include "common/shared_types.h" +#include "functions/function_impl.h" + + +namespace zorba { + + +void populate_context_datetime(static_context* sctx); + + + + +//fn-zorba-dateTime:current-date +class fn_zorba_dateTime_current_date : public function +{ +public: + fn_zorba_dateTime_current_date(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-zorba-dateTime:current-dateTime +class fn_zorba_dateTime_current_dateTime : public function +{ +public: + fn_zorba_dateTime_current_dateTime(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-zorba-dateTime:current-time +class fn_zorba_dateTime_current_time : public function +{ +public: + fn_zorba_dateTime_current_time(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-zorba-dateTime:parse-date +class fn_zorba_dateTime_parse_date : public function +{ +public: + fn_zorba_dateTime_parse_date(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-zorba-dateTime:parse-dateTime +class fn_zorba_dateTime_parse_dateTime : public function +{ +public: + fn_zorba_dateTime_parse_dateTime(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-zorba-dateTime:parse-time +class fn_zorba_dateTime_parse_time : public function +{ +public: + fn_zorba_dateTime_parse_time(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-zorba-dateTime:timestamp +class fn_zorba_dateTime_timestamp : public function +{ +public: + fn_zorba_dateTime_timestamp(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-zorba-dateTime:utc-offset +class fn_zorba_dateTime_utc_offset : public function +{ +public: + fn_zorba_dateTime_utc_offset(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +} //namespace zorba + + +#endif +/* + * Local variables: + * mode: c++ + * End: + */ diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_jsoniq_functions.cpp zorba-2.8.0-0/src/functions/pregenerated/func_jsoniq_functions.cpp --- zorba-2.7.0-0/src/functions/pregenerated/func_jsoniq_functions.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_jsoniq_functions.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -142,6 +142,18 @@ #endif #ifdef ZORBA_WITH_JSON +PlanIter_t fn_jsoniq_json_doc::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new JSONDocIterator(sctx, loc, argv); +} + +#endif +#ifdef ZORBA_WITH_JSON PlanIter_t op_zorba_json_item_accessor::codegen( CompilerCB*, static_context* sctx, @@ -474,6 +486,22 @@ { + DECL_WITH_KIND(sctx, fn_jsoniq_json_doc, + (createQName("http://jsoniq.org/functions","","json-doc"), + GENV_TYPESYSTEM.STRING_TYPE_QUESTION, + GENV_TYPESYSTEM.JSON_ITEM_TYPE_STAR), + FunctionConsts::FN_JSONIQ_JSON_DOC_1); + + } + + +#endif + + +#ifdef ZORBA_WITH_JSON + + + { DECL_WITH_KIND(sctx, op_zorba_json_item_accessor, (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","json-item-accessor"), GENV_TYPESYSTEM.JSON_ITEM_TYPE_ONE, diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_jsoniq_functions.h zorba-2.8.0-0/src/functions/pregenerated/func_jsoniq_functions.h --- zorba-2.7.0-0/src/functions/pregenerated/func_jsoniq_functions.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_jsoniq_functions.h 2013-01-16 18:28:18.000000000 +0000 @@ -238,6 +238,26 @@ #endif #ifdef ZORBA_WITH_JSON +//fn-jsoniq:json-doc +class fn_jsoniq_json_doc : public function +{ +public: + fn_jsoniq_json_doc(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + bool accessesDynCtx() const { return true; } + + bool isSource() const { return true; } + + CODEGEN_DECL(); +}; +#endif +#ifdef ZORBA_WITH_JSON + //op-zorba:json-item-accessor class op_zorba_json_item_accessor : public function { diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_maps.h zorba-2.8.0-0/src/functions/pregenerated/func_maps.h --- zorba-2.7.0-0/src/functions/pregenerated/func_maps.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_maps.h 2013-01-16 18:28:18.000000000 +0000 @@ -127,6 +127,8 @@ bool accessesDynCtx() const { return true; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + CODEGEN_DECL(); }; diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_nodes.h zorba-2.8.0-0/src/functions/pregenerated/func_nodes.h --- zorba-2.7.0-0/src/functions/pregenerated/func_nodes.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_nodes.h 2013-01-16 18:28:18.000000000 +0000 @@ -179,6 +179,8 @@ theXQueryVersion = StaticContextConsts::xquery_version_3_0; } + bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } + CODEGEN_DECL(); }; diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_reference.cpp zorba-2.8.0-0/src/functions/pregenerated/func_reference.cpp --- zorba-2.7.0-0/src/functions/pregenerated/func_reference.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_reference.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,130 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** + + +#include "stdafx.h" +#include "runtime/reference/reference.h" +#include "functions/func_reference.h" + + +namespace zorba{ + + + +PlanIter_t fn_reference_reference::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new ReferenceIterator(sctx, loc, argv); +} + +PlanIter_t fn_reference_has_reference::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new HasReferenceIterator(sctx, loc, argv); +} + +PlanIter_t fn_reference_assign_reference::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new AssignReferenceIterator(sctx, loc, argv); +} + +PlanIter_t fn_reference_dereference::codegen( + CompilerCB*, + static_context* sctx, + const QueryLoc& loc, + std::vector& argv, + expr& ann) const +{ + return new DereferenceIterator(sctx, loc, argv); +} + +void populate_context_reference(static_context* sctx) +{ + + + { + DECL_WITH_KIND(sctx, fn_reference_reference, + (createQName("http://www.zorba-xquery.com/modules/reference","","reference"), + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE), + FunctionConsts::FN_REFERENCE_REFERENCE_1); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_reference_has_reference, + (createQName("http://www.zorba-xquery.com/modules/reference","","has-reference"), + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_ONE, + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), + FunctionConsts::FN_REFERENCE_HAS_REFERENCE_1); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_reference_assign_reference, + (createQName("http://www.zorba-xquery.com/modules/reference","","assign-reference"), + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_ONE, + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE), + FunctionConsts::FN_REFERENCE_ASSIGN_REFERENCE_2); + + } + + + + + { + DECL_WITH_KIND(sctx, fn_reference_dereference, + (createQName("http://www.zorba-xquery.com/modules/reference","","dereference"), + GENV_TYPESYSTEM.STRING_TYPE_ONE, + GENV_TYPESYSTEM.STRUCTURED_ITEM_TYPE_QUESTION), + FunctionConsts::FN_REFERENCE_DEREFERENCE_1); + + } + +} + + +} + + + diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_reference.h zorba-2.8.0-0/src/functions/pregenerated/func_reference.h --- zorba-2.7.0-0/src/functions/pregenerated/func_reference.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_reference.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** + + +#ifndef ZORBA_FUNCTIONS_REFERENCE_H +#define ZORBA_FUNCTIONS_REFERENCE_H + + +#include "common/shared_types.h" +#include "functions/function_impl.h" + + +namespace zorba { + + +void populate_context_reference(static_context* sctx); + + + + +//fn-reference:reference +class fn_reference_reference : public function +{ +public: + fn_reference_reference(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + bool mustCopyInputNodes(expr* fo, csize producer) const { return true; } + + CODEGEN_DECL(); +}; + + +//fn-reference:has-reference +class fn_reference_has_reference : public function +{ +public: + fn_reference_has_reference(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +//fn-reference:assign-reference +class fn_reference_assign_reference : public function +{ +public: + fn_reference_assign_reference(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + unsigned short getScriptingKind() const { return SEQUENTIAL_FUNC_EXPR; } + + CODEGEN_DECL(); +}; + + +//fn-reference:dereference +class fn_reference_dereference : public function +{ +public: + fn_reference_dereference(const signature& sig, FunctionConsts::FunctionKind kind) + : + function(sig, kind) + { + + } + + CODEGEN_DECL(); +}; + + +} //namespace zorba + + +#endif +/* + * Local variables: + * mode: c++ + * End: + */ diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_schema.cpp zorba-2.8.0-0/src/functions/pregenerated/func_schema.cpp --- zorba-2.7.0-0/src/functions/pregenerated/func_schema.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_schema.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -41,16 +41,6 @@ return new ZorbaValidateInPlaceIterator(sctx, loc, argv[0]); } -PlanIter_t fn_zorba_util_schema_type::codegen( - CompilerCB*, - static_context* sctx, - const QueryLoc& loc, - std::vector& argv, - expr& ann) const -{ - return new ZorbaSchemaTypeIterator(sctx, loc, argv); -} - PlanIter_t fn_zorba_schema_schema_type::codegen( CompilerCB*, static_context* sctx, @@ -88,18 +78,6 @@ { - DECL_WITH_KIND(sctx, fn_zorba_util_schema_type, - (createQName("http://www.zorba-xquery.com/zorba/util-functions","","schema-type"), - GENV_TYPESYSTEM.ITEM_TYPE_ONE, - GENV_TYPESYSTEM.QNAME_TYPE_QUESTION), - FunctionConsts::FN_ZORBA_UTIL_SCHEMA_TYPE_1); - - } - - - - - { DECL_WITH_KIND(sctx, fn_zorba_schema_schema_type, (createQName("http://www.zorba-xquery.com/modules/schema","","schema-type"), GENV_TYPESYSTEM.ITEM_TYPE_ONE, diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_schema.h zorba-2.8.0-0/src/functions/pregenerated/func_schema.h --- zorba-2.7.0-0/src/functions/pregenerated/func_schema.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_schema.h 2013-01-16 18:28:18.000000000 +0000 @@ -59,23 +59,6 @@ }; -//fn-zorba-util:schema-type -class fn_zorba_util_schema_type : public function -{ -public: - fn_zorba_util_schema_type(const signature& sig, FunctionConsts::FunctionKind kind) - : - function(sig, kind) - { - - } - - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } - - CODEGEN_DECL(); -}; - - //fn-zorba-schema:schema-type class fn_zorba_schema_schema_type : public function { @@ -104,7 +87,7 @@ } - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } + bool mustCopyInputNodes(expr* fo, csize producer) const; CODEGEN_DECL(); }; diff -Nru zorba-2.7.0-0/src/functions/pregenerated/func_sequences.h zorba-2.8.0-0/src/functions/pregenerated/func_sequences.h --- zorba-2.7.0-0/src/functions/pregenerated/func_sequences.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/func_sequences.h 2013-01-16 18:28:18.000000000 +0000 @@ -348,7 +348,7 @@ bool accessesDynCtx() const { return true; } - bool mustCopyInputNodes(expr* fo, csize producer) const { return false; } + bool mustCopyInputNodes(expr* fo, csize producer) const; CODEGEN_DECL(); }; diff -Nru zorba-2.7.0-0/src/functions/pregenerated/function_enum.h zorba-2.8.0-0/src/functions/pregenerated/function_enum.h --- zorba-2.7.0-0/src/functions/pregenerated/function_enum.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/pregenerated/function_enum.h 2013-01-16 18:28:18.000000000 +0000 @@ -119,6 +119,8 @@ STATIC_COLLECTIONS_DML_DELETE_LAST_2, DYNAMIC_COLLECTIONS_DML_DELETE_LAST_1, DYNAMIC_COLLECTIONS_DML_DELETE_LAST_2, + STATIC_COLLECTIONS_DML_EDIT_2, + DYNAMIC_COLLECTIONS_DML_EDIT_2, STATIC_COLLECTIONS_DML_TRUNCATE_1, DYNAMIC_COLLECTIONS_DML_TRUNCATE_1, ZORBA_STORE_INDEXES_STATIC_DDL_IS_AVAILABLE_INDEX_1, @@ -141,6 +143,17 @@ FN_POSITION_0, FN_LAST_0, FN_STATIC_BASE_URI_0, + FN_ZORBA_DATETIME_CURRENT_DATE_0, + FN_ZORBA_DATETIME_CURRENT_DATETIME_0, + FN_ZORBA_DATETIME_CURRENT_TIME_0, + FN_ZORBA_DATETIME_PARSE_DATE_2, + FN_ZORBA_DATETIME_PARSE_DATE_3, + FN_ZORBA_DATETIME_PARSE_DATETIME_2, + FN_ZORBA_DATETIME_PARSE_DATETIME_3, + FN_ZORBA_DATETIME_PARSE_TIME_2, + FN_ZORBA_DATETIME_PARSE_TIME_3, + FN_ZORBA_DATETIME_TIMESTAMP_0, + FN_ZORBA_DATETIME_UTC_OFFSET_0, FN_YEARS_FROM_DURATION_1, FN_MONTHS_FROM_DURATION_1, FN_DAYS_FROM_DURATION_1, @@ -240,6 +253,7 @@ FN_JSONIQ_MEMBER_2, FN_JSONIQ_MEMBERS_1, FN_JSONIQ_FLATTEN_1, + FN_JSONIQ_JSON_DOC_1, OP_ZORBA_JSON_ITEM_ACCESSOR_2, FN_JSONIQ_NULL_0, FN_JSONIQ_IS_NULL_1, @@ -359,8 +373,11 @@ FN_ZORBA_RANDOM_RANDOM_1, FN_ZORBA_UTIL_UUID_0, FN_ZORBA_RANDOM_UUID_0, + FN_REFERENCE_REFERENCE_1, + FN_REFERENCE_HAS_REFERENCE_1, + FN_REFERENCE_ASSIGN_REFERENCE_2, + FN_REFERENCE_DEREFERENCE_1, FN_ZORBA_SCHEMA_VALIDATE_IN_PLACE_1, - FN_ZORBA_UTIL_SCHEMA_TYPE_1, FN_ZORBA_SCHEMA_SCHEMA_TYPE_1, FN_ZORBA_SCHEMA_IS_VALIDATED_1, OP_CONCATENATE_N, diff -Nru zorba-2.7.0-0/src/functions/udf.cpp zorba-2.8.0-0/src/functions/udf.cpp --- zorba-2.7.0-0/src/functions/udf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/udf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -220,6 +220,15 @@ /******************************************************************************* ********************************************************************************/ +void user_function::setScriptingKind(unsigned short k) +{ + theScriptingKind = k; +} + + +/******************************************************************************* + +********************************************************************************/ void user_function::setBody(expr* body) { theBodyExpr = body; @@ -271,7 +280,7 @@ /******************************************************************************* ********************************************************************************/ -void user_function::addRecursiveCall(expr* call) +void user_function::addRecursiveCall(fo_expr* call) { assert(theBodyExpr != NULL); @@ -288,7 +297,8 @@ ********************************************************************************/ bool user_function::isRecursive() const { - assert(isOptimized()); + // recursiveness is established before any optimization is done + // assert(isOptimized()); assert(theBodyExpr != NULL); return !theMutuallyRecursiveUDFs.empty(); } @@ -299,7 +309,8 @@ ********************************************************************************/ bool user_function::isMutuallyRecursiveWith(const user_function* udf) { - assert(isOptimized()); + // recursiveness is established before any optimization is done + // assert(isOptimized()); assert(theBodyExpr != NULL); if (std::find(theMutuallyRecursiveUDFs.begin(), @@ -314,6 +325,44 @@ /******************************************************************************* ********************************************************************************/ +bool user_function::dereferencesNodes() const +{ + if (!isOptimized()) + { + std::cerr << "dereferencesNodes invoked on non-optimized UDF" + << getName()->getStringValue() << std::endl; + assert(isOptimized()); + } + + if (theBodyExpr != NULL) + return theBodyExpr->dereferencesNodes(); + + return testFlag(FunctionConsts::DereferencesNodes); +} + + +/******************************************************************************* + +********************************************************************************/ +bool user_function::constructsNodes() const +{ + if (!isOptimized()) + { + std::cerr << "constructNodes invoked on non-optimized UDF" + << getName()->getStringValue() << std::endl; + assert(isOptimized()); + } + + if (theBodyExpr != NULL) + return theBodyExpr->constructsNodes(); + + return testFlag(FunctionConsts::ConstructsNodes); +} + + +/******************************************************************************* + +********************************************************************************/ bool user_function::accessesDynCtx() const { if (!isOptimized()) @@ -323,6 +372,9 @@ assert(isOptimized()); } + if (theBodyExpr != NULL) + return theBodyExpr->isUnfoldable(); + return testFlag(FunctionConsts::AccessesDynCtx); } @@ -415,8 +467,15 @@ GENV_COMPILERSUBSYS.getDefaultOptimizingRewriter()->rewrite(rctx); body = rctx.getRoot(); + setBody(body); + if (theBodyExpr->dereferencesNodes()) + setFlag(FunctionConsts::DereferencesNodes); + + if (theBodyExpr->constructsNodes()) + setFlag(FunctionConsts::ConstructsNodes); + if (theBodyExpr->isUnfoldable()) setFlag(FunctionConsts::AccessesDynCtx); diff -Nru zorba-2.7.0-0/src/functions/udf.h zorba-2.8.0-0/src/functions/udf.h --- zorba-2.7.0-0/src/functions/udf.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/functions/udf.h 2013-01-16 18:28:18.000000000 +0000 @@ -19,12 +19,14 @@ #include "functions/function.h" -#include "compiler/expression/expr_base.h" +//#include "compiler/expression/expr_base.h" namespace zorba { + class expr; + namespace store { class Index; @@ -128,7 +130,7 @@ bool theIsLeaf; std::vector theMutuallyRecursiveUDFs; - std::vector theRecursiveCalls; + std::vector theRecursiveCalls; bool theIsOptimized; @@ -171,6 +173,8 @@ expr* getBody() const; + void setScriptingKind(unsigned short k); + void setArgVars(std::vector& args); const std::vector& getArgVars() const; @@ -181,9 +185,9 @@ const std::vector& udfs, const std::vector::const_iterator& cycle); - void addRecursiveCall(expr* call); + void addRecursiveCall(fo_expr* call); - const std::vector& getRecursiveCalls() const { return theRecursiveCalls; } + const std::vector& getRecursiveCalls() const { return theRecursiveCalls; } bool isMutuallyRecursiveWith(const user_function* udf); @@ -210,6 +214,10 @@ unsigned short getScriptingKind() const; + bool dereferencesNodes() const; + + bool constructsNodes() const; + bool accessesDynCtx() const; bool mustCopyInputNodes(expr* fo, csize input) const; diff -Nru zorba-2.7.0-0/src/precompiled/stdafx.h zorba-2.8.0-0/src/precompiled/stdafx.h --- zorba-2.7.0-0/src/precompiled/stdafx.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/precompiled/stdafx.h 2013-01-16 18:28:18.000000000 +0000 @@ -29,6 +29,7 @@ #include #include #include + #include #include "runtime/sequences/sequences.h" #include "diagnostics/xquery_diagnostics.h" @@ -58,17 +59,19 @@ #include "zorbatypes/m_apm.h" #include "zorbatypes/rclock.h" #include "zorbatypes/schema_types.h" +// #include "zorbatypes/timezone.h" #include "zorbatypes/URI.h" #include "zorbatypes/xerces_xmlcharray.h" #include "zorbatypes/zorbatypes_decl.h" #include "zorbatypes/zstring.h" #include "zorbautils/condition.h" - #include "zorbautils/hashfun.h" + #include "zorbautils/hashmap.h" #include "zorbautils/hashmap_itemp.h" #include "zorbautils/hashmap_zstring.h" #include "zorbautils/hashset.h" + #include "zorbautils/latch.h" #include "zorbautils/locale.h" #include "zorbautils/lock.h" @@ -83,6 +86,5 @@ #include "runtime/full_text/ftcontains_visitor.h" #include "store/api/ft_token_iterator.h" #include "store/naive/ft_token_store.h" - #endif /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/runtime/CMakeLists.txt zorba-2.8.0-0/src/runtime/CMakeLists.txt --- zorba-2.7.0-0/src/runtime/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -138,6 +138,7 @@ util/item_iterator.cpp util/timeout.cpp util/flowctl_exception.cpp + util/doc_uri_heuristics.cpp function_item/function_item.cpp function_item/dynamic_fncall_iterator.cpp eval/eval.cpp @@ -174,6 +175,7 @@ IF (ZORBA_WITH_JSON) LIST(APPEND RUNTIME_SRCS json/json_constructors.cpp + json/json_loader.cpp ) HEADER_GROUP_SUBFOLDER(RUNTIME_SRCS json) ENDIF (ZORBA_WITH_JSON) diff -Nru zorba-2.7.0-0/src/runtime/booleans/BooleanImpl.cpp zorba-2.8.0-0/src/runtime/booleans/BooleanImpl.cpp --- zorba-2.7.0-0/src/runtime/booleans/BooleanImpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/booleans/BooleanImpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -629,26 +629,27 @@ store::SchemaTypeCode type1 = item1->getTypeCode(); // all untyped Atomics to String - if (TypeOps::is_subtype(type0, store::XS_UNTYPED_ATOMIC)) + if (type0 == store::XS_UNTYPED_ATOMIC) { - GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc); - - if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC)) + if (type1 == store::XS_UNTYPED_ATOMIC) { - GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc); + castItem0.transfer(item0); + castItem1.transfer(item1); } else { + GenericCast::castToBuiltinAtomic(castItem0, item0, store::XS_STRING, NULL, loc); + if (!GenericCast::promote(castItem1, item1, store::XS_STRING, tm, loc)) castItem1.transfer(item1); } } - else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC)) + else if (type1 == store::XS_UNTYPED_ATOMIC) { if (!GenericCast::promote(castItem0, item0, store::XS_STRING, tm, loc)) castItem0.transfer(item0); - GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc); + GenericCast::castToBuiltinAtomic(castItem1, item1, store::XS_STRING, NULL, loc); } else { @@ -810,45 +811,45 @@ store::SchemaTypeCode type0 = item0->getTypeCode(); store::SchemaTypeCode type1 = item1->getTypeCode(); - if (TypeOps::is_subtype(type0, store::XS_UNTYPED_ATOMIC)) + if (type0 == store::XS_UNTYPED_ATOMIC) { if (TypeOps::is_numeric(type1)) { - GenericCast::castToAtomic(castItem0, item0, store::XS_DOUBLE, tm, NULL, loc); + GenericCast::castToBuiltinAtomic(castItem0, item0, store::XS_DOUBLE, NULL, loc); GenericCast::promote(castItem1, item1, store::XS_DOUBLE, tm, loc); } - else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC)) + else if (type1 == store::XS_UNTYPED_ATOMIC) { - GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc); - GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc); + castItem0.transfer(item0); + castItem1.transfer(item1); } else if (TypeOps::is_subtype(type1, store::XS_STRING)) { - GenericCast::castToAtomic(castItem0, item0, store::XS_STRING, tm, NULL, loc); + GenericCast::castToBuiltinAtomic(castItem0, item0, store::XS_STRING, NULL, loc); castItem1.transfer(item1); } else { - GenericCast::castToAtomic(castItem0, item0, type1, tm, NULL, loc); + GenericCast::castToBuiltinAtomic(castItem0, item0, type1, NULL, loc); castItem1.transfer(item1); } } - else if (TypeOps::is_subtype(type1, store::XS_UNTYPED_ATOMIC)) + else if (type1 == store::XS_UNTYPED_ATOMIC) { if (TypeOps::is_numeric(type0)) { - GenericCast::castToAtomic(castItem1, item1, store::XS_DOUBLE, tm, NULL, loc); + GenericCast::castToBuiltinAtomic(castItem1, item1, store::XS_DOUBLE, NULL, loc); GenericCast::promote(castItem0, item0, store::XS_DOUBLE, tm, loc); } else if (TypeOps::is_subtype(type0, store::XS_STRING)) { - GenericCast::castToAtomic(castItem1, item1, store::XS_STRING, tm, NULL, loc); + GenericCast::castToBuiltinAtomic(castItem1, item1, store::XS_STRING, NULL, loc); castItem0.transfer(item0); } else { - GenericCast::castToAtomic(castItem1, item1, type0, tm, NULL, loc); + GenericCast::castToBuiltinAtomic(castItem1, item1, type0, NULL, loc); castItem0.transfer(item0); } } diff -Nru zorba-2.7.0-0/src/runtime/collections/collections_base.cpp zorba-2.8.0-0/src/runtime/collections/collections_base.cpp --- zorba-2.7.0-0/src/runtime/collections/collections_base.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/collections/collections_base.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -42,7 +42,7 @@ if (!TypeOps::is_treatable(tm, node, *(collectionDecl->getNodeType()), loc)) { RAISE_ERROR(zerr::ZDTY0001_COLLECTION_INVALID_NODE_TYPE, loc, - ERROR_PARAMS(TypeOps::toString(*tm->create_value_type(node)), + ERROR_PARAMS(tm->create_value_type(node)->toSchemaString(), collectionDecl->getName()->getStringValue())); } } diff -Nru zorba-2.7.0-0/src/runtime/collections/collections_impl.cpp zorba-2.8.0-0/src/runtime/collections/collections_impl.cpp --- zorba-2.7.0-0/src/runtime/collections/collections_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/collections/collections_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -346,6 +346,7 @@ void ZorbaCollectionIteratorState::init(PlanState& planState) { PlanIteratorState::init(planState); + theIteratorOpened = false; theIterator = NULL; } @@ -367,6 +368,7 @@ } } + bool ZorbaCollectionIterator::isCountOptimizable() const { // if ref is passed to the collections function, count cannot be @@ -374,6 +376,7 @@ return theChildren.size() <= 2; } + bool ZorbaCollectionIterator::nextImpl( store::Item_t& result, PlanState& planState) const @@ -402,11 +405,13 @@ store::Item_t lSkipItem; consumeNext(lSkipItem, theChildren[(lRefPassed ? 2 : 1)].getp(), planState); lSkip = lSkipItem->getIntegerValue(); + // negative skip is not allowed if (lSkip < xs_integer::zero()) { lSkip = xs_integer::zero(); } + if (!lRefPassed) { state->theIterator = collection->getIterator(lSkip); @@ -1787,6 +1792,129 @@ /******************************************************************************* ********************************************************************************/ +bool ZorbaEditNodesIterator::nextImpl( + store::Item_t& result, + PlanState& planState) const +{ + store::Collection_t collection; + store::Item_t collectionName; + const StaticallyKnownCollection* collectionDecl; + + store::Item_t target; + + store::Item_t content; + store::CopyMode lCopyMode; + + std::auto_ptr pul; + + PlanIteratorState* state; + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); + consumeNext(target, theChildren[0].getp(), planState); + consumeNext(content, theChildren[1].getp(), planState); + + // Target check. + if (! target->getCollection()) + { + throw XQUERY_EXCEPTION(zerr::ZDDY0017_NODE_IS_ORPHAN, ERROR_LOC(loc)); + } + + if ((target->isNode() || target->isJSONItem()) && !target->isRoot()) + { + throw XQUERY_EXCEPTION( + zerr::ZDDY0039_NON_ROOT_NODE_EDIT, + ERROR_PARAMS(target->getCollection()->getName()->getStringValue()), + ERROR_LOC( loc ) + ); + } + if (target->getKind() != content->getKind()) + { + throw XQUERY_EXCEPTION( + zerr::ZDDY0040_INCONSISTENT_EDIT, + ERROR_LOC( loc ) + ); + } + if (target->isNode() && (target->getNodeKind() != content->getNodeKind())) + { + throw XQUERY_EXCEPTION( + zerr::ZDDY0040_INCONSISTENT_EDIT, + ERROR_LOC( loc ) + ); + } + collection = target->getCollection(); + collectionName = collection->getName(); + collectionDecl = getCollection(collectionName, collection); + + // Content check & copy. + getCopyMode(lCopyMode, this->theSctx); + lCopyMode.theDoCopy &= theNeedToCopy; + lCopyMode.theDoCopy &= !this->theChildren[1]->isConstructor(); + checkNodeType(this->theSctx, + content, + collectionDecl, + this->loc, + theIsDynamic); + content = content->copy(NULL, lCopyMode); + + // create the pul and add the primitive + pul.reset(GENV_ITEMFACTORY->createPendingUpdateList()); + + pul->addEditInCollection( + &loc, + collectionName, + target, + content, + theIsDynamic); + + result = pul.release(); + STACK_PUSH( result != NULL, state); + + STACK_END (state); +} + + +/******************************************************************************* + +********************************************************************************/ +const StaticallyKnownCollection* +ZorbaEditNodesIterator::getCollection( + const store::Item_t& name, + store::Collection_t& coll) const +{ + const StaticallyKnownCollection* collectionDecl = + zorba::getCollection(theSctx, name, loc, theIsDynamic, coll); + + if (!theIsDynamic) + { + switch(collectionDecl->getUpdateProperty()) + { + case StaticContextConsts::decl_const: + RAISE_ERROR(zerr::ZDDY0004_COLLECTION_CONST_UPDATE, loc, + ERROR_PARAMS(name->getStringValue())); + + case StaticContextConsts::decl_append_only: + RAISE_ERROR(zerr::ZDDY0037_COLLECTION_APPEND_BAD_EDIT, loc, + ERROR_PARAMS(name->getStringValue())); + + case StaticContextConsts::decl_queue: + RAISE_ERROR(zerr::ZDDY0038_COLLECTION_QUEUE_BAD_EDIT, loc, + ERROR_PARAMS(name->getStringValue())); + + case StaticContextConsts::decl_mutable: + // good to go + break; + + default: + ZORBA_ASSERT(false); + } + } + + return collectionDecl; +} + + +/******************************************************************************* + +********************************************************************************/ bool ZorbaTruncateCollectionIterator::nextImpl( store::Item_t& result, PlanState& planState) const diff -Nru zorba-2.7.0-0/src/runtime/collections/pregenerated/collections.cpp zorba-2.8.0-0/src/runtime/collections/pregenerated/collections.cpp --- zorba-2.7.0-0/src/runtime/collections/pregenerated/collections.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/collections/pregenerated/collections.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -657,6 +657,37 @@ // +// +SERIALIZABLE_CLASS_VERSIONS(ZorbaEditNodesIterator) + +void ZorbaEditNodesIterator::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); + + ar & theIsDynamic; + ar & theNeedToCopy; +} + + +void ZorbaEditNodesIterator::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +ZorbaEditNodesIterator::~ZorbaEditNodesIterator() {} + +// + + // SERIALIZABLE_CLASS_VERSIONS(ZorbaTruncateCollectionIterator) diff -Nru zorba-2.7.0-0/src/runtime/collections/pregenerated/collections.h zorba-2.8.0-0/src/runtime/collections/pregenerated/collections.h --- zorba-2.7.0-0/src/runtime/collections/pregenerated/collections.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/collections/pregenerated/collections.h 2013-01-16 18:28:18.000000000 +0000 @@ -910,6 +910,47 @@ /** * + * zorba:edit + * + * Author: Zorba Team + */ +class ZorbaEditNodesIterator : public NaryBaseIterator +{ +protected: + bool theIsDynamic; // + bool theNeedToCopy; // +public: + SERIALIZABLE_CLASS(ZorbaEditNodesIterator); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(ZorbaEditNodesIterator, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + ZorbaEditNodesIterator( + static_context* sctx, + const QueryLoc& loc, + std::vector& children, + bool isDynamic, + bool needToCopy) + : + NaryBaseIterator(sctx, loc, children), + theIsDynamic(isDynamic), + theNeedToCopy(needToCopy) + {} + + virtual ~ZorbaEditNodesIterator(); + +public: + const StaticallyKnownCollection* getCollection(const store::Item_t& name, store::Collection_t& coll) const; + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * * zorba:truncate * * Author: Zorba Team diff -Nru zorba-2.7.0-0/src/runtime/core/apply_updates.cpp zorba-2.8.0-0/src/runtime/core/apply_updates.cpp --- zorba-2.7.0-0/src/runtime/core/apply_updates.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/core/apply_updates.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -33,11 +33,13 @@ #include "system/globalenv.h" +#include "util/fs_util.h" #include "zorbautils/fatal.h" #include "common/shared_types.h" #include "diagnostics/util_macros.h" +#include "zorba/internal/system_diagnostic.h" namespace zorba @@ -232,32 +234,11 @@ } catch (XQueryException& e) { - if (e.has_source() && - (e.diagnostic() == err::XUDY0021 || - e.diagnostic() == err::XUDY0015 || - e.diagnostic() == err::XUDY0016 || - e.diagnostic() == err::XUDY0017 || - e.diagnostic() == err::XUDY0014)) - { - XQueryException lNewE = - XQUERY_EXCEPTION(err::XUDY0021, ERROR_PARAMS(ZED(XUDY0021_AppliedAt), loc)); - - QueryLoc lLoc; - lLoc.setFilename(e.source_uri()); - lLoc.setLineBegin(e.source_line()); - lLoc.setColumnBegin(e.source_column()); - set_source(lNewE, lLoc); - lNewE.set_diagnostic(e.diagnostic()); - - throw lNewE; - } + if ( e.has_source() ) + set_applied( e, loc ); else - { - // exception raised by the store doesn't have a store location - // hence, we add the location of the apply expression - set_source(e, loc); - throw; - } + set_source( e, loc ); + throw; } } @@ -265,6 +246,5 @@ UNARY_ACCEPT(ApplyIterator); - } // namespace zorba /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/runtime/core/arithmetic_impl.cpp zorba-2.8.0-0/src/runtime/core/arithmetic_impl.cpp --- zorba-2.7.0-0/src/runtime/core/arithmetic_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/core/arithmetic_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -527,9 +527,9 @@ d.reset(i0->getDateTimeValue().subtractDateTime(&i1->getDateTimeValue(), dctx->get_implicit_timezone())); } - catch (InvalidTimezoneException const&) + catch (InvalidTimezoneException const &e) { - throw XQUERY_EXCEPTION(err::FODT0003); + throw XQUERY_EXCEPTION(err::FODT0003, ERROR_PARAMS(e.get_tz_seconds())); } return GENV_ITEMFACTORY->createDayTimeDuration(result, d.get()); } @@ -550,9 +550,9 @@ d.reset(i0->getTimeValue().subtractDateTime(&i1->getTimeValue(), dctx->get_implicit_timezone())); } - catch (InvalidTimezoneException const&) + catch (InvalidTimezoneException const &e) { - throw XQUERY_EXCEPTION(err::FODT0003); + throw XQUERY_EXCEPTION(err::FODT0003, ERROR_PARAMS(e.get_tz_seconds())); } return GENV_ITEMFACTORY->createDayTimeDuration(result, d.get()); } @@ -573,9 +573,9 @@ d.reset(i0->getTimeValue().subtractDateTime(&i1->getTimeValue(), dctx->get_implicit_timezone())); } - catch (InvalidTimezoneException const&) + catch (InvalidTimezoneException const &e) { - throw XQUERY_EXCEPTION(err::FODT0003); + throw XQUERY_EXCEPTION(err::FODT0003, ERROR_PARAMS(e.get_tz_seconds())); } return GENV_ITEMFACTORY->createDayTimeDuration(result, d.get()); } diff -Nru zorba-2.7.0-0/src/runtime/core/fncall_iterator.cpp zorba-2.8.0-0/src/runtime/core/fncall_iterator.cpp --- zorba-2.7.0-0/src/runtime/core/fncall_iterator.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/core/fncall_iterator.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -448,31 +448,34 @@ for (size_t i = 0; i < argsRefs.size(); ++i) { - const ArgVarRefs& argVarRefs = argsRefs[i]; - store::Iterator_t argWrapper; - if (state->theCache) + if (argWraps[i] != NULL) { - std::vector lParam(1, lKey[i]); - state->theArgValues.push_back(GENV_STORE.createTempSeq(lParam)); - argWrapper = state->theArgValues.back()->getIterator(); - argWrapper->open(); - } - else - { - argWrapper = argWraps[i]; - } - - ArgVarRefs::const_iterator argVarRefsIte = argVarRefs.begin(); - ArgVarRefs::const_iterator argVarRefsEnd = argVarRefs.end(); + const ArgVarRefs& argVarRefs = argsRefs[i]; + store::Iterator_t argWrapper; + if (state->theCache) + { + std::vector lParam(1, lKey[i]); + state->theArgValues.push_back(GENV_STORE.createTempSeq(lParam)); + argWrapper = state->theArgValues.back()->getIterator(); + argWrapper->open(); + } + else + { + argWrapper = argWraps[i]; + } - for (; argVarRefsIte != argVarRefsEnd; ++argVarRefsIte) - { - const LetVarIter_t& argRef = (*argVarRefsIte); - assert(argRef != NULL); + ArgVarRefs::const_iterator argVarRefsIte = argVarRefs.begin(); + ArgVarRefs::const_iterator argVarRefsEnd = argVarRefs.end(); - if (argRef != NULL) + for (; argVarRefsIte != argVarRefsEnd; ++argVarRefsIte) { - argRef->bind(argWrapper, *state->thePlanState); + const LetVarIter_t& argRef = (*argVarRefsIte); + assert(argRef != NULL); + + if (argRef != NULL) + { + argRef->bind(argWrapper, *state->thePlanState); + } } } } @@ -708,7 +711,7 @@ throw ZORBA_EXCEPTION( zerr::ZCSE0013_UNABLE_TO_LOAD_QUERY, ERROR_PARAMS( - ZED( NoExternalFunction ), + ZED( NoExternalFunction_2 ), BUILD_STRING( '{', theNamespace, '}', lLocalname ) ) ); diff -Nru zorba-2.7.0-0/src/runtime/core/path_iterators.cpp zorba-2.8.0-0/src/runtime/core/path_iterators.cpp --- zorba-2.7.0-0/src/runtime/core/path_iterators.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/core/path_iterators.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -1788,7 +1788,7 @@ // We have traversed all the subtrees of the node D that is at the // top of theCurrentPath. Return D to the caller, if it satifies the // node test, and then pop D from theCurrentPath. - if (nameOrKindTest(theSctx, state->topNode(), loc)) + if (!getNextContextNode && nameOrKindTest(theSctx, state->topNode(), loc)) { result = state->topNode(); STACK_PUSH(true, state); @@ -1875,6 +1875,8 @@ ancestor = ancestor->getParent(); } + std::reverse(state->theAncestorPath.begin(), state->theAncestorPath.end()); + // For each ancestor A of the current context node N and for each child C // of A such as C is to the right of the next ancestor AC in the ancestor // path (note: AC is a child of A), traverse the subtree rooted at C. @@ -1886,7 +1888,7 @@ ancestor = state->theAncestorPath.back(); state->theAncestorPath.pop_back(); - state->theAncestorChildren->init(ancestor, state->theAncestorPath.back()); + state->theAncestorChildren->init(state->theAncestorPath.back().getp(), ancestor); state->theAncestorChildren->open(); // For each child C of A such that C is to the right of AC ... diff -Nru zorba-2.7.0-0/src/runtime/core/sequencetypes.cpp zorba-2.8.0-0/src/runtime/core/sequencetypes.cpp --- zorba-2.7.0-0/src/runtime/core/sequencetypes.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/core/sequencetypes.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -177,17 +177,34 @@ /******************************************************************************* ********************************************************************************/ +void CastIteratorState::init(PlanState& planState) +{ + PlanIteratorState::init(planState); + theResultPos = 0; + theResultItems.clear(); +} + + +void CastIteratorState::reset(PlanState& planState) +{ + PlanIteratorState::reset(planState); + theResultPos = 0; + theResultItems.clear(); +} + CastIterator::CastIterator( static_context* sctx, const QueryLoc& loc, - PlanIter_t& aChild, - const xqtref_t& aCastType) + PlanIter_t& child, + const xqtref_t& castType, + bool allowEmpty) : - UnaryBaseIterator(sctx, loc, aChild) + UnaryBaseIterator(sctx, loc, child), + theAllowEmpty(allowEmpty), + theNsCtx(theSctx) { - theCastType = TypeOps::prime_type(sctx->get_typemanager(), *aCastType); - theQuantifier = aCastType->get_quantifier(); + theCastType = TypeOps::prime_type(sctx->get_typemanager(), *castType); } @@ -198,9 +215,11 @@ void CastIterator::serialize(::zorba::serialization::Archiver& ar) { - serialize_baseclass(ar, (UnaryBaseIterator*)this); + serialize_baseclass(ar, (UnaryBaseIterator*)this); ar & theCastType; - SERIALIZE_ENUM(TypeConstants::quantifier_t, theQuantifier); + ar & theAllowEmpty; + + theNsCtx.setStaticContext(theSctx); } @@ -208,18 +227,17 @@ { store::Item_t item; bool valid = false; + const UserDefinedXQType* udt; + store::SchemaTypeCode targetType; - const TypeManager* tm = theSctx->get_typemanager(); + TypeManager* tm = theSctx->get_typemanager(); - PlanIteratorState* state; - DEFAULT_STACK_INIT(PlanIteratorState, state, planState); - - assert(theQuantifier == TypeConstants::QUANT_ONE || - theQuantifier == TypeConstants::QUANT_QUESTION); + CastIteratorState* state; + DEFAULT_STACK_INIT(CastIteratorState, state, planState); if (!consumeNext(item, theChild.getp(), planState)) { - if (theQuantifier == TypeConstants::QUANT_ONE) + if (!theAllowEmpty) { RAISE_ERROR(err::XPTY0004, loc, ERROR_PARAMS(ZED(EmptySeqNoCastToTypeWithQuantOne))); @@ -229,20 +247,42 @@ { if (theCastType->type_kind() == XQType::ATOMIC_TYPE_KIND) { - store::SchemaTypeCode targetType = - static_cast(theCastType.getp())->get_type_code(); + targetType = static_cast(theCastType.getp())->get_type_code(); + + GenericCast::castToBuiltinAtomic(result, item, targetType, NULL, loc); - valid = GenericCast::castToAtomic(result, item, targetType, tm, NULL, loc); + STACK_PUSH(true, state); } else { - assert(theCastType->type_kind() == XQType::USER_DEFINED_KIND); + ZORBA_ASSERT(theCastType->type_kind() == XQType::USER_DEFINED_KIND); - zstring strval; - item->getStringValue2(strval); - - namespace_context tmp_ctx(theSctx); - valid = GenericCast::castToAtomic(result, strval, theCastType, tm, &tmp_ctx, loc); + udt = static_cast(theCastType.getp()); + + if (udt->isAtomic()) + { + valid = GenericCast:: + castToAtomic(result, item, theCastType, tm, &theNsCtx, loc); + + STACK_PUSH(valid, state); + } + else + { + assert(udt->isList() || udt->isUnion()); + + valid = GenericCast:: + castToSimple(item, theCastType, &theNsCtx, state->theResultItems, tm, loc); + + state->theResultPos = 0; + + while (state->theResultPos < state->theResultItems.size()) + { + result = state->theResultItems[state->theResultPos]; + STACK_PUSH(true, state); + + ++state->theResultPos; + } + } } if (consumeNext(item, theChild.getp(), planState)) @@ -250,8 +290,6 @@ RAISE_ERROR(err::XPTY0004, loc, ERROR_PARAMS(ZED(NoSeqCastToTypeWithQuantOneOrQuestion))); } - - STACK_PUSH(valid, state); } STACK_END(state); @@ -264,17 +302,17 @@ /******************************************************************************* ********************************************************************************/ - CastableIterator::CastableIterator( static_context* sctx, - const QueryLoc& aLoc, - PlanIter_t& aChild, - const xqtref_t& aCastType) + const QueryLoc& loc, + PlanIter_t& child, + const xqtref_t& castType, + bool allowEmpty) : - UnaryBaseIterator(sctx, aLoc, aChild) + UnaryBaseIterator(sctx, loc, child), + theAllowEmpty(allowEmpty) { - theCastType = TypeOps::prime_type(sctx->get_typemanager(), *aCastType); - theQuantifier = aCastType->get_quantifier(); + theCastType = TypeOps::prime_type(sctx->get_typemanager(), *castType); } @@ -289,7 +327,7 @@ (UnaryBaseIterator*)this); ar & theCastType; - SERIALIZE_ENUM(TypeConstants::quantifier_t, theQuantifier); + ar & theAllowEmpty; } @@ -298,43 +336,22 @@ bool res; store::Item_t item; - const TypeManager* tm = theSctx->get_typemanager(); + TypeManager* tm = theSctx->get_typemanager(); PlanIteratorState* state; DEFAULT_STACK_INIT(PlanIteratorState, state, planState); if (!consumeNext(item, theChild.getp(), planState)) { - res = !(theQuantifier == TypeConstants::QUANT_PLUS || - theQuantifier == TypeConstants::QUANT_ONE); + res = theAllowEmpty; } else { res = GenericCast::isCastable(item, theCastType, tm); - if (res) + + if (consumeNext(item, theChild.getp(), planState)) { - if (consumeNext(item, theChild.getp(), planState)) - { - if (theQuantifier == TypeConstants::QUANT_ONE || - theQuantifier == TypeConstants::QUANT_QUESTION) - { - res = false; - } - else - { - res = true; - do - { - if (!GenericCast::isCastable(item, theCastType, tm)) - { - res = false; - theChild->reset(planState); - break; - } - } - while (consumeNext(item, theChild.getp(), planState)); - } - } + res = false; } } @@ -355,7 +372,7 @@ const QueryLoc& loc, PlanIter_t& child, const xqtref_t& promoteType, - ErrorKind err, + PromoteErrorKind err, store::Item_t qname) : UnaryBaseIterator(sctx, loc, child), @@ -379,7 +396,7 @@ ar & thePromoteType; SERIALIZE_ENUM(TypeConstants::quantifier_t, theQuantifier); - SERIALIZE_ENUM(ErrorKind, theErrorKind); + SERIALIZE_ENUM(PromoteErrorKind, theErrorKind); ar & theQName; } @@ -463,44 +480,54 @@ switch (theErrorKind) { - case FUNC_RETURN: + case PROMOTE_FUNC_RETURN: { assert(theQName != NULL); RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_FuncReturn), + ERROR_PARAMS(ZED(XPTY0004_NoReturnTypePromote_234), valueType, targetType, theQName->getStringValue())); break; } - case FUNC_PARAM: + case PROMOTE_FUNC_PARAM: { assert(theQName != NULL); + if (TypeOps::is_equal(theSctx->get_typemanager(), + *thePromoteType, + *GENV_TYPESYSTEM.NOTATION_TYPE_ONE, + loc)) + { + RAISE_ERROR(err::XPTY0117, loc, + ERROR_PARAMS(ZED(XPTY0117_NotationParam_23), + valueType, theQName->getStringValue())); + } + RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_FuncParam), + ERROR_PARAMS(ZED(XPTY0004_NoParamTypePromote_234), valueType, targetType, theQName->getStringValue())); break; } - case TYPE_PROMOTION: + case PROMOTE_TYPE_PROMOTION: { RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_TypePromotion), valueType, targetType)); + ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23), valueType, targetType)); break; } #ifdef ZORBA_WITH_JSON - case JSONIQ_ARRAY_SELECTOR: + case PROMOTE_JSONIQ_ARRAY_SELECTOR: { RAISE_ERROR(jerr::JNUP0007, loc, ERROR_PARAMS(ZED(JNUP0007_Array), valueType)); break; } - case JSONIQ_OBJECT_SELECTOR: + case PROMOTE_JSONIQ_OBJECT_SELECTOR: { RAISE_ERROR(jerr::JNUP0007, loc, ERROR_PARAMS(ZED(JNUP0007_Object), valueType)); break; } - case JSONIQ_SELECTOR: + case PROMOTE_JSONIQ_SELECTOR: { RAISE_ERROR(jerr::JNUP0007, loc, ERROR_PARAMS(ZED(JNUP0007_ObjectArray), valueType)); @@ -528,7 +555,7 @@ PlanIter_t& child, const xqtref_t& treatType, bool checkPrime, - ErrorKind errorKind, + TreatErrorKind errorKind, store::Item_t qname) : UnaryBaseIterator(sctx, loc, child), @@ -549,7 +576,7 @@ ar & theTreatType; SERIALIZE_ENUM(TypeConstants::quantifier_t, theQuantifier); ar & theCheckPrime; - SERIALIZE_ENUM(ErrorKind, theErrorKind); + SERIALIZE_ENUM(TreatErrorKind, theErrorKind); ar & theQName; } @@ -665,28 +692,28 @@ switch (theErrorKind) { - case FUNC_RETURN: + case TREAT_FUNC_RETURN: { assert(theQName != NULL); RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_FuncReturn), + ERROR_PARAMS(ZED(XPTY0004_NoReturnTypePromote_234), valueType, targetType, theQName->getStringValue())); break; } - case FUNC_PARAM: + case TREAT_FUNC_PARAM: { assert(theQName != NULL); RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_FuncParam), + ERROR_PARAMS(ZED(XPTY0004_NoParamTypePromote_234), valueType, targetType, theQName->getStringValue())); break; } - case TYPE_MATCH: + case TREAT_TYPE_MATCH: { RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_TypeMatch), valueType, targetType)); + ERROR_PARAMS(ZED(XPTY0004_NoTreatAs_23), valueType, targetType)); break; } case TREAT_EXPR: @@ -694,65 +721,64 @@ RAISE_ERROR(err::XPDY0050, loc, ERROR_PARAMS(valueType, targetType)); break; } - case INDEX_DOMAIN: + case TREAT_INDEX_DOMAIN: { RAISE_ERROR(zerr::ZDTY0010_INDEX_DOMAIN_TYPE_ERROR, loc, ERROR_PARAMS(theQName->getStringValue())); break; } - case INDEX_KEY: + case TREAT_INDEX_KEY: { RAISE_ERROR(zerr::ZDTY0011_INDEX_KEY_TYPE_ERROR, loc, ERROR_PARAMS(valueType, targetType, theQName->getStringValue())); break; } - case PATH_STEP: + case TREAT_PATH_STEP: { RAISE_ERROR_NO_PARAMS(err::XPTY0019, loc); break; } - case PATH_DOT: + case TREAT_PATH_DOT: { RAISE_ERROR_NO_PARAMS(err::XPTY0020, loc); break; } - case MULTI_VALUED_GROUPING_KEY: + case TREAT_MULTI_VALUED_GROUPING_KEY: { RAISE_ERROR(err::XPTY0004, loc, ERROR_PARAMS(ZED(XPTY0004_MultiValuedGroupingKey))); break; } #ifdef ZORBA_WITH_JSON - case JSONIQ_VALUE: + case TREAT_JSONIQ_VALUE: { RAISE_ERROR_NO_PARAMS(jerr::JNTY0002, loc); break; } - case JSONIQ_UPDATE_TARGET: + case TREAT_JSONIQ_UPDATE_TARGET: { RAISE_ERROR(jerr::JNUP0008, loc, ERROR_PARAMS(ZED(JNUP0008_ObjectArray), valueType)); break; } - case JSONIQ_OBJECT_UPDATE_TARGET: + case TREAT_JSONIQ_OBJECT_UPDATE_TARGET: { RAISE_ERROR(jerr::JNUP0008, loc, ERROR_PARAMS(ZED(JNUP0008_Object), valueType)); break; } - case JSONIQ_OBJECT_UPDATE_CONTENT: + case TREAT_JSONIQ_OBJECT_UPDATE_CONTENT: { - RAISE_ERROR(jerr::JNUP0019, loc, - ERROR_PARAMS(ZED(JNUP0019), valueType)); + RAISE_ERROR(jerr::JNUP0019, loc, ERROR_PARAMS(valueType)); break; } - case JSONIQ_ARRAY_UPDATE_TARGET: + case TREAT_JSONIQ_ARRAY_UPDATE_TARGET: { RAISE_ERROR(jerr::JNUP0008, loc, ERROR_PARAMS(ZED(JNUP0008_Array), valueType)); break; } - case JSONIQ_OBJECT_UPDATE_VALUE: + case TREAT_JSONIQ_OBJECT_UPDATE_VALUE: { RAISE_ERROR_NO_PARAMS(jerr::JNUP0017, loc); break; diff -Nru zorba-2.7.0-0/src/runtime/core/sequencetypes.h zorba-2.8.0-0/src/runtime/core/sequencetypes.h --- zorba-2.7.0-0/src/runtime/core/sequencetypes.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/core/sequencetypes.h 2013-01-16 18:28:18.000000000 +0000 @@ -24,6 +24,11 @@ #include "types/typeconstants.h" +#include "compiler/expression/expr_consts.h" + +#include "context/namespace_context.h" + + namespace zorba { @@ -67,27 +72,41 @@ http://www.w3.org/TR/xquery/#id-cast ********************************************************************************/ -class CastIterator : public UnaryBaseIterator +class CastIteratorState : public PlanIteratorState +{ +public: + std::vector theResultItems; + csize theResultPos; + + void init(PlanState&); + void reset(PlanState&); +}; + + +class CastIterator : public UnaryBaseIterator { friend class PrinterVisitor; private: - xqtref_t theCastType; - TypeConstants::quantifier_t theQuantifier; + xqtref_t theCastType; + bool theAllowEmpty; + + namespace_context theNsCtx; public: SERIALIZABLE_CLASS(CastIterator); SERIALIZABLE_CLASS_CONSTRUCTOR2T( CastIterator, - UnaryBaseIterator); + UnaryBaseIterator); void serialize(::zorba::serialization::Archiver& ar); public: CastIterator( static_context* sctx, const QueryLoc& loc, - PlanIter_t& aChild, - const xqtref_t& aCastType); + PlanIter_t& child, + const xqtref_t& castType, + bool allowEmpty); ~CastIterator(); @@ -108,8 +127,8 @@ friend class PrinterVisitor; private: - xqtref_t theCastType; - TypeConstants::quantifier_t theQuantifier; + xqtref_t theCastType; + bool theAllowEmpty; public: SERIALIZABLE_CLASS(CastableIterator); @@ -121,9 +140,10 @@ public: CastableIterator( static_context* sctx, - const QueryLoc& aLoc, - PlanIter_t& aChild, - const xqtref_t& aCastType); + const QueryLoc& loc, + PlanIter_t& child, + const xqtref_t& castType, + bool allowEmpty); ~CastableIterator(); @@ -143,21 +163,10 @@ { friend class PrinterVisitor; -public: - typedef enum - { - FUNC_RETURN, - FUNC_PARAM, - TYPE_PROMOTION, - JSONIQ_ARRAY_SELECTOR, - JSONIQ_OBJECT_SELECTOR, - JSONIQ_SELECTOR - } ErrorKind; - private: xqtref_t thePromoteType; TypeConstants::quantifier_t theQuantifier; - ErrorKind theErrorKind; + PromoteErrorKind theErrorKind; store::Item_t theQName; public: @@ -173,7 +182,7 @@ const QueryLoc& loc, PlanIter_t& child, const xqtref_t& promoteType, - ErrorKind err, + PromoteErrorKind err, store::Item_t qname = NULL); ~PromoteIterator(); @@ -202,31 +211,11 @@ { friend class PrinterVisitor; -public: - typedef enum - { - FUNC_RETURN, - FUNC_PARAM, - TYPE_MATCH, - TREAT_EXPR, - INDEX_DOMAIN, - INDEX_KEY, - PATH_STEP, - PATH_DOT, - MULTI_VALUED_GROUPING_KEY, - JSONIQ_VALUE, - JSONIQ_UPDATE_TARGET, - JSONIQ_OBJECT_UPDATE_TARGET, - JSONIQ_OBJECT_UPDATE_CONTENT, - JSONIQ_ARRAY_UPDATE_TARGET, - JSONIQ_OBJECT_UPDATE_VALUE - } ErrorKind; - private: xqtref_t theTreatType; TypeConstants::quantifier_t theQuantifier; bool theCheckPrime; - ErrorKind theErrorKind; + TreatErrorKind theErrorKind; store::Item_t theQName; public: @@ -243,7 +232,7 @@ PlanIter_t& child, const xqtref_t& treatType, bool check_prime, - ErrorKind errorKind, + TreatErrorKind errorKind, store::Item_t qname); void accept(PlanIterVisitor& v) const; diff -Nru zorba-2.7.0-0/src/runtime/core/var_iterators.cpp zorba-2.8.0-0/src/runtime/core/var_iterators.cpp --- zorba-2.7.0-0/src/runtime/core/var_iterators.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/core/var_iterators.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -464,9 +464,9 @@ else { RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); } - } // if (theTargetPosIter != NULL && theTargetLenIter == NULL) + } // if (theTargetPosIter != NULL && theTargetLenIter == NULL && theInfLen == false) else if (theTargetPosIter != NULL) { @@ -500,7 +500,9 @@ if (startPos <= Integer(0)) { - len += startPos - Integer(1); + if (!theInfLen) + len += startPos - Integer(1); + startPos = 1; } @@ -530,7 +532,7 @@ else { RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); } } // if (theTargetPosIter != NULL && theTargetLenIter != NULL) @@ -563,7 +565,7 @@ else { RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); } } // if (theTargetPos > 0) @@ -594,7 +596,7 @@ else { RAISE_ERROR(err::XPDY0002, loc, - ERROR_PARAMS(theVarName->getStringValue(), ZED(VariabledUndeclared))); + ERROR_PARAMS(ZED(XPDY0002_VariableUndeclared_2), theVarName->getStringValue())); } } @@ -957,7 +959,9 @@ if (startPos <= Integer(0)) { - len += startPos - Integer(1); + if (!theInfLen) + len += startPos - Integer(1); + startPos = 1; } diff -Nru zorba-2.7.0-0/src/runtime/datetime/datetime_impl.cpp zorba-2.8.0-0/src/runtime/datetime/datetime_impl.cpp --- zorba-2.7.0-0/src/runtime/datetime/datetime_impl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/datetime/datetime_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,357 @@ +/* + * Copyright 2006-2011 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "stdafx.h" + +#include + +#include + +#include "diagnostics/xquery_exception.h" +#include "runtime/datetime/datetime.h" +#include "store/api/item_factory.h" +#include "system/globalenv.h" +#include "util/ascii_util.h" +#include "util/time_parse.h" +#include "util/time_util.h" + +using namespace std; +using namespace zorba::locale; + +namespace zorba { + +enum parse_type { + parse_date, + parse_time, + parse_dateTime +}; + +/////////////////////////////////////////////////////////////////////////////// + +static void parse( parse_type parse_what, zstring const &buf, + zstring const &fmt, iso639_1::type lang, + iso3166_1::type country, time::ztm *tm, + QueryLoc const &loc ) { + try { + unsigned set_fields; + ::memset( tm, 0, sizeof( *tm ) ); + time::parse( buf, fmt, lang, country, tm, &set_fields ); + + bool set_mday = set_fields & time::set_mday; + bool set_mon = set_fields & time::set_mon; + bool const set_yday = set_fields & time::set_yday; + bool const set_year = set_fields & time::set_year; + + if ( set_yday && set_year && (!set_mday || !set_mon) ) { + // + // Given yday and year, "back fill" mday and/or mon. + // + time::calc_mday_mon( + tm->tm_yday, + set_mday ? nullptr : reinterpret_cast( &tm->tm_mday ), + set_mon ? nullptr : reinterpret_cast( &tm->tm_mon ), + tm->tm_year + ); + set_mday = set_mon = true; + } + + switch ( parse_what ) { + case parse_date: + if ( set_mday && set_mon && set_year ) + return; + break; + case parse_dateTime: + if ( !(set_mday && set_mon && set_year) ) + break; + // no break; + case parse_time: + if ( !(set_fields & time::set_hour) ) + break; + if ( !(set_fields & time::set_min) ) + tm->tm_min = 0; + if ( !(set_fields & time::set_sec) ) + tm->tm_sec = 0; + if ( !(set_fields & time::set_gmtoff) ) + tm->ZTM_GMTOFF = 0; + return; + } + + throw XQUERY_EXCEPTION( + zerr::ZDTP0005_INCOMPLETE_DATE_OR_TIME, + ERROR_PARAMS( fmt ), + ERROR_LOC( loc ) + ); + } + catch ( time::insufficient_buffer const& ) { + throw XQUERY_EXCEPTION( + zerr::ZDTP0002_INSUFFICIENT_BUFFER, + ERROR_PARAMS( buf, fmt ), + ERROR_LOC( loc ) + ); + } + catch ( time::invalid_specification const &e ) { + throw XQUERY_EXCEPTION( + zerr::ZDTP0001_INVALID_SPECIFICATION, + ERROR_PARAMS( ascii::printable_char( e.get_spec() ) ), + ERROR_LOC( loc ) + ); + } + catch ( time::invalid_value const &e ) { + throw XQUERY_EXCEPTION( + zerr::ZDTP0003_INVALID_VALUE, + ERROR_PARAMS( e.get_value(), e.get_specs() ), + ERROR_LOC( loc ) + ); + } + catch ( time::literal_mismatch const &e ) { + throw XQUERY_EXCEPTION( + zerr::ZDTP0004_LITERAL_MISMATCH, + ERROR_PARAMS( + ascii::printable_char( e.get_got() ), + ascii::printable_char( e.get_expected() ) + ), + ERROR_LOC( loc ) + ); + } +} + +static void parse_locale( store::Item_t const &item, iso639_1::type *lang, + iso3166_1::type *country, + QueryLoc const &loc ) { + zstring locale_str; + item->getStringValue2( locale_str ); + if ( !locale::parse( locale_str, lang, country ) ) + throw XQUERY_EXCEPTION( + zerr::ZXQP0011_INVALID_LOCALE, + ERROR_PARAMS( locale_str ), + ERROR_LOC( loc ) + ); + if ( !*lang || !*country ) + throw XQUERY_EXCEPTION( + zerr::ZXQP0012_UNKNOWN_LOCALE, + ERROR_PARAMS( locale_str ), + ERROR_LOC( loc ) + ); + if ( !locale::is_supported( *lang, *country ) ) + throw XQUERY_EXCEPTION( + zerr::ZOSE0007_UNSUPPORTED_LOCALE, + ERROR_PARAMS( locale_str ), + ERROR_LOC( loc ) + ); +} + +/////////////////////////////////////////////////////////////////////////////// + +bool CurrentDate::nextImpl( store::Item_t& result, + PlanState &plan_state ) const { + time::ztm tm; + time::get_gmtime( &tm ); + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + + GENV_ITEMFACTORY->createDate( + result, + static_cast( tm.tm_year + TM_YEAR_BASE ), + static_cast( tm.tm_mon + 1 ), + static_cast( tm.tm_mday ) + ); + + STACK_PUSH( true, state ); + STACK_END( state ); +} + +bool CurrentDateTime::nextImpl( store::Item_t& result, + PlanState &plan_state ) const { + time_t sec; + time::usec_type usec; + time::get_epoch( &sec, &usec ); + time::ztm tm; + time::get_gmtime( &tm, sec ); + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + + GENV_ITEMFACTORY->createDateTime( + result, + static_cast( tm.tm_year + TM_YEAR_BASE ), + static_cast( tm.tm_mon + 1 ), + static_cast( tm.tm_mday ), + static_cast( tm.tm_hour ), + static_cast( tm.tm_min ), + tm.tm_sec + usec / 1000000.0, + static_cast( tm.ZTM_GMTOFF / 3600 ) + ); + + STACK_PUSH( true, state ); + STACK_END( state ); +} + +bool CurrentTime::nextImpl( store::Item_t& result, + PlanState &plan_state ) const { + time_t sec; + time::usec_type usec; + time::get_epoch( &sec, &usec ); + time::ztm tm; + time::get_gmtime( &tm, sec ); + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + + GENV_ITEMFACTORY->createTime( + result, + static_cast( tm.tm_hour ), + static_cast( tm.tm_min ), + tm.tm_sec + usec / 1000000.0, + static_cast( tm.ZTM_GMTOFF / 3600 ) + ); + + STACK_PUSH( true, state ); + STACK_END( state ); +} + +bool ParseDate::nextImpl( store::Item_t& result, PlanState &plan_state ) const { + store::Item_t item; + zstring buf, fmt; + iso639_1::type lang; + iso3166_1::type country; + time::ztm tm; + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + + consumeNext( item, theChildren[0], plan_state ); + item->getStringValue2( buf ); + consumeNext( item, theChildren[1], plan_state ); + item->getStringValue2( fmt ); + if ( theChildren.size() > 2 ) { + consumeNext( item, theChildren[2], plan_state ); + parse_locale( item, &lang, &country, loc ); + } else { + lang = iso639_1::unknown; + country = iso3166_1::unknown; + } + + parse( parse_date, buf, fmt, lang, country, &tm, loc ); + GENV_ITEMFACTORY->createDate( + result, + static_cast( tm.tm_year + TM_YEAR_BASE ), + static_cast( tm.tm_mon + 1 ), + static_cast( tm.tm_mday ) + ); + + STACK_PUSH( true, state ); + STACK_END( state ); +} + +bool ParseDateTime::nextImpl( store::Item_t& result, + PlanState &plan_state ) const { + store::Item_t item; + zstring buf, fmt; + iso639_1::type lang; + iso3166_1::type country; + time::ztm tm; + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + + consumeNext( item, theChildren[0], plan_state ); + item->getStringValue2( buf ); + consumeNext( item, theChildren[1], plan_state ); + item->getStringValue2( fmt ); + if ( theChildren.size() > 2 ) { + consumeNext( item, theChildren[2], plan_state ); + parse_locale( item, &lang, &country, loc ); + } else { + lang = iso639_1::unknown; + country = iso3166_1::unknown; + } + + parse( parse_dateTime, buf, fmt, lang, country, &tm, loc ); + GENV_ITEMFACTORY->createDateTime( + result, + static_cast( tm.tm_year + TM_YEAR_BASE ), + static_cast( tm.tm_mon + 1 ), + static_cast( tm.tm_mday ), + static_cast( tm.tm_hour ), + static_cast( tm.tm_min ), + tm.tm_sec, + static_cast( tm.ZTM_GMTOFF / 3600 ) + ); + + STACK_PUSH( true, state ); + STACK_END( state ); +} + +bool ParseTime::nextImpl( store::Item_t& result, PlanState &plan_state ) const { + store::Item_t item; + zstring buf, fmt; + iso639_1::type lang; + iso3166_1::type country; + time::ztm tm; + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + + consumeNext( item, theChildren[0], plan_state ); + item->getStringValue2( buf ); + consumeNext( item, theChildren[1], plan_state ); + item->getStringValue2( fmt ); + if ( theChildren.size() > 2 ) { + consumeNext( item, theChildren[2], plan_state ); + parse_locale( item, &lang, &country, loc ); + } else { + lang = iso639_1::unknown; + country = iso3166_1::unknown; + } + + parse( parse_time, buf, fmt, lang, country, &tm, loc ); + GENV_ITEMFACTORY->createTime( + result, + static_cast( tm.tm_hour ), + static_cast( tm.tm_min ), + tm.tm_sec, + static_cast( tm.ZTM_GMTOFF / 3600 ) + ); + + STACK_PUSH( true, state ); + STACK_END( state ); +} + +bool Timestamp::nextImpl( store::Item_t& result, + PlanState &plan_state ) const { + time_t sec; + time::get_epoch( &sec ); + + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + GENV_ITEMFACTORY->createLong( result, sec ); + STACK_PUSH( true, state ); + STACK_END( state ); +} + +bool UTCOffset::nextImpl( store::Item_t& result, + PlanState &plan_state ) const { + PlanIteratorState *state; + DEFAULT_STACK_INIT( PlanIteratorState, state, plan_state ); + GENV_ITEMFACTORY->createLong( result, time::get_gmt_offset() ); + STACK_PUSH( true, state ); + STACK_END( state ); +} + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace zorba +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/runtime/datetime/pregenerated/datetime.cpp zorba-2.8.0-0/src/runtime/datetime/pregenerated/datetime.cpp --- zorba-2.7.0-0/src/runtime/datetime/pregenerated/datetime.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/datetime/pregenerated/datetime.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,262 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** + +#include "stdafx.h" +#include "zorbatypes/rchandle.h" +#include "zorbatypes/zstring.h" +#include "runtime/visitors/planiter_visitor.h" +#include "runtime/datetime/datetime.h" +#include "system/globalenv.h" + + + +namespace zorba { + +// +SERIALIZABLE_CLASS_VERSIONS(CurrentDate) + +void CurrentDate::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void CurrentDate::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +CurrentDate::~CurrentDate() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(CurrentDateTime) + +void CurrentDateTime::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void CurrentDateTime::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +CurrentDateTime::~CurrentDateTime() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(CurrentTime) + +void CurrentTime::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void CurrentTime::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +CurrentTime::~CurrentTime() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(ParseDate) + +void ParseDate::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void ParseDate::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +ParseDate::~ParseDate() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(ParseDateTime) + +void ParseDateTime::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void ParseDateTime::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +ParseDateTime::~ParseDateTime() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(ParseTime) + +void ParseTime::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void ParseTime::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +ParseTime::~ParseTime() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(Timestamp) + +void Timestamp::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void Timestamp::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +Timestamp::~Timestamp() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(UTCOffset) + +void UTCOffset::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void UTCOffset::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +UTCOffset::~UTCOffset() {} + +// + + + +} + + diff -Nru zorba-2.7.0-0/src/runtime/datetime/pregenerated/datetime.h zorba-2.8.0-0/src/runtime/datetime/pregenerated/datetime.h --- zorba-2.7.0-0/src/runtime/datetime/pregenerated/datetime.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/datetime/pregenerated/datetime.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,299 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** +#ifndef ZORBA_RUNTIME_DATETIME_DATETIME_H +#define ZORBA_RUNTIME_DATETIME_DATETIME_H + + +#include "common/shared_types.h" + + + +#include "runtime/base/narybase.h" +#include "runtime/base/narybase.h" + + +namespace zorba { + +/** + * + * function for getting the current date + * + * Author: Zorba Team + */ +class CurrentDate : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(CurrentDate); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentDate, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + CurrentDate( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~CurrentDate(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * function for getting the current date and time + * + * Author: Zorba Team + */ +class CurrentDateTime : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(CurrentDateTime); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentDateTime, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + CurrentDateTime( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~CurrentDateTime(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * function for getting the current time + * + * Author: Zorba Team + */ +class CurrentTime : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(CurrentTime); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentTime, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + CurrentTime( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~CurrentTime(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * function for parsing strings into a date + * + * Author: Zorba Team + */ +class ParseDate : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(ParseDate); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(ParseDate, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + ParseDate( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~ParseDate(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * function for parsing strings into a dateTime + * + * Author: Zorba Team + */ +class ParseDateTime : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(ParseDateTime); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(ParseDateTime, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + ParseDateTime( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~ParseDateTime(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * function for parsing strings into a time + * + * Author: Zorba Team + */ +class ParseTime : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(ParseTime); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(ParseTime, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + ParseTime( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~ParseTime(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * function for getting the current number of seconds since epoch + * + * Author: Zorba Team + */ +class Timestamp : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(Timestamp); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(Timestamp, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + Timestamp( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~Timestamp(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * function for getting the current offset from UTC + * + * Author: Zorba Team + */ +class UTCOffset : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(UTCOffset); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(UTCOffset, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + UTCOffset( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~UTCOffset(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +} +#endif +/* + * Local variables: + * mode: c++ + * End: + */ diff -Nru zorba-2.7.0-0/src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp zorba-2.8.0-0/src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp --- zorba-2.7.0-0/src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/durations_dates_times/DurationsDatesTimesImpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -120,9 +120,9 @@ dt = std::auto_ptr(item0->getDateTimeValue().adjustToTimeZone( planState.theLocalDynCtx->get_implicit_timezone())); } - catch (InvalidTimezoneException const&) + catch (InvalidTimezoneException const &e) { - throw XQUERY_EXCEPTION(err::FODT0003); + throw XQUERY_EXCEPTION(err::FODT0003, ERROR_PARAMS(e.get_tz_seconds())); } STACK_PUSH(GENV_ITEMFACTORY->createDateTime(result, dt.get()), state); } @@ -151,9 +151,9 @@ { dt = std::auto_ptr(item0->getDateTimeValue().adjustToTimeZone(!s1 ? NULL : &item1->getDayTimeDurationValue())); } - catch (InvalidTimezoneException const&) + catch (InvalidTimezoneException const &e) { - throw XQUERY_EXCEPTION(err::FODT0003); + throw XQUERY_EXCEPTION(err::FODT0003, ERROR_PARAMS(e.get_tz_seconds())); } STACK_PUSH(GENV_ITEMFACTORY->createDateTime(result, dt.get()), state); } diff -Nru zorba-2.7.0-0/src/runtime/eval/eval.cpp zorba-2.8.0-0/src/runtime/eval/eval.cpp --- zorba-2.7.0-0/src/runtime/eval/eval.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/eval/eval.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -30,6 +30,7 @@ #include "compiler/api/compilercb.h" #include "compiler/api/compiler_api.h" #include "compiler/expression/var_expr.h" +#include "compiler/expression/expr_manager.h" #include "context/dynamic_context.h" #include "context/static_context.h" @@ -166,6 +167,8 @@ // Compile state->thePlan = compile(evalCCB, item->getStringValue(), maxOuterVarId); + planState.theCompilerCB->theNextVisitId = evalCCB->theNextVisitId + 1; + // Set the values for the (explicit) external vars of the eval query setExternalVariables(evalCCB, importSctx, evalSctx, evalDctx); @@ -276,6 +279,7 @@ for (csize i = 0; i < numOuterVars; ++i) { var_expr* ve = evalCCB->theEM->create_var_expr(importSctx, + NULL, loc, var_expr::prolog_var, theOuterVarNames[i].getp()); @@ -306,7 +310,7 @@ ve->set_unique_id(outerGlobalVarId); } - importSctx->bind_var(ve, loc, err::XQST0049); + importSctx->bind_var(ve, loc); } // Import the outer-query ns bindings diff -Nru zorba-2.7.0-0/src/runtime/full_text/ft_module_impl.cpp zorba-2.8.0-0/src/runtime/full_text/ft_module_impl.cpp --- zorba-2.7.0-0/src/runtime/full_text/ft_module_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/full_text/ft_module_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -82,7 +82,7 @@ ), ERROR_LOC( loc ) ); - if ( iso639_1::type const lang = find_lang( lang_string.c_str() ) ) + if ( iso639_1::type const lang = find_lang( lang_string ) ) return lang; throw XQUERY_EXCEPTION( err::FTST0009 /* lang not supported */, diff -Nru zorba-2.7.0-0/src/runtime/full_text/ft_token_matcher.cpp zorba-2.8.0-0/src/runtime/full_text/ft_token_matcher.cpp --- zorba-2.7.0-0/src/runtime/full_text/ft_token_matcher.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/full_text/ft_token_matcher.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -23,6 +23,8 @@ #include "util/cxx_util.h" #include "util/stl_util.h" +#include "system/globalenv.h" + #include "ft_stop_words_set.h" #include "ft_token_matcher.h" #include "ft_util.h" diff -Nru zorba-2.7.0-0/src/runtime/full_text/ft_util.cpp zorba-2.8.0-0/src/runtime/full_text/ft_util.cpp --- zorba-2.7.0-0/src/runtime/full_text/ft_util.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/full_text/ft_util.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -41,7 +41,7 @@ if ( qname && qname->getLocalName() == "lang" && qname->getNamespace() == XML_NS ) { - *lang = locale::find_lang( attr->getStringValue().c_str() ); + *lang = locale::find_lang( attr->getStringValue() ); found_lang = true; break; } diff -Nru zorba-2.7.0-0/src/runtime/full_text/ftcontains_visitor.cpp zorba-2.8.0-0/src/runtime/full_text/ftcontains_visitor.cpp --- zorba-2.7.0-0/src/runtime/full_text/ftcontains_visitor.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/full_text/ftcontains_visitor.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -24,6 +24,9 @@ #include "compiler/parser/query_loc.h" #include "diagnostics/xquery_diagnostics.h" #include "store/api/store.h" + +#include "system/globalenv.h" + #include "util/cxx_util.h" #include "util/indent.h" #include "util/stl_util.h" diff -Nru zorba-2.7.0-0/src/runtime/full_text/thesauri/wn_thesaurus.cpp zorba-2.8.0-0/src/runtime/full_text/thesauri/wn_thesaurus.cpp --- zorba-2.7.0-0/src/runtime/full_text/thesauri/wn_thesaurus.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/full_text/thesauri/wn_thesaurus.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -37,6 +37,8 @@ #include "diagnostics/xquery_diagnostics.h" #include "zorbautils/locale.h" +#include "system/globalenv.h" + #include "decode_base128.h" #include "wn_db_segment.h" #include "wn_synset.h" diff -Nru zorba-2.7.0-0/src/runtime/full_text/thesauri/xqftts_thesaurus.cpp zorba-2.8.0-0/src/runtime/full_text/thesauri/xqftts_thesaurus.cpp --- zorba-2.7.0-0/src/runtime/full_text/thesauri/xqftts_thesaurus.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/full_text/thesauri/xqftts_thesaurus.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -34,6 +34,8 @@ #include "diagnostics/xquery_diagnostics.h" #include "diagnostics/dict.h" +#include "system/globalenv.h" + #include "xqftts_thesaurus.h" using namespace std; diff -Nru zorba-2.7.0-0/src/runtime/function_item/dynamic_fncall_iterator.cpp zorba-2.8.0-0/src/runtime/function_item/dynamic_fncall_iterator.cpp --- zorba-2.7.0-0/src/runtime/function_item/dynamic_fncall_iterator.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/function_item/dynamic_fncall_iterator.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -167,7 +167,7 @@ if (!consumeNext(targetItem, theChildren[0], planState)) { RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_TypePromotion), + ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23), "empty-sequence()", GENV_TYPESYSTEM.ANY_FUNCTION_TYPE_ONE->toSchemaString())); } @@ -177,7 +177,7 @@ if (consumeNext(item, theChildren[0], planState)) { RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_NoMultiSeqTypePromotion), + ERROR_PARAMS(ZED(XPTY0004_NoMultiSeqTypePromotion_2), GENV_TYPESYSTEM.ANY_FUNCTION_TYPE_ONE->toSchemaString())); } @@ -270,12 +270,12 @@ store::SchemaTypeCode selectorType = (isObjectNav ? store::XS_STRING : store::XS_INTEGER); - selectorError = ! GenericCast::castToAtomic(selectorItem3, - selectorItem2, - selectorType, - tm, - NULL, - loc); + GenericCast::castToBuiltinAtomic(selectorItem3, + selectorItem2, + selectorType, + NULL, + loc); + selectorError = false; } } } @@ -308,7 +308,7 @@ xqtref_t type = tm->create_value_type(targetItem); RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_TypePromotion), + ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23), type->toSchemaString(), GENV_TYPESYSTEM.ANY_FUNCTION_TYPE_ONE->toSchemaString())); } diff -Nru zorba-2.7.0-0/src/runtime/function_item/function_item.cpp zorba-2.8.0-0/src/runtime/function_item/function_item.cpp --- zorba-2.7.0-0/src/runtime/function_item/function_item.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/function_item/function_item.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -21,6 +21,7 @@ #include "compiler/api/compilercb.h" #include "compiler/expression/function_item_expr.h" +#include "compiler/expression/expr_manager.h" #include "functions/signature.h" #include "functions/udf.h" @@ -126,7 +127,7 @@ PlanIter_t FunctionItem::getImplementation(std::vector& args) const { - expr* dummy = theCCB->theEM->create_function_item_expr(theSctx, theLoc); + expr* dummy = theCCB->theEM->create_function_item_expr(theSctx, NULL, theLoc); PlanIter_t udfCallIterator = theFunction->codegen(theCCB, theSctx, diff -Nru zorba-2.7.0-0/src/runtime/introspection/sctx_impl.cpp zorba-2.8.0-0/src/runtime/introspection/sctx_impl.cpp --- zorba-2.7.0-0/src/runtime/introspection/sctx_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/introspection/sctx_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -102,7 +102,7 @@ consumeNext(lName, theChildren[0].getp(), aPlanState); - if (theSctx->lookup_ns(ns, lName->getStringValue(), loc, zerr::ZXQP0000_NO_ERROR)) + if (theSctx->lookup_ns(ns, lName->getStringValue(), loc, false)) { STACK_PUSH(GENV_ITEMFACTORY->createString(aResult, ns), state); } diff -Nru zorba-2.7.0-0/src/runtime/json/json_impl.cpp zorba-2.8.0-0/src/runtime/json/json_impl.cpp --- zorba-2.7.0-0/src/runtime/json/json_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/json/json_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -24,8 +24,8 @@ #include "store/api/item_factory.h" #include "system/globalenv.h" +#include "util/ascii_util.h" #include "util/mem_streambuf.h" -#include "util/string_util.h" #include "jsonml_array.h" #include "snelson.h" @@ -105,9 +105,7 @@ catch ( json::illegal_character const &e ) { throw XQUERY_EXCEPTION( zerr::ZJPE0001_ILLEGAL_CHARACTER, - ERROR_PARAMS(zstring("#x") + - BUILD_STRING(std::uppercase << std::hex - << (static_cast(e.get_char()) & 0xFF)) ), + ERROR_PARAMS( ascii::printable_char( e.get_char() ) ), ERROR_LOC( e.get_loc() ) ); } diff -Nru zorba-2.7.0-0/src/runtime/json/json_loader.cpp zorba-2.8.0-0/src/runtime/json/json_loader.cpp --- zorba-2.7.0-0/src/runtime/json/json_loader.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/json/json_loader.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,277 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "stdafx.h" +#include + +#ifdef ZORBA_WITH_JSON + +// Zorba +#include +#include +#include + +#include "context/static_context.h" +#include "diagnostics/xquery_diagnostics.h" +#include "store/api/item_factory.h" +#include "system/globalenv.h" +#include "zorbatypes/zstring.h" + +// local +#include "json_loader.h" + +using namespace std; + +namespace zorba { +namespace json { + +/////////////////////////////////////////////////////////////////////////////// + +loader::stack_element::stack_element( type t ) : type_( t ) { + switch ( type_ ) { + case array_type: + array_ = new json_array_type; + break; + case object_type: + object_ = new json_object_type; + break; + default: + key_ = nullptr; + break; + } +} + +/** + * Destroys a %stack_element. We have this as an ordinary member function + * rather than a destructor so that popping the stack and destroying an element + * are distinct operations and can be called independently which comes in + * handy. + */ +void loader::stack_element::destroy() { + switch ( type_ ) { + case array_type: + delete array_; + break; + case object_type: + delete object_; + break; + case key_type: + key_->removeReference(); + break; + default: + break; + } +} + +/////////////////////////////////////////////////////////////////////////////// + +loader::loader( istream &is, bool allow_multiple, bool strip_top_level_array ) : + parser_( is, allow_multiple ), + strip_top_level_array_( strip_top_level_array ), + stripped_top_level_array_( false ) +{ +} + +loader::~loader() { + clear_stack(); +} + +void loader::add_value( store::Item_t const &value ) { + stack_element top( stack_.top() ); + switch ( top.type_ ) { + case stack_element::array_type: + top.array_->push_back( value ); + break; + case stack_element::object_type: + // + // value must be a string that's the name of the object's next key/value + // pair. + // + push( stack_element::key_type ).key_ = value.getp(); + value->addReference(); + break; + case stack_element::key_type: { + // + // Otherwise, the top of the stack must be a string which means that the + // second-to-top must be an object awaiting a value associated with this + // name. + // + stack_.pop(); + stack_element &top2 = stack_.top(); + assert( top2.type_ == stack_element::object_type ); + top2.object_->keys_.push_back( top.key_ ); + top2.object_->values_.push_back( value ); + top.destroy(); + break; + } + default: + assert( false ); + } +} + +void loader::clear() { + parser_.clear(); + clear_stack(); + stripped_top_level_array_ = false; +} + +void loader::clear_stack() { + while ( !stack_.empty() ) { + stack_.top().destroy(); + stack_.pop(); + } +} + +bool loader::next( store::Item_t *result ) { + store::Item_t item; + zstring s; + json::token t; + + try { + while ( parser_.next( &t ) ) { + switch( t.get_type() ) { + case '[': + if ( strip_top_level_array_ && !stripped_top_level_array_ ) + stripped_top_level_array_ = true; + else + push( stack_element::array_type ); + continue; + case '{': + push( stack_element::object_type ); + continue; + case ']': + if ( stack_.empty() && strip_top_level_array_ ) { + stripped_top_level_array_ = false; + continue; + } + case '}': { + stack_element top( stack_.top() ); + stack_.pop(); + switch ( top.type_ ) { + case stack_element::array_type: + GENV_ITEMFACTORY->createJSONArray( item, *top.array_ ); + break; + case stack_element::object_type: + GENV_ITEMFACTORY->createJSONObject( + item, top.object_->keys_, top.object_->values_ + ); + break; + default: + assert( false ); + } // switch + top.destroy(); + break; + } + case ':': + case ',': + continue; + case token::number: + s = t.get_value(); + GENV_ITEMFACTORY->createJSONNumber( item, s ); + break; + case token::string: + s = t.get_value(); + GENV_ITEMFACTORY->createString( item, s ); + break; + case 'F': + case 'T': + GENV_ITEMFACTORY->createBoolean( item, t.get_type() == 'T' ); + break; + case token::json_null: + GENV_ITEMFACTORY->createJSONNull( item ); + break; + default: + assert( false ); + } // switch + + if ( stack_.empty() ) { + *result = item; + return true; + } + add_value( item ); + } // while + return false; + } // try + catch ( json::illegal_character const &e ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( + ZED( JNDY0021_IllegalCharacter_2 ), + ascii::printable_char( e.get_char() ) + ), + ERROR_LOC( e.get_loc() ) + ); + } + catch ( json::illegal_codepoint const &e ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( + ZED( JNDY0021_IllegalCodepoint_2 ), + e.get_codepoint() + ), + ERROR_LOC( e.get_loc() ) + ); + } + catch ( json::illegal_escape const &e ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( + ZED( JNDY0021_IllegalEscape_2 ), + ascii::printable_char( e.get_escape() ) + ), + ERROR_LOC( e.get_loc() ) + ); + } + catch ( json::illegal_literal const &e ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( ZED( JNDY0021_IllegalLiteral ) ), + ERROR_LOC( e.get_loc() ) + ); + } + catch ( json::illegal_number const &e ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( ZED( JNDY0021_IllegalNumber ) ), + ERROR_LOC( e.get_loc() ) + ); + } + catch ( json::unexpected_token const &e ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( + ZED( JNDY0021_UnexpectedToken_2 ), + e.get_token() + ), + ERROR_LOC( e.get_loc() ) + ); + } + catch ( json::unterminated_string const &e ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( ZED( JNDY0021_UnterminatedString ) ), + ERROR_LOC( e.get_loc() ) + ); + } +} + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace json +} // namespace zorba + +#endif /* ZORBA_WITH_JSON */ +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/runtime/json/json_loader.h zorba-2.8.0-0/src/runtime/json/json_loader.h --- zorba-2.7.0-0/src/runtime/json/json_loader.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/json/json_loader.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * Copyright 2006-2011 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ZORBA_JSON_LOADER_H +#define ZORBA_JSON_LOADER_H + +// standard +#include +#include +#include /* for pair */ +#include + +// Zorba +#include "store/api/item.h" +#include "util/json_parser.h" +#include "zorbatypes/zstring.h" + +namespace zorba { +namespace json { + +/////////////////////////////////////////////////////////////////////////////// + +class loader { +public: + typedef parser::line_type line_type; + typedef parser::column_type column_type; + + /** + * Constructs a %loader. + * + * @param is The istream to read from. + * @param allow_multiple If \c true, allow multiple top-level JSON items to + * be returned. + * @param strip_top_level_array If \c true, strips the top-level array, if + * any. + */ + loader( std::istream &is, bool allow_multiple = false, + bool strip_top_level_array = false ); + + /** + * Destroys this %loader. + */ + ~loader(); + + /** + * Resets this %loader to its initial state. + */ + void clear(); + + /** + * Gets the next Item, if any. + * + * @param result A pointer to the Item to receive the Item. + * @return Returns \c true only if an Item was gotten. + */ + bool next( store::Item_t *result ); + + /** + * Sets the file location. + * + * @param file The source file name. + * @param line The source line number. + * @param col The source column number. + */ + void set_loc( char const *file, line_type line, column_type col ) { + parser_.set_loc( file, line, col ); + } + +private: + typedef std::vector json_array_type; + + struct json_object_type { + std::vector keys_; + std::vector values_; + }; + + struct stack_element { + enum type { + no_type, + array_type, + object_type, + key_type + }; + type const type_; + union { + json_array_type *array_; + json_object_type *object_; + store::Item *key_; + }; + + stack_element( type = no_type ); + void destroy(); + }; + + typedef std::stack stack_type; + stack_type stack_; + + void add_value( store::Item_t const& ); + void clear_stack(); + + stack_element& push( stack_element::type t ) { + // + // We push in this convoluted manner since we can't use C++11 rvalue + // references. + // + stack_.push( stack_element() ); + return *new( &stack_.top() ) stack_element( t ); + } + + parser parser_; + bool const strip_top_level_array_; + bool stripped_top_level_array_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace json +} // namespace zorba + +#endif /* ZORBA_JSON_LOADER_H */ +/* + * Local variables: + * mode: c++ + * End: + */ +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/runtime/json/jsoniq_functions_impl.cpp zorba-2.8.0-0/src/runtime/json/jsoniq_functions_impl.cpp --- zorba-2.7.0-0/src/runtime/json/jsoniq_functions_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/json/jsoniq_functions_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -40,19 +40,28 @@ #include "zorba/internal/diagnostic.h" #include "context/static_context.h" +#include "context/namespace_context.h" #include "types/casting.h" #include "types/typeimpl.h" #include "types/typeops.h" #include "types/root_typemanager.h" -#include "store/api/pul.h" -#include "store/api/item.h" -#include "store/api/item_factory.h" -#include "store/api/store.h" -#include "store/api/copymode.h" +#include + +#include +#include +#include +#include +#include + +#include "util/uri_util.h" #include +#include + +#include "json_loader.h" + namespace zorba { @@ -738,51 +747,59 @@ { PlanIteratorState::init(aState); theAllowMultiple = true; // default - theInputStream = 0; + theInputStream = nullptr; theGotOne = false; + loader_ = nullptr; } void JSONParseIteratorState::reset(PlanState& aState) { PlanIteratorState::reset(aState); - if (theInput == NULL && theInputStream) - { + if (theInput == NULL) { delete theInputStream; + theInputStream = nullptr; } + theGotOne = false; + delete loader_; + loader_ = nullptr; } JSONParseIteratorState::~JSONParseIteratorState() { - if (theInput == NULL && theInputStream) - { + if (theInput == NULL) delete theInputStream; - } + delete loader_; } -void -JSONParseIterator::processOptions( - const store::Item_t& aOptions, - bool& aAllowMultiple) const -{ - store::Item_t lOptionName, lOptionValue; - - zstring s("jsoniq-multiple-top-level-items"); - GENV_ITEMFACTORY->createString(lOptionName, s); - lOptionValue = aOptions->getObjectValue(lOptionName); - - if (lOptionValue != NULL) - { - store::SchemaTypeCode lType = lOptionValue->getTypeCode(); - if (!TypeOps::is_subtype(lType, store::XS_BOOLEAN)) - { - const TypeManager* tm = theSctx->get_typemanager(); - xqtref_t lType = tm->create_value_type(lOptionValue, loc); - RAISE_ERROR(jerr::JNTY0020, loc, - ERROR_PARAMS(lType->toSchemaString(), s, "xs:boolean")); +bool JSONParseIterator::processBooleanOption( store::Item_t const &options, + char const *option_name, + bool *option_value ) const +{ + store::Item_t i_option_name; + zstring z_option_name( option_name ); + GENV_ITEMFACTORY->createString( i_option_name, z_option_name ); + store::Item_t i_option_value = options->getObjectValue( i_option_name ); + + if ( i_option_value ) { + store::SchemaTypeCode const option_type = i_option_value->getTypeCode(); + if ( !TypeOps::is_subtype( option_type, store::XS_BOOLEAN ) ) { + TypeManager const *const tm = theSctx->get_typemanager(); + xqtref_t const option_type = tm->create_value_type( i_option_value, loc ); + throw XQUERY_EXCEPTION( + jerr::JNTY0020, + ERROR_PARAMS( + option_type->toSchemaString(), + z_option_name, + "xs:boolean" + ), + ERROR_LOC( loc ) + ); } - aAllowMultiple = lOptionValue->getBooleanValue(); + *option_value = i_option_value->getBooleanValue(); + return true; } + return false; } bool @@ -791,6 +808,7 @@ PlanState& planState) const { store::Item_t lInput; + bool lStripTopLevelArray = false; JSONParseIteratorState* state; DEFAULT_STACK_INIT(JSONParseIteratorState, state, planState); @@ -801,7 +819,12 @@ { store::Item_t lOptions; consumeNext(lOptions, theChildren[1].getp(), planState); - processOptions(lOptions, state->theAllowMultiple); + processBooleanOption( + lOptions, "jsoniq-multiple-top-level-items", &state->theAllowMultiple + ); + processBooleanOption( + lOptions, "jsoniq-strip-top-level-array", &lStripTopLevelArray + ); } if (lInput->isStreamable()) @@ -812,59 +835,36 @@ else { // will be deleted in the state - state->theInputStream = new std::stringstream( - lInput->getStringValue().c_str()); + state->theInputStream = + new std::stringstream( lInput->getStringValue().c_str() ); } - while (true) - { - try - { - // streamable string or non-literal string - if (state->theInput != NULL || theRelativeLocation == QueryLoc::null) - { - result = GENV_STORE.parseJSON(*state->theInputStream, 0); - } - else - { - // pass the query location of the StringLiteral to the JSON - // parser such that it can give better error locations. - zorba::internal::diagnostic::location lLoc; - lLoc = ERROR_LOC(theRelativeLocation); - result = GENV_STORE.parseJSON(*state->theInputStream, &lLoc); - } - } - catch (zorba::XQueryException& e) - { - // rethrow with JNDY0021 - XQueryException xq = XQUERY_EXCEPTION( - jerr::JNDY0021, - ERROR_PARAMS(e.what()), - ERROR_LOC(loc)); - - // use location of e in case of literal string - if (!(theRelativeLocation == QueryLoc::null)) set_source(xq, e); - throw xq; - } - - if (result != NULL) - { - if (!state->theAllowMultiple && state->theGotOne) - { - RAISE_ERROR(jerr::JNDY0021, loc, - ERROR_PARAMS(ZED(JSON_UNEXPECTED_EXTRA_CONTENT))); - } - state->theGotOne = true; - STACK_PUSH(true, state); - continue; - } - else - { - break; + state->loader_ = new json::loader( + *state->theInputStream, true, lStripTopLevelArray + ); + + if ( state->theInput == NULL && theRelativeLocation ) { + // pass the query location of the StringLiteral to the JSON + // parser such that it can give better error locations. + state->loader_->set_loc( + theRelativeLocation.getFilename().c_str(), + theRelativeLocation.getLineBegin(), + theRelativeLocation.getColumnBegin() + ); + } + + while ( state->loader_->next( &result ) ) { + if ( !state->theAllowMultiple && state->theGotOne ) { + throw XQUERY_EXCEPTION( + jerr::JNDY0021, + ERROR_PARAMS( ZED( JNDY0021_UnexpectedExtraContent ) ), + ERROR_LOC( loc ) + ); } + state->theGotOne = true; + STACK_PUSH( true, state ); } } - STACK_END(state); } @@ -1154,7 +1154,7 @@ xqtref_t type = tm->create_value_type(selector, loc); RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_NoTypePromotion_23), + ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23), type->toSchemaString(), GENV_TYPESYSTEM.INTEGER_TYPE_ONE->toSchemaString())); } @@ -1172,7 +1172,7 @@ xqtref_t type = tm->create_value_type(selector, loc); RAISE_ERROR(err::XPTY0004, loc, - ERROR_PARAMS(ZED(XPTY0004_NoTypePromotion_23), + ERROR_PARAMS(ZED(XPTY0004_NoTypePromote_23), type->toSchemaString(), GENV_TYPESYSTEM.STRING_TYPE_ONE->toSchemaString())); } @@ -1597,8 +1597,94 @@ STACK_END(state); } +/******************************************************************************* + +********************************************************************************/ + +void +JSONDocIteratorState::init(PlanState& aState) +{ + PlanIteratorState::init(aState); + theStream = nullptr; + theGotOne = false; + loader_ = nullptr; +} + +void +JSONDocIteratorState::reset(PlanState& aState) +{ + PlanIteratorState::reset(aState); + theGotOne = false; + delete loader_; + loader_ = nullptr; +} + +JSONDocIteratorState::~JSONDocIteratorState() +{ + delete loader_; +} + +bool JSONDocIterator::nextImpl(store::Item_t& result, PlanState& planState) const +{ + store::Item_t uriItem; + JSONDocIteratorState* state; + zstring uriString; + zstring lErrorMessage; + internal::StreamResource* lStreamResource; + zstring lNormUri; + DEFAULT_STACK_INIT(JSONDocIteratorState, state, planState); + + if (consumeNext(uriItem, theChildren[0].getp(), planState)) + { + uriItem->getStringValue2(uriString); + // Normalize input to handle filesystem paths, etc. + normalizeInputUri(uriString, theSctx, loc, &lNormUri); + + // Resolve URI to a stream + state->theResource = theSctx->resolve_uri( + lNormUri, + internal::EntityData::DOCUMENT, + lErrorMessage); + + lStreamResource = + dynamic_cast(state->theResource.get()); + if (lStreamResource == NULL) { + throw XQUERY_EXCEPTION( + err::FODC0002, + ERROR_PARAMS(uriString, lErrorMessage), + ERROR_LOC(loc)); + } + + state->theStream = lStreamResource->getStream(); + if (state->theStream == NULL) { + throw XQUERY_EXCEPTION( + err::FODC0002, + ERROR_PARAMS( uriString ), + ERROR_LOC(loc)); + } + + state->theGotOne = false; + state->loader_ = new json::loader( *state->theStream, true ); + + while ( state->loader_->next( &result ) ) + { + if (!state->theGotOne) + { + state->theGotOne = true; + STACK_PUSH(true, state); + } else { + RAISE_ERROR( + jerr::JNDY0021, + loc, + ERROR_PARAMS(ZED(JNDY0021_UnexpectedExtraContent))); + } + } + } + + STACK_END(state); +} } /* namespace zorba */ -/* vim:set et sw=2 ts=2: */ #endif /* ZORBA_WITH_JSON */ +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/runtime/json/pregenerated/jsoniq_functions.cpp zorba-2.8.0-0/src/runtime/json/pregenerated/jsoniq_functions.cpp --- zorba-2.7.0-0/src/runtime/json/pregenerated/jsoniq_functions.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/json/pregenerated/jsoniq_functions.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -358,6 +358,37 @@ #endif #ifdef ZORBA_WITH_JSON +// +SERIALIZABLE_CLASS_VERSIONS(JSONDocIterator) + +void JSONDocIterator::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void JSONDocIterator::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +JSONDocIterator::~JSONDocIterator() {} + +JSONDocIteratorState::JSONDocIteratorState() {} + +// + +#endif +#ifdef ZORBA_WITH_JSON // SERIALIZABLE_CLASS_VERSIONS(JSONItemAccessorIterator) diff -Nru zorba-2.7.0-0/src/runtime/json/pregenerated/jsoniq_functions.h zorba-2.8.0-0/src/runtime/json/pregenerated/jsoniq_functions.h --- zorba-2.7.0-0/src/runtime/json/pregenerated/jsoniq_functions.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/json/pregenerated/jsoniq_functions.h 2013-01-16 18:28:18.000000000 +0000 @@ -29,6 +29,8 @@ #include "runtime/base/binarybase.h" #include "runtime/base/noarybase.h" #include "runtime/base/narybase.h" +#include +#include "runtime/json/json_loader.h" namespace zorba { @@ -150,6 +152,7 @@ store::Item_t theInput; // std::istream* theInputStream; // bool theGotOne; // + json::loader* loader_; // JSONParseIteratorState(); @@ -184,7 +187,7 @@ virtual ~JSONParseIterator(); public: - void processOptions(const store::Item_t& aOptions, bool& aAllowMultiple) const; + bool processBooleanOption(const store::Item_t& options, char const* option_name, bool* option_value) const; void accept(PlanIterVisitor& v) const; bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; @@ -459,6 +462,54 @@ #ifdef ZORBA_WITH_JSON /** + * jn:json-doc + * Author: Zorba Team + */ +class JSONDocIteratorState : public PlanIteratorState +{ +public: + std::auto_ptr theResource; // + std::istream* theStream; // + bool theGotOne; // + json::loader* loader_; // + + JSONDocIteratorState(); + + ~JSONDocIteratorState(); + + void init(PlanState&); + void reset(PlanState&); +}; + +class JSONDocIterator : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(JSONDocIterator); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONDocIterator, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + JSONDocIterator( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~JSONDocIterator(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + +#endif + +#ifdef ZORBA_WITH_JSON +/** * * Author: */ diff -Nru zorba-2.7.0-0/src/runtime/nodes/nodes_impl.cpp zorba-2.8.0-0/src/runtime/nodes/nodes_impl.cpp --- zorba-2.7.0-0/src/runtime/nodes/nodes_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/nodes/nodes_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -121,6 +121,14 @@ consumeNext(lUUID, theChildren[0].getp(), planState); try { + zstring lReference = lUUID->getStringValue(); + + if (lReference.length() != 45 || + !utf8::match_whole(lReference, "urn:uuid:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}")) + { + throw XQUERY_EXCEPTION(zerr::ZAPI0028_INVALID_NODE_URI, ERROR_PARAMS(lReference), ERROR_LOC(loc)); + } + haveResult = GENV_STORE.getNodeByReference(result, lUUID->getStringValue()); } catch (ZorbaException& e) diff -Nru zorba-2.7.0-0/src/runtime/numerics/format_integer_impl.cpp zorba-2.8.0-0/src/runtime/numerics/format_integer_impl.cpp --- zorba-2.7.0-0/src/runtime/numerics/format_integer_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/numerics/format_integer_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -762,7 +762,7 @@ utf8_string utf8_picture(pictureString); xs_integer valueInteger; bool is_neg = false; - const TypeManager* tm = theSctx->get_typemanager(); + TypeManager* tm = theSctx->get_typemanager(); const RootTypeManager& rtm = GENV_TYPESYSTEM; PlanIteratorState* state; @@ -788,10 +788,11 @@ { consumeNext(language_item, theChildren[2].getp(), planState); languageString = language_item->getStringValue(); + if(!GenericCast::isCastable(languageString, &*rtm.LANGUAGE_TYPE_ONE, tm)) { - throw XQUERY_EXCEPTION(err::FOFI0001, ERROR_PARAMS( languageString ), ERROR_LOC( loc ) - ); + throw XQUERY_EXCEPTION(err::FOFI0001, + ERROR_PARAMS(languageString), ERROR_LOC(loc)); } } diff -Nru zorba-2.7.0-0/src/runtime/numerics/numerics_impl.cpp zorba-2.8.0-0/src/runtime/numerics/numerics_impl.cpp --- zorba-2.7.0-0/src/runtime/numerics/numerics_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/numerics/numerics_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -883,7 +883,7 @@ if (!isAllowedType(result->getType())) { RAISE_ERROR(err::XPTY0004, info.loc, - ERROR_PARAMS(ZED(FormatNumber_2), result->getType()->getStringValue())); + ERROR_PARAMS(ZED(XPTY0004_FormatNumber_2), result->getType()->getStringValue())); } consumeNext(pictureItem, theChildren[1].getp(), planState); @@ -909,27 +909,34 @@ zstring ns; zstring prefix = tmpFormatName.substr(0, tmpFormatName.find(':')); - if (theSctx->lookup_ns(ns, prefix, loc, zerr::ZXQP0000_NO_ERROR)) + if (theSctx->lookup_ns(ns, prefix, loc, false)) { - GENV_ITEMFACTORY->createQName(formatName, ns, prefix, tmpFormatName.substr(tmpFormatName.find(':')+1)); + GENV_ITEMFACTORY->createQName(formatName, + ns, + prefix, + tmpFormatName.substr(tmpFormatName.find(':')+1)); break; } // The prefix is not in the known namespaces, the only posibility left is for the function to be invoked from an EnclosedIterator if (planState.theNodeConstuctionPath.empty()) { - throw XQUERY_EXCEPTION(err::FODF1280, ERROR_PARAMS(tmpFormatName), ERROR_LOC(loc)); + RAISE_ERROR(err::FODF1280, loc, ERROR_PARAMS(tmpFormatName)); } store::NsBindings bindings; planState.theNodeConstuctionPath.top()->getNamespaceBindings(bindings); - for (unsigned int i=0; icreateQName(formatName, bindings[i].second, prefix, tmpFormatName.substr(tmpFormatName.find(':')+1)); + GENV_ITEMFACTORY->createQName(formatName, + bindings[i].second, + prefix, + tmpFormatName.substr(tmpFormatName.find(':')+1)); break; } - + } } while(0); if (formatName.isNull()) diff -Nru zorba-2.7.0-0/src/runtime/pregenerated/iterator_enum.h zorba-2.8.0-0/src/runtime/pregenerated/iterator_enum.h --- zorba-2.7.0-0/src/runtime/pregenerated/iterator_enum.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/pregenerated/iterator_enum.h 2013-01-16 18:28:18.000000000 +0000 @@ -54,6 +54,7 @@ TYPE_ZorbaDeleteNodesIterator, TYPE_ZorbaDeleteNodesFirstIterator, TYPE_ZorbaDeleteNodesLastIterator, + TYPE_ZorbaEditNodesIterator, TYPE_ZorbaTruncateCollectionIterator, TYPE_IsAvailableIndexIterator, TYPE_AvailableIndexesIterator, @@ -71,6 +72,14 @@ TYPE_CurrentTimeIterator, TYPE_ImplicitTimezoneIterator, TYPE_DefaultCollationIterator, + TYPE_CurrentDate, + TYPE_CurrentDateTime, + TYPE_CurrentTime, + TYPE_ParseDate, + TYPE_ParseDateTime, + TYPE_ParseTime, + TYPE_Timestamp, + TYPE_UTCOffset, TYPE_DebugIterator, TYPE_YearsFromDurationIterator, TYPE_MonthsFromDurationIterator, @@ -161,6 +170,7 @@ TYPE_JSONArrayMemberIterator, TYPE_JSONArrayMembersIterator, TYPE_JSONArrayFlattenIterator, + TYPE_JSONDocIterator, TYPE_JSONItemAccessorIterator, TYPE_JSONNullIterator, TYPE_JSONIsNullIterator, @@ -266,6 +276,10 @@ TYPE_SeededRandomIterator, TYPE_RandomIterator, TYPE_UuidIterator, + TYPE_ReferenceIterator, + TYPE_HasReferenceIterator, + TYPE_AssignReferenceIterator, + TYPE_DereferenceIterator, TYPE_ValidateIterator, TYPE_ZorbaValidateInPlaceIterator, TYPE_ZorbaSchemaTypeIterator, diff -Nru zorba-2.7.0-0/src/runtime/qnames/qnames_impl.cpp zorba-2.8.0-0/src/runtime/qnames/qnames_impl.cpp --- zorba-2.7.0-0/src/runtime/qnames/qnames_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/qnames/qnames_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -31,6 +31,8 @@ #include "store/api/item_factory.h" #include "store/api/item.h" +#include "diagnostics/util_macros.h" + namespace zorba { #define GENV_GCAST (*GenericCast::instance ()) @@ -66,19 +68,22 @@ resLocal = qname.substr(index+1, qname.size() - index); // must check for FOCA0002 first - if (!GENV_GCAST.castableToNCName(resPre) || ! GENV_GCAST.castableToNCName(resLocal)) - throw XQUERY_EXCEPTION( - err::FOCA0002, ERROR_PARAMS( qname ), ERROR_LOC(loc) - ); + if (!GENV_GCAST.castableToNCName(resPre) || + ! GENV_GCAST.castableToNCName(resLocal)) + { + RAISE_ERROR(err::FOCA0002, loc, + ERROR_PARAMS(ZED(FOCA0002_BadLexicalQName_2), qname)); + } } else { resLocal = qname; if (! GENV_GCAST.castableToNCName(resLocal)) - throw XQUERY_EXCEPTION( - err::FOCA0002, ERROR_PARAMS( qname ), ERROR_LOC(loc) - ); + { + RAISE_ERROR(err::FOCA0002, loc, + ERROR_PARAMS(ZED(FOCA0002_BadLexicalQName_2), qname)); + } } if (consumeNext(itemElem, theChild1, planState )) @@ -100,9 +105,7 @@ } if (!found && !resPre.empty()) - throw XQUERY_EXCEPTION( - err::FONS0004, ERROR_PARAMS( resPre ), ERROR_LOC( loc ) - ); + RAISE_ERROR(err::FONS0004, loc, ERROR_PARAMS(resPre)); } GENV_ITEMFACTORY->createQName(result, resNs, resPre, resLocal); @@ -146,9 +149,10 @@ if (index != zstring::npos) { if (resNs.empty()) - throw XQUERY_EXCEPTION( - err::FOCA0002, ERROR_PARAMS( resNs ), ERROR_LOC(loc) - ); + { + RAISE_ERROR(err::FOCA0002, loc, + ERROR_PARAMS(ZED(FOCA0002_NoURIforPrefix_2), qname)); + } resPre = qname.substr(0, index); resLocal = qname.substr(index+1, qname.size() - index); @@ -161,9 +165,8 @@ if ((index != zstring::npos && ! GENV_GCAST.castableToNCName(resPre)) || ! GENV_GCAST.castableToNCName(resLocal)) { - throw XQUERY_EXCEPTION( - err::FOCA0002, ERROR_PARAMS( qname ), ERROR_LOC(loc) - ); + RAISE_ERROR(err::FOCA0002, loc, + ERROR_PARAMS(ZED(FOCA0002_BadLexicalQName_2), qname)); } GENV_ITEMFACTORY->createQName(result, resNs, resPre, resLocal); diff -Nru zorba-2.7.0-0/src/runtime/reference/pregenerated/reference.cpp zorba-2.8.0-0/src/runtime/reference/pregenerated/reference.cpp --- zorba-2.7.0-0/src/runtime/reference/pregenerated/reference.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/reference/pregenerated/reference.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,150 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** + +#include "stdafx.h" +#include "zorbatypes/rchandle.h" +#include "zorbatypes/zstring.h" +#include "runtime/visitors/planiter_visitor.h" +#include "runtime/reference/reference.h" +#include "system/globalenv.h" + + + +namespace zorba { + +// +SERIALIZABLE_CLASS_VERSIONS(ReferenceIterator) + +void ReferenceIterator::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void ReferenceIterator::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +ReferenceIterator::~ReferenceIterator() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(HasReferenceIterator) + +void HasReferenceIterator::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void HasReferenceIterator::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +HasReferenceIterator::~HasReferenceIterator() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(AssignReferenceIterator) + +void AssignReferenceIterator::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void AssignReferenceIterator::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +AssignReferenceIterator::~AssignReferenceIterator() {} + +// + + +// +SERIALIZABLE_CLASS_VERSIONS(DereferenceIterator) + +void DereferenceIterator::serialize(::zorba::serialization::Archiver& ar) +{ + serialize_baseclass(ar, + (NaryBaseIterator*)this); +} + + +void DereferenceIterator::accept(PlanIterVisitor& v) const +{ + v.beginVisit(*this); + + std::vector::const_iterator lIter = theChildren.begin(); + std::vector::const_iterator lEnd = theChildren.end(); + for ( ; lIter != lEnd; ++lIter ){ + (*lIter)->accept(v); + } + + v.endVisit(*this); +} + +DereferenceIterator::~DereferenceIterator() {} + +// + + + +} + + diff -Nru zorba-2.7.0-0/src/runtime/reference/pregenerated/reference.h zorba-2.8.0-0/src/runtime/reference/pregenerated/reference.h --- zorba-2.7.0-0/src/runtime/reference/pregenerated/reference.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/reference/pregenerated/reference.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,170 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// ****************************************** +// * * +// * THIS IS A GENERATED FILE. DO NOT EDIT! * +// * SEE .xml FILE WITH SAME NAME * +// * * +// ****************************************** +#ifndef ZORBA_RUNTIME_REFERENCE_REFERENCE_H +#define ZORBA_RUNTIME_REFERENCE_REFERENCE_H + + +#include "common/shared_types.h" + + + +#include "runtime/base/narybase.h" + + +namespace zorba { + +/** + * + * declare function ref:reference($item as item()) as xs:string + * + * Author: Federico Cavalieri + */ +class ReferenceIterator : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(ReferenceIterator); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(ReferenceIterator, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + ReferenceIterator( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~ReferenceIterator(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * declare function ref:has-reference($item as item()) as xs:boolean + * + * Author: Till Westmann + */ +class HasReferenceIterator : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(HasReferenceIterator); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(HasReferenceIterator, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + HasReferenceIterator( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~HasReferenceIterator(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * declare function ref:assign-reference($item as item()) as xs:boolean + * + * Author: Till Westmann + */ +class AssignReferenceIterator : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(AssignReferenceIterator); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(AssignReferenceIterator, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + AssignReferenceIterator( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~AssignReferenceIterator(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +/** + * + * declare function ref:dereference($reference as xs:string) as item()? + * + * Author: Federico Cavalieri + */ +class DereferenceIterator : public NaryBaseIterator +{ +public: + SERIALIZABLE_CLASS(DereferenceIterator); + + SERIALIZABLE_CLASS_CONSTRUCTOR2T(DereferenceIterator, + NaryBaseIterator); + + void serialize( ::zorba::serialization::Archiver& ar); + + DereferenceIterator( + static_context* sctx, + const QueryLoc& loc, + std::vector& children) + : + NaryBaseIterator(sctx, loc, children) + {} + + virtual ~DereferenceIterator(); + + void accept(PlanIterVisitor& v) const; + + bool nextImpl(store::Item_t& result, PlanState& aPlanState) const; +}; + + +} +#endif +/* + * Local variables: + * mode: c++ + * End: + */ diff -Nru zorba-2.7.0-0/src/runtime/reference/reference_impl.cpp zorba-2.8.0-0/src/runtime/reference/reference_impl.cpp --- zorba-2.7.0-0/src/runtime/reference/reference_impl.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/reference/reference_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "stdafx.h" + +#include "runtime/reference/reference.h" +//#include "zorbamisc/ns_consts.h" + +#include "system/globalenv.h" +#include "context/static_context.h" + +#include "store/api/item.h" +//#include "store/api/iterator.h" +#include "store/api/item_factory.h" +#include "store/api/store.h" + +//#include "util/string_util.h" +//#include "util/uri_util.h" +//#include "zorbautils/string_util.h" + +using namespace std; + +namespace zorba { + +/******************************************************************************* + +********************************************************************************/ +bool +ReferenceIterator::nextImpl(store::Item_t& aResult, PlanState& aPlanState) const +{ + store::Item_t lItem; + bool lHasRef; + + PlanIteratorState* state; + DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); + + consumeNext(lItem, theChildren[0].getp(), aPlanState); + + try + { + lHasRef = GENV_STORE.getNodeReference(aResult, lItem); + } + catch (ZorbaException& e) + { + set_source( e, loc ); + throw; + } + STACK_PUSH(lHasRef, state); + + STACK_END (state); +} + + +/******************************************************************************* + +********************************************************************************/ +bool +HasReferenceIterator::nextImpl(store::Item_t& aResult, PlanState& aPlanState) const +{ + store::Item_t lItem; + xs_boolean lHasReference; + + PlanIteratorState* state; + DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); + + consumeNext(lItem, theChildren[0].getp(), aPlanState); + + lHasReference = GENV_STORE.hasReference(lItem); + + STACK_PUSH(GENV_ITEMFACTORY->createBoolean(aResult, lHasReference), state); + + STACK_END (state); +} + + +/******************************************************************************* + +********************************************************************************/ +bool +AssignReferenceIterator::nextImpl(store::Item_t& aResult, PlanState& aPlanState) const +{ + store::Item_t lItem; + store::Item_t lUUID; + xs_boolean lHaveResult; + + PlanIteratorState* state; + DEFAULT_STACK_INIT(PlanIteratorState, state, aPlanState); + + consumeNext(lItem, theChildren[0].getp(), aPlanState); + consumeNext(lUUID, theChildren[1].getp(), aPlanState); + try + { + lHaveResult = GENV_STORE.assignReference(lItem, lUUID->getStringValue()); + } + catch (ZorbaException& e) + { + set_source( e, loc ); + throw; + } + STACK_PUSH(GENV_ITEMFACTORY->createBoolean(aResult, lHaveResult), state); + + STACK_END (state); +} + + +/******************************************************************************* + +********************************************************************************/ +bool +DereferenceIterator::nextImpl(store::Item_t& result, PlanState& planState) const +{ + store::Item_t lUUID; + bool haveResult; + + PlanIteratorState* state; + DEFAULT_STACK_INIT(PlanIteratorState, state, planState); + + consumeNext(lUUID, theChildren[0].getp(), planState); + try + { + haveResult = GENV_STORE.getNodeByReference(result, lUUID->getStringValue()); + } + catch (ZorbaException& e) + { + set_source( e, loc ); + throw; + } + STACK_PUSH(haveResult, state); + + STACK_END (state); +} + +} // namespace zorba +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/runtime/sequences/sequences_impl.cpp zorba-2.8.0-0/src/runtime/sequences/sequences_impl.cpp --- zorba-2.7.0-0/src/runtime/sequences/sequences_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/sequences/sequences_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -1718,71 +1719,6 @@ zorbatm::get_walltime_elapsed(t0, t1); } -/** - * Utility method for fn:doc() and fn:doc-available(). Given an input string, - * use a few heuristics to create a valid URI, assuming that the input might - * be an absolute or relative filesystem path, etc. - */ -static zstring normalizeInput(zstring const& aUri, static_context* aSctx, - QueryLoc const& loc) -{ - zstring const aBaseUri = aSctx->get_base_uri(); - zstring lResolvedURI; - - try - { - // To support the very common (if technically incorrect) use - // case of users passing local filesystem paths to fn:doc(), - // we use the following heuristic: IF the base URI has a file: - // scheme AND the incoming URI has no scheme, we will assume - // the incoming URI is actually a filesystem path. QQQ For - // the moment, we assume any "unknown" schemes are probably - // Windows drive letters. - if ((uri::get_scheme(aUri) == uri::none || - uri::get_scheme(aUri) == uri::unknown) && - uri::get_scheme(aBaseUri) == uri::file) - { - // Ok, we assume it's a filesystem path. First normalize it. - zstring lNormalizedPath = - fs::get_normalized_path(aUri, zstring("")); - // QQQ For now, get_normalized_path() doesn't do what we - // want when base URI represents a file. So, when the - // normalized path is relative, we pretend it's a relative - // URI and resolve it as such. - if (fs::is_absolute(lNormalizedPath)) - { - URI::encode_file_URI(lNormalizedPath, lResolvedURI); - } - else - { -#ifdef WIN32 - ascii::replace_all(lNormalizedPath, '\\', '/'); -#endif - lResolvedURI = aSctx->resolve_relative_uri(lNormalizedPath, true); - } - } - else - { - // We do NOT assume it's a filesystem path; just resolve it. - lResolvedURI = aSctx->resolve_relative_uri(aUri, true); - } - } - catch (ZorbaException& e) - { - if (e.diagnostic() == err::XQST0046) - // the value of a URILiteral is of nonzero length and is not in the - // lexical space of xs:anyURI. - e.set_diagnostic(err::FODC0005); - else - e.set_diagnostic(err::FODC0002); - - set_source(e, loc); - throw; - } - - return lResolvedURI; -} - static void loadDocument( zstring const& aUri, static_context* aSctx, @@ -1791,7 +1727,8 @@ store::Item_t& oResult) { // Normalize input to handle filesystem paths, etc. - zstring const lNormUri(normalizeInput(aUri, aSctx, loc)); + zstring lNormUri; + normalizeInputUri(aUri, aSctx, loc, &lNormUri); // See if this (normalized) URI is already loaded in the store. try { @@ -1968,7 +1905,8 @@ store::Item_t& oResult) { //Normalize input to handle filesystem paths, etc. - zstring const lNormUri(normalizeInput(aUri, aSctx, loc)); + zstring lNormUri; + normalizeInputUri(aUri, aSctx, loc, &lNormUri); //Resolve URI to stream zstring lErrorMessage; @@ -2119,7 +2057,7 @@ //Normalize input to handle filesystem paths, etc. uriItem->getStringValue2(uriString); - lNormUri = normalizeInput(uriString, theSctx, loc); + normalizeInputUri(uriString, theSctx, loc, &lNormUri); //Resolve URI to stream lResource = theSctx->resolve_uri diff -Nru zorba-2.7.0-0/src/runtime/spec/accessors/accessors.xml zorba-2.8.0-0/src/runtime/spec/accessors/accessors.xml --- zorba-2.7.0-0/src/runtime/spec/accessors/accessors.xml 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/spec/accessors/accessors.xml 2013-01-16 18:28:18.000000000 +0000 @@ -71,7 +71,7 @@ - + @@ -140,7 +140,7 @@ - + @@ -173,7 +173,7 @@ - + @@ -236,7 +236,7 @@ - + diff -Nru zorba-2.7.0-0/src/runtime/spec/collections/collections.xml zorba-2.8.0-0/src/runtime/spec/collections/collections.xml --- zorba-2.7.0-0/src/runtime/spec/collections/collections.xml 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/spec/collections/collections.xml 2013-01-16 18:28:18.000000000 +0000 @@ -284,6 +284,7 @@ + @@ -1251,6 +1252,56 @@ /******************************************************************************* ********************************************************************************/ --> + + + + zorba:edit + + + + + + structured-item() + structured-item() + empty-sequence() + + + + structured-item() + structured-item() + empty-sequence() + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru zorba-2.7.0-0/src/runtime/spec/datetime/datetime.xml zorba-2.8.0-0/src/runtime/spec/datetime/datetime.xml --- zorba-2.7.0-0/src/runtime/spec/datetime/datetime.xml 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/spec/datetime/datetime.xml 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,130 @@ + + + + + + + + runtime/base/narybase.h + + + + + function for getting the current date + + + + xs:date + + + + + + + function for getting the current date and time + + + + xs:dateTime + + + + + + + function for getting the current time + + + + xs:time + + + + + + + function for parsing strings into a date + + + + xs:string + xs:string + xs:date + + + xs:string + xs:string + xs:string + xs:date + + + + + + + function for parsing strings into a dateTime + + + + xs:string + xs:string + xs:dateTime + + + xs:string + xs:string + xs:string + xs:dateTime + + + + + + + function for parsing strings into a time + + + + xs:string + xs:string + xs:time + + + xs:string + xs:string + xs:string + xs:time + + + + + + + function for getting the current number of seconds since epoch + + + + xs:long + + + + + + + function for getting the current offset from UTC + + + + xs:long + + + + + + + + + diff -Nru zorba-2.7.0-0/src/runtime/spec/json/jsoniq_functions.xml zorba-2.8.0-0/src/runtime/spec/json/jsoniq_functions.xml --- zorba-2.7.0-0/src/runtime/spec/json/jsoniq_functions.xml 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/spec/json/jsoniq_functions.xml 2013-01-16 18:28:18.000000000 +0000 @@ -9,6 +9,11 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.zorba-xquery.com ../runtime.xsd"> + + context/uri_resolver.h + runtime/json/json_loader.h + + + + + jn:json-doc + + + + + xs:string? + json-item()* + + + + + + + + + + + + + + + + + + + + + + + + declare function ref:reference($item as item()) as xs:string + + + + + + structured-item() + xs:string + + + + + + + + + + + + + + + declare function ref:has-reference($item as item()) as xs:boolean + + + + + + structured-item() + xs:boolean + + + + + + + + + + + declare function ref:assign-reference($item as item()) as xs:boolean + + + + + + structured-item() + xs:string + xs:boolean + + + + + + + + + + + + + + + declare function ref:dereference($reference as xs:string) as item()? + + + + + + xs:string + structured-item()? + + + + + + + + diff -Nru zorba-2.7.0-0/src/runtime/spec/schema/schema.xml zorba-2.8.0-0/src/runtime/spec/schema/schema.xml --- zorba-2.7.0-0/src/runtime/spec/schema/schema.xml 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/spec/schema/schema.xml 2013-01-16 18:28:18.000000000 +0000 @@ -81,18 +81,6 @@ iterator backing the schema-type function - - item() - xs:QName? - - - - - - - - - item() xs:QName? @@ -121,7 +109,7 @@ - + diff -Nru zorba-2.7.0-0/src/runtime/spec/sequences/sequences.xml zorba-2.8.0-0/src/runtime/spec/sequences/sequences.xml --- zorba-2.7.0-0/src/runtime/spec/sequences/sequences.xml 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/spec/sequences/sequences.xml 2013-01-16 18:28:18.000000000 +0000 @@ -636,7 +636,7 @@ - + diff -Nru zorba-2.7.0-0/src/runtime/spec/store/maps.xml zorba-2.8.0-0/src/runtime/spec/store/maps.xml --- zorba-2.7.0-0/src/runtime/spec/store/maps.xml 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/spec/store/maps.xml 2013-01-16 18:28:18.000000000 +0000 @@ -156,6 +156,7 @@ + diff -Nru zorba-2.7.0-0/src/runtime/store/documents_impl.cpp zorba-2.8.0-0/src/runtime/store/documents_impl.cpp --- zorba-2.7.0-0/src/runtime/store/documents_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/store/documents_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -210,7 +210,8 @@ void AvailableDocumentsIteratorState::reset(PlanState& planState) { PlanIteratorState::reset(planState); - if ( theNameIterator != NULL ) { + if ( theNameIterator != NULL ) + { theNameIterator->close(); theNameIterator = NULL; } @@ -225,7 +226,7 @@ DEFAULT_STACK_INIT(AvailableDocumentsIteratorState, state, aPlanState); state->theNameIterator = GENV_STORE.getDocumentNames(); - state->theNameIterator->open (); + state->theNameIterator->open(); while (state->theNameIterator->next(result)) { STACK_PUSH( true, state); @@ -236,6 +237,7 @@ STACK_END(state); } + /******************************************************************************* declare function is-available-document() as xs:boolean diff -Nru zorba-2.7.0-0/src/runtime/store/maps_impl.cpp zorba-2.8.0-0/src/runtime/store/maps_impl.cpp --- zorba-2.7.0-0/src/runtime/store/maps_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/store/maps_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -399,15 +399,11 @@ if (lSpec.getNumColumns() != theChildren.size() - 2) { - RAISE_ERROR( - zerr::ZDDY0025_INDEX_WRONG_NUMBER_OF_PROBE_ARGS, - loc, - ERROR_PARAMS( - lQName->getStringValue(), - "map", - theChildren.size() - 2, - lSpec.getNumColumns() ) - ); + RAISE_ERROR(zerr::ZDDY0025_INDEX_WRONG_NUMBER_OF_PROBE_ARGS, loc, + ERROR_PARAMS(lQName->getStringValue(), + "map", + theChildren.size() - 2, + lSpec.getNumColumns())); } lKey.resize(theChildren.size() - 2); @@ -497,16 +493,11 @@ if (lSpec.getNumColumns() != theChildren.size() - 1) { - RAISE_ERROR( - zerr::ZDDY0025_INDEX_WRONG_NUMBER_OF_PROBE_ARGS, - loc, - ERROR_PARAMS( - lQName->getStringValue(), - "map", - theChildren.size() - 1, - lSpec.getNumColumns() - ) - ); + RAISE_ERROR(zerr::ZDDY0025_INDEX_WRONG_NUMBER_OF_PROBE_ARGS, loc, + ERROR_PARAMS(lQName->getStringValue(), + "map", + theChildren.size() - 1, + lSpec.getNumColumns())); } lKey.resize(theChildren.size()-1); diff -Nru zorba-2.7.0-0/src/runtime/util/doc_uri_heuristics.cpp zorba-2.8.0-0/src/runtime/util/doc_uri_heuristics.cpp --- zorba-2.7.0-0/src/runtime/util/doc_uri_heuristics.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/util/doc_uri_heuristics.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include "stdafx.h" +#include + +#include "doc_uri_heuristics.h" + +#include +#include +#include +#include + + +namespace zorba { + +void normalizeInputUri( + zstring const& aUri, + static_context* aSctx, + QueryLoc const& aLoc, + zstring* aResult) +{ + zstring const lBaseUri = aSctx->get_base_uri(); + + try + { + // To support the very common (if technically incorrect) use + // case of users passing local filesystem paths to fn:doc(), + // we use the following heuristic: IF the base URI has a file: + // scheme AND the incoming URI has no scheme, we will assume + // the incoming URI is actually a filesystem path. QQQ For + // the moment, we assume any "unknown" schemes are probably + // Windows drive letters. + if ((uri::get_scheme(aUri) == uri::none || + uri::get_scheme(aUri) == uri::unknown) && + uri::get_scheme(lBaseUri) == uri::file) + { + // Ok, we assume it's a filesystem path. First normalize it. + zstring lNormalizedPath = fs::get_normalized_path( + aUri, + zstring("")); + // QQQ For now, get_normalized_path() doesn't do what we + // want when base URI represents a file. So, when the + // normalized path is relative, we pretend it's a relative + // URI and resolve it as such. + if (fs::is_absolute(lNormalizedPath)) + { + URI::encode_file_URI(lNormalizedPath, *aResult); + } + else + { +#ifdef WIN32 + ascii::replace_all(lNormalizedPath, '\\', '/'); +#endif + *aResult = aSctx->resolve_relative_uri(lNormalizedPath, true); + } + } + else + { + // We do NOT assume it's a filesystem path; just resolve it. + *aResult = aSctx->resolve_relative_uri(aUri, true); + } + } + catch (ZorbaException& e) + { + if (e.diagnostic() == err::XQST0046) + // the value of a URILiteral is of nonzero length and is not in the + // lexical space of xs:anyURI. + e.set_diagnostic(err::FODC0005); + else + e.set_diagnostic(err::FODC0002); + + set_source(e, aLoc); + throw; + } +} + +} /* namespace zorba */ +/* vim:set et sw=2 ts=2: */ + diff -Nru zorba-2.7.0-0/src/runtime/util/doc_uri_heuristics.h zorba-2.8.0-0/src/runtime/util/doc_uri_heuristics.h --- zorba-2.7.0-0/src/runtime/util/doc_uri_heuristics.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/util/doc_uri_heuristics.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,43 @@ +/* + * Copyright 2006-2012 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#ifndef ZORBA_RUNTIME_UTIL_DOC_URI_HEURISTICS_H +#define ZORBA_RUNTIME_UTIL_DOC_URI_HEURISTICS_H + +#include "stdafx.h" +#include + +#include + +namespace zorba { + +class static_context; +class QueryLoc; + +/** + * Utility method for fn:doc() and jn:json-doc(). Given an input string, + * use a few heuristics to create a valid URI, assuming that the input might + * be an absolute or relative filesystem path, etc. + */ +void normalizeInputUri( + zstring const& aUri, + static_context* aSctx, + QueryLoc const& aLoc, + zstring* aResult); + +} /* namespace zorba */ +/* vim:set et sw=2 ts=2: */ + +#endif /* ZORBA_RUNTIME_UTIL_DOC_URI_HEURISTICS_H */ diff -Nru zorba-2.7.0-0/src/runtime/visitors/pregenerated/planiter_visitor.h zorba-2.8.0-0/src/runtime/visitors/pregenerated/planiter_visitor.h --- zorba-2.7.0-0/src/runtime/visitors/pregenerated/planiter_visitor.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/visitors/pregenerated/planiter_visitor.h 2013-01-16 18:28:18.000000000 +0000 @@ -98,6 +98,8 @@ class ZorbaDeleteNodesLastIterator; + class ZorbaEditNodesIterator; + class ZorbaTruncateCollectionIterator; class IsAvailableIndexIterator; @@ -132,6 +134,22 @@ class DefaultCollationIterator; + class CurrentDate; + + class CurrentDateTime; + + class CurrentTime; + + class ParseDate; + + class ParseDateTime; + + class ParseTime; + + class Timestamp; + + class UTCOffset; + #ifdef ZORBA_WITH_DEBUGGER class DebugIterator; #endif @@ -339,6 +357,9 @@ class JSONArrayFlattenIterator; #endif #ifdef ZORBA_WITH_JSON + class JSONDocIterator; +#endif +#ifdef ZORBA_WITH_JSON class JSONItemAccessorIterator; #endif #ifdef ZORBA_WITH_JSON @@ -558,6 +579,14 @@ class UuidIterator; + class ReferenceIterator; + + class HasReferenceIterator; + + class AssignReferenceIterator; + + class DereferenceIterator; + #ifndef ZORBA_NO_XMLSCHEMA class ValidateIterator; #endif @@ -841,6 +870,9 @@ virtual void beginVisit ( const ZorbaDeleteNodesLastIterator& ) = 0; virtual void endVisit ( const ZorbaDeleteNodesLastIterator& ) = 0; + virtual void beginVisit ( const ZorbaEditNodesIterator& ) = 0; + virtual void endVisit ( const ZorbaEditNodesIterator& ) = 0; + virtual void beginVisit ( const ZorbaTruncateCollectionIterator& ) = 0; virtual void endVisit ( const ZorbaTruncateCollectionIterator& ) = 0; @@ -892,6 +924,30 @@ virtual void beginVisit ( const DefaultCollationIterator& ) = 0; virtual void endVisit ( const DefaultCollationIterator& ) = 0; + virtual void beginVisit ( const CurrentDate& ) = 0; + virtual void endVisit ( const CurrentDate& ) = 0; + + virtual void beginVisit ( const CurrentDateTime& ) = 0; + virtual void endVisit ( const CurrentDateTime& ) = 0; + + virtual void beginVisit ( const CurrentTime& ) = 0; + virtual void endVisit ( const CurrentTime& ) = 0; + + virtual void beginVisit ( const ParseDate& ) = 0; + virtual void endVisit ( const ParseDate& ) = 0; + + virtual void beginVisit ( const ParseDateTime& ) = 0; + virtual void endVisit ( const ParseDateTime& ) = 0; + + virtual void beginVisit ( const ParseTime& ) = 0; + virtual void endVisit ( const ParseTime& ) = 0; + + virtual void beginVisit ( const Timestamp& ) = 0; + virtual void endVisit ( const Timestamp& ) = 0; + + virtual void beginVisit ( const UTCOffset& ) = 0; + virtual void endVisit ( const UTCOffset& ) = 0; + #ifdef ZORBA_WITH_DEBUGGER virtual void beginVisit ( const DebugIterator& ) = 0; virtual void endVisit ( const DebugIterator& ) = 0; @@ -1189,6 +1245,10 @@ virtual void endVisit ( const JSONArrayFlattenIterator& ) = 0; #endif #ifdef ZORBA_WITH_JSON + virtual void beginVisit ( const JSONDocIterator& ) = 0; + virtual void endVisit ( const JSONDocIterator& ) = 0; +#endif +#ifdef ZORBA_WITH_JSON virtual void beginVisit ( const JSONItemAccessorIterator& ) = 0; virtual void endVisit ( const JSONItemAccessorIterator& ) = 0; #endif @@ -1513,6 +1573,18 @@ virtual void beginVisit ( const UuidIterator& ) = 0; virtual void endVisit ( const UuidIterator& ) = 0; + virtual void beginVisit ( const ReferenceIterator& ) = 0; + virtual void endVisit ( const ReferenceIterator& ) = 0; + + virtual void beginVisit ( const HasReferenceIterator& ) = 0; + virtual void endVisit ( const HasReferenceIterator& ) = 0; + + virtual void beginVisit ( const AssignReferenceIterator& ) = 0; + virtual void endVisit ( const AssignReferenceIterator& ) = 0; + + virtual void beginVisit ( const DereferenceIterator& ) = 0; + virtual void endVisit ( const DereferenceIterator& ) = 0; + #ifndef ZORBA_NO_XMLSCHEMA virtual void beginVisit ( const ValidateIterator& ) = 0; virtual void endVisit ( const ValidateIterator& ) = 0; diff -Nru zorba-2.7.0-0/src/runtime/visitors/pregenerated/printer_visitor.cpp zorba-2.8.0-0/src/runtime/visitors/pregenerated/printer_visitor.cpp --- zorba-2.7.0-0/src/runtime/visitors/pregenerated/printer_visitor.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/visitors/pregenerated/printer_visitor.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -41,6 +41,7 @@ #include "runtime/booleans/booleans.h" #include "runtime/collections/collections.h" #include "runtime/context/context.h" +#include "runtime/datetime/datetime.h" #include "runtime/debug/debug_iterator.h" #include "runtime/durations_dates_times/durations_dates_times.h" #include "runtime/errors_and_diagnostics/errors_and_diagnostics.h" @@ -62,6 +63,7 @@ #include "runtime/parsing_and_serializing/parsing_and_serializing.h" #include "runtime/qnames/qnames.h" #include "runtime/random/random.h" +#include "runtime/reference/reference.h" #include "runtime/schema/schema.h" #include "runtime/sequences/sequences.h" #include "runtime/store/documents.h" @@ -450,6 +452,20 @@ // +// +void PrinterVisitor::beginVisit ( const ZorbaEditNodesIterator& a) { + thePrinter.startBeginVisit("ZorbaEditNodesIterator", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const ZorbaEditNodesIterator& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + // void PrinterVisitor::beginVisit ( const ZorbaTruncateCollectionIterator& a) { thePrinter.startBeginVisit("ZorbaTruncateCollectionIterator", ++theId); @@ -687,6 +703,118 @@ } // + +// +void PrinterVisitor::beginVisit ( const CurrentDate& a) { + thePrinter.startBeginVisit("CurrentDate", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const CurrentDate& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const CurrentDateTime& a) { + thePrinter.startBeginVisit("CurrentDateTime", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const CurrentDateTime& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const CurrentTime& a) { + thePrinter.startBeginVisit("CurrentTime", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const CurrentTime& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const ParseDate& a) { + thePrinter.startBeginVisit("ParseDate", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const ParseDate& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const ParseDateTime& a) { + thePrinter.startBeginVisit("ParseDateTime", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const ParseDateTime& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const ParseTime& a) { + thePrinter.startBeginVisit("ParseTime", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const ParseTime& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const Timestamp& a) { + thePrinter.startBeginVisit("Timestamp", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const Timestamp& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const UTCOffset& a) { + thePrinter.startBeginVisit("UTCOffset", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const UTCOffset& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + #ifdef ZORBA_WITH_DEBUGGER // void PrinterVisitor::beginVisit ( const DebugIterator& a) { @@ -1974,6 +2102,21 @@ #endif #ifdef ZORBA_WITH_JSON +// +void PrinterVisitor::beginVisit ( const JSONDocIterator& a) { + thePrinter.startBeginVisit("JSONDocIterator", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const JSONDocIterator& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + +#endif +#ifdef ZORBA_WITH_JSON // void PrinterVisitor::beginVisit ( const JSONItemAccessorIterator& a) { thePrinter.startBeginVisit("JSONItemAccessorIterator", ++theId); @@ -3453,6 +3596,62 @@ } // + +// +void PrinterVisitor::beginVisit ( const ReferenceIterator& a) { + thePrinter.startBeginVisit("ReferenceIterator", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const ReferenceIterator& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const HasReferenceIterator& a) { + thePrinter.startBeginVisit("HasReferenceIterator", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const HasReferenceIterator& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const AssignReferenceIterator& a) { + thePrinter.startBeginVisit("AssignReferenceIterator", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const AssignReferenceIterator& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + + +// +void PrinterVisitor::beginVisit ( const DereferenceIterator& a) { + thePrinter.startBeginVisit("DereferenceIterator", ++theId); + printCommons( &a, theId ); + thePrinter.endBeginVisit( theId ); +} + +void PrinterVisitor::endVisit ( const DereferenceIterator& ) { + thePrinter.startEndVisit(); + thePrinter.endEndVisit(); +} +// + #ifndef ZORBA_NO_XMLSCHEMA // void PrinterVisitor::beginVisit ( const ValidateIterator& a) { diff -Nru zorba-2.7.0-0/src/runtime/visitors/pregenerated/printer_visitor.h zorba-2.8.0-0/src/runtime/visitors/pregenerated/printer_visitor.h --- zorba-2.7.0-0/src/runtime/visitors/pregenerated/printer_visitor.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/visitors/pregenerated/printer_visitor.h 2013-01-16 18:28:18.000000000 +0000 @@ -149,6 +149,9 @@ void beginVisit( const ZorbaDeleteNodesLastIterator& ); void endVisit ( const ZorbaDeleteNodesLastIterator& ); + void beginVisit( const ZorbaEditNodesIterator& ); + void endVisit ( const ZorbaEditNodesIterator& ); + void beginVisit( const ZorbaTruncateCollectionIterator& ); void endVisit ( const ZorbaTruncateCollectionIterator& ); @@ -200,6 +203,30 @@ void beginVisit( const DefaultCollationIterator& ); void endVisit ( const DefaultCollationIterator& ); + void beginVisit( const CurrentDate& ); + void endVisit ( const CurrentDate& ); + + void beginVisit( const CurrentDateTime& ); + void endVisit ( const CurrentDateTime& ); + + void beginVisit( const CurrentTime& ); + void endVisit ( const CurrentTime& ); + + void beginVisit( const ParseDate& ); + void endVisit ( const ParseDate& ); + + void beginVisit( const ParseDateTime& ); + void endVisit ( const ParseDateTime& ); + + void beginVisit( const ParseTime& ); + void endVisit ( const ParseTime& ); + + void beginVisit( const Timestamp& ); + void endVisit ( const Timestamp& ); + + void beginVisit( const UTCOffset& ); + void endVisit ( const UTCOffset& ); + #ifdef ZORBA_WITH_DEBUGGER void beginVisit( const DebugIterator& ); void endVisit ( const DebugIterator& ); @@ -523,6 +550,11 @@ #endif #ifdef ZORBA_WITH_JSON + void beginVisit( const JSONDocIterator& ); + void endVisit ( const JSONDocIterator& ); +#endif + +#ifdef ZORBA_WITH_JSON void beginVisit( const JSONItemAccessorIterator& ); void endVisit ( const JSONItemAccessorIterator& ); #endif @@ -857,6 +889,18 @@ void beginVisit( const UuidIterator& ); void endVisit ( const UuidIterator& ); + void beginVisit( const ReferenceIterator& ); + void endVisit ( const ReferenceIterator& ); + + void beginVisit( const HasReferenceIterator& ); + void endVisit ( const HasReferenceIterator& ); + + void beginVisit( const AssignReferenceIterator& ); + void endVisit ( const AssignReferenceIterator& ); + + void beginVisit( const DereferenceIterator& ); + void endVisit ( const DereferenceIterator& ); + #ifndef ZORBA_NO_XMLSCHEMA void beginVisit( const ValidateIterator& ); void endVisit ( const ValidateIterator& ); diff -Nru zorba-2.7.0-0/src/runtime/visitors/printer_visitor_impl.cpp zorba-2.8.0-0/src/runtime/visitors/printer_visitor_impl.cpp --- zorba-2.7.0-0/src/runtime/visitors/printer_visitor_impl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/runtime/visitors/printer_visitor_impl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -193,7 +193,7 @@ { thePrinter.startBeginVisit("TreatIterator", ++theId); if (a.theCheckPrime) - thePrinter.addAttribute("type", TypeOps::toString(*a.theTreatType)); + thePrinter.addAttribute("type", a.theTreatType->toString()); thePrinter.addAttribute("quant", TypeOps::decode_quantifier(a.theQuantifier)); printCommons( &a, theId ); thePrinter.endBeginVisit(theId); diff -Nru zorba-2.7.0-0/src/store/api/item.h zorba-2.8.0-0/src/store/api/item.h --- zorba-2.7.0-0/src/store/api/item.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/api/item.h 2013-01-16 18:28:18.000000000 +0000 @@ -820,6 +820,12 @@ getJSONItemKind() const; /** + * @return true if the JSON item is a root in a collection. + */ + virtual bool + isRoot() const; + + /** * defined on JSONArray * (jdm:size accessor on an array) * @return the number of values in the array. @@ -923,6 +929,15 @@ locale::iso639_1::type lang, bool wildcards = false) const; #endif /* ZORBA_NO_FULL_TEXT */ + /* --------------------- Method for Full swap ---------------------- */ + + /** + * Performs a full memory swap with the other item. It can also be seen as + * a swap of their locations in memory. + * + * @param anotherItem The item with which this must be swapped. + */ + virtual void swap(Item* anotherItem); private: Item(const Item& other); diff -Nru zorba-2.7.0-0/src/store/api/pul.h zorba-2.8.0-0/src/store/api/pul.h --- zorba-2.7.0-0/src/store/api/pul.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/api/pul.h 2013-01-16 18:28:18.000000000 +0000 @@ -203,6 +203,13 @@ bool isLast, bool isDynamic) = 0; + virtual void addEditInCollection( + const QueryLoc* aQueryLoc, + Item_t& name, + Item_t& target, + Item_t& content, + bool isDynamic) = 0; + virtual void addTruncateCollection( const QueryLoc* aQueryLoc, Item_t& name, diff -Nru zorba-2.7.0-0/src/store/api/store.h zorba-2.8.0-0/src/store/api/store.h --- zorba-2.7.0-0/src/store/api/store.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/api/store.h 2013-01-16 18:28:18.000000000 +0000 @@ -29,14 +29,6 @@ namespace zorba { -namespace internal -{ -namespace diagnostic -{ - class location; -} -} - SYNC_CODE(class Lock;) class TokenizerProvider; @@ -368,13 +360,6 @@ virtual TokenizerProvider const* getTokenizerProvider() const = 0; #endif /* ZORBA_NO_FULL_TEXT */ - -#ifdef ZORBA_WITH_JSON - virtual Item_t parseJSON( - std::istream& stream, - internal::diagnostic::location* relative_error_loc - ) = 0; -#endif }; } // namespace store diff -Nru zorba-2.7.0-0/src/store/api/update_consts.h zorba-2.8.0-0/src/store/api/update_consts.h --- zorba-2.7.0-0/src/store/api/update_consts.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/api/update_consts.h 2013-01-16 18:28:18.000000000 +0000 @@ -81,6 +81,7 @@ UP_INSERT_AT_INTO_COLLECTION, UP_REMOVE_FROM_COLLECTION, UP_REMOVE_AT_FROM_COLLECTION, + UP_REPLACE_IN_COLLECTION, UP_TRUNCATE_COLLECTION, // index primitives diff -Nru zorba-2.7.0-0/src/store/naive/CMakeLists.txt zorba-2.8.0-0/src/store/naive/CMakeLists.txt --- zorba-2.7.0-0/src/store/naive/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -60,7 +60,7 @@ IF (ZORBA_WITH_JSON) LIST(APPEND ZORBA_STORE_IMPL_SRCS json_items.cpp - json_loader.cpp ) ENDIF (ZORBA_WITH_JSON) +# vim:set et sw=2 ts=2: diff -Nru zorba-2.7.0-0/src/store/naive/atomic_items.cpp zorba-2.8.0-0/src/store/naive/atomic_items.cpp --- zorba-2.7.0-0/src/store/naive/atomic_items.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/atomic_items.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -683,12 +683,19 @@ bool QNameItem::equals( const store::Item* item, long timezone, - const XQPCollator* aCollation) const + const XQPCollator* collation) const { - assert(dynamic_cast(item) != NULL); + if (item->getBaseItem() == NULL) + { + assert(dynamic_cast(item) != NULL); - return (theNormalizedQName == - static_cast(item)->theNormalizedQName); + return (theNormalizedQName == + static_cast(item)->theNormalizedQName); + } + else + { + return this->equals(item->getBaseItem(), timezone, collation); + } } @@ -2293,9 +2300,9 @@ { return 0 == theValue.compare(&aItem->getDateTimeValue(), timezone); } - catch (InvalidTimezoneException const&) + catch (InvalidTimezoneException const &e) { - throw XQUERY_EXCEPTION(err::FODT0003); + throw XQUERY_EXCEPTION(err::FODT0003, ERROR_PARAMS(e.get_tz_seconds())); } } @@ -2309,9 +2316,9 @@ { return theValue.compare(&other->getDateTimeValue(), timezone); } - catch (InvalidTimezoneException const&) + catch (InvalidTimezoneException const &e) { - throw XQUERY_EXCEPTION(err::FODT0003); + throw XQUERY_EXCEPTION(err::FODT0003, ERROR_PARAMS(e.get_tz_seconds())); } } @@ -2672,7 +2679,10 @@ catch ( std::range_error const& ) { RAISE_ERROR_NO_LOC(err::FORG0001, - ERROR_PARAMS(theValue, ZED(CastFromToFailed_34), "integer", "long")); + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234), + getStringValue(), + "xs:integer", + "xs:long")); } } @@ -2686,7 +2696,10 @@ catch ( std::range_error const& ) { RAISE_ERROR_NO_LOC(err::FORG0001, - ERROR_PARAMS(theValue, ZED(CastFromToFailed_34), "integer", "unsignedInt")); + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234), + getStringValue(), + "xs:integer", + "xs:unsignedInt")); } } @@ -2786,10 +2799,11 @@ } catch ( std::range_error const& ) { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( theValue, ZED( CastFromToFailed_34 ), "integer", "long" ) - ); + RAISE_ERROR_NO_LOC(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234), + getStringValue(), + "xs:nonPositiveInteger", + "xs:long")); } } @@ -2875,6 +2889,7 @@ } } + store::Item* NonNegativeIntegerItem::getType() const { return GET_STORE().theSchemaTypeNames[store::XS_NON_NEGATIVE_INTEGER]; @@ -2886,26 +2901,30 @@ return xs_decimal(theValue); } + xs_integer NonNegativeIntegerItem::getIntegerValue() const { return xs_integer(theValue); } + xs_long NonNegativeIntegerItem::getLongValue() const { try { return to_xs_long(theValue); } - catch ( std::range_error const& ) + catch (const std::range_error& ) { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( theValue, ZED( CastFromToFailed_34 ), "integer", "long" ) - ); + RAISE_ERROR_NO_LOC(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234), + getStringValue(), + "xs:nonNegativeInteger", + "xs:long")); } } + zstring NonNegativeIntegerItem::getStringValue() const { return theValue.toString(); @@ -3711,6 +3730,7 @@ std::streambuf * pbuf; pbuf = theIstream.rdbuf(); pbuf->pubseekoff(0, std::ios::beg); + theIstream.clear(); } theIsConsumed = true; return theIstream; diff -Nru zorba-2.7.0-0/src/store/naive/collection.h zorba-2.8.0-0/src/store/naive/collection.h --- zorba-2.7.0-0/src/store/naive/collection.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/collection.h 2013-01-16 18:28:18.000000000 +0000 @@ -60,15 +60,20 @@ virtual zorba::store::Item_t nodeAt(xs_integer position) = 0; - virtual bool findNode(const store::Item* node, xs_integer& position) const = 0; + virtual bool findNode( + const store::Item* node, + xs_integer& position) const = 0; virtual bool isDynamic() const = 0; - virtual void getAnnotations(std::vector&) const = 0; + virtual void getAnnotations( + std::vector&) const = 0; /************************* Updates on collection ****************************/ - virtual void addNode(store::Item* node, xs_integer position = xs_integer(-1)) = 0; + virtual void addNode( + store::Item* node, + xs_integer position = xs_integer(-1)) = 0; virtual zorba::xs_integer addNodes( std::vector& nodes, @@ -79,9 +84,15 @@ virtual bool removeNode(xs_integer position) = 0; - virtual zorba::xs_integer removeNodes(xs_integer position, xs_integer num) = 0; + virtual zorba::xs_integer removeNodes( + xs_integer position, + xs_integer num) = 0; virtual void removeAll() = 0; + + virtual bool replaceNode( + store::Item* target, + store::Item* content) = 0; virtual void adjustTreePositions() = 0; diff -Nru zorba-2.7.0-0/src/store/naive/document_name_iterator.h zorba-2.8.0-0/src/store/naive/document_name_iterator.h --- zorba-2.7.0-0/src/store/naive/document_name_iterator.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/document_name_iterator.h 2013-01-16 18:28:18.000000000 +0000 @@ -23,66 +23,70 @@ namespace simplestore { - /******************************************************************************* - ********************************************************************************/ - template < typename T > - class DocumentNameIterator : public store::Iterator +/******************************************************************************* + +********************************************************************************/ +template < typename T > +class DocumentNameIterator : public store::Iterator +{ +private: + T& theItems; + typename T::iterator theIterator; + bool theOpened; + +public: + DocumentNameIterator(const T& aItems) + : + theItems(*const_cast(&aItems)), + theOpened(false) + { + } + + virtual ~DocumentNameIterator() + { + close(); + } + + virtual void open() + { + theIterator = theItems.begin(); + theOpened = true; + } + + virtual bool next(store::Item_t& aResult) + { + if (theIterator == theItems.end()) { - private: - T& theItems; - typename T::iterator theIterator; - bool theOpened; - - public: - DocumentNameIterator(const T& aItems) - : theItems(*const_cast(&aItems)), - theOpened(false) - { - } - - virtual ~DocumentNameIterator() - { - close(); - } - - virtual void open() - { - theIterator = theItems.begin(); - theOpened = true; - } - - virtual bool next(store::Item_t& aResult) - { - if (theIterator == theItems.end()) - { - aResult = NULL; - return false; - } - else - { - zstring lUri = (*theIterator).first; - GENV_ITEMFACTORY->createString(aResult, lUri); - ++theIterator; - return true; - } - } + aResult = NULL; + return false; + } + else + { + zstring lUri = (*theIterator).first; + GENV_ITEMFACTORY->createString(aResult, lUri); + ++theIterator; + return true; + } + } + + virtual void reset() + { + theIterator = theItems.begin(); + } + + virtual void close() + { + if (!theOpened) + { + return; + } - virtual void reset() - { - theIterator = theItems.begin(); - } + theOpened = false; + } +}; - virtual void close() - { - if (!theOpened) { - return; - } - - theOpened = false; - } - }; - } // namespace store +} // namespace store } // namespace zorba diff -Nru zorba-2.7.0-0/src/store/naive/hashmap_nodep.h zorba-2.8.0-0/src/store/naive/hashmap_nodep.h --- zorba-2.7.0-0/src/store/naive/hashmap_nodep.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/hashmap_nodep.h 2013-01-16 18:28:18.000000000 +0000 @@ -65,6 +65,43 @@ }; +/***************************************************************************//** + Class to privide the equality and hash functions for the NodePointerHashMap + class defined below. +*******************************************************************************/ +class ItemPointerHashMapCmp +{ +public: + static bool equal(const store::Item* n1, const store::Item* n2) + { + return n1 == n2; + } + + static uint32_t hash(const store::Item* n) + { + return hashfun::h32((void*)(&n), sizeof(n)); + } +}; + + +/******************************************************************************* + A hash-based map container mapping item pointers to values of type V. + Equality is based on the Item::equals() method. +*******************************************************************************/ +template +class ItemPointerHashMap : public HashMap +{ +public: + ItemPointerHashMap(ulong size, bool sync) + : + HashMap(size, sync) + { + } +}; + + } } diff -Nru zorba-2.7.0-0/src/store/naive/item.cpp zorba-2.8.0-0/src/store/naive/item.cpp --- zorba-2.7.0-0/src/store/naive/item.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/item.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -1387,6 +1387,13 @@ ); } +bool Item::isRoot() const +{ + throw ZORBA_EXCEPTION( + zerr::ZSTR0050_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE, + ERROR_PARAMS( __FUNCTION__, getType()->getStringValue() ) + ); +} xs_integer Item::getArraySize() const @@ -1486,6 +1493,35 @@ ); } +void Item::swap(Item* anotherItem) +{ + if(isNode()) + { + assert(anotherItem->isNode()); + SYNC_CODE(static_cast(this)->getRCLock()->acquire()); + SYNC_CODE(static_cast(anotherItem)->getRCLock()->acquire()); + // Swap trees. + assert(theUnion.treeRCPtr); + assert(anotherItem->theUnion.treeRCPtr); + std::swap(theUnion.treeRCPtr, anotherItem->theUnion.treeRCPtr); + + // Adjust counters. + *theUnion.treeRCPtr += theRefCount; + *theUnion.treeRCPtr -= anotherItem->theRefCount; + *anotherItem->theUnion.treeRCPtr -= theRefCount; + *anotherItem->theUnion.treeRCPtr += anotherItem->theRefCount; + SYNC_CODE(static_cast(this)->getRCLock()->release()); + SYNC_CODE(static_cast(anotherItem)->getRCLock()->release()); + return; + } + + throw ZORBA_EXCEPTION( + zerr::ZSTR0050_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE, + ERROR_PARAMS( __FUNCTION__, getType()->getStringValue() ) + ); +} + + } // namespace store } // namespace zorba /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/store/naive/json_items.cpp zorba-2.8.0-0/src/store/naive/json_items.cpp --- zorba-2.7.0-0/src/store/naive/json_items.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/json_items.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -36,6 +36,14 @@ /****************************************************************************** *******************************************************************************/ +JSONTree::~JSONTree() +{ + GET_STORE().unregisterReferenceToDeletedNode(theRoot); +} + +/****************************************************************************** + +*******************************************************************************/ store::Item* JSONNull::getType() const { return GET_STORE().JS_NULL_QNAME; @@ -494,6 +502,18 @@ return true; } +/****************************************************************************** + +*******************************************************************************/ +void SimpleJSONObject::swap(store::Item* anotherItem) +{ + SimpleJSONObject* lOther = dynamic_cast(anotherItem); + assert(lOther); + std::swap(theKeys, lOther->theKeys); + std::swap(thePairs, lOther->thePairs); + setTree(getTree()); + lOther->setTree(lOther->getTree()); +} /****************************************************************************** @@ -919,6 +939,18 @@ /****************************************************************************** *******************************************************************************/ +void SimpleJSONArray::swap(store::Item* anotherItem) +{ + SimpleJSONArray* lOther = dynamic_cast(anotherItem); + assert(lOther); + std::swap(theContent, lOther->theContent); + setTree(getTree()); + lOther->setTree(lOther->getTree()); +} + +/****************************************************************************** + +*******************************************************************************/ store::Item_t SimpleJSONArray::replace( const xs_integer& aPos, const store::Item_t& value) diff -Nru zorba-2.7.0-0/src/store/naive/json_items.h zorba-2.8.0-0/src/store/naive/json_items.h --- zorba-2.7.0-0/src/store/naive/json_items.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/json_items.h 2013-01-16 18:28:18.000000000 +0000 @@ -97,6 +97,8 @@ JSONTree() : theCollection(NULL), theId(), theRoot(NULL) {} + ~JSONTree(); + simplestore::Collection* getCollection() const { return theCollection; @@ -159,6 +161,11 @@ { return theTree; } + + bool isRoot() const + { + return theTree != NULL && (this == theTree->getRoot()); + } // These two functions are only to be called if in a collection. const TreeId& getTreeId() const; @@ -337,6 +344,8 @@ const store::Item_t& aName, const store::Item_t& aNewName); + virtual void swap(store::Item* anotherItem); + // root management protected: @@ -493,6 +502,8 @@ virtual store::Item_t replace(const xs_integer& aPos, const store::Item_t& value); + virtual void swap(Item* anotherItem); + // root management public: void setTree(JSONTree* aTree); diff -Nru zorba-2.7.0-0/src/store/naive/json_loader.cpp zorba-2.8.0-0/src/store/naive/json_loader.cpp --- zorba-2.7.0-0/src/store/naive/json_loader.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/json_loader.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,307 +0,0 @@ -/* - * Copyright 2006-2011 The FLWOR Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#include "json_loader.h" -#include "util/json_parser.h" -#include "json_items.h" -#include "simple_item_factory.h" -#include "store_defs.h" -#include "simple_store.h" -#include "diagnostics/diagnostic.h" -#include -#include - -namespace zorba -{ - -namespace simplestore -{ - -namespace json -{ - - -/****************************************************************************** - -*******************************************************************************/ -JSONLoader::JSONLoader( - std::istream& s, - internal::diagnostic::location* relative_error_loc - ) - : in(s), - theRelativeLoc(relative_error_loc) -{ -} - - -/****************************************************************************** - -*******************************************************************************/ -JSONLoader::~JSONLoader() -{ -} - -#define RAISE_JSON_ERROR_NO_PARAM(msg) \ - if (theRelativeLoc) \ - { \ - throw XQUERY_EXCEPTION( \ - jerr::JNDY0021, \ - ERROR_PARAMS( \ - ZED(msg), \ - "" \ - ), \ - ERROR_LOC(e.get_loc()) \ - ); \ - } \ - else \ - { \ - throw ZORBA_EXCEPTION( \ - jerr::JNDY0021, \ - ERROR_PARAMS( \ - ZED(msg), \ - BUILD_STRING(e.get_loc().line(), ", ", e.get_loc().column()) \ - ) \ - ); \ - } - -#define RAISE_JSON_ERROR_WITH_PARAM(msg, param) \ - if (theRelativeLoc) \ - { \ - throw XQUERY_EXCEPTION( \ - jerr::JNDY0021, \ - ERROR_PARAMS( \ - ZED(msg), \ - param, \ - "" \ - ), \ - ERROR_LOC(e.get_loc()) \ - ); \ - } \ - else \ - { \ - throw ZORBA_EXCEPTION( \ - jerr::JNDY0021, \ - ERROR_PARAMS( \ - ZED(msg), \ - param, \ - BUILD_STRING(e.get_loc().line(), ", ", e.get_loc().column()) \ - ) \ - ); \ - } - -/****************************************************************************** - -*******************************************************************************/ -store::Item_t -JSONLoader::next( ) -{ - using namespace zorba::json; - using namespace zorba::simplestore; - using namespace zorba::simplestore::json; - - try - { - BasicItemFactory& lFactory = GET_FACTORY(); - - JSONItem_t lRootItem; - - // stack of objects, arrays, and object pairs - std::vector lStack; - - parser lParser(in); - if (theRelativeLoc) - { - lParser.set_loc(theRelativeLoc->file(), theRelativeLoc->line(), theRelativeLoc->column()+1); - } - - token lToken; - - while (lParser.next(&lToken)) - { - switch (lToken.get_type()) - { - case token::begin_array: - lStack.push_back(new SimpleJSONArray()); - break; - - case token::begin_object: - lStack.push_back(new SimpleJSONObject()); - break; - - case token::end_array: - case token::end_object: - { - store::Item_t lItem = lStack.back(); - - lStack.pop_back(); - - if (lStack.empty()) - { - lRootItem = lItem.cast(); - } - else - { - addValue(lStack, lItem); - } - - break; - } - case token::name_separator: - case token::value_separator: - break; - case token::string: - { - store::Item_t lValue; - zstring s = lToken.get_value(); - lFactory.createString(lValue, s); - - addValue(lStack, lValue); - break; - } - case token::number: - { - store::Item_t lValue; - zstring s = lToken.get_value(); - lFactory.createJSONNumber(lValue, s); - // todo check return type - addValue(lStack, lValue); - break; - } - case token::json_false: - { - store::Item_t lValue; - lFactory.createBoolean(lValue, false); - addValue(lStack, lValue); - break; - } - case token::json_true: - { - store::Item_t lValue; - lFactory.createBoolean(lValue, true); - addValue(lStack, lValue); - break; - } - case token::json_null: - { - store::Item_t lValue; - lFactory.createJSONNull(lValue); - addValue(lStack, lValue); - break; - } - default: - assert(false); - } - } - return lRootItem; - } - catch (zorba::json::unterminated_string& e) - { - RAISE_JSON_ERROR_NO_PARAM(JSON_UNTERMINATED_STRING) - } - catch (zorba::json::unexpected_token& e) - { - RAISE_JSON_ERROR_WITH_PARAM(JSON_UNEXPECTED_TOKEN, e.get_token()) - } - catch (zorba::json::illegal_number& e) - { - RAISE_JSON_ERROR_NO_PARAM(JSON_ILLEGAL_NUMBER) - } - catch (zorba::json::illegal_literal& e) - { - RAISE_JSON_ERROR_NO_PARAM(JSON_ILLEGAL_LITERAL) - } - catch (zorba::json::illegal_escape& e) - { - RAISE_JSON_ERROR_WITH_PARAM(JSON_ILLEGAL_ESCAPE, e.get_escape()) - } - catch (zorba::json::illegal_codepoint& e) - { - RAISE_JSON_ERROR_WITH_PARAM(JSON_ILLEGAL_CODEPOINT, e.get_codepoint()) - } - catch (zorba::json::illegal_character& e) - { - RAISE_JSON_ERROR_WITH_PARAM(JSON_ILLEGAL_CHARACTER, e.get_char()) - } - return NULL; -} -#undef RAISE_JSON_ERROR_WITH_PARAM -#undef RAISE_JSON_ERROR_NO_PARAM - -void -JSONLoader::addValue( - std::vector& aStack, - const store::Item_t& aValue) -{ - store::Item_t lLast = aStack.back(); - - JSONObject* lObject = dynamic_cast(lLast.getp()); - - if (lObject) - { - // if the top of the stack is an object, then - // the value must be a string which is the name - // of the object's next name/value pair - aStack.push_back(aValue); - return; - } - - JSONArray* lArray = dynamic_cast(lLast.getp()); - if (lArray) - { - // if the top of the stack is an array, then - // the value must be appended to it - lArray->push_back(aValue); - return; - } - - // Otherwise, the top of the stack must be a string, which means - // that the second-to-top must be an object awaiting a value associated with - // this name. - store::Item_t lString = aStack.back(); - aStack.pop_back(); - - lLast = aStack.back(); - - lObject = dynamic_cast(lLast.getp()); - - assert(lObject); - lObject->add(lString, aValue, false); -} - -template T* -JSONLoader::cast(const JSONItem_t& j) -{ -#ifndef NDEBUG - T* t = dynamic_cast(j.getp()); - assert(t); -#else - T* t = static_cast(j.getp()); -#endif - return t; -} - -} /* namespace json */ - -} /* namespace simplestore */ - -} /* namespace zorba */ - -/* - * Local variables: - * mode: c++ - * End: - */ -/* vim:set et sw=2 ts=2: */ - diff -Nru zorba-2.7.0-0/src/store/naive/json_loader.h zorba-2.8.0-0/src/store/naive/json_loader.h --- zorba-2.7.0-0/src/store/naive/json_loader.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/json_loader.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,80 +0,0 @@ -/* - * Copyright 2006-2011 The FLWOR Foundation. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef ZORBA_SIMPLE_STORE_JSON_LOADER_H -#define ZORBA_SIMPLE_STORE_JSON_LOADER_H - -#include "common/common.h" -#include "shared_types.h" -#include "store/api/item.h" - -namespace zorba -{ - -namespace internal -{ -namespace diagnostic -{ - class location; -} -} - - -namespace simplestore -{ - -namespace json -{ - -class JSONLoader -{ -protected: - std::istream & in; - internal::diagnostic::location * theRelativeLoc; - -public: - JSONLoader( - std::istream& s, - internal::diagnostic::location* relative_error_loc); - - ~JSONLoader(); - - store::Item_t - next( ); - -private: - template - static T* - cast(const JSONItem_t&); - - void - addValue(std::vector&, const store::Item_t&); - -}; /* class JSONLoader */ - - -} /* namespace json */ - -} /* namespace simplestore */ - -} /* namespace zorba */ - -#endif /* ZORBA_SIMPLE_STORE_JSON_LOADER_H */ -/* - * Local variables: - * mode: c++ - * End: - */ -/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/store/naive/node_items.cpp zorba-2.8.0-0/src/store/naive/node_items.cpp --- zorba-2.7.0-0/src/store/naive/node_items.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/node_items.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -22,8 +22,11 @@ #include #include "api/unmarshaller.h" + #include "diagnostics/assert.h" +#include "diagnostics/util_macros.h" #include "diagnostics/xquery_diagnostics.h" + #include "zorbatypes/URI.h" #ifndef ZORBA_NO_FULL_TEXT #include "zorbautils/locale.h" @@ -623,6 +626,9 @@ const store::CopyMode& copymode) const { assert(!isConnectorNode()); + store::StoreConsts::NodeKind kind = getNodeKind(); + + bool copy = (copymode.theDoCopy || kind == store::StoreConsts::attributeNode); InternalNode* parent = NULL; csize pos = 0; @@ -634,9 +640,9 @@ parent = reinterpret_cast(inParent); - if (copymode.theDoCopy == false) + if (!copy) { - if (getNodeKind() == store::StoreConsts::textNode) + if (kind == store::StoreConsts::textNode) { pos = parent->numChildren(); @@ -670,28 +676,12 @@ } } } - else if (getNodeKind() == store::StoreConsts::attributeNode) - { - ElementNode* pnode = reinterpret_cast(parent); - store::Item_t attrName = getNodeName(); - pnode->checkUniqueAttr(attrName); - - try - { - pnode->addBindingForQName(attrName, true, false); - } - catch (...) - { - goto doCopy; - } - } new ConnectorNode(parent->getTree(), parent, this); return const_cast(this); } - doCopy: - if (getNodeKind() == store::StoreConsts::attributeNode) + if (kind == store::StoreConsts::attributeNode) { ElementNode* pnode = reinterpret_cast(parent); pnode->checkUniqueAttr(getNodeName()); @@ -703,7 +693,7 @@ } } // have parent - if (copymode.theDoCopy) + if (copy) { return copyInternal(parent, parent, pos, NULL, copymode); } @@ -714,53 +704,6 @@ } -#if 0 -/******************************************************************************* - Make a copy of the xml tree rooted at this node and place the copied tree at - a given position under a given node. Return a pointer to the root node of the - copied tree. - - parent : The node P under which the copied tree is to be placed. P may be - NULL, in which case the copied tree becomes a new standalone tree. - pos : The position under P where the copied tree is to be placed. If - "this" is an attribute node, pos is a position among the attributes - of P; otherwise it is a position among the children of P. If pos - is greater or equal to the current number of attrs/children in P, - then the copied tree is appended to P's attributes/children. - copymode : Encapsulates the construction-mode and copy-namespace-mode - components of the query's static context. -********************************************************************************/ -store::Item* XmlNode::copy( - store::Item* inParent, - csize pos, - const store::CopyMode& copymode) const -{ - assert(!isConnectorNode()); - assert(copymode.theDoCopy == true); - - InternalNode* parent = NULL; - - if (inParent) - { - parent = reinterpret_cast(inParent); - ZORBA_ASSERT(inParent->getNodeKind() == store::StoreConsts::elementNode || - inParent->getNodeKind() == store::StoreConsts::documentNode); - } - - if (getNodeKind() == store::StoreConsts::attributeNode) - { - if (parent) - { - ElementNode* pnode = reinterpret_cast(parent); - pnode->checkUniqueAttr(getNodeName()); - } - } - - return copyInternal(parent, parent, pos, NULL, copymode); -} -#endif - - /******************************************************************************* Connect "this" to the given parent at the given position. ********************************************************************************/ @@ -815,6 +758,61 @@ } +void XmlNode::swap(Item* anotherItem) +{ + // Need Item to swap trees and adjust counters. + Item::swap(anotherItem); + XmlNode* lOtherItem = dynamic_cast(anotherItem); + assert(lOtherItem); + assert(theParent == NULL); + assert(lOtherItem->theParent == NULL); + + // Swap flags expect hasReference. + bool lHasReference = haveReference(); + bool lOtherHasReference = lOtherItem->haveReference(); + std::swap(theFlags, lOtherItem->theFlags); + if(lHasReference) + { + setHaveReference(); + } + if(lOtherHasReference) + { + setHaveReference(); + } + + // Swap root nodes and adjust type maps. + store::Item_t lRootNodeType; + store::Item_t lOtherRootNodeType; + bool lRootHasType = getTree()->theTypesMap->get( + getTree()->theRootNode, lRootNodeType); + bool lOtherRootHasType = lOtherItem->getTree()->theTypesMap->get( + lOtherItem->getTree()->theRootNode, lOtherRootNodeType); + if(lRootHasType) + { + getTree()->theTypesMap->erase(getTree()->theRootNode); + } + if(lOtherRootHasType) + { + lOtherItem->getTree()->theTypesMap->erase( + lOtherItem->getTree()->theRootNode); + } + std::swap(getTree()->theRootNode, lOtherItem->getTree()->theRootNode); + if(lRootHasType) + { + getTree()->theTypesMap->insert(getTree()->theRootNode, lRootNodeType); + } + if(lOtherRootHasType) + { + lOtherItem->getTree()->theTypesMap->insert( + lOtherItem->getTree()->theRootNode, lOtherRootNodeType); + } + + // Adjust trees. +#ifndef EMBEDED_TYPE + std::swap(getTree()->theTypesMap, lOtherItem->getTree()->theTypesMap); +#endif +} + /******************************************************************************* Deallocate all nodes in the subtree rooted at "this". ********************************************************************************/ @@ -965,6 +963,16 @@ return str.str(); } +void ConnectorNode::swap(Item* anotherItem) +{ + throw ZORBA_EXCEPTION( + zerr::ZSTR0050_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE, + ERROR_PARAMS( __FUNCTION__, getType()->getStringValue() ) + ); +} + + + ///////////////////////////////////////////////////////////////////////////////// // // @@ -1452,6 +1460,14 @@ } +void OrdPathNode::swap(Item* anotherItem) +{ + XmlNode::swap(anotherItem); + OrdPathNode* lOtherItem = dynamic_cast(anotherItem); + std::swap(theOrdPath, lOtherItem->theOrdPath); +} + + ///////////////////////////////////////////////////////////////////////////////// // // // class InternalNode // @@ -1759,6 +1775,28 @@ } +void InternalNode::swap(Item* anotherItem) +{ + OrdPathNode::swap(anotherItem); + InternalNode* lOtherItem = dynamic_cast(anotherItem); + std::swap(theNodes, lOtherItem->theNodes); + for (iterator lIterator = theNodes.begin(); + lIterator != theNodes.end(); + ++lIterator) + { + (*lIterator)->setParent(this); + } + for (iterator lIterator = lOtherItem->theNodes.begin(); + lIterator != lOtherItem->theNodes.end(); + ++lIterator) + { + (*lIterator)->setParent(lOtherItem); + } + std::swap(theNumAttrs, lOtherItem->theNumAttrs); + std::swap(theNsContext, lOtherItem->theNsContext); +} + + ///////////////////////////////////////////////////////////////////////////////// // // // class DocumentNode // @@ -1981,6 +2019,15 @@ +void DocumentNode::swap(Item* anotherItem) +{ + InternalNode::swap(anotherItem); + DocumentNode* lOtherItem = dynamic_cast(anotherItem); + std::swap(theBaseUri, lOtherItem->theBaseUri); + std::swap(theDocUri, lOtherItem->theDocUri); +} + + ///////////////////////////////////////////////////////////////////////////////// // // // class ElementNode // @@ -3219,7 +3266,7 @@ ********************************************************************************/ void ElementNode::checkNamespaceConflict( const store::Item* qname, - Error const& ecode) const + const QueryLoc* loc) const { const QNameItem* qn = reinterpret_cast(qname); @@ -3235,7 +3282,8 @@ if (found && ns2 != ns) { - throw XQUERY_EXCEPTION_VAR(ecode, ERROR_PARAMS(qname->show(), prefix, ns2)); + RAISE_ERROR(err::XUDY0023, loc, + ERROR_PARAMS(qn->getStringValue(), prefix, ns, ns2)); } } @@ -3284,7 +3332,8 @@ if (!otherAttr->isHidden() && otherAttr->getNodeName()->equals(attrName)) { - throw XQUERY_EXCEPTION(err::XUDY0021, ERROR_PARAMS(attrName->getStringValue())); + throw XQUERY_EXCEPTION(err::XUDY0021, + ERROR_PARAMS(ZED(XUDY0021_AttributeName), "", attrName->getStringValue())); } } } @@ -3467,6 +3516,17 @@ +void ElementNode::swap(Item* anotherItem) +{ + InternalNode::swap(anotherItem); + ElementNode* lOtherItem = dynamic_cast(anotherItem); + std::swap(theName, lOtherItem->theName); +#ifdef EMBEDED_TYPE + std::swap(theTypeName, lOtherItem->theTypeName); +#endif +} + + ///////////////////////////////////////////////////////////////////////////////// // // // class AttributeNode // @@ -3974,6 +4034,18 @@ return NULL; } +void AttributeNode::swap(Item* anotherItem) +{ + OrdPathNode::swap(anotherItem); + AttributeNode* lOtherItem = dynamic_cast(anotherItem); + std::swap(theName, lOtherItem->theName); +#ifdef EMBEDED_TYPE + std::swap(theTypeName, lOtherItem->theTypeName); +#endif + std::swap(theTypedValue, lOtherItem->theTypedValue); +} + + ///////////////////////////////////////////////////////////////////////////////// // // // class TextNode // @@ -4681,6 +4753,15 @@ return NULL; } +void TextNode::swap(Item* anotherItem) +{ + throw ZORBA_EXCEPTION( + zerr::ZSTR0050_FUNCTION_NOT_IMPLEMENTED_FOR_ITEMTYPE, + ERROR_PARAMS( __FUNCTION__, getType()->getStringValue() ) + ); +} + + ///////////////////////////////////////////////////////////////////////////////// // // // class PiNode // @@ -4826,6 +4907,16 @@ } +void PiNode::swap(Item* anotherItem) +{ + OrdPathNode::swap(anotherItem); + PiNode* lOtherItem = dynamic_cast(anotherItem); + std::swap(theTarget, lOtherItem->theTarget); + std::swap(theContent, lOtherItem->theContent); + std::swap(theName, lOtherItem->theName); +} + + ///////////////////////////////////////////////////////////////////////////////// // // // class CommentNode // @@ -4958,6 +5049,14 @@ } +void CommentNode::swap(Item* anotherItem) +{ + OrdPathNode::swap(anotherItem); + CommentNode* lOtherItem = dynamic_cast(anotherItem); + std::swap(theContent, lOtherItem->theContent); +} + + #ifndef ZORBA_NO_FULL_TEXT /****************************************************************************** diff -Nru zorba-2.7.0-0/src/store/naive/node_items.h zorba-2.8.0-0/src/store/naive/node_items.h --- zorba-2.7.0-0/src/store/naive/node_items.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/node_items.h 2013-01-16 18:28:18.000000000 +0000 @@ -54,6 +54,9 @@ namespace zorba { +class QueryLoc; + + namespace store { class CopyMode; @@ -382,6 +385,8 @@ void connect(InternalNode* node, csize pos); + virtual void swap(Item* anotherItem); + #ifndef ZORBA_NO_FULL_TEXT virtual void tokenize( XmlNodeTokenizerCallback& ); #endif @@ -434,6 +439,11 @@ return reinterpret_cast(theParent); } + bool isRoot() const + { + return getCollection() != NULL && getParent() == NULL; + } + bool equals( const store::Item* other, long timezone = 0, @@ -595,6 +605,8 @@ const store::CopyMode& copyMode) const; zstring show() const; + + virtual void swap(Item* anotherItem); }; @@ -685,6 +697,8 @@ virtual store::Item_t leastCommonAncestor(const store::Item_t&) const; + + virtual void swap(Item* anotherItem); }; @@ -860,6 +874,8 @@ const OrdPath* getFirstChildOrdPathAfter(csize pos) const; const OrdPath* getFirstChildOrdPathBefore(csize pos) const; + + virtual void swap(Item* anotherItem); }; @@ -926,6 +942,8 @@ void setDocUri(const zstring& uri) { theDocUri = uri; } + virtual void swap(Item* anotherItem); + protected: void getBaseURIInternal(zstring& uri, bool& local) const; }; @@ -1071,7 +1089,7 @@ void addBindingForQName2(const store::Item* qname); - void checkNamespaceConflict(const store::Item* qname, Error const &ecode) const; + void checkNamespaceConflict(const store::Item* qname, const QueryLoc* loc) const; void uninheritBinding( NsBindingsContext* rootNSCtx, @@ -1106,6 +1124,8 @@ void restoreName(UpdRenameElem& upd); + virtual void swap(Item* anotherItem); + protected: void setType(store::Item_t& type); @@ -1236,6 +1256,8 @@ bool wildcards = false ) const; #endif /* ZORBA_NO_FULL_TEXT */ + virtual void swap(Item* anotherItem); + protected: void setType(store::Item_t& type); @@ -1394,6 +1416,8 @@ leastCommonAncestor(const store::Item_t&) const; #endif + virtual void swap(Item* anotherItem); + protected: const zstring& getText() const { return theContent.getText(); } @@ -1475,6 +1499,9 @@ void restoreName(UpdRenamePi& upd); store::Iterator_t getChildren() const; + + virtual void swap(Item* anotherItem); + }; @@ -1532,6 +1559,8 @@ void restoreValue(UpdReplaceCommentValue& upd); store::Iterator_t getChildren() const; + + virtual void swap(Item* anotherItem); }; diff -Nru zorba-2.7.0-0/src/store/naive/pul_primitive_factory.cpp zorba-2.8.0-0/src/store/naive/pul_primitive_factory.cpp --- zorba-2.7.0-0/src/store/naive/pul_primitive_factory.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/pul_primitive_factory.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -396,6 +396,28 @@ /*************************************************************************** ****************************************************************************/ +UpdEditInCollection* +PULPrimitiveFactory::createUpdEditInCollection( + CollectionPul* pul, + const QueryLoc* aLoc, + store::Item_t& name, + store::Item_t& target, + store::Item_t& content, + bool isDynamic) +{ + return new UpdEditInCollection( + pul, + aLoc, + name, + target, + content, + isDynamic); +} + + +/*************************************************************************** + +****************************************************************************/ UpdTruncateCollection* PULPrimitiveFactory::createUpdTruncateCollection( CollectionPul* pul, diff -Nru zorba-2.7.0-0/src/store/naive/pul_primitive_factory.h zorba-2.8.0-0/src/store/naive/pul_primitive_factory.h --- zorba-2.7.0-0/src/store/naive/pul_primitive_factory.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/pul_primitive_factory.h 2013-01-16 18:28:18.000000000 +0000 @@ -55,6 +55,7 @@ class UpdInsertBeforeIntoCollection; class UpdInsertAfterIntoCollection; class UpdDeleteNodesFromCollection; + class UpdEditInCollection; class UpdTruncateCollection; class UpdCreateIndex; class UpdDeleteIndex; @@ -278,6 +279,15 @@ bool isLast, bool isDynamic); + virtual UpdEditInCollection* + createUpdEditInCollection( + CollectionPul* pul, + const QueryLoc*, + store::Item_t& name, + store::Item_t& target, + store::Item_t& content, + bool isDynamic); + virtual UpdTruncateCollection* createUpdTruncateCollection( CollectionPul* pul, diff -Nru zorba-2.7.0-0/src/store/naive/pul_primitives.cpp zorba-2.8.0-0/src/store/naive/pul_primitives.cpp --- zorba-2.7.0-0/src/store/naive/pul_primitives.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/pul_primitives.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -302,9 +302,9 @@ UpdatePrimitive(pul, aLoc, target), theNumApplied(0) { - std::size_t numAttrs = attrs.size(); + csize numAttrs = attrs.size(); theNewAttrs.resize(numAttrs); - for (std::size_t i = 0; i < numAttrs; i++) + for (csize i = 0; i < numAttrs; i++) { theNewAttrs[i].transfer(attrs[i]); } @@ -314,7 +314,15 @@ void UpdInsertAttributes::apply() { theIsApplied = true; - ELEM_NODE(theTarget)->insertAttributes(*this); + try + { + ELEM_NODE(theTarget)->insertAttributes(*this); + } + catch (ZorbaException& e) + { + set_source(e, *theLoc); + throw; + } } @@ -330,7 +338,8 @@ try { target->checkUniqueAttrs(); - } catch (ZorbaException& e) + } + catch (ZorbaException& e) { set_source(e, *theLoc); throw; @@ -364,8 +373,16 @@ void UpdReplaceAttribute::apply() { - theIsApplied = true; - ELEM_NODE(theTarget)->replaceAttribute(*this); + try + { + ELEM_NODE(theTarget)->replaceAttribute(*this); + theIsApplied = true; + } + catch (ZorbaException& e) + { + set_source(e, *theLoc); + throw; + } } @@ -381,7 +398,8 @@ try { target->checkUniqueAttrs(); - } catch (ZorbaException& e) + } + catch (ZorbaException& e) { set_source(e, *theLoc); throw; @@ -463,8 +481,16 @@ ********************************************************************************/ void UpdRenameElem::apply() { - ELEM_NODE(theTarget)->replaceName(*this); - theIsApplied = true; + try + { + ELEM_NODE(theTarget)->replaceName(*this); + theIsApplied = true; + } + catch (ZorbaException& e) + { + set_source(e, *theLoc); + throw; + } } @@ -612,8 +638,16 @@ ********************************************************************************/ void UpdRenameAttr::apply() { - ATTR_NODE(theTarget)->replaceName(*this); - theIsApplied = true; + try + { + ATTR_NODE(theTarget)->replaceName(*this); + theIsApplied = true; + } + catch (ZorbaException& e) + { + set_source(e, *theLoc); + throw; + } } @@ -839,7 +873,7 @@ store->addNode(targetUri, theTarget); } - catch(ZorbaException const& e) + catch(ZorbaException& e) { if (e.diagnostic() == zerr::ZAPI0020_DOCUMENT_ALREADY_EXISTS) { @@ -851,6 +885,7 @@ } else { + set_source(e, *theLoc); throw; } } @@ -989,7 +1024,7 @@ } catch (std::range_error& e) { - throw ZORBA_EXCEPTION(zerr::ZSTR0060_RANGE_EXCEPTION, + RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc, ERROR_PARAMS(BUILD_STRING("collection too big (" << e.what() << "; " << theName << ")"))); } @@ -1066,7 +1101,7 @@ } catch (std::range_error& e) { - throw ZORBA_EXCEPTION(zerr::ZSTR0060_RANGE_EXCEPTION, + RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc, ERROR_PARAMS(BUILD_STRING("collection too big (" << e.what() << "; " << theName << ")"))); } @@ -1157,7 +1192,7 @@ } catch (std::range_error& e) { - throw ZORBA_EXCEPTION(zerr::ZSTR0060_RANGE_EXCEPTION, + RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc, ERROR_PARAMS(BUILD_STRING("collection too big (" << e.what() << "; " << theName << ")"))); } @@ -1242,21 +1277,21 @@ ********************************************************************************/ void UpdDeleteNodesFromCollection::apply() { - Collection* lColl = static_cast + Collection* coll = static_cast (GET_STORE().getCollection(theName, theIsDynamic).getp()); - assert(lColl); + assert(coll); theIsApplied = true; uint64_t size; try { - size = to_xs_unsignedLong(lColl->size()); + size = to_xs_unsignedLong(coll->size()); } catch (std::range_error& e) { - throw ZORBA_EXCEPTION(zerr::ZSTR0060_RANGE_EXCEPTION, + RAISE_ERROR(zerr::ZSTR0060_RANGE_EXCEPTION, theLoc, ERROR_PARAMS(BUILD_STRING("collection too big (" << e.what() << "; " << theName << ")"))); } @@ -1269,7 +1304,7 @@ { for (csize i = numNodes; i > 0; --i) { - if (theNodes[i-1] != lColl->nodeAt(xs_integer(size - i))) + if (theNodes[i-1] != coll->nodeAt(xs_integer(size - i))) { isLast = false; break; @@ -1285,31 +1320,65 @@ theFound.resize(numNodes); thePositions.resize(numNodes); - for (std::size_t i = 0; i < numNodes; ++i) + for (csize i = 0; i < numNodes; ++i) { - theFound[i] = lColl->removeNode(theNodes[i], thePositions[i]); + theFound[i] = coll->removeNode(theNodes[i], thePositions[i]); ++theNumApplied; } } void UpdDeleteNodesFromCollection::undo() { - Collection* lColl = static_cast + Collection* coll = static_cast (GET_STORE().getCollection(theName, theIsDynamic).getp()); - assert(lColl); + assert(coll); for (csize i = 0; i < theNumApplied; ++i) { if (theFound[i]) { - lColl->addNode(theNodes[i], thePositions[i]); + coll->addNode(theNodes[i], thePositions[i]); } } } /******************************************************************************* + UpdEditInCollection +********************************************************************************/ +void UpdEditInCollection::apply() +{ +#ifndef NDEBUG + Collection* coll = static_cast + (GET_STORE().getCollection(theName, theIsDynamic).getp()); + + assert(coll); +#endif + + theTarget->swap(theContent.getp()); + + theIsApplied = true; +} + + +void UpdEditInCollection::undo() +{ + if (!theFound) + return; + +#ifndef NDEBUG + Collection* coll = static_cast + (GET_STORE().getCollection(theName, theIsDynamic).getp()); + + assert(coll); +#endif + + theTarget->swap(theContent.getp()); +} + + +/******************************************************************************* UpdTruncateCollection ********************************************************************************/ void UpdTruncateCollection::apply() @@ -1362,15 +1431,15 @@ { theIndex = store->createIndex(theQName, theSpec, theSourceIter); } - catch(ZorbaException const& e) + catch(ZorbaException& e) { if (e.diagnostic() == zerr::ZSTR0045_DUPLICATE_NODE_ERROR) { - throw ZORBA_EXCEPTION( - zerr::ZDDY0028_INDEX_DOMAIN_HAS_DUPLICATE_NODES, - ERROR_PARAMS( theQName->getStringValue() ) - ); + RAISE_ERROR(zerr::ZDDY0028_INDEX_DOMAIN_HAS_DUPLICATE_NODES, theLoc, + ERROR_PARAMS(theQName->getStringValue())); } + + set_source(e, *theLoc); throw; } @@ -1409,7 +1478,7 @@ if ((theIndex = store->getIndex(theQName)) == NULL) { - throw ZORBA_EXCEPTION(zerr::ZSTR0002_INDEX_DOES_NOT_EXIST, + RAISE_ERROR(zerr::ZDDY0023_INDEX_DOES_NOT_EXIST, theLoc, ERROR_PARAMS(theQName->getStringValue())); } @@ -1457,7 +1526,7 @@ if ((theIndex = store.getIndex(theQName)) == NULL) { - throw ZORBA_EXCEPTION(zerr::ZSTR0002_INDEX_DOES_NOT_EXIST, + RAISE_ERROR(zerr::ZDDY0023_INDEX_DOES_NOT_EXIST, theLoc, ERROR_PARAMS(theQName->getStringValue())); } @@ -1821,7 +1890,7 @@ if (!lMap) { - throw ZORBA_EXCEPTION(zerr::ZDDY0023_INDEX_DOES_NOT_EXIST, + RAISE_ERROR(zerr::ZDDY0023_INDEX_DOES_NOT_EXIST, theLoc, ERROR_PARAMS(theQName->getStringValue())); } @@ -1877,10 +1946,8 @@ if (!lMap) { - throw ZORBA_EXCEPTION( - zerr::ZDDY0023_INDEX_DOES_NOT_EXIST, - ERROR_PARAMS( theQName->getStringValue() ) - ); + RAISE_ERROR(zerr::ZDDY0023_INDEX_DOES_NOT_EXIST, theLoc, + ERROR_PARAMS(theQName->getStringValue())); } simplestore::ValueHashIndex* lImpl = diff -Nru zorba-2.7.0-0/src/store/naive/pul_primitives.h zorba-2.8.0-0/src/store/naive/pul_primitives.h --- zorba-2.7.0-0/src/store/naive/pul_primitives.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/pul_primitives.h 2013-01-16 18:28:18.000000000 +0000 @@ -1213,6 +1213,54 @@ /******************************************************************************* ********************************************************************************/ +class UpdEditInCollection: public UpdCollection +{ + friend class PULPrimitiveFactory; + +protected: + store::Item_t theTarget; + store::Item_t theContent; + bool theFound; + + UpdEditInCollection( + CollectionPul* pul, + const QueryLoc* aLoc, + store::Item_t& name, + store::Item_t& target, + store::Item_t& content, + bool isDynamic) + : + UpdCollection(pul, aLoc, name, isDynamic), + theTarget(target), + theContent(content), + theFound(false) + { + } + +public: + store::UpdateConsts::UpdPrimKind getKind() const + { + return store::UpdateConsts::UP_REPLACE_IN_COLLECTION; + } + + store::Item* getTarget() const + { + return theTarget.getp(); + } + + store::Item* getContent() const + { + return theContent.getp(); + } + + void apply(); + void undo(); +}; + + +/******************************************************************************* + +********************************************************************************/ class UpdTruncateCollection: public UpdCollection { friend class PULPrimitiveFactory; diff -Nru zorba-2.7.0-0/src/store/naive/qname_pool.cpp zorba-2.8.0-0/src/store/naive/qname_pool.cpp --- zorba-2.7.0-0/src/store/naive/qname_pool.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/qname_pool.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -63,12 +63,12 @@ ********************************************************************************/ QNamePool::~QNamePool() { - csize n = theHashSet.theHashTab.size(); + csize n = theHashSet.capacity(); for (csize i = 0; i < n; ++i) { if (!theHashSet.theHashTab[i].isFree() && - theHashSet.theHashTab[i].theItem->isOverflow()) - delete theHashSet.theHashTab[i].theItem; + theHashSet.theHashTab[i].key()->isOverflow()) + delete theHashSet.theHashTab[i].key(); } if (theCache != NULL) @@ -297,12 +297,12 @@ bool found; entry = theHashSet.hashInsert(qn, hval, found); - entry->theItem = qn; + entry->key() = qn; ZORBA_FATAL(!found, ""); } else { - qn = entry->theItem; + qn = entry->key(); cachePin(qn); } @@ -389,12 +389,12 @@ bool found; entry = theHashSet.hashInsert(qn, hval, found); - entry->theItem = qn; + entry->key() = qn; ZORBA_FATAL(!found, ""); } else { - qn = entry->theItem; + qn = entry->key(); cachePin(qn); } @@ -478,7 +478,7 @@ while (entry != NULL) { - QNameItem* qn = entry->theItem; + QNameItem* qn = entry->key(); if (ztd::equals(qn->getLocalName(), ln, lnlen) && ztd::equals(qn->getNamespace(), ns, nslen) && diff -Nru zorba-2.7.0-0/src/store/naive/simple_collection.cpp zorba-2.8.0-0/src/store/naive/simple_collection.cpp --- zorba-2.7.0-0/src/store/naive/simple_collection.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_collection.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -444,6 +444,97 @@ } } +/******************************************************************************* + * Substitues content for target. +********************************************************************************/ +bool SimpleCollection::replaceNode(store::Item* target, store::Item* content) +{ + XmlNode* lTargetNode = NULL; + XmlNode* lContentNode = NULL; +#ifdef ZORBA_WITH_JSON + json::JSONItem* lTargetJSONItem = NULL; + json::JSONItem* lContentJSONItem = NULL; +#endif + + if (target->isNode()) + { + lTargetNode = static_cast(target); + } +#ifdef ZORBA_WITH_JSON + else if (target->isJSONItem()) + { + lTargetJSONItem = static_cast(target); + } + else + { + throw ZORBA_EXCEPTION(zerr::ZSTR0013_COLLECTION_ITEM_MUST_BE_STRUCTURED, + ERROR_PARAMS(getName()->getStringValue())); + } +#else + else + { + throw ZORBA_EXCEPTION(zerr::ZSTR0012_COLLECTION_ITEM_MUST_BE_A_NODE, + ERROR_PARAMS(getName()->getStringValue())); + } +#endif + + if (content->isNode()) + { + lContentNode = static_cast(content); + } +#ifdef ZORBA_WITH_JSON + else if (content->isJSONItem()) + { + lContentJSONItem = static_cast(content); + } + else + { + throw ZORBA_EXCEPTION(zerr::ZSTR0013_COLLECTION_ITEM_MUST_BE_STRUCTURED, + ERROR_PARAMS(getName()->getStringValue())); + } +#else + else + { + throw ZORBA_EXCEPTION(zerr::ZSTR0012_COLLECTION_ITEM_MUST_BE_A_NODE, + ERROR_PARAMS(getName()->getStringValue())); + } +#endif + + SYNC_CODE(AutoLatch lock(theLatch, Latch::WRITE);) + + xs_integer position; + bool found = findNode(target, position); + + if (found) + { + ZORBA_ASSERT(target->getCollection() == this); + + xs_integer const &zero = xs_integer::zero(); + +#ifdef ZORBA_WITH_JSON + if (lTargetJSONItem) + lTargetJSONItem->detachFromCollection(); + else +#endif + lTargetNode->setCollection(NULL, zero); + + csize pos = to_xs_unsignedInt(position); + theXmlTrees[pos] = content; + +#ifdef ZORBA_WITH_JSON + if (lContentJSONItem) + lContentJSONItem->attachToCollection(this, createTreeId()); + else +#endif + lContentNode->setCollection(this, position); + return true; + } + else + { + return false; + } +} + /******************************************************************************* * Remove all the nodes from the collection diff -Nru zorba-2.7.0-0/src/store/naive/simple_collection.h zorba-2.8.0-0/src/store/naive/simple_collection.h --- zorba-2.7.0-0/src/store/naive/simple_collection.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_collection.h 2013-01-16 18:28:18.000000000 +0000 @@ -131,6 +131,10 @@ xs_integer removeNodes(xs_integer position, xs_integer num); + bool replaceNode( + store::Item* target, + store::Item* content); + bool findNode(const store::Item* node, xs_integer& position) const; store::Item_t nodeAt(xs_integer position); diff -Nru zorba-2.7.0-0/src/store/naive/simple_index_value.cpp zorba-2.8.0-0/src/store/naive/simple_index_value.cpp --- zorba-2.7.0-0/src/store/naive/simple_index_value.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_index_value.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -792,10 +792,11 @@ /****************************************************************************** ********************************************************************************/ -void ProbeValueTreeIndexIterator::init(const store::IndexCondition_t& cond, - const xs_integer& aSkip) +void ProbeValueTreeIndexIterator::init( + const store::IndexCondition_t& cond, + const xs_integer& skip) { - theSkip = aSkip; + theSkip = skip; if (cond->getKind() != store::IndexCondition::BOX_VALUE && cond->getKind() != store::IndexCondition::POINT_VALUE) @@ -907,13 +908,23 @@ if (haveLowerBound) { if (!flags[i].theHaveLowerBound) - lowerBounds[i] = IndexConditionImpl::theNegInf; + { + if (lowIncl) + lowerBounds[i] = IndexConditionImpl::theNegInf; + else + lowerBounds[i] = IndexConditionImpl::thePosInf; + } } if (haveUpperBound) { if (!flags[i].theHaveUpperBound) - upperBounds[i] = IndexConditionImpl::thePosInf; + { + if (highIncl) + upperBounds[i] = IndexConditionImpl::thePosInf; + else + upperBounds[i] = IndexConditionImpl::theNegInf; + } } if (flags[i].theHaveLowerBound && flags[i].theHaveUpperBound) @@ -984,22 +995,37 @@ ********************************************************************************/ void ProbeValueTreeIndexIterator::reset() { + theResultSet = NULL; + if (theMapBegin != theIndex->theMap.end()) { theMapIte = theMapBegin; - theResultSet = theMapIte->second; - theIte = theResultSet->begin(); - theEnd = theResultSet->end(); - - // primitive skip - store::Item_t lDummy; - for (long l = 0; l < to_xs_long(theSkip); ++l) + while (theMapIte != theMapEnd) { - if(!next(lDummy)) - { - // no more values + if (!theDoExtraFiltering || + theBoxCond == NULL || + theBoxCond->test(*(theMapIte->first))) break; + + ++theMapIte; + } + + if (theMapIte != theMapEnd) + { + theResultSet = theMapIte->second; + theIte = theResultSet->begin(); + theEnd = theResultSet->end(); + + // primitive skip + store::Item_t lDummy; + for (long l = 0; l < to_xs_long(theSkip); ++l) + { + if(!next(lDummy)) + { + // no more values + break; + } } } } @@ -1032,7 +1058,7 @@ } theResultSet = NULL; - theMapIte++; + ++theMapIte; while (theMapIte != theMapEnd) { @@ -1044,7 +1070,7 @@ break; } - theMapIte++; + ++theMapIte; } } @@ -1053,9 +1079,9 @@ /****************************************************************************** - The implementation here doesn't really give anything in terms of - performance but other implementations might be able to provide more - efficient ones. + The implementation here doesn't really give anything in terms of + performance but other implementations might be able to provide more + efficient ones. ********************************************************************************/ void ProbeValueTreeIndexIterator::count(store::Item_t& result) { diff -Nru zorba-2.7.0-0/src/store/naive/simple_item_factory.cpp zorba-2.8.0-0/src/store/naive/simple_item_factory.cpp --- zorba-2.7.0-0/src/store/naive/simple_item_factory.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_item_factory.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -446,6 +446,7 @@ return true; } + bool BasicItemFactory::createDateTime( store::Item_t& result, const xs_date* date, @@ -457,10 +458,16 @@ { result = dtin.get(); dtin.release(); - } // destroy object if error occured - return err == 0; + return true; + } + else + { + result = NULL; + return false; + } } + bool BasicItemFactory::createDateTime( store::Item_t& result, short year, @@ -473,7 +480,7 @@ DateTime dt; TimeZone tz; - if(DateTime::createDateTime(year, month, day, hour, minute, second, &tz, dt) == 0) + if (DateTime::createDateTime(year, month, day, hour, minute, second, &tz, dt) == 0) { result = new DateTimeItem(&dt); return true; @@ -544,10 +551,10 @@ } else { - xs_date const &d = date->getDateValue(); - xs_time const &t = time->getTimeValue(); + const xs_date& d = date->getDateValue(); + const xs_time& t = time->getTimeValue(); if (! createDateTime(result, &d, &t)) - throw XQUERY_EXCEPTION( err::FORG0008, ERROR_PARAMS( d, t ) ); + throw XQUERY_EXCEPTION(err::FORG0008, ERROR_PARAMS(d, t)); return true; } @@ -570,7 +577,7 @@ DateTime dt; TimeZone tz; - if(DateTime::createDate(year, month, day, &tz, dt) == 0) + if (DateTime::createDate(year, month, day, &tz, dt) == 0) { result = new DateTimeItem(&dt); return true; @@ -617,7 +624,7 @@ { DateTime dt; - if( DateTime::parseTime(str, strlen, dt) == 0) + if (DateTime::parseTime(str, strlen, dt) == 0) { result = new DateTimeItem(&dt); return true; @@ -796,11 +803,13 @@ { DateTime dt; - if(DateTime::createGMonthDay(month, day, dt) == 0) + if (DateTime::createGMonthDay(month, day, dt) == 0) { result = new DateTimeItem(&dt); return true; - } else { + } + else + { result = NULL; return false; } @@ -887,7 +896,7 @@ { DateTime dt; - if(DateTime::createGYearMonth(year, month, dt) == 0) + if (DateTime::createGYearMonth(year, month, dt) == 0) { result = new DateTimeItem(&dt); return true; @@ -1019,9 +1028,7 @@ bool seekable, bool encoded) { - result = new StreamableBase64BinaryItem( - aStream, aReleaser, seekable, encoded - ); + result = new StreamableBase64BinaryItem(aStream, aReleaser, seekable, encoded); return true; } @@ -1032,6 +1039,7 @@ return true; } + bool BasicItemFactory::createNOTATION( store::Item_t& result, zstring& ns, @@ -1042,9 +1050,8 @@ return true; } -bool BasicItemFactory::createNOTATION( - store::Item_t& result, - zstring& str) + +bool BasicItemFactory::createNOTATION(store::Item_t& result, zstring& str) { zstring nsuri; zstring prefix; diff -Nru zorba-2.7.0-0/src/store/naive/simple_pul.cpp zorba-2.8.0-0/src/store/naive/simple_pul.cpp --- zorba-2.7.0-0/src/store/naive/simple_pul.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_pul.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -392,7 +392,7 @@ ********************************************************************************/ void PULImpl::addInsertAttributes( - const QueryLoc* aQueryLoc, + const QueryLoc* loc, store::Item_t& target, std::vector& attrs) { @@ -401,16 +401,16 @@ ElementNode* n = ELEM_NODE(target); csize numAttrs = attrs.size(); - for (csize i = 0; i < numAttrs; i++) + for (csize i = 0; i < numAttrs; ++i) { - n->checkNamespaceConflict(attrs[i]->getNodeName(), err::XUDY0023); + n->checkNamespaceConflict(attrs[i]->getNodeName(), loc); } NodeUpdates* updates = 0; bool found = pul->theNodeToUpdatesMap.get(n, updates); UpdInsertAttributes* upd = GET_PUL_FACTORY(). - createUpdInsertAttributes(pul, aQueryLoc, target, attrs); + createUpdInsertAttributes(pul, loc, target, attrs); pul->theDoFirstList.push_back(upd); @@ -431,7 +431,7 @@ ********************************************************************************/ void PULImpl::addReplaceNode( - const QueryLoc* aQueryLoc, + const QueryLoc* loc, store::Item_t& target, std::vector& newNodes) { @@ -456,19 +456,19 @@ csize numNewAttrs = newNodes.size(); for (csize i = 0; i < numNewAttrs; ++i) { - elemParent->checkNamespaceConflict(newNodes[i]->getNodeName(), err::XUDY0023); + elemParent->checkNamespaceConflict(newNodes[i]->getNodeName(), loc); } } upd = GET_PUL_FACTORY(). - createUpdReplaceAttribute(pul, aQueryLoc, parent, target, newNodes); + createUpdReplaceAttribute(pul, loc, parent, target, newNodes); kind = store::UpdateConsts::UP_REPLACE_ATTRIBUTE; } else { upd = GET_PUL_FACTORY(). - createUpdReplaceChild(pul, aQueryLoc, parent, target, newNodes); + createUpdReplaceChild(pul, loc, parent, target, newNodes); kind = store::UpdateConsts::UP_REPLACE_CHILD; } @@ -614,7 +614,7 @@ ********************************************************************************/ void PULImpl::addRename( - const QueryLoc* aQueryLoc, + const QueryLoc* loc, store::Item_t& target, store::Item_t& newName) { @@ -632,10 +632,9 @@ case store::StoreConsts::elementNode: { ElementNode* elemTarget = ELEM_NODE(target); - elemTarget->checkNamespaceConflict(newName.getp(), err::XUDY0023); + elemTarget->checkNamespaceConflict(newName.getp(), loc); - upd = GET_PUL_FACTORY(). - createUpdRenameElem(pul, aQueryLoc, target, newName); + upd = GET_PUL_FACTORY().createUpdRenameElem(pul, loc, target, newName); break; } case store::StoreConsts::attributeNode: @@ -643,16 +642,16 @@ ElementNode* elemParent = reinterpret_cast(n->theParent); if (elemParent != NULL) - elemParent->checkNamespaceConflict(newName.getp(), err::XUDY0023); + elemParent->checkNamespaceConflict(newName.getp(), loc); - upd = GET_PUL_FACTORY().createUpdRenameAttr(pul, aQueryLoc, target, newName); + upd = GET_PUL_FACTORY().createUpdRenameAttr(pul, loc, target, newName); break; } case store::StoreConsts::piNode: { zstring tmp; newName->getStringValue2(tmp); - upd = GET_PUL_FACTORY().createUpdRenamePi(pul, aQueryLoc, target, tmp); + upd = GET_PUL_FACTORY().createUpdRenamePi(pul, loc, target, tmp); break; } default: @@ -670,7 +669,7 @@ else { csize numUpdates = updates->size(); - for (csize i = 0; i < numUpdates; i++) + for (csize i = 0; i < numUpdates; ++i) { if (store::UpdateConsts::isRename((*updates)[i]->getKind())) { @@ -935,6 +934,25 @@ } +void PULImpl::addEditInCollection( + const QueryLoc* loc, + store::Item_t& name, + store::Item_t& target, + store::Item_t& content, + bool isDynamic) +{ + CollectionPul* pul = getCollectionPulByName(name.getp(), isDynamic); + + pul->theEditInCollectionList.push_back( + GET_PUL_FACTORY().createUpdEditInCollection( + pul, + loc, + name, + target, + content, + isDynamic)); +} + void PULImpl::addTruncateCollection( const QueryLoc* aQueryLoc, store::Item_t& name, @@ -1735,6 +1753,10 @@ otherPul->theInsertIntoCollectionList); mergeCollectionUpdateLists(thisPul, + thisPul->theEditInCollectionList, + otherPul->theEditInCollectionList); + + mergeCollectionUpdateLists(thisPul, thisPul->theDeleteFromCollectionList, otherPul->theDeleteFromCollectionList); @@ -2409,6 +2431,16 @@ pul->theInsertedDocs.push_back(upd->getNode(j)); } + numCollUpdates = pul->theEditInCollectionList.size(); + + for (csize i = 0; i < numCollUpdates; ++i) + { + UpdEditInCollection* upd = static_cast + (pul->theEditInCollectionList[i]); + + pul->theModifiedDocs.insert(upd->getTarget()); + } + numCollUpdates = pul->theDeleteFromCollectionList.size(); for (csize i = 0; i < numCollUpdates; ++i) @@ -2692,6 +2724,7 @@ cleanList(theCreateCollectionList); cleanList(theInsertIntoCollectionList); + cleanList(theEditInCollectionList); cleanList(theDeleteFromCollectionList); cleanList(theTruncateCollectionList); cleanList(theDeleteCollectionList); @@ -2738,6 +2771,7 @@ switchPulInPrimitivesList(theCreateCollectionList); switchPulInPrimitivesList(theInsertIntoCollectionList); + switchPulInPrimitivesList(theEditInCollectionList); switchPulInPrimitivesList(theDeleteFromCollectionList); switchPulInPrimitivesList(theTruncateCollectionList); switchPulInPrimitivesList(theDeleteCollectionList); @@ -3595,6 +3629,7 @@ // Apply collection primitives, except delete primitives applyList(theCreateCollectionList); applyList(theInsertIntoCollectionList); + applyList(theEditInCollectionList); applyList(theDeleteFromCollectionList); // Compute the after-delta for each incrementally maintained index. @@ -3633,6 +3668,7 @@ { undoList(theTruncateCollectionList); undoList(theDeleteFromCollectionList); + undoList(theEditInCollectionList); undoList(theInsertIntoCollectionList); undoList(theCreateCollectionList); diff -Nru zorba-2.7.0-0/src/store/naive/simple_pul.h zorba-2.8.0-0/src/store/naive/simple_pul.h --- zorba-2.7.0-0/src/store/naive/simple_pul.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_pul.h 2013-01-16 18:28:18.000000000 +0000 @@ -186,6 +186,7 @@ std::vector theCreateCollectionList; std::vector theInsertIntoCollectionList; std::vector theDeleteFromCollectionList; + std::vector theEditInCollectionList; std::vector theTruncateCollectionList; std::vector theDeleteCollectionList; @@ -505,6 +506,13 @@ bool isLast, bool isDynamic); + void addEditInCollection( + const QueryLoc* aQueryLoc, + store::Item_t& name, + store::Item_t& target, + store::Item_t& content, + bool isDynamic); + void addTruncateCollection( const QueryLoc* aQueryLoc, store::Item_t& name, diff -Nru zorba-2.7.0-0/src/store/naive/simple_store.cpp zorba-2.8.0-0/src/store/naive/simple_store.cpp --- zorba-2.7.0-0/src/store/naive/simple_store.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_store.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -27,6 +27,7 @@ #include "node_factory.h" #include "pul_primitive_factory.h" #include "node_items.h" +#include "json_items.h" #include "diagnostics/zorba_exception.h" #include "diagnostics/diagnostic.h" @@ -35,10 +36,6 @@ #include #include "zorbautils/string_util.h" -#ifdef ZORBA_WITH_JSON -#include "json_loader.h" -#endif - namespace zorba { @@ -88,8 +85,8 @@ { if (theNodeToReferencesMap.size() > 0) { - NodeRefMap::iterator iter = theNodeToReferencesMap.begin(); - NodeRefMap::iterator end = theNodeToReferencesMap.end(); + ItemRefMap::iterator iter = theNodeToReferencesMap.begin(); + ItemRefMap::iterator end = theNodeToReferencesMap.end(); for (; iter != end; ++iter) { std::cerr << "Reference: " << (*iter).second @@ -278,27 +275,28 @@ ********************************************************************************/ bool SimpleStore::getNodeReference(store::Item_t& result, const store::Item* node) { - const XmlNode* xmlNode = static_cast(node); + bool lHasReference = hasReference(node); - if (xmlNode->haveReference()) + if (lHasReference) { - NodeRefMap::iterator resIt = theNodeToReferencesMap.find(xmlNode); + ItemRefMap::iterator resIt = theNodeToReferencesMap.find(node); ZORBA_FATAL(resIt != theNodeToReferencesMap.end(),"Node reference cannot be found"); zstring id = (*resIt).second; return theItemFactory->createAnyURI(result, id); } + else + { + uuid u; + uuid::create(&u); + std::ostringstream oss; + oss << "urn:uuid:" << u; + zstring uuidStr = oss.str(); + assignReference(node, uuidStr); - uuid u; - uuid::create(&u); - std::ostringstream oss; - oss << "urn:uuid:" << u; - zstring uuidStr = oss.str(); - - assignReference(xmlNode, uuidStr); - - return theItemFactory->createAnyURI(result, uuidStr); + return theItemFactory->createAnyURI(result, uuidStr); + } } @@ -310,22 +308,58 @@ ********************************************************************************/ bool SimpleStore::hasReference(const store::Item* node) { - return static_cast(node)->haveReference(); + using namespace zorba::simplestore::json; + + bool lHasReference = false; + if (node->isNode()) + { + const XmlNode* x = static_cast(node); + lHasReference = x->haveReference(); + } + else + { + assert(node->isJSONItem()); + JSONItem* j = const_cast(static_cast(node)); + + // only root nodes in a collection can have a reference + if (j->getTree() && j->getTree()->getRoot() == j) + { + ItemRefMap::iterator lIter = theNodeToReferencesMap.find(node); + + lHasReference = (lIter != theNodeToReferencesMap.end()); + } + } + return lHasReference; } bool SimpleStore::assignReference(const store::Item* node, const zstring& reference) { - const XmlNode* xmlNode = static_cast(node); - zstring uuidStr = reference; + using namespace zorba::simplestore::json; - if (xmlNode->haveReference()) + bool lHasReference = hasReference(node); + + if (lHasReference) { return false; } - const_cast(xmlNode)->setHaveReference(); - theNodeToReferencesMap.insert(xmlNode, uuidStr); + if (node->isNode()) + { + const XmlNode* x = static_cast(node); + const_cast(x)->setHaveReference(); + } + else + { + assert(node->isJSONItem()); + const JSONItem* j = static_cast(node); + + if (!j->getTree() || j != j->getTree()->getRoot()) + throw ZORBA_EXCEPTION(zerr::ZAPI0080_CANNOT_RETRIEVE_REFERENCE); + } + + zstring uuidStr = reference; + theNodeToReferencesMap.insert(node, uuidStr); theReferencesToNodeMap[uuidStr] = node; return true; @@ -342,12 +376,6 @@ ********************************************************************************/ bool SimpleStore::getNodeByReference(store::Item_t& result, const zstring& reference) { - if (reference.length() != 45 || - !utf8::match_whole(reference, "urn:uuid:[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}")) - { - throw ZORBA_EXCEPTION(zerr::ZAPI0028_INVALID_NODE_URI, ERROR_PARAMS(reference)); - } - RefNodeMap::iterator resIt; if ((resIt = theReferencesToNodeMap.find(reference)) != theReferencesToNodeMap.end()) @@ -367,70 +395,61 @@ @param node XDM node @return whether the node was registered or not. ********************************************************************************/ -bool SimpleStore::unregisterReferenceToUnusedNode(XmlNode* node) +bool SimpleStore::unregisterReferenceToUnusedNode(store::Item* node) { - if (!node->haveReference()) + bool lHasReference = hasReference(node); + + if (!lHasReference) + { return false; + } - NodeRefMap::iterator resIt; + ItemRefMap::iterator resIt; if ((resIt = theNodeToReferencesMap.find(node)) != theNodeToReferencesMap.end()) { zstring value = (*resIt).second; theNodeToReferencesMap.erase(resIt); - node->resetHaveReference(); + + if (node->isNode()) + { + static_cast(node)->resetHaveReference(); + } theReferencesToNodeMap.erase(value); return true; } - else - { - return false; - } + assert(false); } /******************************************************************************* + * Remove a reference from the cache Does nothing in the simple store. @param node XDM node @return whether the node was registered or not. ********************************************************************************/ -bool SimpleStore::unregisterReferenceToDeletedNode(XmlNode* node) +bool SimpleStore::unregisterReferenceToDeletedNode(store::Item* node) { - // Does nothing, since there is no persistency layer. A deleted node can still - // be retrieved with a reference, so its reference may not be removed from the - // cache. - // Merely returns true if entry found, false otherwise. + using namespace zorba::simplestore::json; - if (!node->haveReference()) - return false; - - NodeRefMap::iterator resIt; + bool lHasReference = hasReference(node); - if ((resIt = theNodeToReferencesMap.find(node)) != theNodeToReferencesMap.end()) - { - return true; - } - else + if (!lHasReference) { return false; } -} + ItemRefMap::iterator resIt = theNodeToReferencesMap.find(node); + zstring id = (*resIt).second; -#ifdef ZORBA_WITH_JSON -/******************************************************************************* + theNodeToReferencesMap.erase(node); + theReferencesToNodeMap.erase(id); -********************************************************************************/ -store::Item_t SimpleStore::parseJSON( - std::istream& stream, - internal::diagnostic::location* relative_error_loc) -{ - json::JSONLoader lLoader(stream, relative_error_loc); - return lLoader.next(); + return true; } -#endif /* ZORBA_WITH_JSON */ + } // namespace simplestore } // namespace zorba diff -Nru zorba-2.7.0-0/src/store/naive/simple_store.h zorba-2.8.0-0/src/store/naive/simple_store.h --- zorba-2.7.0-0/src/store/naive/simple_store.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/simple_store.h 2013-01-16 18:28:18.000000000 +0000 @@ -21,6 +21,7 @@ #include "node_factory.h" #include "pul_primitive_factory.h" #include "tree_id_generator.h" +#include "zorbautils/hashmap_itemp.h" namespace zorba { namespace simplestore { @@ -47,14 +48,14 @@ friend class zorba::StoreManager; typedef std::map RefNodeMap; - typedef NodePointerHashMap NodeRefMap; + typedef zorba::simplestore::ItemPointerHashMap ItemRefMap; private: ulong theCollectionCounter; SYNC_CODE(Mutex theCollectionCounterMutex;) RefNodeMap theReferencesToNodeMap; - NodeRefMap theNodeToReferencesMap; + ItemRefMap theNodeToReferencesMap; public: ulong createCollectionId(); @@ -98,9 +99,9 @@ void destroyTreeIdGeneratorFactory(TreeIdGeneratorFactory* g) const; - bool unregisterReferenceToUnusedNode(XmlNode* node); + bool unregisterReferenceToUnusedNode(store::Item* node); - bool unregisterReferenceToDeletedNode(XmlNode* node); + bool unregisterReferenceToDeletedNode(store::Item* node); // // Store api methods @@ -113,12 +114,6 @@ bool assignReference(const store::Item* node, const zstring& reference); bool getNodeByReference(store::Item_t& result, const zstring& reference); - -#ifdef ZORBA_WITH_JSON - store::Item_t parseJSON( - std::istream& stream, - internal::diagnostic::location* relative_error_loc); -#endif }; } // namespace store diff -Nru zorba-2.7.0-0/src/store/naive/store.cpp zorba-2.8.0-0/src/store/naive/store.cpp --- zorba-2.7.0-0/src/store/naive/store.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/store.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -714,7 +714,7 @@ if (!theIndices.get(non_const_items, index)) { - throw ZORBA_EXCEPTION(zerr::ZSTR0002_INDEX_DOES_NOT_EXIST, + throw ZORBA_EXCEPTION(zerr::ZDDY0023_INDEX_DOES_NOT_EXIST, ERROR_PARAMS(qname->getStringValue())); } diff -Nru zorba-2.7.0-0/src/store/naive/store.h zorba-2.8.0-0/src/store/naive/store.h --- zorba-2.7.0-0/src/store/naive/store.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/store.h 2013-01-16 18:28:18.000000000 +0000 @@ -420,10 +420,10 @@ // Unregisters a reference to an unused node (upon its destruction in // the memory). - virtual bool unregisterReferenceToUnusedNode(XmlNode* node) = 0; + virtual bool unregisterReferenceToUnusedNode(store::Item* node) = 0; // Unregisters a reference to a node that was deleted (by XQUF). - virtual bool unregisterReferenceToDeletedNode(XmlNode* node) = 0; + virtual bool unregisterReferenceToDeletedNode(store::Item* node) = 0; /*----------------------- Temp Sequence Management ---------------------------*/ public: diff -Nru zorba-2.7.0-0/src/store/naive/string_pool.cpp zorba-2.8.0-0/src/store/naive/string_pool.cpp --- zorba-2.7.0-0/src/store/naive/string_pool.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/store/naive/string_pool.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -28,13 +28,14 @@ StringPool::~StringPool() { csize count = 0; - csize n = theHashTab.size(); + csize n = capacity(); for (csize i = 0; i < n; ++i) { - if (theHashTab[i].theItem.is_shared()) + if (!theHashTab[i].isFree() && theHashTab[i].key().is_shared()) { - std::cerr << "ID: " << i << " Referenced URI: " << theHashTab[i].theItem << std::endl; + std::cerr << "ID: " << i << " Referenced URI: " + << theHashTab[i].key() << std::endl; //delete theHashTab[i].theString.getp(); count++; } @@ -57,7 +58,8 @@ bool found = false; zstring::size_type len = strlen(str); - ulong hval = hashfun::h32(str, len, FNV_32_INIT) % theHashTabSize; + + ulong hval = hashfun::h32(str, len, FNV_32_INIT) % bucket_count(); { SYNC_CODE(AutoMutex lock(&theMutex);) @@ -68,7 +70,7 @@ { while (entry != NULL) { - if (ztd::equals(entry->theItem, str, len)) + if (ztd::equals(entry->key(), str, len)) { found = true; break; @@ -79,7 +81,7 @@ if (found) { - outStr = entry->theItem; + outStr = entry->key(); return false; } } @@ -97,76 +99,78 @@ ********************************************************************************/ void StringPool::garbageCollect() { - HashEntry* entry; + HashEntry* currEntry; HashEntry* freeList = NULL; - zstring::size_type size = theHashTabSize; + csize size = bucket_count(); - for (ulong i = 0; i < size; ++i) + for (csize i = 0; i < size; ++i) { - entry = &theHashTab[i]; + currEntry = &theHashTab[i]; // If the current hash bucket is empty, move to the next one - if (entry->isFree()) + if (currEntry->isFree()) { - ZORBA_FATAL(entry->theNext == 0, ""); + ZORBA_FATAL(currEntry->theNext == 0, ""); continue; } // Handle the 1st hash entry of the current hash bucket - while (!entry->theItem.is_shared()) + while (!currEntry->key().is_shared()) { - if (entry->theNext == 0) + if (currEntry->theNext == 0) { - entry->setFree(); - theNumEntries--; + currEntry->setFree(); + --theNumEntries; break; } else { - HashEntry* nextEntry = entry->getNext(); - *entry = *nextEntry; - entry->setNext(nextEntry->getNext()); + HashEntry* nextEntry = currEntry->getNext(); + assert(!nextEntry->isFree()); + *currEntry = *nextEntry; + currEntry->setNext(nextEntry->getNext()); nextEntry->setFree(); nextEntry->setNext(freeList); freeList = nextEntry; - theNumEntries--; + --theNumEntries; } } // Handle the overflow entries of the current hash bucket. - HashEntry* prevEntry = entry; - entry = entry->getNext(); + HashEntry* prevEntry = currEntry; + currEntry = currEntry->getNext(); - while (entry != NULL) + while (currEntry != NULL) { - if (!entry->theItem.is_shared()) + if (!currEntry->key().is_shared()) { - prevEntry->setNext(entry->getNext()); - entry->setFree(); - entry->setNext(freeList); - freeList = entry; - theNumEntries--; + prevEntry->setNext(currEntry->getNext()); + currEntry->setFree(); + currEntry->setNext(freeList); + freeList = currEntry; + --theNumEntries; - entry = prevEntry->getNext(); + currEntry = prevEntry->getNext(); } else { - prevEntry = entry; - entry = entry->getNext(); + prevEntry = currEntry; + currEntry = currEntry->getNext(); } } } if (freeList != NULL) { - entry = freeList; - while (entry->theNext != 0) - entry = entry->getNext(); + currEntry = freeList; + while (currEntry->theNext != 0) + currEntry = currEntry->getNext(); + + currEntry->setNext(theHashTab[bucket_count()].getNext()); - entry->setNext(theHashTab[theHashTabSize].getNext()); - theHashTab[theHashTabSize].setNext(freeList); + theHashTab[bucket_count()].setNext(freeList); } } diff -Nru zorba-2.7.0-0/src/types/casting.cpp zorba-2.8.0-0/src/types/casting.cpp --- zorba-2.7.0-0/src/types/casting.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/casting.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -49,7 +49,7 @@ namespace zorba { -void castToUserDefinedType( +void castToUserDefinedAtomicType( store::Item_t& result, const store::Item_t& aItem, const XQType* aSourceType, @@ -60,9 +60,6 @@ #define ATOMIC_TYPE(type) \ GENV_TYPESYSTEM.create_atomic_type(store::XS_##type, TypeConstants::QUANT_ONE) -#define ATOMIC_CODE_T \ - store::SchemaTypeCode - struct ErrorInfo { @@ -99,13 +96,40 @@ }; -void throwTypeException(const Diagnostic& errcode, const ErrorInfo& info) +void throwXPTY0004Exception(const ErrorInfo& info) +{ + if (info.theSourceType) + { + RAISE_ERROR(err::XPTY0004, info.theLoc, + ERROR_PARAMS(*info.theSourceType, ZED(NoCastTo_34o), *info.theTargetType)); + } + else + { + TypeManager& tm = GENV_TYPESYSTEM; + + xqtref_t sourceType = + tm.create_builtin_atomic_type(info.theSourceTypeCode, + TypeConstants::QUANT_ONE); + + xqtref_t targetType = + tm.create_builtin_atomic_type(info.theTargetTypeCode, + TypeConstants::QUANT_ONE); + + RAISE_ERROR(err::XPTY0004, info.theLoc, + ERROR_PARAMS(*sourceType, ZED(NoCastTo_34o), *targetType)); + } +} + + +void throwFOCA0002Exception(const zstring& str, const ErrorInfo& info) { if (info.theSourceType) { - throw XQUERY_EXCEPTION_VAR(errcode, - ERROR_PARAMS(*info.theSourceType, ZED(NoCastTo_34o), *info.theTargetType), - ERROR_LOC(info.theLoc)); + RAISE_ERROR(err::FOCA0002, info.theLoc, + ERROR_PARAMS(ZED(FOCA0002_NoCastTo_234), + str, + info.theSourceType->toSchemaString(), + info.theTargetType->toSchemaString())); } else { @@ -119,9 +143,42 @@ tm.create_builtin_atomic_type(info.theTargetTypeCode, TypeConstants::QUANT_ONE); - throw XQUERY_EXCEPTION_VAR(errcode, - ERROR_PARAMS(*sourceType, ZED(NoCastTo_34o), *targetType), - ERROR_LOC(info.theLoc)); + RAISE_ERROR(err::FOCA0002, info.theLoc, + ERROR_PARAMS(ZED(FOCA0002_NoCastTo_234), + str, + sourceType->toSchemaString(), + targetType->toSchemaString())); + } +} + + +void throwFORG0001Exception(const zstring& str, const ErrorInfo& info) +{ + if (info.theTargetType) + { + RAISE_ERROR(err::FORG0001, info.theLoc, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234), + str, + info.theSourceType->toSchemaString(), + info.theTargetType->toSchemaString())); + } + else + { + TypeManager& tm = GENV_TYPESYSTEM; + + xqtref_t sourceType = + tm.create_builtin_atomic_type(info.theSourceTypeCode, + TypeConstants::QUANT_ONE); + + xqtref_t targetType = + tm.create_builtin_atomic_type(info.theTargetTypeCode, + TypeConstants::QUANT_ONE); + + RAISE_ERROR(err::FORG0001, info.theLoc, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234), + str, + sourceType->toSchemaString(), + targetType->toSchemaString())); } } @@ -131,16 +188,15 @@ casting is actually done. ********************************************************************************/ #define SAME_S_AND_T(type) \ -inline bool type##_##type( \ +inline void type##_##type( \ store::Item_t& result, \ const store::Item* aItem, \ zstring& strval, \ store::ItemFactory*, \ - namespace_context *nsCtx, \ - const ErrorInfo& aErrorInfo) \ + const namespace_context* nsCtx, \ + const ErrorInfo& errInfo) \ { \ result = (aItem); \ - return true; \ } \ SAME_S_AND_T(uA) @@ -173,19 +229,19 @@ #define T1_TO_T2(type1, type2) \ -inline bool type1##_##type2( \ +inline void type1##_##type2( \ store::Item_t& result, \ const store::Item* aItem, \ zstring& strval, \ store::ItemFactory* aFactory, \ - namespace_context* nsCtx, \ - const ErrorInfo& aErrorInfo) \ + const namespace_context* nsCtx, \ + const ErrorInfo& errInfo) \ T1_TO_T2(str, uA) { - return aFactory->createUntypedAtomic(result, strval); + aFactory->createUntypedAtomic(result, strval); } @@ -194,16 +250,15 @@ try { xs_float const n(strval.c_str()); - return aFactory->createFloat(result, n); + aFactory->createFloat(result, n); } catch (std::invalid_argument const&) { - throwTypeException(err::FORG0001, aErrorInfo); - return NULL; + throwFORG0001Exception(strval, errInfo); } - catch ( std::range_error const& ) + catch (const std::range_error& ) { - throw XQUERY_EXCEPTION(err::FOAR0002, ERROR_PARAMS(strval)); + RAISE_ERROR(err::FOAR0002, errInfo.theLoc, ERROR_PARAMS(strval)); } } @@ -213,16 +268,15 @@ try { xs_double const n(strval.c_str()); - return aFactory->createDouble(result, n); + aFactory->createDouble(result, n); } catch (std::invalid_argument const& ) { - throwTypeException(err::FORG0001, aErrorInfo); - return NULL; + throwFORG0001Exception(strval, errInfo); } - catch (std::range_error const& ) + catch (const std::range_error& ) { - throw XQUERY_EXCEPTION(err::FOAR0002, ERROR_PARAMS(strval)); + RAISE_ERROR(err::FOAR0002, errInfo.theLoc, ERROR_PARAMS(strval)); } } @@ -232,12 +286,11 @@ try { xs_decimal const n(strval.c_str()); - return aFactory->createDecimal(result, n); + aFactory->createDecimal(result, n); } - catch ( std::exception const& ) + catch (const std::exception& ) { - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } } @@ -247,17 +300,33 @@ try { xs_integer const n(strval.c_str()); - return aFactory->createInteger(result, n); + aFactory->createInteger(result, n); + } + catch (const std::invalid_argument& ) + { + throwFORG0001Exception(strval, errInfo); + } + catch (const std::range_error& ) + { + RAISE_ERROR(err::FOAR0002, errInfo.theLoc, ERROR_PARAMS(strval)); } - catch ( std::invalid_argument const& ) +} + + +T1_TO_T2(str, uint) +{ + try { - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + const xs_nonNegativeInteger n(strval.c_str()); + aFactory->createNonNegativeInteger(result, n); } - catch ( std::range_error const& ) + catch (const std::invalid_argument& ) { - throwTypeException( err::FOAR0002, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); + } + catch (const std::range_error& ) + { + RAISE_ERROR(err::FOAR0002, errInfo.theLoc, ERROR_PARAMS(strval)); } } @@ -268,10 +337,12 @@ int err; if (0 == (err = Duration::parseDuration(strval.c_str(), strval.size(), d))) - return aFactory->createDuration(result, &d); + { + aFactory->createDuration(result, &d); + return; + } - throwTypeException(err::FORG0001, aErrorInfo); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -281,10 +352,12 @@ int err; if (0 == (err = Duration::parseYearMonthDuration(strval.c_str(), strval.size(), d))) - return aFactory->createYearMonthDuration(result, &d); + { + aFactory->createYearMonthDuration(result, &d); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -294,10 +367,12 @@ int err; if (0 == (err = Duration::parseDayTimeDuration(strval.c_str(), strval.size(), d))) - return aFactory->createDayTimeDuration(result, &d); + { + aFactory->createDayTimeDuration(result, &d); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -305,10 +380,12 @@ { xs_dateTime dt; if (0 == DateTime::parseDateTime(strval.c_str(), strval.size(), dt)) - return aFactory->createDateTime(result, &dt); + { + aFactory->createDateTime(result, &dt); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -316,10 +393,12 @@ { xs_time t; if (0 == DateTime::parseTime(strval.c_str(), strval.size(), t)) - return aFactory->createTime(result, &t); + { + aFactory->createTime(result, &t); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -327,10 +406,12 @@ { xs_date d; if (0 == DateTime::parseDate(strval.c_str(), strval.size(), d)) - return aFactory->createDate(result, &d); + { + aFactory->createDate(result, &d); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -338,10 +419,12 @@ { xs_gYearMonth ym; if (0 == DateTime::parseGYearMonth(strval.c_str(), strval.size(), ym)) - return aFactory->createGYearMonth(result, &ym); + { + aFactory->createGYearMonth(result, &ym); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -349,10 +432,12 @@ { xs_gYear y; if (0 == DateTime::parseGYear(strval.c_str(), strval.size(), y)) - return aFactory->createGYear(result, &y); + { + aFactory->createGYear(result, &y); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -360,10 +445,12 @@ { xs_gMonthDay md; if (0 == DateTime::parseGMonthDay(strval.c_str(), strval.size(), md)) - return aFactory->createGMonthDay(result, &md); + { + aFactory->createGMonthDay(result, &md); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -371,10 +458,12 @@ { xs_gDay d; if (0 == DateTime::parseGDay(strval.c_str(), strval.size(), d)) - return aFactory->createGDay(result, &d); + { + aFactory->createGDay(result, &d); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -382,10 +471,12 @@ { xs_gMonth m; if (0 == DateTime::parseGMonth(strval.c_str(), strval.size(), m)) - return aFactory->createGMonth(result, &m); + { + aFactory->createGMonth(result, &m); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -422,17 +513,18 @@ } else { - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } pos = str - strval.c_str(); ascii::skip_whitespace(strval.c_str(), len, &pos); if (pos != len) - throwTypeException( err::FORG0001, aErrorInfo ); + { + throwFORG0001Exception(strval, errInfo); + } - return aFactory->createBoolean(result, lRetValue); + aFactory->createBoolean(result, lRetValue); } @@ -440,10 +532,12 @@ { xs_base64Binary n; if (xs_base64Binary::parseString(strval, n)) - return aFactory->createBase64Binary(result, n); + { + aFactory->createBase64Binary(result, n); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -451,10 +545,12 @@ { xs_hexBinary n; if (xs_hexBinary::parseString(strval, n)) - return aFactory->createHexBinary(result, n); + { + aFactory->createHexBinary(result, n); + return; + } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } @@ -464,11 +560,11 @@ { URI uriVal(strval); zstring resolvedUri = uriVal.toString(); - return aFactory->createAnyURI(result, resolvedUri); + aFactory->createAnyURI(result, resolvedUri); } catch (ZorbaException& e) { - e.set_diagnostic( err::FORG0001 ); + e.set_diagnostic(err::FORG0001); throw; } } @@ -482,7 +578,7 @@ zstring::size_type lidx = strval.rfind(":", strval.size(), 1); if (idx != lidx) - throwTypeException( err::FORG0001, aErrorInfo ); + throwFORG0001Exception(strval, errInfo); zstring nsuri; zstring prefix; @@ -501,22 +597,28 @@ { prefix = strval.substr(0, idx); - if (!GenericCast::instance()->castableToNCName(prefix)) - throwTypeException( err::FORG0001, aErrorInfo ); + if (!GenericCast::castableToNCName(prefix)) + { + RAISE_ERROR(err::FORG0001, errInfo.theLoc, + ERROR_PARAMS(ZED(FORG0001_PrefixNotNCName_2), prefix)); + } if (nsCtx) { if (!nsCtx->findBinding(prefix, nsuri)) - throw XQUERY_EXCEPTION( err::FONS0004, ERROR_PARAMS( prefix ) ); + RAISE_ERROR(err::FONS0004, errInfo.theLoc, ERROR_PARAMS(prefix)); } local = strval.substr(idx + 1); } - if (!GenericCast::instance()->castableToNCName(local)) - throwTypeException( err::FORG0001, aErrorInfo ); + if (!GenericCast::castableToNCName(local)) + { + RAISE_ERROR(err::FORG0001, errInfo.theLoc, + ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), local)); + } - return aFactory->createQName(result, nsuri, prefix, local); + aFactory->createQName(result, nsuri, prefix, local); } @@ -535,14 +637,19 @@ local = strval.substr(pos+1, strval.size()); } else + { local = strval; + } if (!nsCtx->findBinding(prefix, uri)) - ZORBA_ERROR_DESC_OSS(err::FORG0001, "Prefix '" << prefix << "' not found in current namespace context."); + { + RAISE_ERROR(err::FORG0001, errInfo.theLoc, + ERROR_PARAMS(ZED(FORG0001_PrefixNotBound_2), prefix)); + } store::Item_t qname; aFactory->createQName(qname, uri, prefix, local); - return aFactory->createNOTATION(result, qname); + aFactory->createNOTATION(result, qname); } @@ -550,7 +657,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return aFactory->createString(result, strval2); + aFactory->createString(result, strval2); } @@ -558,7 +665,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_flt(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_flt(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -566,7 +673,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_dbl(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_dbl(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -574,7 +681,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_dec(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_dec(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -582,7 +689,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_int(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_int(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -590,7 +697,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_dur(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_dur(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -598,7 +705,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_yMD(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_yMD(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -606,7 +713,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_dTD(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_dTD(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -614,7 +721,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_dT(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_dT(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -622,7 +729,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_tim(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_tim(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -630,7 +737,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_dat(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_dat(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -638,7 +745,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_gYM(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_gYM(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -646,7 +753,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_gYr(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_gYr(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -654,7 +761,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_gMD(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_gMD(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -662,7 +769,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_gDay(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_gDay(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -670,7 +777,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_gMon(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_gMon(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -678,7 +785,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_bool(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_bool(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -686,7 +793,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_b64(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_b64(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -694,7 +801,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_hxB(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_hxB(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -702,7 +809,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_aURI(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_aURI(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -710,19 +817,19 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(flt, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } T1_TO_T2(flt, dbl) { - return aFactory->createDouble(result, xs_double(aItem->getFloatValue())); + aFactory->createDouble(result, xs_double(aItem->getFloatValue())); } @@ -731,12 +838,11 @@ try { xs_decimal const n( aItem->getFloatValue() ); - return aFactory->createDecimal(result, n); + aFactory->createDecimal(result, n); } - catch ( std::exception const& /*e*/ ) + catch (const std::exception&) { - throwTypeException( err::FOCA0002, aErrorInfo ); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -745,12 +851,11 @@ { try { - return aFactory->createInteger(result, xs_integer(aItem->getFloatValue())); + aFactory->createInteger(result, xs_integer(aItem->getFloatValue())); } - catch ( std::exception const& ) + catch (const std::exception&) { - throwTypeException( err::FOCA0002, aErrorInfo ); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -758,7 +863,6 @@ T1_TO_T2(flt, bool) { aFactory->createBoolean(result, aItem->getEBV()); - return true; } @@ -766,19 +870,19 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(dbl, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } T1_TO_T2(dbl, flt) { - return aFactory->createFloat(result, xs_float(aItem->getDoubleValue())); + aFactory->createFloat(result, xs_float(aItem->getDoubleValue())); } @@ -787,12 +891,11 @@ try { xs_decimal const n( aItem->getDoubleValue() ); - return aFactory->createDecimal(result, n); + aFactory->createDecimal(result, n); } - catch ( std::exception const& ) + catch (const std::exception&) { - throwTypeException(err::FOCA0002, aErrorInfo); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -801,12 +904,11 @@ { try { - return aFactory->createInteger(result, xs_integer(aItem->getDoubleValue())); + aFactory->createInteger(result, xs_integer(aItem->getDoubleValue())); } - catch ( std::exception const& ) + catch (const std::exception& ) { - throwTypeException( err::FOCA0002, aErrorInfo ); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -814,7 +916,6 @@ T1_TO_T2(dbl, bool) { aFactory->createBoolean(result, aItem->getEBV()); - return true; } @@ -822,38 +923,37 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(dec, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } T1_TO_T2(dec, flt) { - return aFactory->createFloat(result, xs_float(aItem->getDecimalValue())); + aFactory->createFloat(result, xs_float(aItem->getDecimalValue())); } T1_TO_T2(dec, dbl) { - return aFactory->createDouble(result, xs_double(aItem->getDecimalValue())); + aFactory->createDouble(result, xs_double(aItem->getDecimalValue())); } T1_TO_T2(dec, int) { - return aFactory->createInteger(result, xs_integer(aItem->getDecimalValue())); + aFactory->createInteger(result, xs_integer(aItem->getDecimalValue())); } T1_TO_T2(dec, bool) { aFactory->createBoolean(result, aItem->getEBV()); - return true; } @@ -861,39 +961,37 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(int, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } T1_TO_T2(int, flt) { - return aFactory->createFloat(result, xs_float(aItem->getIntegerValue())); + aFactory->createFloat(result, xs_float(aItem->getIntegerValue())); } T1_TO_T2(int, dbl) { - return aFactory->createDouble(result, xs_double(aItem->getIntegerValue())); + aFactory->createDouble(result, xs_double(aItem->getIntegerValue())); } T1_TO_T2(int, dec) { - return aFactory->createDecimal(result, - xs_decimal(aItem->getIntegerValue())); + aFactory->createDecimal(result, xs_decimal(aItem->getIntegerValue())); } T1_TO_T2(int, bool) { aFactory->createBoolean(result, aItem->getEBV()); - return true; } @@ -901,13 +999,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(dur, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -915,7 +1013,7 @@ { std::auto_ptr dur = std::auto_ptr(aItem->getDurationValue().toYearMonthDuration()); - return aFactory->createYearMonthDuration(result, dur.get()); + aFactory->createYearMonthDuration(result, dur.get()); } @@ -923,7 +1021,7 @@ { std::auto_ptr dur = std::auto_ptr(aItem->getDurationValue().toDayTimeDuration()); - return aFactory->createDayTimeDuration(result, dur.get()); + aFactory->createDayTimeDuration(result, dur.get()); } @@ -931,13 +1029,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(yMD, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -945,7 +1043,7 @@ { std::auto_ptr dur = std::auto_ptr(aItem->getYearMonthDurationValue().toDuration()); - return aFactory->createDuration(result, dur.get()); + aFactory->createDuration(result, dur.get()); } @@ -953,7 +1051,7 @@ { std::auto_ptr dur = std::auto_ptr(aItem->getYearMonthDurationValue().toDayTimeDuration()); - return aFactory->createDayTimeDuration(result, dur.get()); + aFactory->createDayTimeDuration(result, dur.get()); } @@ -961,13 +1059,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(dTD, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -975,7 +1073,7 @@ { std::auto_ptr dur = std::auto_ptr(aItem->getDayTimeDurationValue().toDuration()); - return aFactory->createDuration(result, dur.get()); + aFactory->createDuration(result, dur.get()); } @@ -983,7 +1081,7 @@ { std::auto_ptr dur = std::auto_ptr(aItem->getDayTimeDurationValue().toYearMonthDuration()); - return aFactory->createYearMonthDuration(result, dur.get()); + aFactory->createYearMonthDuration(result, dur.get()); } @@ -991,13 +1089,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(dT, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1005,7 +1103,7 @@ { DateTime dt; aItem->getDateTimeValue().createWithNewFacet(DateTime::TIME_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1013,7 +1111,7 @@ { DateTime dt; aItem->getDateTimeValue().createWithNewFacet(DateTime::DATE_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1021,7 +1119,7 @@ { DateTime dt; aItem->getDateTimeValue().createWithNewFacet(DateTime::GYEARMONTH_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1029,7 +1127,7 @@ { DateTime dt; aItem->getDateTimeValue().createWithNewFacet(DateTime::GYEAR_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1037,7 +1135,7 @@ { DateTime dt; aItem->getDateTimeValue().createWithNewFacet(DateTime::GMONTHDAY_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1045,7 +1143,7 @@ { DateTime dt; aItem->getDateTimeValue().createWithNewFacet(DateTime::GDAY_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1053,7 +1151,7 @@ { DateTime dt; aItem->getDateTimeValue().createWithNewFacet(DateTime::GMONTH_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1061,13 +1159,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(tim, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1075,13 +1173,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(dat, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1089,7 +1187,7 @@ { DateTime dt; aItem->getDateValue().createWithNewFacet(DateTime::DATETIME_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1097,7 +1195,7 @@ { DateTime dt; aItem->getDateValue().createWithNewFacet(DateTime::GYEARMONTH_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1105,7 +1203,7 @@ { DateTime dt; aItem->getDateValue().createWithNewFacet(DateTime::GYEAR_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1113,7 +1211,7 @@ { DateTime dt; aItem->getDateValue().createWithNewFacet(DateTime::GMONTHDAY_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1121,7 +1219,7 @@ { DateTime dt; aItem->getDateValue().createWithNewFacet(DateTime::GDAY_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1129,7 +1227,7 @@ { DateTime dt; aItem->getDateValue().createWithNewFacet(DateTime::GMONTH_FACET, dt); - return aFactory->createTime(result, &dt); + aFactory->createTime(result, &dt); } @@ -1137,13 +1235,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(gYM, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1151,13 +1249,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(gYr, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1165,13 +1263,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(gMD, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1179,13 +1277,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(gDay, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1193,13 +1291,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(gMon, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1207,49 +1305,49 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(bool, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } T1_TO_T2(bool, flt) { if (aItem->getBooleanValue()) - return aFactory->createFloat(result, xs_float::one()); + aFactory->createFloat(result, xs_float::one()); else - return aFactory->createFloat(result, xs_float::zero()); + aFactory->createFloat(result, xs_float::zero()); } T1_TO_T2(bool, dbl) { if (aItem->getBooleanValue()) - return aFactory->createDouble(result, xs_double::one()); + aFactory->createDouble(result, xs_double::one()); else - return aFactory->createDouble(result, xs_double::zero()); + aFactory->createDouble(result, xs_double::zero()); } T1_TO_T2(bool, dec) { if (aItem->getBooleanValue()) - return aFactory->createDecimal(result, xs_decimal::one()); + aFactory->createDecimal(result, xs_decimal::one()); else - return aFactory->createDecimal(result, xs_decimal::zero()); + aFactory->createDecimal(result, xs_decimal::zero()); } T1_TO_T2(bool, int) { if (aItem->getBooleanValue()) - return aFactory->createInteger(result, xs_integer::one()); + aFactory->createInteger(result, xs_integer::one()); else - return aFactory->createInteger(result, xs_integer::zero()); + aFactory->createInteger(result, xs_integer::zero()); } @@ -1257,13 +1355,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(b64, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1280,7 +1378,7 @@ { Base64::encode((const unsigned char*)c, s, tmp); } - return aFactory->createHexBinary(result, xs_hexBinary(tmp)); + aFactory->createHexBinary(result, xs_hexBinary(tmp)); } @@ -1288,20 +1386,20 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(hxB, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } T1_TO_T2(hxB, b64) { - return aFactory->createBase64Binary(result, - xs_base64Binary(aItem->getHexBinaryValue())); + aFactory-> + createBase64Binary(result, xs_base64Binary(aItem->getHexBinaryValue())); } @@ -1309,13 +1407,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(aURI, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1323,13 +1421,13 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(QN, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } @@ -1337,57 +1435,51 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(NOT, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } + T1_TO_T2(uint, uA) { zstring strval2; aItem->getStringValue2(strval2); - return str_uA(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_uA(result, aItem, strval2, aFactory, nsCtx, errInfo); } T1_TO_T2(uint, str) { - return uA_str(result, aItem, strval, aFactory, nsCtx, aErrorInfo); + uA_str(result, aItem, strval, aFactory, nsCtx, errInfo); } T1_TO_T2(uint, flt) { - return aFactory->createFloat( - result, xs_float(aItem->getUnsignedIntegerValue()) - ); + aFactory->createFloat(result, xs_float(aItem->getUnsignedIntegerValue())); } T1_TO_T2(uint, dbl) { - return aFactory->createDouble( - result, xs_double(aItem->getUnsignedIntegerValue()) - ); + aFactory->createDouble(result, xs_double(aItem->getUnsignedIntegerValue())); } T1_TO_T2(uint, dec) { - return aFactory->createDecimal( - result, xs_decimal(aItem->getUnsignedIntegerValue()) - ); + aFactory->createDecimal(result, xs_decimal(aItem->getUnsignedIntegerValue())); } T1_TO_T2(uint, bool) { aFactory->createBoolean(result, aItem->getEBV()); - return true; } @@ -1395,7 +1487,7 @@ { zstring strval2; aItem->getStringValue2(strval2); - return str_int(result, aItem, strval2, aFactory, nsCtx, aErrorInfo); + str_int(result, aItem, strval2, aFactory, nsCtx, errInfo); } @@ -1404,12 +1496,11 @@ try { xs_nonNegativeInteger const n(aItem->getFloatValue()); - return aFactory->createNonNegativeInteger(result, n); + aFactory->createNonNegativeInteger(result, n); } - catch ( std::exception const& ) + catch (const std::exception& ) { - throwTypeException( err::FOCA0002, aErrorInfo ); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -1419,12 +1510,11 @@ try { xs_nonNegativeInteger const n(aItem->getIntegerValue()); - return aFactory->createNonNegativeInteger(result, n); + aFactory->createNonNegativeInteger(result, n); } - catch ( std::exception const& ) + catch (const std::exception& ) { - throwTypeException( err::FOCA0002, aErrorInfo ); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -1434,12 +1524,11 @@ try { xs_integer const n(aItem->getIntegerValue()); - return aFactory->createInteger(result, n); + aFactory->createInteger(result, n); } - catch ( std::exception const& ) + catch (const std::exception& ) { - throwTypeException( err::FOCA0002, aErrorInfo ); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -1449,12 +1538,11 @@ try { xs_nonNegativeInteger const n(aItem->getDoubleValue()); - return aFactory->createInteger(result, n); + aFactory->createInteger(result, n); } - catch ( std::exception const& ) + catch (const std::exception& ) { - throwTypeException( err::FOCA0002, aErrorInfo ); - return NULL; + throwFOCA0002Exception(aItem->getStringValue(), errInfo); } } @@ -1462,54 +1550,35 @@ T1_TO_T2(dec, uint) { xs_nonNegativeInteger const n(aItem->getDecimalValue()); - return aFactory->createNonNegativeInteger(result, n); + aFactory->createNonNegativeInteger(result, n); } T1_TO_T2(bool, uint) { if (aItem->getBooleanValue()) - return aFactory->createNonNegativeInteger( - result, xs_nonNegativeInteger::one() - ); + aFactory->createNonNegativeInteger(result, xs_nonNegativeInteger::one()); else - return aFactory->createNonNegativeInteger( - result, xs_nonNegativeInteger::zero() - ); + aFactory->createNonNegativeInteger(result, xs_nonNegativeInteger::zero()); } -T1_TO_T2(str, uint) -{ - try { - xs_nonNegativeInteger const n(strval.c_str()); - return aFactory->createNonNegativeInteger(result, n); - } - catch ( std::invalid_argument const& ) { - throwTypeException( err::FORG0001, aErrorInfo ); - } - catch ( std::range_error const& ) { - throwTypeException( err::FOCA0002, aErrorInfo ); - } - return NULL; -} - T1_TO_T2(NUL, str) { zstring val("null"); - return aFactory->createString(result, val); + aFactory->createString(result, val); } /******************************************************************************* ********************************************************************************/ -bool str_down( +void str_down( store::Item_t& result, const store::Item* aItem, - ATOMIC_CODE_T aTargetAtomicType, - store::ItemFactory* aFactory, - const ErrorInfo& aErrorInfo) + store::SchemaTypeCode aTargetAtomicType, + store::ItemFactory* factory, + const ErrorInfo& errInfo) { zstring strval; aItem->getStringValue2(strval); @@ -1519,19 +1588,28 @@ case store::XS_NORMALIZED_STRING: { if (GenericCast::instance()->castableToNormalizedString(strval)) - return aFactory->createNormalizedString(result, strval); + { + factory->createNormalizedString(result, strval); + return; + } break; } case store::XS_TOKEN: { if (GenericCast::instance()->castableToToken(strval)) - return aFactory->createToken(result, strval); + { + factory->createToken(result, strval); + return; + } break; } case store::XS_LANGUAGE: { if (GenericCast::instance()->castableToLanguage(strval)) - return aFactory->createLanguage(result, strval); + { + factory->createLanguage(result, strval); + return; + } break; } case store::XS_NMTOKEN: @@ -1540,7 +1618,8 @@ if (GenericCast::instance()->castableToNMToken(strval)) { - return aFactory->createNMTOKEN(result, strval); + factory->createNMTOKEN(result, strval); + return; } break; } @@ -1550,7 +1629,8 @@ if (GenericCast::instance()->castableToName(strval)) { - return aFactory->createName(result, strval); + factory->createName(result, strval); + return; } break; } @@ -1559,63 +1639,82 @@ ascii::normalize_whitespace(strval); ascii::trim_whitespace(strval); - if (GenericCast::instance()->castableToNCName(strval)) + if (GenericCast::castableToNCName(strval)) { - return aFactory->createNCName(result, strval); + factory->createNCName(result, strval); + return; } break; } case store::XS_ID: { - if (GenericCast::instance()->castableToNCName(strval)) - return aFactory->createID(result, strval); + if (GenericCast::castableToNCName(strval)) + { + factory->createID(result, strval); + return; + } break; } case store::XS_IDREF: { - if (GenericCast::instance()->castableToNCName(strval)) - return aFactory->createIDREF(result, strval); + if (GenericCast::castableToNCName(strval)) + { + factory->createIDREF(result, strval); + return; + } break; } case store::XS_ENTITY: { - if (GenericCast::instance()->castableToNCName(strval)) - return aFactory->createENTITY(result, strval); + if (GenericCast::castableToNCName(strval)) + { + factory->createENTITY(result, strval); + return; + } break; } default: ZORBA_ASSERT(false); } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(strval, errInfo); } /******************************************************************************* ********************************************************************************/ -bool int_down( +void int_down( store::Item_t& result, const store::Item* aItem, - ATOMIC_CODE_T aTargetAtomicType, - store::ItemFactory* aFactory, - const ErrorInfo& aErrorInfo) + store::SchemaTypeCode aTargetAtomicType, + store::ItemFactory* factory, + const ErrorInfo& errInfo) { switch(aTargetAtomicType) { case store::XS_NON_POSITIVE_INTEGER: { xs_integer const lInteger = aItem->getIntegerValue(); + if (lInteger.sign() <= 0) - return aFactory->createNonPositiveInteger(result, lInteger); + { + factory->createNonPositiveInteger(result, lInteger); + return; + } + break; } case store::XS_NEGATIVE_INTEGER: { xs_integer const lInteger = aItem->getIntegerValue(); + if (lInteger.sign() < 0) - return aFactory->createNegativeInteger(result, lInteger); + { + factory->createNegativeInteger(result, lInteger); + return; + } + break; } case store::XS_LONG: @@ -1625,9 +1724,10 @@ try { xs_long const n = ztd::aton(lString.c_str()); - return aFactory->createLong(result, n); + factory->createLong(result, n); + return; } - catch ( std::exception const& ) + catch (std::exception const&) { // ignore } @@ -1640,7 +1740,8 @@ try { xs_int const n = ztd::aton(lString.c_str()); - return aFactory->createInt(result, n); + factory->createInt(result, n); + return; } catch ( std::exception const& ) { @@ -1655,7 +1756,8 @@ try { xs_short const n = ztd::aton(lString.c_str()); - return aFactory->createShort(result, n); + factory->createShort(result, n); + return; } catch ( std::exception const& ) { @@ -1670,7 +1772,8 @@ try { xs_byte const n = ztd::aton(lString.c_str()); - return aFactory->createByte(result, n); + factory->createByte(result, n); + return; } catch ( std::exception const& ) { @@ -1680,15 +1783,20 @@ } case store::XS_NON_NEGATIVE_INTEGER: { - xs_decimal const d = aItem->getDecimalValue(); + const xs_decimal d = aItem->getDecimalValue(); if (d.sign() >= 0) - try { + { + try + { xs_nonNegativeInteger const i(d); - return aFactory->createNonNegativeInteger(result, i); + factory->createNonNegativeInteger(result, i); + return; } - catch ( std::exception const& ) { + catch ( std::exception const& ) + { // ignore } + } break; } case store::XS_UNSIGNED_LONG: @@ -1698,7 +1806,8 @@ try { xs_unsignedLong const n = ztd::aton(lString.c_str()); - return aFactory->createUnsignedLong(result, n); + factory->createUnsignedLong(result, n); + return; } catch ( std::exception const& ) { @@ -1713,7 +1822,8 @@ try { xs_unsignedInt const n = ztd::aton(lString.c_str()); - return aFactory->createUnsignedInt(result, n); + factory->createUnsignedInt(result, n); + return; } catch ( std::exception const& ) { @@ -1728,7 +1838,8 @@ try { xs_unsignedShort const n = ztd::aton(lString.c_str()); - return aFactory->createUnsignedShort(result, n); + factory->createUnsignedShort(result, n); + return; } catch ( std::exception const& ) { @@ -1743,7 +1854,8 @@ try { xs_unsignedByte const n = ztd::aton(lString.c_str()); - return aFactory->createUnsignedByte(result, n); + factory->createUnsignedByte(result, n); + return; } catch ( std::exception const& ) { @@ -1755,15 +1867,17 @@ { xs_positiveInteger const i = aItem->getUnsignedIntegerValue(); if (i.sign() > 0) - return aFactory->createPositiveInteger(result, i); + { + factory->createPositiveInteger(result, i); + return; + } break; } default: - ZORBA_ASSERT (false); + ZORBA_ASSERT(false); } - throwTypeException( err::FORG0001, aErrorInfo ); - return NULL; + throwFORG0001Exception(aItem->getStringValue(), errInfo); } @@ -2006,22 +2120,131 @@ /******************************************************************************* ********************************************************************************/ -bool GenericCast::castToAtomic( +bool GenericCast::castToSimple( + store::Item_t& item, + const xqtref_t& targetType, + const namespace_context* nsCtx, + std::vector& resultList, + TypeManager* tm, + const QueryLoc& loc) +{ + const TypeManager* ttm = targetType->get_manager(); + + if (ttm != tm && ttm != &GENV_TYPESYSTEM && !TypeOps::is_in_scope(tm, *targetType)) + { + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(ZED(BadType_23o), targetType, ZED(NotAmongInScopeSchemaTypes))); + } + + if (targetType->isAtomicAny()) + { + store::Item_t atomicResult; + bool res = castToAtomic(atomicResult, item, targetType, tm, nsCtx, loc); + + if (res == false) + { + return false; + } + else + { + csize s = resultList.size(); + resultList.resize(s+1); + resultList[s].transfer(atomicResult); + + return true; + } + } + else + { + ZORBA_ASSERT(targetType->type_kind() == XQType::USER_DEFINED_KIND); + +#ifndef ZORBA_NO_XMLSCHEMA + tm->initializeSchema(); + + Schema* schema = tm->getSchema(); + + const UserDefinedXQType* udt = + static_cast(targetType.getp()); + + ZORBA_ASSERT(udt->isList() || udt->isUnion()); + + if (udt->isList()) + { + store::SchemaTypeCode itemTypeCode = item->getTypeCode(); + zstring textValue = item->getStringValue(); + + if (itemTypeCode != store::XS_STRING && + itemTypeCode != store::XS_UNTYPED_ATOMIC) + { + xqtref_t sourceType = tm->create_value_type(item); + + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(*sourceType, ZED(NoCastTo_34o), *targetType)); + } + + return schema->parseUserListTypes(textValue, targetType, resultList, loc); + } + else + { + std::vector memberTypes = udt->getUnionItemTypes(); + + for (csize i = 0; i < memberTypes.size(); ++i) + { + try + { + store::Item_t tmp = item; + bool success = castToSimple(tmp, memberTypes[i], nsCtx, resultList, tm, loc); + + if (success) + { + /* + zstring textValue = item->getStringValue(); + store::Item_t tmp; + + resultList.clear(); + if (schema->parseUserUnionTypes(textValue, targetType, resultList, loc)) + */ + return true; + } + } + catch(ZorbaException const&) + { + } + } + + xqtref_t sourceType = tm->create_value_type(item); + + RAISE_ERROR(err::FORG0001, loc, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234), + item->getStringValue(), + sourceType->toSchemaString(), + udt->toSchemaString())); + } // union +#endif // ZORBA_NO_XMLSCHEMA + } // list or union +} + + +/******************************************************************************* + Executes the string casting of the passed string to an item of the passed + target type. +********************************************************************************/ +bool GenericCast::castStringToAtomic( store::Item_t& result, zstring& str, const XQType* targetType, const TypeManager* tm, - namespace_context* aNsCtx, + const namespace_context* nsCtx, const QueryLoc& loc) { RootTypeManager& rtm = GENV_TYPESYSTEM; - store::ItemFactory* lFactory = GENV_ITEMFACTORY; + store::ItemFactory* factory = GENV_ITEMFACTORY; const XQType* sourceType = rtm.STRING_TYPE_ONE.getp(); - ErrorInfo lErrorInfo(sourceType, targetType, loc); + ErrorInfo errInfo(sourceType, targetType, loc); - if (!TypeOps::is_atomic(tm, *targetType)) + if (!targetType->isAtomicOne()) RAISE_ERROR(err::XPST0051, loc, ERROR_PARAMS(targetType)); #ifndef ZORBA_NO_XMLSCHEMA @@ -2032,14 +2255,14 @@ bool success = tm->getSchema()->parseUserAtomicTypes(str, targetType, baseItem, - aNsCtx, + nsCtx, loc); if (success) { const UserDefinedXQType* udt = static_cast(targetType); store::Item_t typeName = udt->get_qname(); - GENV_ITEMFACTORY->createUserTypedAtomicItem(result, baseItem, typeName); + factory->createUserTypedAtomicItem(result, baseItem, typeName); return true; } @@ -2047,316 +2270,180 @@ } #endif - store::Item_t lItem; - ATOMIC_CODE_T sourceTypeCode = store::XS_STRING; - ATOMIC_CODE_T targetTypeCode = TypeOps::get_atomic_type_code(*targetType); - bool valid = true; + store::Item_t item; + store::SchemaTypeCode sourceTypeCode = store::XS_STRING; + store::SchemaTypeCode targetTypeCode = TypeOps::get_atomic_type_code(*targetType); if (theMapping[sourceTypeCode] == theMapping[targetTypeCode]) { - lFactory->createString(result, str); + factory->createString(result, str); } else { - CastFunc lCastFunc = theCastMatrix[theMapping[sourceTypeCode]] + CastFunc castFunc = theCastMatrix[theMapping[sourceTypeCode]] [theMapping[targetTypeCode]]; - if (lCastFunc == 0) - throwTypeException(err::XPTY0004, lErrorInfo); + if (castFunc == 0) + throwXPTY0004Exception(errInfo); - valid = (*lCastFunc)(result, - lItem, - str, - lFactory, - aNsCtx, - lErrorInfo); + (*castFunc)(result, item, str, factory, nsCtx, errInfo); } - DownCastFunc lDownCastFunc = theDownCastMatrix[theMapping[targetTypeCode]]; + DownCastFunc downCastFunc = theDownCastMatrix[theMapping[targetTypeCode]]; - if (lDownCastFunc != 0 && + if (downCastFunc != 0 && targetTypeCode != store::XS_STRING && targetTypeCode != store::XS_INTEGER) { - valid = (*lDownCastFunc)(result, - &*result, - targetTypeCode, - lFactory, - lErrorInfo); + (*downCastFunc)(result, &*result, targetTypeCode, factory, errInfo); } - return valid; + return true; } /******************************************************************************* - Cast, if possible, a given atomic item SI to an atomic item TI of a given - type TT. If the cast is not allowed, the method raises an error. If the cast + Cast a given atomic item SI to an atomic item TI of a given atomic type TT. + No casting is done if TI and TT are exactly the same type. If the cast is + not allowed, the method raises an error. If the cast is not possible, the method may raise an error or return false (TODO fix this!). Otherwise, it returns true. ********************************************************************************/ bool GenericCast::castToAtomic( store::Item_t& result, - store::Item_t& aItem, + store::Item_t& item, const XQType* targetType, const TypeManager* tm, - namespace_context* nsCtx, + const namespace_context* nsCtx, const QueryLoc& loc) { - store::ItemFactory* factory = GENV_ITEMFACTORY; - - ZORBA_ASSERT(aItem->isAtomic()); - - xqtref_t sourceType = tm->create_named_type(aItem->getType(), - TypeConstants::QUANT_ONE, - QueryLoc::null, - err::XPTY0004); - ZORBA_ASSERT(sourceType != NULL); - assert(TypeOps::is_atomic(tm, *sourceType)); - - // std::cout << "-castToAtomic: " << aItem.getp()->getStringValue()->c_str() - // << " srcType: " << sourceType->get_qname()->getLocalName()->c_str() - // << " @ " << sourceType->get_qname()->getNamespace()->c_str() << "\n"; - // std::cout << "\t\t tgtType: " << aTargetType->get_qname()->getLocalName()->c_str() - // << " @ " << aTargetType->get_qname()->getNamespace()->c_str() << "\n"; - - ErrorInfo errorInfo(sourceType.getp(), targetType, loc); - - if (!TypeOps::is_atomic(tm, *targetType)) - RAISE_ERROR(err::XPST0051, loc, ERROR_PARAMS(targetType)); + ZORBA_ASSERT(item->isAtomic()); -#ifndef ZORBA_NO_XMLSCHEMA - if (targetType->type_kind() == XQType::USER_DEFINED_KIND) + if (!targetType->isAtomicOne()) { - castToUserDefinedType(result, aItem, sourceType.getp(), targetType, loc); - return result != NULL; + RAISE_ERROR(err::XPST0051, loc, ERROR_PARAMS(targetType)); } -#endif // ZORBA_NO_XMLSCHEMA - - sourceType = sourceType->getBaseBuiltinType(); - zstring sourceString; - ATOMIC_CODE_T sourceTypeCode = TypeOps::get_atomic_type_code(*sourceType); - ATOMIC_CODE_T targetTypeCode = TypeOps::get_atomic_type_code(*targetType); + store::SchemaTypeCode targetTypeCode; - if (sourceTypeCode == targetTypeCode) + if (targetType->type_kind() == XQType::ATOMIC_TYPE_KIND) { - result.transfer(aItem); + targetTypeCode = TypeOps::get_atomic_type_code(*targetType); + + castToBuiltinAtomic(result, item, targetTypeCode, nsCtx, loc); return true; } - - if (targetTypeCode == store::XS_NOTATION || - targetTypeCode == store::XS_ANY_ATOMIC) + else { - RAISE_ERROR(err::XPST0080, loc, ERROR_PARAMS(*errorInfo.theTargetType)); - } + assert(targetType->type_kind() == XQType::USER_DEFINED_KIND); - if (sourceTypeCode == store::XS_ANY_ATOMIC) - throwTypeException(err::XPTY0004, errorInfo); + const UserDefinedXQType* udt = + static_cast(targetType); - if (targetTypeCode == store::XS_NCNAME && - sourceTypeCode != store::XS_STRING && - sourceTypeCode != store::XS_NCNAME && - sourceTypeCode != store::XS_UNTYPED_ATOMIC) - throwTypeException(err::XPTY0004, errorInfo); + xqtref_t baseTargetType = udt->getBaseBuiltinType(); + targetTypeCode = TypeOps::get_atomic_type_code(*baseTargetType); - if (targetTypeCode == store::JS_NULL) - throwTypeException(err::XPTY0004, errorInfo); + if (targetTypeCode == store::XS_NOTATION) + { + zstring stringValue; + item->getStringValue2(stringValue); - CastFunc castFunc = theCastMatrix[theMapping[sourceTypeCode]] - [theMapping[targetTypeCode]]; - if (castFunc == 0) - throwTypeException(err::XPTY0004, errorInfo); + return castStringToAtomic(result, stringValue, targetType, tm, nsCtx, loc); + } - if (theMapping[sourceTypeCode] == theMapping[store::XS_STRING]) - { - aItem->getStringValue2(sourceString); - } + castToBuiltinAtomic(result, item, targetTypeCode, nsCtx, loc); - bool valid = (*castFunc)(result, - aItem, - sourceString, - factory, - nsCtx, - errorInfo); + const TypeManager* tm = targetType->get_manager(); + Schema* schema = tm->getSchema(); - DownCastFunc downCastFunc = theDownCastMatrix[theMapping[targetTypeCode]]; + zstring stringValue; + result->getStringValue2(stringValue); - if (downCastFunc != 0 && - targetTypeCode != store::XS_STRING && - targetTypeCode != store::XS_INTEGER) - { - valid = (*downCastFunc)(result, - &*result, - targetTypeCode, - factory, - errorInfo); - } + store::Item_t baseItem; + + bool valid = + schema->parseUserAtomicTypes(stringValue, targetType, baseItem, nsCtx, loc); - assert(valid); - return valid; + if (valid) + { + store::Item_t typeName = udt->get_qname(); + GENV_ITEMFACTORY->createUserTypedAtomicItem(result, baseItem, typeName); + } + + return valid; + } } /******************************************************************************* - Cast, if possible, a given atomic item SI to an atomic item TI of a given - type TT. If the cast is not allowed, the method raises an error. If the cast - is not possible, the method may raise an error or return false (TODO fix - this!). Otherwise, it returns true. + Cast a given atomic item SI to an atomic item TI of a given builtin atomic + type TT. No casting is done if TI and TT are exactly the same type. If the + cast is not allowed or is not possible, the method raises an error. Otherwise, + it returns true. + + Bug: no casting is done if TI is a user-defined type whose builtin base type + is TT. TODO fix this ???? ********************************************************************************/ -bool GenericCast::castToAtomic( - store::Item_t& result, - store::Item_t& item, - store::SchemaTypeCode targetType, - const TypeManager* tm, - namespace_context* nsCtx, - const QueryLoc& loc) +void GenericCast::castToBuiltinAtomic( + store::Item_t& result, + store::Item_t& item, + store::SchemaTypeCode targetTypeCode, + const namespace_context* nsCtx, + const QueryLoc& loc) { store::ItemFactory* factory = GENV_ITEMFACTORY; - zstring sourceString; + zstring stringValue; - store::SchemaTypeCode sourceType = item->getTypeCode(); + store::SchemaTypeCode sourceTypeCode = item->getTypeCode(); - if (sourceType == targetType) + if (sourceTypeCode == targetTypeCode) { result.transfer(item); - return true; + return; } - ErrorInfo errorInfo(sourceType, targetType, loc); + ErrorInfo errInfo(sourceTypeCode, targetTypeCode, loc); - if (targetType == store::XS_NOTATION || - targetType == store::XS_ANY_ATOMIC) + if (targetTypeCode == store::XS_NOTATION || + targetTypeCode == store::XS_ANY_ATOMIC) { - RAISE_ERROR(err::XPST0080, loc, ERROR_PARAMS(*errorInfo.theTargetType)); + RAISE_ERROR(err::XPST0080, loc, ERROR_PARAMS(errInfo.theTargetTypeCode)); } - if (sourceType == store::XS_ANY_ATOMIC) + if (sourceTypeCode == store::XS_ANY_ATOMIC) { - throwTypeException(err::XPTY0004, errorInfo); + throwXPTY0004Exception(errInfo); } - if (targetType == store::XS_NCNAME && - sourceType != store::XS_STRING && - sourceType != store::XS_NCNAME && - sourceType != store::XS_UNTYPED_ATOMIC) + if (targetTypeCode == store::XS_NCNAME && + sourceTypeCode != store::XS_STRING && + sourceTypeCode != store::XS_NCNAME && + sourceTypeCode != store::XS_UNTYPED_ATOMIC) { - throwTypeException(err::XPTY0004, errorInfo); + throwXPTY0004Exception(errInfo); } - CastFunc castFunc = theCastMatrix[theMapping[sourceType]] - [theMapping[targetType]]; + CastFunc castFunc = theCastMatrix[theMapping[sourceTypeCode]] + [theMapping[targetTypeCode]]; if (castFunc == 0) { - throwTypeException(err::XPTY0004, errorInfo); + throwXPTY0004Exception(errInfo); } - if (theMapping[sourceType] == theMapping[store::XS_STRING]) + if (theMapping[sourceTypeCode] == theMapping[store::XS_STRING]) { - item->getStringValue2(sourceString); + item->getStringValue2(stringValue); } - bool valid = (*castFunc)(result, - item, - sourceString, - factory, - nsCtx, - errorInfo); + (*castFunc)(result, item, stringValue, factory, nsCtx, errInfo); - DownCastFunc downCastFunc = theDownCastMatrix[theMapping[targetType]]; + DownCastFunc downCastFunc = theDownCastMatrix[theMapping[targetTypeCode]]; if (downCastFunc != 0 && - targetType != store::XS_STRING && - targetType != store::XS_INTEGER) - { - valid = (*downCastFunc)(result, - &*result, - targetType, - factory, - errorInfo); - } - - assert(valid); - return valid; -} - - -/******************************************************************************* - -********************************************************************************/ -void castToUserDefinedType( - store::Item_t& result, - const store::Item_t& aItem, - const XQType* aSourceType, - const XQType* aTargetType, - const QueryLoc& loc) -{ - ErrorInfo lErrorInfo(aSourceType, aTargetType, loc); - - // std::cout << "-castToUserDefinedType: " << aItem.getp()->getStringValue()->c_str() - // << " srcType: " << aSourceType->get_qname()->getLocalName()->c_str() - // << " @ " << aSourceType->get_qname()->getNamespace()->c_str() << "\n"; - // std::cout << "\t\t tgtType: " - // << aTargetType->get_qname()->getLocalName()->c_str() << " @ " - // << aTargetType->get_qname()->getNamespace()->c_str() << "\n"; - - const TypeManager* lTypeManager = aTargetType->get_manager(); - Schema* schema = lTypeManager->getSchema(); - - if (aSourceType->type_kind() != XQType::ATOMIC_TYPE_KIND || - (TypeOps::get_atomic_type_code(*aSourceType) != store::XS_STRING)) - { - throwTypeException(err::FORG0001, lErrorInfo); - } - - const UserDefinedXQType* udt = static_cast(aTargetType); - - switch ( udt->getTypeCategory() ) - { - case UserDefinedXQType::ATOMIC_TYPE: + targetTypeCode != store::XS_STRING && + targetTypeCode != store::XS_INTEGER) { - zstring strValue; - aItem->getStringValue2(strValue); - - store::Item_t baseItem; - bool hasResult = schema->parseUserAtomicTypes(strValue, - aTargetType, - baseItem, - NULL, - loc); - if (hasResult) - { - store::Item_t typeName = udt->get_qname(); - GENV_ITEMFACTORY->createUserTypedAtomicItem(result, baseItem, typeName); - return; - } - } - break; - - case UserDefinedXQType::LIST_TYPE: - case UserDefinedXQType::UNION_TYPE: - case UserDefinedXQType::COMPLEX_TYPE: - default: - ZORBA_ASSERT( false); - break; + (*downCastFunc)(result, &*result, targetTypeCode, factory, errInfo); } - - result = NULL; -} - - -/******************************************************************************* - -********************************************************************************/ -bool GenericCast::castToSimple( - zstring& str, - const xqtref_t& aTargetType, - std::vector& aResultList, - const TypeManager* tm, - const QueryLoc& loc) -{ - //std::cout << "-castToSimple: " << aStr.c_str() << " tgtType: " << aTargetType->get_qname()->getLocalName()->c_str() << " @ " << aTargetType->get_qname()->getNamespace()->c_str() << "\n"; - - return tm->getSchema()->parseUserSimpleTypes(str, aTargetType, aResultList, loc); } @@ -2366,7 +2453,7 @@ bool GenericCast::castToQName( store::Item_t& result, const store::Item_t& item, - namespace_context* nsCtx, + const namespace_context* nsCtx, bool isAttrName, const TypeManager* tm, const QueryLoc& loc) @@ -2376,7 +2463,7 @@ xqtref_t sourceType = tm->create_named_type(item->getType(), TypeConstants::QUANT_ONE, loc, - err::XPTY0004); + true); ZORBA_ASSERT(item->isAtomic()); ZORBA_ASSERT(sourceType != NULL); @@ -2393,19 +2480,21 @@ ERROR_PARAMS(ZED(BadType_23o), *sourceType, ZED(NoCastTo_45o), "QName")); } - ErrorInfo errorInfo(sourceType.getp(), rtm.QNAME_TYPE_ONE.getp(), loc); + ErrorInfo errInfo(sourceType.getp(), rtm.QNAME_TYPE_ONE.getp(), loc); zstring strval; item->getStringValue2(strval); + ascii::trim_whitespace(strval); zstring::size_type idx = strval.find(":"); zstring::size_type lidx = strval.rfind(":", strval.size(), 1); + if (idx != lidx) - throwTypeException(err::FORG0001, errorInfo); + throwFORG0001Exception(strval, errInfo); - zstring prefix; zstring nsuri; + zstring prefix; zstring local; if (idx == zstring::npos) @@ -2421,20 +2510,26 @@ { prefix = strval.substr(0, idx); - if (!GenericCast::instance()->castableToNCName(prefix)) - throwTypeException(err::FORG0001, errorInfo); + if (!GenericCast::castableToNCName(prefix)) + { + RAISE_ERROR(err::FORG0001, errInfo.theLoc, + ERROR_PARAMS(ZED(FORG0001_PrefixNotNCName_2), prefix)); + } if (nsCtx) { if (!nsCtx->findBinding(prefix, nsuri)) - throw XQUERY_EXCEPTION(err::FONS0004, ERROR_PARAMS(prefix)); + RAISE_ERROR(err::FONS0004, errInfo.theLoc, ERROR_PARAMS(prefix)); } local = strval.substr(idx + 1); } - if (!GenericCast::instance()->castableToNCName(local.c_str())) - throwTypeException(err::FORG0001, errorInfo ); + if (!GenericCast::castableToNCName(local)) + { + RAISE_ERROR(err::FORG0001, errInfo.theLoc, + ERROR_PARAMS(ZED(FORG0001_LocalNotNCName_2), local)); + } return GENV_ITEMFACTORY->createQName(result, nsuri, prefix, local); } @@ -2696,18 +2791,19 @@ ********************************************************************************/ bool GenericCast::isCastable( const store::Item_t& aItem, - const XQType* aTargetType, - const TypeManager* tm) + const XQType* targetType, + TypeManager* tm) { #ifndef ZORBA_NO_XMLSCHEMA - if (aTargetType->type_kind() == XQType::USER_DEFINED_KIND ) + if (targetType->type_kind() == XQType::USER_DEFINED_KIND ) { - const UserDefinedXQType* udt = static_cast(aTargetType); + const UserDefinedXQType* udt = static_cast(targetType); if (!udt->isComplex()) { + tm->initializeSchema(); + return tm->getSchema()-> - isCastableUserSimpleTypes(aItem->getStringValue(), - udt->getBaseType().getp()); + isCastableUserSimpleTypes(aItem->getStringValue(), targetType); } } #endif // ZORBA_NO_XMLSCHEMA @@ -2715,10 +2811,10 @@ xqtref_t lSourceType = tm->create_named_type(aItem->getType(), TypeConstants::QUANT_ONE, QueryLoc::null, - err::XPTY0004); + true); TypeConstants::castable_t lIsCastable = TypeOps::castability(*lSourceType, - *aTargetType); + *targetType); switch(lIsCastable) { case TypeConstants::NOT_CASTABLE: @@ -2732,7 +2828,7 @@ try { store::Item_t temp = aItem; - return castToAtomic(temp, temp, aTargetType, tm, NULL, QueryLoc::null); + return castToAtomic(temp, temp, targetType, tm, NULL, QueryLoc::null); } catch (ZorbaException const&) { @@ -2752,7 +2848,7 @@ bool GenericCast::isCastable( const zstring& str, const XQType* aTargetType, - const TypeManager* tm) + TypeManager* tm) { #ifndef ZORBA_NO_XMLSCHEMA if (aTargetType->type_kind() == XQType::USER_DEFINED_KIND ) @@ -2760,6 +2856,8 @@ const UserDefinedXQType* udt = static_cast(aTargetType); if (!udt->isComplex()) { + tm->initializeSchema(); + return tm->getSchema()-> isCastableUserSimpleTypes(str, udt->getBaseType().getp()); @@ -2787,7 +2885,7 @@ { store::Item_t dummy; zstring copyStr = str; - return castToAtomic(dummy, copyStr, aTargetType, tm, NULL, QueryLoc::null); + return castStringToAtomic(dummy, copyStr, aTargetType, tm, NULL, QueryLoc::null); } catch (ZorbaException const&) { @@ -2873,7 +2971,8 @@ if (TypeOps::is_subtype(itemTypeCode, store::XS_ANY_URI)) { - return castToAtomic(result, item, store::XS_STRING, tm, NULL, loc); + castToBuiltinAtomic(result, item, store::XS_STRING, NULL, loc); + return true; } } @@ -2901,11 +3000,17 @@ return result != NULL; } - if (TypeOps::is_subtype(itemType, store::XS_UNTYPED_ATOMIC) && - ! TypeOps::is_subtype(targetType, store::XS_QNAME)) + if (TypeOps::is_subtype(itemType, store::XS_UNTYPED_ATOMIC)) { + if (TypeOps::is_subtype(targetType, store::XS_QNAME) || + TypeOps::is_subtype(targetType, store::XS_NOTATION)) + { + return false; + } + // untyped --> target type - return castToAtomic(result, item, targetType, tm, NULL, loc); + castToBuiltinAtomic(result, item, targetType, NULL, loc); + return true; } else if (TypeOps::is_subtype(targetType, store::XS_DOUBLE)) { @@ -2913,7 +3018,8 @@ if (TypeOps::is_subtype(itemType, store::XS_DECIMAL) || TypeOps::is_subtype(itemType, store::XS_FLOAT)) { - return castToAtomic(result, item, targetType, tm, NULL, loc); + castToBuiltinAtomic(result, item, targetType, NULL, loc); + return true; } } else if (TypeOps::is_subtype(targetType, store::XS_FLOAT)) @@ -2921,7 +3027,8 @@ // decimal --> xs:float if (TypeOps::is_subtype(itemType, store::XS_DECIMAL)) { - return castToAtomic(result, item, targetType, tm, NULL, loc); + castToBuiltinAtomic(result, item, targetType, NULL, loc); + return true; } } else if (TypeOps::is_subtype(targetType, store::XS_STRING)) @@ -2929,7 +3036,8 @@ // URI --> xs:String Promotion if (TypeOps::is_subtype(itemType, store::XS_ANY_URI)) { - return castToAtomic(result, item, store::XS_STRING, tm, NULL, loc); + castToBuiltinAtomic(result, item, store::XS_STRING, NULL, loc); + return true; } } diff -Nru zorba-2.7.0-0/src/types/casting.h zorba-2.8.0-0/src/types/casting.h --- zorba-2.7.0-0/src/types/casting.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/casting.h 2013-01-16 18:28:18.000000000 +0000 @@ -34,20 +34,19 @@ class GenericCast { - typedef bool (*CastFunc)( - store::Item_t&, - const store::Item*, - zstring& strval, - store::ItemFactory*, - namespace_context *nsCtx, - const ErrorInfo& aErrorInfo); + typedef void (*CastFunc)(store::Item_t&, + const store::Item*, + zstring& strval, + store::ItemFactory*, + const namespace_context* nsCtx, + const ErrorInfo& errorInfo); - typedef bool (*DownCastFunc)( + typedef void (*DownCastFunc)( store::Item_t&, const store::Item*, - store::SchemaTypeCode aTargetAtomicType, + store::SchemaTypeCode targetAtomicType, store::ItemFactory*, - const ErrorInfo& aErrorInfo); + const ErrorInfo& errorInfo); private: static const int theMapping[store::XS_LAST]; @@ -85,54 +84,41 @@ const TypeManager* tm, const QueryLoc& loc); - /** - * Executes the string casting of the passed string to an item of the passed - * target type. - */ - static bool castToAtomic( + static bool castToSimple( + store::Item_t& item, + const xqtref_t& targetType, + const namespace_context* nsCtx, + std::vector& resultList, + TypeManager* tm, + const QueryLoc& loc); + + static bool castStringToAtomic( store::Item_t& result, - zstring& aStr, - const XQType* aTargetType, + zstring& stringValue, + const XQType* targetType, const TypeManager* tm, - namespace_context* aNCtx, + const namespace_context* nsCtx, const QueryLoc& loc); - /** - * Executes the casting of the passed item. If the passed item has the same - * type or a subtype of the passed targetType, the passed item is directly - * returned. - */ + static bool castToAtomic( store::Item_t& result, store::Item_t& item, const XQType* targetType, const TypeManager* tm, - namespace_context* nameCtx, + const namespace_context* nsCtx, const QueryLoc& loc); - /** - * Executes the casting of the passed item. If the passed item has the same - * type or a subtype of the passed targetType, the passed item is directly - * returned. - */ - static bool castToAtomic( + static void castToBuiltinAtomic( store::Item_t& result, store::Item_t& item, store::SchemaTypeCode targetType, - const TypeManager* tm, - namespace_context* nameCtx, - const QueryLoc& loc); - - static bool castToSimple( - zstring& aStr, - const xqtref_t& aTargetType, - std::vector& aResultList, - const TypeManager* tm, + const namespace_context* nameCtx, const QueryLoc& loc); static bool castToQName( store::Item_t& result, const store::Item_t& item, - namespace_context* aNCtx, + const namespace_context* nsCtx, bool attrName, const TypeManager* tm, const QueryLoc& loc); @@ -149,27 +135,15 @@ static bool castableToName(const zstring& str); - /** - * Checks if the passed item would be castable to the passed target type. - * @param aItem - * @param aTargetType - * @return true if castable, else false - */ static bool isCastable( - const store::Item_t& aItem, - const XQType* aTargetType, - const TypeManager* tm); + const store::Item_t& item, + const XQType* targetType, + TypeManager* tm); - /** - * Checks if the passed string is castable to the passed target type. - * @param aStr - * @param aTargetType - * @return true if castable, else false - */ static bool isCastable( - const zstring& aStr, - const XQType* aTargetType, - const TypeManager* tm); + const zstring& stringValue, + const XQType* targetType, + TypeManager* tm); }; } /* namespace zorba */ diff -Nru zorba-2.7.0-0/src/types/root_typemanager.cpp zorba-2.8.0-0/src/types/root_typemanager.cpp --- zorba-2.7.0-0/src/types/root_typemanager.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/root_typemanager.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -46,6 +46,7 @@ const TypeConstants::castable_t RootTypeManager::ATOMIC_CAST_MATRIX[store::XS_LAST][store::XS_LAST] = { +// aA s nS t l NM Na NC ID IR EN uA dT d t d yM dT f do de i nP nI l i s b nn uL uI uS uB pI YM Y MD D M b 64 hB aU QN NO nu {Y, Y, M, M, M, M, M, M, M, M, M, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* anyAtomicType */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* string */ {Y, Y, Y, M, M, M, M, M, M, M, M, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* normalizedString */ @@ -56,7 +57,7 @@ {Y, Y, Y, Y, M, M, Y, Y, M, M, M, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* NCMame */ {Y, Y, Y, Y, M, M, Y, Y, Y, M, M, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* ID */ {Y, Y, Y, Y, M, M, Y, Y, M, Y, M, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* IDREF */ - {Y, Y, Y, Y, M, M, Y, Y, M, M, Y, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* EMTITY */ + {Y, Y, Y, Y, M, M, Y, Y, M, M, Y, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N}, /* ENTITY */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N, N, N}, /* untypedAtomic */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, Y, Y, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, Y, Y, Y, Y, Y, N, N, N, N, N, N, N}, /* dateTime */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, Y, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, Y, Y, Y, Y, Y, N, N, N, N, N, N, N}, /* date */ @@ -66,20 +67,20 @@ {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, Y, Y, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N}, /* dayTimeDuration */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* float */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* double */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* decimal */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* integer */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* nonPositiveInteger */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* negativeInteger */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* long */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* int */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* short */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* byte */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* nonNegativeInteger */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedLong */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedInt */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedShort */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedByte */ - {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* positiveInteger */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, M, M, M, M, M, M, M, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* decimal */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, M, M, M, M, M, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* integer */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, M, M, M, M, M, M, M, M, M, M, N, N, N, N, N, N, Y, N, N, N, N, N, N}, /* nonPositiveInteger */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, Y, Y, M, M, M, M, Y, N, N, N, N, N, N, N, N, N, N, Y, N, N, N, N, N, N}, /* negativeInteger */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, M, Y, M, M, M, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* long */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, M, Y, Y, M, M, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* int */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, M, Y, Y, Y, M, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* short */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, M, Y, Y, Y, Y, M, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* byte */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, N, M, M, M, M, Y, M, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* nonNegativeInteger */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, N, M, M, M, M, Y, Y, M, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedLong */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, N, Y, M, M, M, Y, Y, Y, M, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedInt */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, N, Y, Y, M, M, Y, Y, Y, Y, M, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedShort */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, M, N, Y, Y, Y, M, Y, Y, Y, Y, Y, M, N, N, N, N, N, Y, N, N, N, N, N, N}, /* unsignedByte */ + {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, Y, Y, Y, Y, N, N, M, M, M, M, M, Y, Y, Y, Y, Y, N, N, N, N, N, Y, N, N, N, N, N, N}, /* positiveInteger */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, Y, N, N, N, N, N, N, N, N, N, N, N}, /* gYearMonth */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, Y, N, N, N, N, N, N, N, N, N, N}, /* gYear */ {Y, Y, M, M, M, M, M, M, M, M, M, Y, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, N, Y, N, N, N, N, N, N, N, N, N}, /* gMonthDay */ @@ -229,7 +230,8 @@ ANY_FUNCTION_TYPE_PLUS = new AnyFunctionXQType(this, TypeConstants::QUANT_PLUS, true); #define XSQNDECL(var, local) \ - GENV.getStore().getItemFactory()->createQName(var, XML_SCHEMA_NS, XML_SCHEMA_PREFIX, local) + GENV.getStore().getItemFactory()-> \ + createQName(var, XML_SCHEMA_NS, XML_SCHEMA_PREFIX, local) XSQNDECL(XS_ANY_ATOMIC_QNAME, "anyAtomicType"); XSQNDECL(XS_STRING_QNAME, "string"); @@ -279,6 +281,9 @@ XSQNDECL(XS_ANY_TYPE_QNAME, "anyType"); XSQNDECL(XS_ANY_SIMPLE_TYPE_QNAME, "anySimpleType"); XSQNDECL(XS_UNTYPED_QNAME, "untyped"); + XSQNDECL(XS_NMTOKENS_QNAME, "NMTOKENS"); + XSQNDECL(XS_IDREFS_QNAME, "IDREFS"); + XSQNDECL(XS_ENTITIES_QNAME, "ENTITIES"); #ifdef ZORBA_WITH_JSON GENV_STORE.getItemFactory()->createQName(JS_NULL_QNAME, @@ -376,6 +381,24 @@ ATOMIC_TYPE_DEFN(NOTATION) #undef ATOMIC_TYPE_DEFN + XS_NMTOKENS_TYPE = new UserDefinedXQType(this, + XS_NMTOKENS_QNAME, + NULL, + NMTOKEN_TYPE_ONE.getp(), + true); + + XS_ENTITIES_TYPE = new UserDefinedXQType(this, + XS_ENTITIES_QNAME, + NULL, + ENTITY_TYPE_ONE.getp(), + true); + + XS_IDREFS_TYPE = new UserDefinedXQType(this, + XS_IDREFS_QNAME, + NULL, + IDREF_TYPE_ONE.getp(), + true); + STRUCTURED_ITEM_TYPE_ONE = new StructuredItemXQType(this, TypeConstants::QUANT_ONE, true); @@ -557,6 +580,14 @@ DELETE_TYPE(ANY_NODE) DELETE_TYPE(STRUCTURED_ITEM) + // These must be deallocated first because they may reference other types + delete XS_NMTOKENS_TYPE.getp(); + XS_NMTOKENS_TYPE.setNull(); + delete XS_ENTITIES_TYPE.getp(); + XS_ENTITIES_TYPE.setNull(); + delete XS_IDREFS_TYPE.getp(); + XS_IDREFS_TYPE.setNull(); + #ifdef ZORBA_WITH_JSON DELETE_TYPE(JS_NULL) diff -Nru zorba-2.7.0-0/src/types/root_typemanager.h zorba-2.8.0-0/src/types/root_typemanager.h --- zorba-2.7.0-0/src/types/root_typemanager.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/root_typemanager.h 2013-01-16 18:28:18.000000000 +0000 @@ -41,12 +41,12 @@ public: /** - * Pre-allocated XQType object for the "none" type + * Pre-allocated XQType object for the "none" type. */ xqtref_t NONE_TYPE; /** - * Pre-allocated XQType object for the () sequence type (the empty sequence). + * Pre-allocated XQType object for the empty-sequence() type. */ xqtref_t EMPTY_TYPE; @@ -219,16 +219,21 @@ /** * Pre-allocated XQType and QNameItem objects for the remaining build-in - * XQDM types (not including the built-in list types xs:IDREFS, xs:NMTOKENS, - * and xs:ENTITIES). + * XQDM types. These are not sequence-types. */ xqtref_t ANY_TYPE; xqtref_t UNTYPED_TYPE; xqtref_t ANY_SIMPLE_TYPE; + xqtref_t XS_NMTOKENS_TYPE; + xqtref_t XS_IDREFS_TYPE; + xqtref_t XS_ENTITIES_TYPE; store::Item_t XS_ANY_TYPE_QNAME; store::Item_t XS_UNTYPED_QNAME; store::Item_t XS_ANY_SIMPLE_TYPE_QNAME; + store::Item_t XS_NMTOKENS_QNAME; + store::Item_t XS_IDREFS_QNAME; + store::Item_t XS_ENTITIES_QNAME; private: diff -Nru zorba-2.7.0-0/src/types/schema/XercSchemaValidator.cpp zorba-2.8.0-0/src/types/schema/XercSchemaValidator.cpp --- zorba-2.7.0-0/src/types/schema/XercSchemaValidator.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/schema/XercSchemaValidator.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -123,6 +123,11 @@ // to do to validate it. // // the top of the type stack always knows best... + if ( fTypeStack->empty() ) + { + emitError(XMLValid::DatatypeValidationFailure, elemDecl->getFullName()); + } + ComplexTypeInfo* currType = fTypeStack->pop(); const SchemaElementDecl::ModelTypes modelType = (currType) @@ -171,7 +176,7 @@ , fGrammarResolver , fGrammarResolver->getStringPool() , indexFailingChild - , getScanner()->getMemoryManager()); + , getScanner()->getMemoryManager()); } if(!result) { @@ -194,7 +199,7 @@ XMLCh* value = fDatatypeBuffer.getRawBuffer(); XMLCh* elemDefaultValue = ((SchemaElementDecl*) elemDecl)->getDefaultValue(); - if (fCurrentDatatypeValidator) + if (fCurrentDatatypeValidator) { if (fNil) { @@ -364,7 +369,7 @@ { fTrailingSeenNonWhiteSpace.flags = 0; fSeenId = false; - fTypeStack->removeAllElements(); + fTypeStack->removeAllElements(); delete fXsiType; fXsiType = 0; fCurrentDatatypeValidator = 0; @@ -561,7 +566,7 @@ fErrorOccurred = false; - if (fXsiType) + if (fXsiType) { // handle "xsi:type" right here DatatypeValidator *xsiTypeDV = 0; @@ -1085,7 +1090,7 @@ } catch (const XMLException& excep) { fSchemaErrorReporter.emitError(excep, curGroup.getLocator()); - } + } } if (curGroup.getCheckElementConsistency()) @@ -1686,7 +1691,7 @@ int baseFlags = baseElemDecl->getMiscFlags(); if (((baseFlags & SchemaSymbols::XSD_NILLABLE) == 0) && - ((derivedFlags & SchemaSymbols::XSD_NILLABLE) != 0)) { + ((derivedFlags & SchemaSymbols::XSD_NILLABLE) != 0)) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK2, derivedName, fMemoryManager); } @@ -1809,7 +1814,7 @@ DatatypeValidator* bDV = baseElemDecl->getDatatypeValidator(); if (bInfo || bDV == 0 || - !bDV->isSubstitutableBy(derivedElemDecl->getDatatypeValidator())) { + !bDV->isSubstitutableBy(derivedElemDecl->getDatatypeValidator())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK5, derivedElemName, fMemoryManager); } @@ -2163,7 +2168,7 @@ // didn't find a match. if (!matched) { - codeToThrow = XMLExcepts::PD_RecurseUnordered; + codeToThrow = XMLExcepts::PD_RecurseUnordered; break; } } @@ -2173,7 +2178,7 @@ for (XMLSize_t j=0; j < baseCount; j++) { if (!foundIt[j] && baseNodes->elementAt(j)->getMinTotalRange()) { - codeToThrow = XMLExcepts::PD_RecurseUnordered; + codeToThrow = XMLExcepts::PD_RecurseUnordered; break; } } @@ -2229,7 +2234,7 @@ // didn't find a match. if (!matched) { - ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_MapAndSum, fMemoryManager); + ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_MapAndSum, fMemoryManager); } } @@ -2309,6 +2314,11 @@ // to do to validate it. // // the top of the type stack always knows best... + if ( fTypeStack->empty() ) + { + emitError(XMLValid::DatatypeValidationFailure, elemDecl->getFullName()); + } + ComplexTypeInfo* currType = fTypeStack->pop(); const SchemaElementDecl::ModelTypes modelType = (currType) @@ -2383,7 +2393,7 @@ XMLCh* value = fDatatypeBuffer.getRawBuffer(); XMLCh* elemDefaultValue = ((SchemaElementDecl*) elemDecl)->getDefaultValue(); - if (fCurrentDatatypeValidator) + if (fCurrentDatatypeValidator) { if (fNil) { @@ -2549,7 +2559,7 @@ { fTrailing = false; fSeenId = false; - fTypeStack->removeAllElements(); + fTypeStack->removeAllElements(); delete fXsiType; fXsiType = 0; fCurrentDatatypeValidator = 0; @@ -2742,7 +2752,7 @@ fErrorOccurred = false; - if (fXsiType) + if (fXsiType) { // handle "xsi:type" right here DatatypeValidator *xsiTypeDV = 0; @@ -2752,43 +2762,43 @@ if (uri != XMLElementDecl::fgInvalidElemId && uri != XMLElementDecl::fgPCDataElemId && uri != XMLContentModel::gEpsilonFakeId && - uri != XMLContentModel::gEOCFakeId) + uri != XMLContentModel::gEOCFakeId) { // retrieve Grammar for the uri const XMLCh* uriStr = getScanner()->getURIText(uri); //std::cout << " xsv: fXsiType: " << zorba::StrX(localPart) << " @ " << zorba::StrX(uriStr) << "\n"; std::cout.flush(); SchemaGrammar* sGrammar = (SchemaGrammar*) fGrammarResolver->getGrammar(uriStr); - if (!sGrammar) + if (!sGrammar) { // Check built-in simple types - if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) + if (XMLString::equals(uriStr, SchemaSymbols::fgURI_SCHEMAFORSCHEMA)) { xsiTypeDV = fGrammarResolver->getDatatypeValidator(uriStr, localPart); - if (!xsiTypeDV) + if (!xsiTypeDV) { emitError(XMLValid::BadXsiType, fXsiType->getRawName()); fErrorOccurred = true; } - else + else { if (elemTypeInfo || (fCurrentDatatypeValidator - && !fCurrentDatatypeValidator->isSubstitutableBy(xsiTypeDV))) + && !fCurrentDatatypeValidator->isSubstitutableBy(xsiTypeDV))) { // the type is not derived from ancestor emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } - else + else { // the type is derived from ancestor - if (((SchemaElementDecl*)elemDef)->getBlockSet() == SchemaSymbols::XSD_RESTRICTION) + if (((SchemaElementDecl*)elemDef)->getBlockSet() == SchemaSymbols::XSD_RESTRICTION) { emitError(XMLValid::NoSubforBlock, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } - if (elemDef->hasAttDefs()) + if (elemDef->hasAttDefs()) { // if we have an attribute but xsi:type's type is simple, we have a problem... emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); @@ -2798,28 +2808,28 @@ fCurrentDatatypeValidator = xsiTypeDV; } } - else + else { // Grammar not found emitError(XMLValid::GrammarNotFound, uriStr); fErrorOccurred = true; } } - else if (sGrammar->getGrammarType() != Grammar::SchemaGrammarType) + else if (sGrammar->getGrammarType() != Grammar::SchemaGrammarType) { emitError(XMLValid::GrammarNotFound, uriStr); fErrorOccurred = true; } - else + else { // retrieve complexType registry and DatatypeValidator registry RefHashTableOf* complexTypeRegistry = sGrammar->getComplexTypeRegistry(); - if (!complexTypeRegistry) + if (!complexTypeRegistry) { emitError(XMLValid::BadXsiType, fXsiType->getRawName()); fErrorOccurred = true; } - else + else { // retrieve the typeInfo specified in xsi:type XMLBuffer aBuffer(1023, fMemoryManager); @@ -2828,10 +2838,10 @@ aBuffer.append(localPart); ComplexTypeInfo* typeInfo = complexTypeRegistry->get(aBuffer.getRawBuffer()); - if (typeInfo) + if (typeInfo) { // typeInfo is found - if (typeInfo->getAbstract()) + if (typeInfo->getAbstract()) { emitError(XMLValid::NoAbstractInXsiType, aBuffer.getRawBuffer()); fErrorOccurred = true; @@ -2841,22 +2851,22 @@ if (elemTypeInfo) { ComplexTypeInfo* tempType = typeInfo; - while (tempType) + while (tempType) { if (tempType == elemTypeInfo) break; tempType = tempType->getBaseComplexTypeInfo(); } - if (!tempType) + if (!tempType) { emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } - else + else { int derivationMethod = typeInfo->getDerivedBy(); - if ((((SchemaElementDecl*)elemDef)->getBlockSet() & derivationMethod) != 0) + if ((((SchemaElementDecl*)elemDef)->getBlockSet() & derivationMethod) != 0) { emitError(XMLValid::NoSubforBlock, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; @@ -2866,7 +2876,7 @@ else { // if the original type is a simple type, check derivation ok. - if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(typeInfo->getDatatypeValidator())) + if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(typeInfo->getDatatypeValidator())) { // the type is not derived from ancestor emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); @@ -2887,29 +2897,29 @@ // typeInfo not found xsiTypeDV = fGrammarResolver->getDatatypeValidator(uriStr, localPart); - if (!xsiTypeDV) + if (!xsiTypeDV) { emitError(XMLValid::BadXsiType, fXsiType->getRawName()); fErrorOccurred = true; } - else + else { - if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(xsiTypeDV)) + if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(xsiTypeDV)) { // the type is not derived from ancestor emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } - else + else { // the type is derived from ancestor - if (((SchemaElementDecl*)elemDef)->getBlockSet() == SchemaSymbols::XSD_RESTRICTION) + if (((SchemaElementDecl*)elemDef)->getBlockSet() == SchemaSymbols::XSD_RESTRICTION) { emitError(XMLValid::NoSubforBlock, fXsiType->getRawName(), elemDef->getFullName()); fErrorOccurred = true; } - - if (elemDef->hasAttDefs()) + + if (elemDef->hasAttDefs()) { // if we have an attribute but xsi:type's type is simple, we have a problem... emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); @@ -2927,13 +2937,13 @@ delete fXsiType; fXsiType = 0; } - else + else { // // xsi:type was not specified... // If the corresponding type is abstract, detect an error // - if (elemTypeInfo && elemTypeInfo->getAbstract()) + if (elemTypeInfo && elemTypeInfo->getAbstract()) { emitError(XMLValid::NoUseAbstractType, elemDef->getFullName()); fErrorOccurred = true; @@ -2944,7 +2954,7 @@ // Check whether this element is abstract. If so, an error // int miscFlags = ((SchemaElementDecl*)elemDef)->getMiscFlags(); - if ((miscFlags & SchemaSymbols::XSD_ABSTRACT) != 0) + if ((miscFlags & SchemaSymbols::XSD_ABSTRACT) != 0) { emitError(XMLValid::NoDirectUseAbstractElement, elemDef->getFullName()); fErrorOccurred = true; @@ -2953,7 +2963,7 @@ // // Check whether this element allows Nillable // - if (fNil && (miscFlags & SchemaSymbols::XSD_NILLABLE) == 0 ) + if (fNil && (miscFlags & SchemaSymbols::XSD_NILLABLE) == 0 ) { fNil = false; emitError(XMLValid::NillNotAllowed, elemDef->getFullName()); @@ -2980,7 +2990,7 @@ if (uri != XMLElementDecl::fgInvalidElemId && uri != XMLElementDecl::fgPCDataElemId && uri != XMLContentModel::gEpsilonFakeId && - uri != XMLContentModel::gEOCFakeId) + uri != XMLContentModel::gEOCFakeId) { // retrieve Grammar for the uri const XMLCh* uriStr = getScanner()->getURIText(uri); @@ -3035,10 +3045,10 @@ aBuffer.append(localPart); ComplexTypeInfo* typeInfo = complexTypeRegistry->get(aBuffer.getRawBuffer()); - if (typeInfo) + if (typeInfo) { // typeInfo is found - if (typeInfo->getAbstract()) + if (typeInfo->getAbstract()) { emitError(XMLValid::NoAbstractInXsiType, aBuffer.getRawBuffer()); fErrorOccurred = true; @@ -3047,7 +3057,7 @@ { { // if the original type is a simple type, check derivation ok. - if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(typeInfo->getDatatypeValidator())) + if (fCurrentDatatypeValidator && !fCurrentDatatypeValidator->isSubstitutableBy(typeInfo->getDatatypeValidator())) { // the type is not derived from ancestor emitError(XMLValid::NonDerivedXsiType, fXsiType->getRawName(), elemDef->getFullName()); @@ -3171,7 +3181,7 @@ // 3) That for any notation types, that their lists // of possible values refer to declared notations. // - if (curElem.hasAttDefs()) + if (curElem.hasAttDefs()) { XMLAttDefList& attDefList = curElem.getAttDefList(); bool seenId = false; @@ -3260,7 +3270,7 @@ } // For each complex type info, check the Unique Particle Attribution - if (getScanner()->getValidationSchemaFullChecking()) + if (getScanner()->getValidationSchemaFullChecking()) { RefHashTableOf* complexTypeRegistry = sGrammar.getComplexTypeRegistry(); @@ -3276,20 +3286,20 @@ RefHashTableOf* groupInfoRegistry = sGrammar.getGroupInfoRegistry(); RefHashTableOfEnumerator groupEnum(groupInfoRegistry, false, fMemoryManager); - while (groupEnum.hasMoreElements()) + while (groupEnum.hasMoreElements()) { XercesGroupInfo& curGroup = groupEnum.nextElement(); XercesGroupInfo* baseGroup = curGroup.getBaseGroup(); - if (baseGroup) + if (baseGroup) { - try + try { checkParticleDerivationOk(&sGrammar, curGroup.getContentSpec(), curGroup.getScope(), baseGroup->getContentSpec(), baseGroup->getScope()); } - catch (const XMLException& excep) + catch (const XMLException& excep) { fSchemaErrorReporter.emitError(excep, curGroup.getLocator()); } @@ -3347,7 +3357,7 @@ const XMLCh* srcPtr = value; XMLReader* fCurReader = getReaderMgr()->getCurrentReader(); - if ((wsFacet==DatatypeValidator::COLLAPSE) && fTrailing) + if ((wsFacet==DatatypeValidator::COLLAPSE) && fTrailing) { nextCh = *srcPtr; if (!fCurReader->isWhitespace(nextCh)) @@ -3408,19 +3418,19 @@ // --------------------------------------------------------------------------- void XercSchemaValidator::checkRefElementConsistency(SchemaGrammar* const currentGrammar, const ComplexTypeInfo* const curTypeInfo, - const XercesGroupInfo* const curGroup) + const XercesGroupInfo* const curGroup) { unsigned int elemCount = (curTypeInfo) ? curTypeInfo->elementCount() : curGroup->elementCount(); int elemScope = (curTypeInfo) ? curTypeInfo->getScopeDefined() : curGroup->getScope(); XSDLocator* typeInfoLocator = (curTypeInfo) ? curTypeInfo->getLocator() : curGroup->getLocator(); - for (unsigned int i=0; i < elemCount; i++) + for (unsigned int i=0; i < elemCount; i++) { const SchemaElementDecl* elemDecl = (curTypeInfo) ? curTypeInfo->elementAt(i) : curGroup->elementAt(i); - if (elemDecl->isGlobalDecl()) + if (elemDecl->isGlobalDecl()) { unsigned int elemURI = elemDecl->getURI(); @@ -3430,23 +3440,23 @@ if (other && (elemDecl->getComplexTypeInfo() != other->getComplexTypeInfo() || - elemDecl->getDatatypeValidator() != other->getDatatypeValidator())) + elemDecl->getDatatypeValidator() != other->getDatatypeValidator())) { fSchemaErrorReporter.emitError(XMLErrs::DuplicateElementDeclaration, XMLUni::fgXMLErrDomain, typeInfoLocator, elemName, 0, 0, 0, fMemoryManager); continue; } - RefHash2KeysTableOf* validSubsGroups = + RefHash2KeysTableOf* validSubsGroups = currentGrammar->getValidSubstitutionGroups(); - ValueVectorOf* subsElements = + ValueVectorOf* subsElements = validSubsGroups->get(elemName, elemURI); - if (subsElements) + if (subsElements) { unsigned subsElemSize = subsElements->size(); - for (unsigned int j=0; j < subsElemSize; j++) + for (unsigned int j=0; j < subsElemSize; j++) { SchemaElementDecl* subsElem = subsElements->elementAt(j); const XMLCh* subsElemName = subsElem->getBaseName(); @@ -3455,11 +3465,11 @@ if (other && (subsElem->getComplexTypeInfo() != other->getComplexTypeInfo() - || subsElem->getDatatypeValidator() != other->getDatatypeValidator())) + || subsElem->getDatatypeValidator() != other->getDatatypeValidator())) { fSchemaErrorReporter.emitError(XMLErrs::DuplicateElementDeclaration, - XMLUni::fgXMLErrDomain, - typeInfoLocator, elemName, + XMLUni::fgXMLErrDomain, + typeInfoLocator, elemName, 0, 0, 0, fMemoryManager); } } @@ -3472,7 +3482,7 @@ // XercSchemaValidator: Particle Derivation Checking // --------------------------------------------------------------------------- void XercSchemaValidator::checkParticleDerivation(SchemaGrammar* const currentGrammar, - const ComplexTypeInfo* const curTypeInfo) + const ComplexTypeInfo* const curTypeInfo) { ComplexTypeInfo* baseTypeInfo = 0; ContentSpecNode* curSpecNode = 0; @@ -3481,21 +3491,21 @@ && ((baseTypeInfo = curTypeInfo->getBaseComplexTypeInfo()) != 0) && ((curSpecNode = curTypeInfo->getContentSpec()) != 0)) { - try + try { checkParticleDerivationOk(currentGrammar, curSpecNode, curTypeInfo->getScopeDefined(), baseTypeInfo->getContentSpec(), baseTypeInfo->getScopeDefined(), baseTypeInfo); } - catch (const XMLException& excep) + catch (const XMLException& excep) { fSchemaErrorReporter.emitError(excep, curTypeInfo->getLocator()); } } } -ContentSpecNode* XercSchemaValidator::getNonUnaryGroup(ContentSpecNode* const pNode) +ContentSpecNode* XercSchemaValidator::getNonUnaryGroup(ContentSpecNode* const pNode) { int pNodeType = (pNode->getType() & 0x0f); if (pNodeType == ContentSpecNode::Leaf @@ -3517,7 +3527,7 @@ ContentSpecNode* const baseNode, const int baseScope, const ComplexTypeInfo* const baseInfo, - const bool toCheckOccurence) + const bool toCheckOccurence) { // Check for pointless occurrences of all, choice, sequence. The result is // the contentspec which is not pointless. If the result is a non-pointless @@ -3537,14 +3547,14 @@ if ((curNodeType & 0x0f) == ContentSpecNode::Sequence || (curNodeType & 0x0f) == ContentSpecNode::Choice || - curNodeType == ContentSpecNode::All) + curNodeType == ContentSpecNode::All) { curSpecNode = checkForPointlessOccurrences(curSpecNode, curNodeType, &curVector); } if ((baseNodeType & 0x0f) == ContentSpecNode::Sequence || (baseNodeType & 0x0f) == ContentSpecNode::Choice || - baseNodeType == ContentSpecNode::All) + baseNodeType == ContentSpecNode::All) { baseSpecNode = checkForPointlessOccurrences(baseSpecNode, baseNodeType, &baseVector); } @@ -3552,15 +3562,15 @@ curNodeType = curSpecNode->getType(); baseNodeType = baseSpecNode->getType(); - switch (curNodeType & 0x0f) + switch (curNodeType & 0x0f) { case ContentSpecNode::Leaf: { - switch (baseNodeType & 0x0f) + switch (baseNodeType & 0x0f) { case ContentSpecNode::Leaf: { - checkNameAndTypeOK(aGrammar, curSpecNode, derivedScope, baseSpecNode, + checkNameAndTypeOK(aGrammar, curSpecNode, derivedScope, baseSpecNode, baseScope, baseInfo); return; } @@ -3590,7 +3600,7 @@ case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { - switch (baseNodeType & 0x0f) + switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: @@ -3604,25 +3614,25 @@ case ContentSpecNode::All: case ContentSpecNode::Leaf: { - ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes1, + ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes1, fMemoryManager); } default: { - ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, + ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, fMemoryManager); } } } case ContentSpecNode::All: { - switch (baseNodeType & 0x0f) + switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: case ContentSpecNode::Any_NS: { - checkNSRecurseCheckCardinality(aGrammar, curSpecNode, &curVector, + checkNSRecurseCheckCardinality(aGrammar, curSpecNode, &curVector, derivedScope, baseSpecNode, toCheckOccurence); return; } @@ -3636,19 +3646,19 @@ case ContentSpecNode::Sequence: case ContentSpecNode::Leaf: { - ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes2, + ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_ForbiddenRes2, fMemoryManager); } default: { - ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, + ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_InvalidContentType, fMemoryManager); } } } case ContentSpecNode::Choice: { - switch (baseNodeType & 0x0f) + switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: @@ -3677,7 +3687,7 @@ } case ContentSpecNode::Sequence: { - switch (baseNodeType & 0x0f) + switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: case ContentSpecNode::Any_Other: @@ -3720,17 +3730,17 @@ ContentSpecNode* XercSchemaValidator::checkForPointlessOccurrences(ContentSpecNode* const specNode, const ContentSpecNode::NodeTypes nodeType, - ValueVectorOf* const nodes) + ValueVectorOf* const nodes) { ContentSpecNode* rightNode = specNode->getSecond(); int min = specNode->getMinOccurs(); int max = specNode->getMaxOccurs(); - if (!rightNode) + if (!rightNode) { gatherChildren(nodeType, specNode->getFirst(), nodes); - if (nodes->size() == 1 && min == 1 && max == 1) + if (nodes->size() == 1 && min == 1 && max == 1) { return nodes->elementAt(0); } @@ -3746,9 +3756,9 @@ void XercSchemaValidator::gatherChildren(const ContentSpecNode::NodeTypes parentNodeType, ContentSpecNode* const specNode, - ValueVectorOf* const nodes) + ValueVectorOf* const nodes) { - if (!specNode) + if (!specNode) { return; } @@ -3761,25 +3771,25 @@ if (nodeType == ContentSpecNode::Leaf || (nodeType & 0x0f) == ContentSpecNode::Any || (nodeType & 0x0f) == ContentSpecNode::Any_NS || - (nodeType & 0x0f) == ContentSpecNode::Any_Other) + (nodeType & 0x0f) == ContentSpecNode::Any_Other) { nodes->addElement(specNode); } - else if (min !=1 || max != 1) + else if (min !=1 || max != 1) { nodes->addElement(specNode); } - else if (!rightNode) + else if (!rightNode) { gatherChildren(nodeType, specNode->getFirst(), nodes); } - else if ((parentNodeType & 0x0f) == (nodeType & 0x0f)) + else if ((parentNodeType & 0x0f) == (nodeType & 0x0f)) { gatherChildren(nodeType, specNode->getFirst(), nodes); gatherChildren(nodeType, rightNode, nodes); } - else + else { nodes->addElement(specNode); } @@ -3788,19 +3798,19 @@ void XercSchemaValidator::checkNSCompat(const ContentSpecNode* const derivedSpecNode, const ContentSpecNode* const baseSpecNode, - const bool toCheckOccurence) + const bool toCheckOccurence) { // check Occurrence ranges if (toCheckOccurence && !isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), - baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) + baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_OccurRangeE, derivedSpecNode->getElement()->getLocalPart(), fMemoryManager); } // check wildcard subset - if (!wildcardEltAllowsNamespace(baseSpecNode, derivedSpecNode->getElement()->getURI())) + if (!wildcardEltAllowsNamespace(baseSpecNode, derivedSpecNode->getElement()->getURI())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NSCompat1, derivedSpecNode->getElement()->getLocalPart(), fMemoryManager); @@ -3809,27 +3819,27 @@ bool XercSchemaValidator::wildcardEltAllowsNamespace(const ContentSpecNode* const baseSpecNode, - const unsigned int derivedURI) + const unsigned int derivedURI) { ContentSpecNode::NodeTypes nodeType = baseSpecNode->getType(); - if ((nodeType & 0x0f) == ContentSpecNode::Any) + if ((nodeType & 0x0f) == ContentSpecNode::Any) { return true; } unsigned int baseURI = baseSpecNode->getElement()->getURI(); - if ((nodeType & 0x0f) == ContentSpecNode::Any_NS) + if ((nodeType & 0x0f) == ContentSpecNode::Any_NS) { - if (derivedURI == baseURI) + if (derivedURI == baseURI) { return true; } } - else + else { // must be ANY_OTHER - if (derivedURI != baseURI && derivedURI != getScanner()->getEmptyNamespaceId()) + if (derivedURI != baseURI && derivedURI != getScanner()->getEmptyNamespaceId()) { return true; } @@ -3844,7 +3854,7 @@ const int derivedScope, const ContentSpecNode* const baseSpecNode, const int baseScope, - const ComplexTypeInfo* const baseInfo) + const ComplexTypeInfo* const baseInfo) { if (derivedSpecNode->getMaxOccurs() == 0) @@ -3853,7 +3863,7 @@ unsigned int derivedURI = derivedSpecNode->getElement()->getURI(); // case of mixed complex types with attributes only - if (derivedURI == XMLElementDecl::fgPCDataElemId) + if (derivedURI == XMLElementDecl::fgPCDataElemId) { return; } @@ -3861,12 +3871,12 @@ SchemaGrammar* aGrammar = currentGrammar; const XMLCh* schemaURI = fGrammarResolver->getStringPool()->getValueForId(derivedURI); - if (derivedURI != getScanner()->getEmptyNamespaceId()) + if (derivedURI != getScanner()->getEmptyNamespaceId()) { aGrammar= (SchemaGrammar*) fGrammarResolver->getGrammar(schemaURI); } - if (!aGrammar) + if (!aGrammar) { //something is wrong return; } @@ -3875,29 +3885,29 @@ SchemaElementDecl* derivedElemDecl = findElement(derivedScope, derivedURI, derivedName, aGrammar); - if (!derivedElemDecl) + if (!derivedElemDecl) { return; } - const XMLCh* baseName = baseSpecNode->getElement()->getLocalPart(); - unsigned int baseURI = baseSpecNode->getElement()->getURI(); + const XMLCh* baseName = baseSpecNode->getElement()->getLocalPart(); + unsigned int baseURI = baseSpecNode->getElement()->getURI(); bool subsGroup = false; - if (!XMLString::equals(derivedName, baseName) || derivedURI != baseURI) + if (!XMLString::equals(derivedName, baseName) || derivedURI != baseURI) { // Check if derived is substitutable for base. // SchemaElementDecl* e = derivedElemDecl->getSubstitutionGroupElem (); for (; e != 0; e = e->getSubstitutionGroupElem ()) { - if (XMLString::equals(e->getBaseName (), baseName) && e->getURI () == baseURI) + if (XMLString::equals(e->getBaseName (), baseName) && e->getURI () == baseURI) { break; } } - if (e == 0) + if (e == 0) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NameTypeOK1, fMemoryManager); } @@ -3906,7 +3916,7 @@ } if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), - baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) + baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_OccurRangeE, derivedName, fMemoryManager); } @@ -3914,7 +3924,7 @@ SchemaElementDecl* baseElemDecl = findElement(baseScope, baseURI, baseName, aGrammar, baseInfo); - if (!baseElemDecl) + if (!baseElemDecl) { return; } @@ -3923,7 +3933,7 @@ int baseFlags = baseElemDecl->getMiscFlags(); if (((baseFlags & SchemaSymbols::XSD_NILLABLE) == 0) && - ((derivedFlags & SchemaSymbols::XSD_NILLABLE) != 0)) + ((derivedFlags & SchemaSymbols::XSD_NILLABLE) != 0)) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK2, derivedName, fMemoryManager); } @@ -3933,7 +3943,7 @@ if (baseDefVal && (baseFlags & SchemaSymbols::XSD_FIXED) != 0 && ((derivedFlags & SchemaSymbols::XSD_FIXED) == 0 || - !XMLString::equals(derivedDefVal, baseDefVal))) + !XMLString::equals(derivedDefVal, baseDefVal))) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK3, derivedName, fMemoryManager); } @@ -3941,7 +3951,7 @@ int derivedBlockSet = derivedElemDecl->getBlockSet(); int baseBlockSet = baseElemDecl->getBlockSet(); - if ((derivedBlockSet & baseBlockSet) != baseBlockSet) + if ((derivedBlockSet & baseBlockSet) != baseBlockSet) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK4, derivedName, fMemoryManager); } @@ -3958,13 +3968,13 @@ XercSchemaValidator::findElement(const int scope, const unsigned int uriIndex, const XMLCh* const name, SchemaGrammar* const grammar, - const ComplexTypeInfo* const typeInfo) + const ComplexTypeInfo* const typeInfo) { // check for element at given scope first SchemaElementDecl* elemDecl = (SchemaElementDecl*) grammar->getElemDecl(uriIndex, name, 0, scope); // if not found, check at global scope - if (!elemDecl) + if (!elemDecl) { elemDecl = (SchemaElementDecl*) grammar->getElemDecl(uriIndex, name, 0, Grammar::TOP_LEVEL_SCOPE); @@ -3974,12 +3984,12 @@ const ComplexTypeInfo* baseInfo = typeInfo; - while (baseInfo) + while (baseInfo) { elemDecl = (SchemaElementDecl*) grammar->getElemDecl(uriIndex, name, 0, baseInfo->getScopeDefined()); - if (elemDecl) + if (elemDecl) { break; } @@ -3996,32 +4006,32 @@ XercSchemaValidator::checkICRestriction(const SchemaElementDecl* const derivedElemDecl, const SchemaElementDecl* const baseElemDecl, const XMLCh* const derivedElemName, - const XMLCh* const baseElemName) + const XMLCh* const baseElemName) { // REVIST - need to get more clarification unsigned int derivedICCount = derivedElemDecl->getIdentityConstraintCount(); unsigned int baseICCount = baseElemDecl->getIdentityConstraintCount(); - if (derivedICCount > baseICCount) + if (derivedICCount > baseICCount) { ThrowXMLwithMemMgr2(RuntimeException, XMLExcepts::PD_NameTypeOK6, derivedElemName, baseElemName, fMemoryManager); } - for (unsigned int i=0; i < derivedICCount; i++) + for (unsigned int i=0; i < derivedICCount; i++) { bool found = false; IdentityConstraint* ic= derivedElemDecl->getIdentityConstraintAt(i); - for (unsigned int j=0; j < baseICCount; j++) + for (unsigned int j=0; j < baseICCount; j++) { - if (*ic == *(baseElemDecl->getIdentityConstraintAt(j))) + if (*ic == *(baseElemDecl->getIdentityConstraintAt(j))) { found = true; break; } } - if (!found) + if (!found) { ThrowXMLwithMemMgr2(RuntimeException, XMLExcepts::PD_NameTypeOK7, derivedElemName, baseElemName, fMemoryManager); } @@ -4031,11 +4041,11 @@ void XercSchemaValidator::checkTypesOK(const SchemaElementDecl* const derivedElemDecl, const SchemaElementDecl* const baseElemDecl, - const XMLCh* const derivedElemName) + const XMLCh* const derivedElemName) { SchemaElementDecl::ModelTypes baseType = baseElemDecl->getModelType(); - if (baseType == SchemaElementDecl::Any) + if (baseType == SchemaElementDecl::Any) { return; } @@ -4043,19 +4053,19 @@ ComplexTypeInfo* rInfo = derivedElemDecl->getComplexTypeInfo(); ComplexTypeInfo* bInfo = baseElemDecl->getComplexTypeInfo(); - if (derivedElemDecl->getModelType() == SchemaElementDecl::Simple) + if (derivedElemDecl->getModelType() == SchemaElementDecl::Simple) { - if (baseType != SchemaElementDecl::Simple) + if (baseType != SchemaElementDecl::Simple) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK5, derivedElemName, fMemoryManager); } - if (!rInfo) + if (!rInfo) { DatatypeValidator* bDV = baseElemDecl->getDatatypeValidator(); if (bInfo || bDV == 0 || - !bDV->isSubstitutableBy(derivedElemDecl->getDatatypeValidator())) + !bDV->isSubstitutableBy(derivedElemDecl->getDatatypeValidator())) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK5, derivedElemName, fMemoryManager); } @@ -4067,16 +4077,16 @@ if (rInfo == bInfo) return; - for (; rInfo && rInfo != bInfo; rInfo = rInfo->getBaseComplexTypeInfo()) + for (; rInfo && rInfo != bInfo; rInfo = rInfo->getBaseComplexTypeInfo()) { - if (rInfo->getDerivedBy() != SchemaSymbols::XSD_RESTRICTION) + if (rInfo->getDerivedBy() != SchemaSymbols::XSD_RESTRICTION) { rInfo = 0; break; } } - if (!rInfo) + if (!rInfo) { ThrowXMLwithMemMgr1(RuntimeException, XMLExcepts::PD_NameTypeOK5, derivedElemName, fMemoryManager); } @@ -4089,7 +4099,7 @@ const ContentSpecNode* const baseSpecNode, const int baseScope, ValueVectorOf* const baseNodes, - const ComplexTypeInfo* const baseInfo) + const ComplexTypeInfo* const baseInfo) { ContentSpecNode::NodeTypes baseType = baseSpecNode->getType(); bool toLax = false; @@ -4098,7 +4108,7 @@ ContentSpecNode derivedGroupNode(baseType, derivedSpecNodeIn, 0, false, true, fMemoryManager); const ContentSpecNode* const derivedSpecNode = &derivedGroupNode; - if ((baseSpecNode->getType() & 0x0f) == ContentSpecNode::Choice) + if ((baseSpecNode->getType() & 0x0f) == ContentSpecNode::Choice) { toLax = true; } @@ -4108,7 +4118,7 @@ // baseSpecNode, baseScope, baseNodes, baseInfo, toLax); if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), - baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) + baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_Recurse1, fMemoryManager); } @@ -4121,22 +4131,22 @@ { bool matched = false; - for (unsigned int j = current; j < count2; j++) + for (unsigned int j = current; j < count2; j++) { ContentSpecNode* baseNode = baseNodes->elementAt(j); current++; bool bDoBreak=false; // workaround for Borland bug with 'break' in 'catch' - try + try { checkParticleDerivationOk(currentGrammar, derivedSpecNodeIn, derivedScope, baseNode, baseScope, baseInfo); matched = true; break; } - catch(const XMLException&) + catch(const XMLException&) { - if (!toLax && baseNode->getMinTotalRange()) + if (!toLax && baseNode->getMinTotalRange()) { bDoBreak=true; } @@ -4147,7 +4157,7 @@ } // did not find a match - if (!matched) + if (!matched) { codeToThrow = XMLExcepts::PD_Recurse2; } @@ -4157,11 +4167,11 @@ // in case of Sequence or All if (!toLax && codeToThrow == XMLExcepts::NoError && (true || (baseType & 0x0f) == ContentSpecNode::All || - derivedSpecNodeIn->getElement()->getURI() != XMLElementDecl::fgPCDataElemId)) + derivedSpecNodeIn->getElement()->getURI() != XMLElementDecl::fgPCDataElemId)) { - for (unsigned int j = current; j < count2; j++) + for (unsigned int j = current; j < count2; j++) { - if (baseNodes->elementAt(j)->getMinTotalRange() * baseSpecNode->getMinOccurs()) + if (baseNodes->elementAt(j)->getMinTotalRange() * baseSpecNode->getMinOccurs()) { //!emptiable codeToThrow = XMLExcepts::PD_Recurse2; break; @@ -4169,7 +4179,7 @@ } } - if (codeToThrow != XMLExcepts::NoError) + if (codeToThrow != XMLExcepts::NoError) { ThrowXMLwithMemMgr(RuntimeException, codeToThrow, fMemoryManager); } @@ -4184,10 +4194,10 @@ const int baseScope, ValueVectorOf* const baseNodes, const ComplexTypeInfo* const baseInfo, - const bool toLax) + const bool toLax) { if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), - baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) + baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_Recurse1, fMemoryManager); } @@ -4198,17 +4208,17 @@ unsigned int count2= baseNodes->size(); unsigned int current = 0; - for (unsigned int i=0; ielementAt(j); current++; bool bDoBreak=false; // workaround for Borland bug with 'break' in 'catch' - try + try { checkParticleDerivationOk(currentGrammar, derivedNodes->elementAt(i), @@ -4216,9 +4226,9 @@ matched = true; break; } - catch(const XMLException&) + catch(const XMLException&) { - if (!toLax && baseNode->getMinTotalRange()) + if (!toLax && baseNode->getMinTotalRange()) { bDoBreak=true; } @@ -4229,7 +4239,7 @@ } // did not find a match - if (!matched) + if (!matched) { codeToThrow = XMLExcepts::PD_Recurse2; break; @@ -4238,11 +4248,11 @@ // Now, see if there are some elements in the base we didn't match up // in case of Sequence or All - if (!toLax && codeToThrow == XMLExcepts::NoError) + if (!toLax && codeToThrow == XMLExcepts::NoError) { - for (unsigned int j = current; j < count2; j++) + for (unsigned int j = current; j < count2; j++) { - if (baseNodes->elementAt(j)->getMinTotalRange()) + if (baseNodes->elementAt(j)->getMinTotalRange()) { //!emptiable codeToThrow = XMLExcepts::PD_Recurse2; break; @@ -4250,23 +4260,23 @@ } } - if (codeToThrow != XMLExcepts::NoError) + if (codeToThrow != XMLExcepts::NoError) { ThrowXMLwithMemMgr(RuntimeException, codeToThrow, fMemoryManager); } } void XercSchemaValidator::checkNSSubset(const ContentSpecNode* const derivedSpecNode, - const ContentSpecNode* const baseSpecNode) + const ContentSpecNode* const baseSpecNode) { // check Occurrence ranges if (!isOccurrenceRangeOK(derivedSpecNode->getMinOccurs(), derivedSpecNode->getMaxOccurs(), - baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) + baseSpecNode->getMinOccurs(), baseSpecNode->getMaxOccurs())) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NSSubset1, fMemoryManager); } - if (!isWildCardEltSubset(derivedSpecNode, baseSpecNode)) + if (!isWildCardEltSubset(derivedSpecNode, baseSpecNode)) { ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_NSSubset2, fMemoryManager); } @@ -4392,7 +4402,7 @@ // didn't find a match. if (!matched) { - codeToThrow = XMLExcepts::PD_RecurseUnordered; + codeToThrow = XMLExcepts::PD_RecurseUnordered; break; } } @@ -4402,7 +4412,7 @@ for (unsigned int j=0; j < baseCount; j++) { if (!foundIt[j] && baseNodes->elementAt(j)->getMinTotalRange()) { - codeToThrow = XMLExcepts::PD_RecurseUnordered; + codeToThrow = XMLExcepts::PD_RecurseUnordered; break; } } @@ -4458,7 +4468,7 @@ // didn't find a match. if (!matched) { - ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_MapAndSum, fMemoryManager); + ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::PD_MapAndSum, fMemoryManager); } } diff -Nru zorba-2.7.0-0/src/types/schema/XercesParseUtils.cpp zorba-2.8.0-0/src/types/schema/XercesParseUtils.cpp --- zorba-2.7.0-0/src/types/schema/XercesParseUtils.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/schema/XercesParseUtils.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -67,9 +67,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "boolean" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:boolean")); } } @@ -96,9 +95,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "integer" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:integer")); } } @@ -125,10 +123,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "positiveInteger" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:positiveInteger")); } } @@ -155,10 +151,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "nonPositiveInteger" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:nonPositiveInteger")); } } @@ -185,13 +179,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "negativeInteger" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:negativeInteger")); } } + bool XercesParseUtils::parseXSNonNegativeInteger( const zstring& textValue, store::Item_t &result) @@ -214,13 +207,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "nonNegativeInteger" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:nonNegativeInteger")); } } + bool XercesParseUtils::parseXSUnsignedByte( const zstring& textValue, store::Item_t &result) @@ -243,13 +235,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "unsignedByte" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:unsignedByte")); } } + bool XercesParseUtils::parseXSUnsignedShort( const zstring& textValue, store::Item_t &result) @@ -272,12 +263,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "unsignedShort" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:unsignedShort")); } } + bool XercesParseUtils::parseXSUnsignedInt( const zstring& textValue, store::Item_t &result) @@ -300,14 +291,15 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "unsignedInt" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:unsignedInt")); } } + bool XercesParseUtils::parseXSUnsignedLong( - const zstring& textValue, store::Item_t &result) + const zstring& textValue, + store::Item_t &result) { XMLCh* content = XMLString::transcode(textValue.c_str()); XSValue::DataType datatype = XSValue::dt_unsignedLong; @@ -327,13 +319,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "unsignedLong" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:unsignedLong")); } } + bool XercesParseUtils::parseXSByte( const zstring& textValue, store::Item_t &result) @@ -356,12 +347,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "byte" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:byte")); } } + bool XercesParseUtils::parseXSShort( const zstring& textValue, store::Item_t &result) @@ -384,12 +375,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "short" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:short")); } } + bool XercesParseUtils::parseXSInt( const zstring& textValue, store::Item_t &result) @@ -412,12 +403,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "int" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:int")); } } + bool XercesParseUtils::parseXSLong( const zstring& textValue, store::Item_t &result) @@ -440,12 +431,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "long" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:long")); } } + bool XercesParseUtils::parseXSFloat( const zstring& textValue, store::Item_t &result) @@ -470,7 +461,8 @@ //textValue = textValue.trim(" \n\r\t",4); zstring textValue2; utf8::normalize_whitespace(textValue, &textValue2); - try { + try + { xs_float const n(textValue2.c_str()); return GENV_ITEMFACTORY->createFloat(result, n); } @@ -479,11 +471,11 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "float" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:float")); } + bool XercesParseUtils::parseXSDouble( const zstring& textValue, store::Item_t &result) @@ -517,11 +509,11 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "double" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:double")); } + bool XercesParseUtils::parseXSDecimal( const zstring& textValue, store::Item_t &result) @@ -542,12 +534,12 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "decimal" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:decimal")); } } + // string types bool XercesParseUtils::parseXSString( const zstring& textValue, @@ -560,6 +552,7 @@ return factory->createString(result, textValue2); } + bool XercesParseUtils::parseXSNormalizedString( const zstring& textValue, store::Item_t &result) @@ -600,9 +593,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "NMToken" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:NMToken")); } } @@ -629,9 +621,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "NMToken" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:NMToken")); } } @@ -659,9 +650,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "Name" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:Name")); } } @@ -688,9 +678,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "NCName" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:NCName")); } } @@ -717,9 +706,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "ID" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:ID")); } } @@ -746,9 +734,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "IDREF" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:IDREF")); } } @@ -775,9 +762,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "ENTITY" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:ENTITY")); } } @@ -804,9 +790,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "NOTATION" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:NOTATION")); } } @@ -855,9 +840,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "dateTime" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:dateTime")); } @@ -896,9 +880,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "date" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:date")); } @@ -942,9 +925,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "time" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:time")); } @@ -978,9 +960,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "gYearMonth" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:gYearMonth")); } @@ -1013,9 +994,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "gYear" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:gYear")); } @@ -1048,9 +1028,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "gMonthDay" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:gMonthDay")); } @@ -1082,9 +1061,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "gDay" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:gDay")); } @@ -1116,9 +1094,8 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "gDay" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:gDay")); } @@ -1154,9 +1131,8 @@ return factory->createDuration(result, &tValue); } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "duration" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:duration")); } @@ -1172,10 +1148,8 @@ return factory->createYearMonthDuration(result, &d); } - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "yearMonthDuration" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:yearMonthDuration")); } @@ -1191,10 +1165,8 @@ return factory->createDayTimeDuration(result, &d); } - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "dayTimeDuration" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:dayTimeDuration")); } @@ -1241,10 +1213,8 @@ return factory->createBase64Binary(result, tValue); } - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "base64Binary" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:base64Binary")); } @@ -1269,9 +1239,8 @@ return factory->createHexBinary(result, tValue); } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "hexBinary" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:hexBinary")); } @@ -1296,9 +1265,8 @@ return factory->createAnyURI(result, textValue2); } - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), "anyURI" ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, "xs:anyURI")); } diff -Nru zorba-2.7.0-0/src/types/schema/revalidateUtils.cpp zorba-2.8.0-0/src/types/schema/revalidateUtils.cpp --- zorba-2.7.0-0/src/types/schema/revalidateUtils.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/schema/revalidateUtils.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -497,7 +497,8 @@ { xqtref_t type = typeManager->create_named_atomic_type(typeQName, TypeConstants::QUANT_ONE, - loc); + loc, + false); //cout << " vup - processTextValue: '" << textValue->c_str() << "'\n"; //cout << " vup - processTextValue: " << typeQName->getPrefix()->str() // << ":" << typeQName->getLocalName()->str() << "@" @@ -539,12 +540,12 @@ // else isAtomic } - bool isResult = GenericCast::castToAtomic(result, - textValue, - type.getp(), - typeManager, - &nsCtx, - loc); + bool isResult = GenericCast::castStringToAtomic(result, + textValue, + type.getp(), + typeManager, + &nsCtx, + loc); if ( isResult ) resultList.push_back(result); } diff -Nru zorba-2.7.0-0/src/types/schema/schema.cpp zorba-2.8.0-0/src/types/schema/schema.cpp --- zorba-2.7.0-0/src/types/schema/schema.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/schema/schema.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -23,7 +23,9 @@ #include "context/uri_resolver.h" #include "zorbamisc/ns_consts.h" + #include "diagnostics/assert.h" +#include "diagnostics/util_macros.h" #include "types/typeimpl.h" #include "types/root_typemanager.h" @@ -353,7 +355,8 @@ *******************************************************************************/ Schema::Schema(TypeManager* tm) : - theTypeManager(tm) + theTypeManager(tm), + theHasXSD(false) { #ifndef ZORBA_NO_XMLSCHEMA theGrammarPool = new XMLGrammarPoolImpl(XMLPlatformUtils::fgMemoryManager); @@ -364,11 +367,15 @@ } +/******************************************************************************* + +*******************************************************************************/ Schema::Schema(::zorba::serialization::Archiver& ar) { #ifndef ZORBA_NO_XMLSCHEMA initialize(); theGrammarPool = new XMLGrammarPoolImpl(XMLPlatformUtils::fgMemoryManager); + theHasXSD = false; #endif } @@ -403,10 +410,11 @@ /******************************************************************************* Registers an imported schema into the curent grammar *******************************************************************************/ -void Schema::registerXSD(const char* xsdURL, - static_context * aSctx, - internal::StreamResource* stream, - const QueryLoc& loc) +void Schema::registerXSD( + const char* xsdURL, + static_context * aSctx, + internal::StreamResource* stream, + const QueryLoc& loc) { std::auto_ptr parser; @@ -460,6 +468,8 @@ { handler.resetErrors(); } + + theHasXSD = true; } catch (const OutOfMemoryException&) { @@ -503,11 +513,8 @@ if (!typeDef) { - throw XQUERY_EXCEPTION( - err::XPST0008, - ERROR_PARAMS( qname->getStringValue(), ZED( SchemaElementName ) ), - ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); } const XMLCh* typeNameStr = typeDef->getName(); @@ -532,11 +539,8 @@ if (!typeDef) { - throw XQUERY_EXCEPTION( - err::XPST0008, - ERROR_PARAMS( qname->getStringValue(), ZED( SchemaAttributeName ) ), - ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), qname->getStringValue())); } const XMLCh* typeNameStr = typeDef->getName(); @@ -569,11 +573,8 @@ if (!typeDef) { - throw XQUERY_EXCEPTION( - err::XPST0008, - ERROR_PARAMS( qname->getStringValue(), ZED( SchemaElementName ) ), - ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), qname->getStringValue())); } xqtref_t res = createXQTypeFromTypeDefinition(typeManager, typeDef); @@ -601,11 +602,8 @@ if (!typeDef) { - throw XQUERY_EXCEPTION( - err::XPST0008, - ERROR_PARAMS( qname->getStringValue(), ZED( SchemaAttributeName ) ), - ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), qname->getStringValue())); } return createXQTypeFromTypeDefinition(typeManager, typeDef); @@ -802,7 +800,7 @@ Creates a zorba schema type for a schema type definition *******************************************************************************/ xqtref_t Schema::createXQTypeFromTypeDefinition( - const TypeManager* typeManager, + const TypeManager* tm, XSTypeDefinition* xsTypeDef) { if (!xsTypeDef) @@ -820,65 +818,65 @@ zstring strUri; transcode(uri, strUri); - if ( XMLString::equals(strUri.c_str(), Schema::XSD_NAMESPACE) ) + if (XMLString::equals(strUri.c_str(), Schema::XSD_NAMESPACE)) { const XMLCh* local = xsTypeDef->getName(); - result = createXQTypeFromTypeDefForBuiltinTypes(typeManager, strUri, - local); + result = createXQTypeFromTypeDefForBuiltinTypes(tm, strUri, local); } else { // must be a user defined simple type - XSSimpleTypeDefinition * xsSimpleTypeDef = - (XSSimpleTypeDefinition *)xsTypeDef; + XSSimpleTypeDefinition* xsSimpleTypeDef = + (XSSimpleTypeDefinition*)xsTypeDef; zstring lLocal; transcode(xsTypeDef->getName(), lLocal); store::Item_t qname; GENV_ITEMFACTORY->createQName(qname, strUri, zstring(), lLocal); - TRACE("createXQType " << qname->getStringValue() ); + TRACE("createXQType " << qname->getStringValue()); - switch ( xsSimpleTypeDef->getVariety() ) + switch (xsSimpleTypeDef->getVariety()) { case XSSimpleTypeDefinition::VARIETY_ATOMIC: { XSTypeDefinition* baseTypeDef = xsTypeDef->getBaseType(); - if ( !baseTypeDef ) + if (!baseTypeDef) { - //error allway must have a baseType + // allways must have a baseType ZORBA_ASSERT(false); result = NULL; } - xqtref_t baseXQType = createXQTypeFromTypeDefinition(typeManager, - baseTypeDef); + xqtref_t baseXQType = createXQTypeFromTypeDefinition(tm, baseTypeDef); + + xqtref_t xqType = new UserDefinedXQType(tm, + qname, + baseXQType, + TypeConstants::QUANT_ONE, + UserDefinedXQType::ATOMIC_TYPE, + XQType::SIMPLE_CONTENT_KIND); - xqtref_t xqType = xqtref_t(new UserDefinedXQType(typeManager, - qname, - baseXQType, - TypeConstants::QUANT_ONE, - UserDefinedXQType::ATOMIC_TYPE, - XQType::SIMPLE_CONTENT_KIND)); - TRACE("created atomic " << qname->getStringValue() << " base:" << baseXQType->toString()); + TRACE("created atomic " << qname->getStringValue() + << " base:" << baseXQType->toString()); result = xqType; } break; case XSSimpleTypeDefinition::VARIETY_LIST: { - XSSimpleTypeDefinition * itemTypeDef = xsSimpleTypeDef->getItemType(); - if ( !itemTypeDef ) + XSSimpleTypeDefinition* itemTypeDef = xsSimpleTypeDef->getItemType(); + if (!itemTypeDef) { //error since VARIETY is LIST must have an itemType ZORBA_ASSERT(false); result = NULL; } - xqtref_t itemXQType = createXQTypeFromTypeDefinition(typeManager, - itemTypeDef); - if ( itemXQType->type_kind() == XQType::USER_DEFINED_KIND ) + xqtref_t itemXQType = createXQTypeFromTypeDefinition(tm, itemTypeDef); + + if (itemXQType->type_kind() == XQType::USER_DEFINED_KIND) { // if UDT add it to the cache, otherwise it will get lost addTypeToCache(itemXQType); } @@ -888,12 +886,10 @@ // qname->getNamespace()->c_str() << " of " << itemXQType->toString() // << endl; cout.flush(); - xqtref_t xqType = xqtref_t( - new UserDefinedXQType(typeManager, - qname, - NULL /*GENV_TYPESYSTEM.ANY_SIMPLE_TYPE*/, - TypeConstants::QUANT_ONE, - itemXQType.getp())); + xqtref_t xqType = new UserDefinedXQType(tm, + qname, + NULL, + itemXQType.getp()); //cout << " created UDT Simple List Type: " << xqType->toString() << // endl; cout.flush(); @@ -905,43 +901,51 @@ case XSSimpleTypeDefinition::VARIETY_UNION: { - XSSimpleTypeDefinitionList * memberTypesDefList = - xsSimpleTypeDef->getMemberTypes(); + XSSimpleTypeDefinitionList* memberTypesDefList = + xsSimpleTypeDef->getMemberTypes(); - if ( !memberTypesDefList ) + if (!memberTypesDefList) { //error since VARIETY is UNION must have a memberTypesDefList ZORBA_ASSERT(false); result = NULL; } + xqtref_t baseXQType; + XSTypeDefinition* baseTypeDef = xsTypeDef->getBaseType(); + if (!baseTypeDef) + { + baseXQType = createXQTypeFromTypeDefinition(tm, baseTypeDef); + } + //cout << " creating UDT Simple Union Type: " << // qname->getLocalName()->c_str() << "@" << // qname->getNamespace()->c_str() << " of: "; std::vector unionItemTypes; - for ( unsigned int i = 0; i < memberTypesDefList->size(); i++) + for (csize i = 0; i < memberTypesDefList->size(); ++i) { XSSimpleTypeDefinition* itemTypeDef = - memberTypesDefList->elementAt(i); - xqtref_t itemXQType = createXQTypeFromTypeDefinition(typeManager, - itemTypeDef); + memberTypesDefList->elementAt(i); + + xqtref_t itemXQType = createXQTypeFromTypeDefinition(tm, itemTypeDef); + unionItemTypes.push_back(itemXQType); //cout << " " << itemXQType->toString(); - if ( itemXQType->type_kind() == XQType::USER_DEFINED_KIND ) - { // if UDT add it to the cache, otherwise it will get lost + if (itemXQType->type_kind() == XQType::USER_DEFINED_KIND) + { + // if UDT add it to the cache, otherwise it will get lost addTypeToCache(itemXQType); } } //cout << endl; cout.flush(); - xqtref_t xqType = xqtref_t( - new UserDefinedXQType(typeManager, - qname, - NULL /*GENV_TYPESYSTEM.ANY_SIMPLE_TYPE*/, - TypeConstants::QUANT_ONE, - unionItemTypes)); + xqtref_t xqType = new UserDefinedXQType(tm, + qname, + baseXQType, + TypeConstants::QUANT_ONE, + unionItemTypes); //cout << " created UDT Union Type: " << xqType->toString() << endl; // cout.flush(); @@ -960,21 +964,20 @@ ZORBA_ASSERT(false); } - checkForAnonymousTypesInType(typeManager, xsTypeDef); - + checkForAnonymousTypesInType(tm, xsTypeDef); } // end user defined simple types - } // end simple types + } // end simple types else { // is not a simple type has to be complex - ZORBA_ASSERT( xsTypeDef->getTypeCategory()==XSTypeDefinition::COMPLEX_TYPE); + ZORBA_ASSERT(xsTypeDef->getTypeCategory()==XSTypeDefinition::COMPLEX_TYPE); // first check if it is a built-in type const XMLCh* uri = xsTypeDef->getNamespace(); zstring strUri; transcode(uri, strUri); - if ( XMLString::equals(strUri.c_str(), Schema::XSD_NAMESPACE) ) + if (XMLString::equals(strUri.c_str(), Schema::XSD_NAMESPACE)) { const XMLCh* local = xsTypeDef->getName(); // maybe there is a better way than comparing strings @@ -1004,8 +1007,7 @@ result = NULL; } - xqtref_t baseXQType = createXQTypeFromTypeDefinition(typeManager, - baseTypeDef); + xqtref_t baseXQType = createXQTypeFromTypeDefinition(tm, baseTypeDef); zstring lLocal; transcode(xsTypeDef->getName(), lLocal); @@ -1040,13 +1042,12 @@ ZORBA_ASSERT(false); } - xqtref_t xqType = - xqtref_t(new UserDefinedXQType(typeManager, - qname, - baseXQType, - TypeConstants::QUANT_ONE, - UserDefinedXQType::COMPLEX_TYPE, - contentType)); + xqtref_t xqType = new UserDefinedXQType(tm, + qname, + baseXQType, + TypeConstants::QUANT_ONE, + UserDefinedXQType::COMPLEX_TYPE, + contentType); result = xqType; @@ -1054,7 +1055,7 @@ //check if it contains anonymous types (they are not available through // xsModel API) add them to the cache - checkForAnonymousTypesInType(typeManager, xsTypeDef); + checkForAnonymousTypesInType(tm, xsTypeDef); } } @@ -1063,7 +1064,8 @@ xqtref_t Schema::createXQTypeFromTypeDefForBuiltinTypes( - const TypeManager* typeManager, zstring& strUri, + const TypeManager* typeManager, + zstring& strUri, const XMLCh* local) { xqtref_t result; @@ -1227,17 +1229,7 @@ } else if ( XMLString::equals(XMLChArray("NMTOKENS").get (), local) ) { - store::Item_t qname; - GENV_ITEMFACTORY->createQName(qname, - XML_SCHEMA_NS, - "XS", - "NMTOKENS"); - - result = new UserDefinedXQType(typeManager, - qname, - NULL, - TypeConstants::QUANT_ONE, - GENV_TYPESYSTEM.NMTOKEN_TYPE_ONE.getp()); + result = GENV_TYPESYSTEM.XS_NMTOKENS_TYPE; } else if ( XMLString::equals(XMLChArray("IDREF").get (), local) ) { @@ -1245,35 +1237,15 @@ } else if ( XMLString::equals(XMLChArray("IDREFS").get (), local) ) { - store::Item_t qname; - GENV_ITEMFACTORY->createQName(qname, - XML_SCHEMA_NS, - "XS", - "IDREFS"); - - result = new UserDefinedXQType(typeManager, - qname, - NULL, - TypeConstants::QUANT_ONE, - GENV_TYPESYSTEM.IDREF_TYPE_ONE.getp()); + result = GENV_TYPESYSTEM.XS_IDREFS_TYPE; } else if ( XMLString::equals(XMLChArray("ENTITY").get (), local) ) { - store::Item_t qname; - GENV_ITEMFACTORY->createQName(qname, - XML_SCHEMA_NS, - "XS", - "ENTITIES"); - - result = new UserDefinedXQType(typeManager, - qname, - NULL, - TypeConstants::QUANT_ONE, - GENV_TYPESYSTEM.ENTITY_TYPE_ONE.getp()); + result = GENV_TYPESYSTEM.ENTITY_TYPE_ONE; } else if ( XMLString::equals(XMLChArray("ENTITIES").get (), local) ) { - result = GENV_TYPESYSTEM.ENTITY_TYPE_PLUS; + result = GENV_TYPESYSTEM.XS_ENTITIES_TYPE; } else if ( XMLString::equals(XMLChArray("NOTATION").get (), local) ) { @@ -1531,6 +1503,9 @@ } +/******************************************************************************* + +*******************************************************************************/ void Schema::addTypeToCache(xqtref_t itemXQType) { ZORBA_ASSERT( itemXQType->type_kind() == XQType::USER_DEFINED_KIND ); @@ -1549,7 +1524,9 @@ key += ":"; key += ns; key += " "; - key += TypeOps::decode_quantifier(itemXQType->get_quantifier()); + + if (!itemUDType->isList()) + key += TypeOps::decode_quantifier(itemXQType->get_quantifier()); xqtref_t res; if( !theUdTypesCache->get(key, res) ) @@ -1572,30 +1549,25 @@ std::vector& resultList, const QueryLoc& loc) { - //cout << "parseUserSimpleTypes: '" << textValue << "' to " << - // aTargetType->toString() << endl; cout.flush(); - - if ( aTargetType->type_kind() != XQType::USER_DEFINED_KIND ) + if (aTargetType->type_kind() != XQType::USER_DEFINED_KIND) { // must be a built in type store::Item_t atomicResult; //todo add nsCtx - bool res = GenericCast::instance()->castToAtomic(atomicResult, - textValue, - aTargetType, - theTypeManager, - NULL, - loc); + bool res = GenericCast::castStringToAtomic(atomicResult, + textValue, + aTargetType, + theTypeManager, + NULL, + loc); - if ( res == false ) + if (res == false) { return false; } else { - // use resultList.resize() and resultList[x].transfer(atomicResult) - //resultList.push_back(atomicResult); - std::size_t s = resultList.size(); + csize s = resultList.size(); resultList.resize(s+1); resultList[s].transfer(atomicResult); @@ -1654,18 +1626,18 @@ ********************************************************************************/ bool Schema::parseUserAtomicTypes( zstring& textValue, - const xqtref_t& aTargetType, + const xqtref_t& targetType, store::Item_t& result, - namespace_context* aNCtx, + const namespace_context* nsCtx, const QueryLoc& loc) { - TRACE("parsing '" << textValue << "' to " << aTargetType->toString()); + TRACE("parsing '" << textValue << "' to " << targetType->toString()); - ZORBA_ASSERT( aTargetType->type_kind() == XQType::USER_DEFINED_KIND ); + ZORBA_ASSERT(targetType->type_kind() == XQType::USER_DEFINED_KIND); const UserDefinedXQType* udXQType = - static_cast(aTargetType.getp()); - ZORBA_ASSERT( udXQType->isAtomic() ); + static_cast(targetType.getp()); + ZORBA_ASSERT(udXQType->isAtomic()); const store::Item* typeQName = udXQType->get_qname(); @@ -1673,13 +1645,11 @@ XMLChArray localPart (typeQName->getLocalName()); XMLChArray uriStr (typeQName->getNamespace()); - bool wasError = false; - try { // Create grammar resolver and string pool that we pass to the scanner std::auto_ptr fGrammarResolver( - new GrammarResolver(theGrammarPool)); + new GrammarResolver(theGrammarPool)); fGrammarResolver->useCachedGrammarInParse(true); @@ -1689,7 +1659,7 @@ if (sGrammar) { DatatypeValidator* xsiTypeDV = fGrammarResolver-> - getDatatypeValidator(uriStr, localPart); + getDatatypeValidator(uriStr, localPart); if (!xsiTypeDV) { @@ -1707,13 +1677,12 @@ XMLChArray baseUriStr(baseTypeQName->getNamespace()); xsiTypeDV = fGrammarResolver-> - getDatatypeValidator(baseUriStr, baseLocalPart); + getDatatypeValidator(baseUriStr, baseLocalPart); tmpXQType = NULL; if (baseXQType->type_kind() == XQType::USER_DEFINED_KIND) { - tmpXQType = - static_cast(baseXQType.getp()); + tmpXQType = static_cast(baseXQType.getp()); } } } @@ -1721,9 +1690,8 @@ if (!xsiTypeDV) { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( aTargetType, ZED( NoTypeInCtx ) ) - ); + RAISE_ERROR(err::FORG0001, loc, + ERROR_PARAMS(ZED(FORG0001_NoTypeInCtx_2), targetType->toSchemaString())); } // workaround for validating xs:NOTATION with Xerces @@ -1737,14 +1705,16 @@ zstring local = textValue.substr(colonIndex+1, textValue.size()).str(); zstring uri; - if (aNCtx != NULL && aNCtx->findBinding(prefix, uri)) + if (nsCtx != NULL && nsCtx->findBinding(prefix, uri)) { XMLChArray xchTextValue(uri.append(":").append(local).str()); xsiTypeDV->validate(xchTextValue.get()); } else - ZORBA_ERROR_DESC_OSS(err::FORG0001, "Prefix '" << prefix << - "' not found in current namespace context."); + { + RAISE_ERROR(err::FORG0001, loc, + ERROR_PARAMS(ZED(FORG0001_PrefixNotBound_2), prefix)); + } } else { @@ -1754,24 +1724,20 @@ } else { - ZORBA_ERROR_DESC_OSS(err::FORG0001, - "Uri '" << typeQName->getNamespace() - << "' not found in current schema context."); - wasError = true; + RAISE_ERROR(err::FORG0001, loc, + ERROR_PARAMS(ZED(FORG0001_NoTypeInCtx_2), targetType->toSchemaString())); } - - if (wasError) - return false; } catch (XMLException& idve) { zstring msg; transcode(idve.getMessage(), msg); - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), aTargetType, msg ) - ); + RAISE_ERROR(err::FORG0001, loc, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), + textValue, + targetType->toSchemaString(), + msg)); } catch(const OutOfMemoryException&) { @@ -1788,37 +1754,36 @@ #endif //ZORBA_NO_XMLSCHEMA // find the non user defined base type - const XQType* baseType = udXQType->getBaseType().getp(); - - while (baseType->type_kind() == XQType::USER_DEFINED_KIND) - { - const UserDefinedXQType* udt = - static_cast(baseType); - - baseType = udt->getBaseType().getp(); - } + const XQType* baseType = udXQType->getBaseBuiltinType().getp(); // create a UserTypedAtomicItem with the built-in value store::Item_t baseItem; - if (GenericCast::castToAtomic(baseItem, - textValue, - baseType, - theTypeManager, - aNCtx, - loc)) + if (GenericCast::castStringToAtomic(baseItem, + textValue, + baseType, + theTypeManager, + nsCtx, + loc)) { store::Item_t tTypeQName = udXQType->get_qname(); - //TRACE("factory '" << baseItem->getStringValue() << "' type " << tTypeQName->getStringValue() << " base:" << baseType->toString()); + //TRACE("factory '" << baseItem->getStringValue() << "' type " + // << tTypeQName->getStringValue() << " base:" << baseType->toString()); + return GENV_ITEMFACTORY-> - createUserTypedAtomicItem(result, baseItem, tTypeQName); + createUserTypedAtomicItem(result, baseItem, tTypeQName); } else + { return false; + } } +/******************************************************************************* + +*******************************************************************************/ void splitToAtomicTextValues( const zstring& textValue, std::vector& atomicTextValues) @@ -1844,38 +1809,40 @@ } - -// user list types +/******************************************************************************* + user list types +*******************************************************************************/ bool Schema::parseUserListTypes( const zstring& textValue, - const xqtref_t& aTargetType, + const xqtref_t& targetType, std::vector& resultList, const QueryLoc& loc) { - ZORBA_ASSERT( aTargetType->type_kind() == XQType::USER_DEFINED_KIND ); + assert(targetType->type_kind() == XQType::USER_DEFINED_KIND); -// cout << "parseUserListTypes: '" << textValue << "' to " << -// aTargetType->toString() << endl; cout.flush(); - - const UserDefinedXQType* udXQType = - static_cast(aTargetType.getp()); - ZORBA_ASSERT( udXQType->isList() ); + const UserDefinedXQType* udt = + static_cast(targetType.getp()); + assert(udt->isList()); bool hasResult = true; - const XQType* listItemType = udXQType->getListItemType(); - ZORBA_ASSERT( listItemType ); + const XQType* listItemType = udt->getListItemType(); + ZORBA_ASSERT(listItemType); - //split text into atoms std::vector atomicTextValues; splitToAtomicTextValues(textValue, atomicTextValues); - for ( unsigned int i = 0; i < atomicTextValues.size() ; i++) + if (atomicTextValues.empty()) { - TRACE("trying parsing '" << textValue << "' to " << - listItemType->toString()); + RAISE_ERROR(err::FORG0001, loc, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, udt->toSchemaString())); + } + + for (csize i = 0; i < atomicTextValues.size() ; ++i) + { + TRACE("trying parsing '" << textValue << "' to " << listItemType->toString()); bool res = parseUserSimpleTypes(atomicTextValues[i], - xqtref_t(listItemType), + listItemType, resultList, loc); hasResult = hasResult && res; @@ -1884,25 +1851,25 @@ return hasResult; } -// user union types + +/******************************************************************************* + user union types +*******************************************************************************/ bool Schema::parseUserUnionTypes( zstring& textValue, - const xqtref_t& aTargetType, + const xqtref_t& targetType, std::vector& resultList, const QueryLoc& loc) { -// cout << "parseUserUnionTypes: '" << textValue << "'" << " to " << -// aTargetType->toString() << endl; cout.flush(); + assert(targetType->type_kind() == XQType::USER_DEFINED_KIND); - ZORBA_ASSERT( aTargetType->type_kind() == XQType::USER_DEFINED_KIND ); + const UserDefinedXQType* udt = + static_cast(targetType.getp()); + ZORBA_ASSERT(udt->isUnion()); - const UserDefinedXQType* udXQType = - static_cast(aTargetType.getp()); - ZORBA_ASSERT( udXQType->isUnion() ); + std::vector unionItemTypes = udt->getUnionItemTypes(); - std::vector unionItemTypes = udXQType->getUnionItemTypes(); - - for ( unsigned int i = 0; i < unionItemTypes.size(); i++) + for (csize i = 0; i < unionItemTypes.size(); ++i) { try { @@ -1916,21 +1883,18 @@ } } - throw XQUERY_EXCEPTION( - err::FORG0001, - ERROR_PARAMS( textValue, ZED( NoCastTo_34o ), udXQType->toSchemaString() ) - ); + RAISE_ERROR(err::FORG0001, loc, + ERROR_PARAMS(ZED(FORG0001_NoCastTo_234o), textValue, udt->toSchemaString())); } -// user defined simple types, i.e. Atomic, List or Union Types +/******************************************************************************* + user defined simple types, i.e. Atomic, List or Union Types +*******************************************************************************/ bool Schema::isCastableUserSimpleTypes( const zstring& textValue, const xqtref_t& aTargetType) { - //cout << "isCastableUserSimpleTypes: '" << textValue << "' to " << - // aTargetType->toString() << endl; cout.flush(); - if ( aTargetType->type_kind() != XQType::USER_DEFINED_KIND ) { // must be a built in type @@ -1945,8 +1909,7 @@ const UserDefinedXQType* udXQType = static_cast(aTargetType.getp()); - ZORBA_ASSERT( udXQType->isAtomic() || udXQType->isList() || - udXQType->isUnion() ); + ZORBA_ASSERT(udXQType->isAtomic() || udXQType->isList() || udXQType->isUnion()); switch ( udXQType->getTypeCategory() ) @@ -1973,41 +1936,45 @@ } -// user defined atomic types +/******************************************************************************* + user defined atomic types +*******************************************************************************/ bool Schema::isCastableUserAtomicTypes( const zstring& textValue, - const xqtref_t& aTargetType) + const xqtref_t& targetType) { - //cout << "isCastableUserAtomicTypes: '" << textValue << "' to " << - // aTargetType->toString() << endl; cout.flush(); - return GenericCast::instance()->isCastable(textValue, aTargetType.getp(), theTypeManager); + return GenericCast::isCastable(textValue, targetType.getp(), theTypeManager); } -// user defined list types +/******************************************************************************* + user defined list types +*******************************************************************************/ bool Schema::isCastableUserListTypes( const zstring& textValue, - const xqtref_t& aTargetType) + const xqtref_t& targetType) { - //cout << "isCastableUserListTypes: '" << textValue << "' to " << - // aTargetType->toString() << endl; cout.flush(); - ZORBA_ASSERT( aTargetType->type_kind() == XQType::USER_DEFINED_KIND ); + assert(targetType->type_kind() == XQType::USER_DEFINED_KIND); - const UserDefinedXQType* udXQType = - static_cast(aTargetType.getp()); - ZORBA_ASSERT( udXQType->isList() ); + const UserDefinedXQType* udt = + static_cast(targetType.getp()); + assert(udt->isList()); bool hasResult = true; - const XQType* listItemType = udXQType->getListItemType(); + const XQType* listItemType = udt->getListItemType(); //split text into atoms std::vector atomicTextValues; splitToAtomicTextValues(textValue, atomicTextValues); - for ( unsigned int i = 0; i(typeManager); + TypeManagerImpl* typeManagerImpl = static_cast(typeManager); typeManagerImpl->initializeSchema(); schema = typeManager->getSchema(); } } + else if (validationMode == ParseConstants::val_dtd_lax && !schema->hasXSD()) + { + // when dtd validation enabled avoid using schema object + result = sourceNode; + return true; + } #ifndef ZORBA_NO_XMLSCHEMA @@ -816,13 +822,16 @@ xqtref_t baseType = udt.getBaseType(); while ( baseType->type_kind() == XQType::USER_DEFINED_KIND && - static_cast(*baseType).isComplex() ) + static_cast(*baseType).isComplex() ) { - const UserDefinedXQType udBaseType = static_cast(*baseType); + const UserDefinedXQType udBaseType = + static_cast(*baseType); + baseType = udBaseType.getBaseType(); } - bool res = GenericCast::castToSimple(textValue, baseType.getp(), - resultList, typeManager, loc); + + bool res = typeManager->getSchema()-> + parseUserSimpleTypes(textValue, baseType, resultList, loc); // if this assert fails it means the validator and zorba casting code // don't follow the same rules @@ -840,15 +849,17 @@ { try { - bool res = GenericCast::castToAtomic(result, textValue, type.getp(), - typeManager, &nsCtx, loc); + bool res = GenericCast::castStringToAtomic(result, textValue, type.getp(), + typeManager, &nsCtx, loc); ZORBA_ASSERT(res); resultList.push_back(result); } catch(ZorbaException const& /*err*/) { - // do nothing here, the validator will throw the right error at end elemet event call - //std::cout << "validate.cpp: processTextValue2 '" << textValue << "' err:" << err.toString() << std::endl; std::cout.flush(); + // do nothing here, the validator will throw the right error at end + // elemet event call + //std::cout << "validate.cpp: processTextValue2 '" << textValue + // << "' err:" << err.toString() << std::endl; std::cout.flush(); } } else diff -Nru zorba-2.7.0-0/src/types/typeimpl.cpp zorba-2.8.0-0/src/types/typeimpl.cpp --- zorba-2.7.0-0/src/types/typeimpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/typeimpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -106,7 +106,7 @@ "xs:ID", "xs:IDREF", "xs:ENTITY", - "UNTYPED_ATOMIC", + "xs:untypedAtomic", "xs:dateTime", "xs:date", "xs:time", @@ -240,6 +240,66 @@ /******************************************************************************* + Returns true if the ItemType of the given sequence type is an atomic type. +********************************************************************************/ +bool XQType::isAtomicAny() const +{ + if (type_kind() == XQType::ATOMIC_TYPE_KIND) + { + return true; + } + else if (type_kind() == XQType::USER_DEFINED_KIND) + { + return static_cast(this)->isAtomic(); + } + + return false; +} + + +/******************************************************************************* + Returns true if the quantifier of the given sequence type is QUANT_ONE and + its ItemType is an atomic type. +********************************************************************************/ +bool XQType::isAtomicOne() const +{ + if (get_quantifier() == TypeConstants::QUANT_ONE) + { + if (type_kind() == XQType::ATOMIC_TYPE_KIND) + { + return true; + } + else if (type_kind() == XQType::USER_DEFINED_KIND) + { + return static_cast(this)->isAtomic(); + } + } + + return false; +} + + +/******************************************************************************* + +********************************************************************************/ +bool XQType::isBuiltinAtomicAny() const +{ + return type_kind() == XQType::ATOMIC_TYPE_KIND; +} + + +/******************************************************************************* + Returns true if the quantifier of the given sequence type is QUANT_ONE and + its ItemType is a builtin atomic type. +********************************************************************************/ +bool XQType::isBuiltinAtomicOne() const +{ + return get_quantifier() == TypeConstants::QUANT_ONE && + type_kind() == XQType::ATOMIC_TYPE_KIND; +} + + +/******************************************************************************* ********************************************************************************/ std::string XQType::toString() const @@ -270,6 +330,11 @@ switch (type_kind()) { + case NONE_KIND: + { + result = "none"; + break; + } case EMPTY_KIND: { result = "empty-sequence()"; @@ -283,11 +348,13 @@ case ITEM_KIND: { result = "item()"; + result += TypeOps::decode_quantifier(get_quantifier()); break; } case STRUCTURED_ITEM_KIND: { result = "structured-item()"; + result += TypeOps::decode_quantifier(get_quantifier()); break; } @@ -311,6 +378,7 @@ result = "array()"; } + result += TypeOps::decode_quantifier(get_quantifier()); break; } #endif @@ -318,11 +386,19 @@ case NODE_TYPE_KIND: { result = static_cast(this)->toSchemaStringInternal(); + result += TypeOps::decode_quantifier(get_quantifier()); break; } case FUNCTION_TYPE_KIND: { result = toString(); + result += TypeOps::decode_quantifier(get_quantifier()); + break; + } + case ANY_FUNCTION_TYPE_KIND: + { + result = "function(*)"; + result += TypeOps::decode_quantifier(get_quantifier()); break; } case ANY_TYPE_KIND: @@ -335,22 +411,19 @@ result = "xs:anySimpleType"; break; } - case ANY_FUNCTION_TYPE_KIND: + case UNTYPED_KIND: { - result = "function(*)"; + result = "xs:untyped"; break; } - case UNTYPED_KIND: + default: { result = toString(); + result += TypeOps::decode_quantifier(get_quantifier()); break; } - default: - return toString(); - break; } - result += TypeOps::decode_quantifier(get_quantifier()); return result; } @@ -735,7 +808,15 @@ assert(subitem->isNode()); if (m_node_kind == store::StoreConsts::anyNode) + { + if (theContentType != NULL && + theContentType->type_kind() == XQType::UNTYPED_KIND) + { + return (subitem->getType()->equals(GENV_TYPESYSTEM.XS_UNTYPED_QNAME)); + } + return true; + } if (m_node_kind != subitem->getNodeKind()) return false; @@ -802,7 +883,7 @@ xqtref_t subContentType = tm->create_named_type(subitem->getType(), TypeConstants::QUANT_ONE, loc, - err::XPTY0004); + true); return TypeOps::is_subtype(tm, *subContentType, *theContentType); } @@ -1032,9 +1113,10 @@ const xqtref_t& baseType, TypeConstants::quantifier_t quantifier, type_category_t typeCategory, - content_kind_t contentKind) + content_kind_t contentKind, + bool builtin) : - XQType(manager, USER_DEFINED_KIND, quantifier, false), + XQType(manager, USER_DEFINED_KIND, quantifier, builtin), m_qname(qname), m_baseType(baseType), m_typeCategory(typeCategory), @@ -1058,17 +1140,16 @@ const TypeManager* manager, store::Item_t qname, const xqtref_t& baseType, - TypeConstants::quantifier_t quantifier, - const XQType* listItemType) + const XQType* listItemType, + bool builtin) : - XQType(manager, USER_DEFINED_KIND, quantifier, false), + XQType(manager, USER_DEFINED_KIND, TypeConstants::QUANT_STAR, builtin), m_qname(qname), m_baseType(baseType), m_typeCategory(LIST_TYPE), m_contentKind(SIMPLE_CONTENT_KIND), m_listItemType(listItemType) { - ZORBA_ASSERT(quantifier == TypeConstants::QUANT_ONE); ZORBA_ASSERT(listItemType); } @@ -1081,16 +1162,22 @@ store::Item_t qname, const xqtref_t& baseType, TypeConstants::quantifier_t quantifier, - std::vector& unionItemTypes) + const std::vector& unionItemTypes, + bool builtin) : - XQType(manager, USER_DEFINED_KIND, quantifier, false), + XQType(manager, USER_DEFINED_KIND, quantifier, builtin), m_qname(qname), m_baseType(baseType), m_typeCategory(UNION_TYPE), m_contentKind(SIMPLE_CONTENT_KIND), m_unionItemTypes(unionItemTypes) { - ZORBA_ASSERT(quantifier == TypeConstants::QUANT_ONE); + std::vector::const_iterator ite = unionItemTypes.begin(); + std::vector::const_iterator end = unionItemTypes.end(); + for (; ite != end; ++ite) + { + theQuantifier = TypeOps::union_quant(theQuantifier, (*ite)->get_quantifier()); + } } @@ -1119,7 +1206,7 @@ while (builtinType->type_kind() == XQType::USER_DEFINED_KIND) { const UserDefinedXQType* tmp = - reinterpret_cast(builtinType.getp()); + static_cast(builtinType.getp()); builtinType = tmp->getBaseType(); } @@ -1161,7 +1248,7 @@ /******************************************************************************* - + TODO: fix this method ????? ********************************************************************************/ bool UserDefinedXQType::isSubTypeOf( const TypeManager* tm, @@ -1187,7 +1274,7 @@ return TypeOps::is_subtype(tm, *subtype, supertype); } } - while(true); + while(subtype != NULL); return false; } @@ -1224,35 +1311,49 @@ switch (m_typeCategory) { case ATOMIC_TYPE: + { info << "isAtomic"; break; + } case COMPLEX_TYPE: + { info << "isComplex"; break; + } case LIST_TYPE: + { info << " isList itemType:" << m_listItemType->toString(); break; + } case UNION_TYPE: - info << " isUnion " << m_unionItemTypes.size() << ":"; - for ( unsigned int i = 0; i < m_unionItemTypes.size(); i++) + { + csize numMembers = m_unionItemTypes.size(); + info << " Union (" ; + if (numMembers > 0) { - info << m_unionItemTypes[i]->toString(); + for (csize i = 0; i < numMembers-1; ++i) + { + info << m_unionItemTypes[i]->toString() << ", "; + } + info << m_unionItemTypes[numMembers-1]->toString(); } + info << ")"; break; + } default: ZORBA_ASSERT(false); } info << " " << contentKindStr(m_contentKind); - return os << "[UserDefinedXQType " << " " - << TypeOps::decode_quantifier (get_quantifier()) << " " + return os << "[UserDefinedXQType " + << TypeOps::decode_quantifier(get_quantifier()) << " " << m_qname->getLocalName() << "@" << m_qname->getNamespace() << " " << info.str() << " base:" - << ( m_baseType ? TypeOps::toString(*m_baseType) : "NULL" ) - << " ]"; + << ( m_baseType ? m_baseType->toString() : "NULL" ) + << "]"; } @@ -1280,7 +1381,7 @@ ///////////////////////////////////////////////////////////////////////////////// // // -// AnySimpleXQType // +// UntypedXQType // // // ///////////////////////////////////////////////////////////////////////////////// @@ -1288,21 +1389,21 @@ /******************************************************************************* ********************************************************************************/ -void AnySimpleXQType::serialize(::zorba::serialization::Archiver& ar) +void UntypedXQType::serialize(::zorba::serialization::Archiver& ar) { serialize_baseclass(ar, (XQType*)this); } -store::Item_t AnySimpleXQType::get_qname() const +store::Item_t UntypedXQType::get_qname() const { - return GENV_TYPESYSTEM.XS_ANY_SIMPLE_TYPE_QNAME; + return GENV_TYPESYSTEM.XS_UNTYPED_QNAME; } ///////////////////////////////////////////////////////////////////////////////// // // -// UntypedXQType // +// AnySimpleXQType // // // ///////////////////////////////////////////////////////////////////////////////// @@ -1310,15 +1411,15 @@ /******************************************************************************* ********************************************************************************/ -void UntypedXQType::serialize(::zorba::serialization::Archiver& ar) +void AnySimpleXQType::serialize(::zorba::serialization::Archiver& ar) { serialize_baseclass(ar, (XQType*)this); } -store::Item_t UntypedXQType::get_qname() const +store::Item_t AnySimpleXQType::get_qname() const { - return GENV_TYPESYSTEM.XS_UNTYPED_QNAME; + return GENV_TYPESYSTEM.XS_ANY_SIMPLE_TYPE_QNAME; } diff -Nru zorba-2.7.0-0/src/types/typeimpl.h zorba-2.8.0-0/src/types/typeimpl.h --- zorba-2.7.0-0/src/types/typeimpl.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/typeimpl.h 2013-01-16 18:28:18.000000000 +0000 @@ -132,7 +132,6 @@ individual schema designers. They are always derived. They can be atomic, list, or union, and simple or complex. - 2. Primitive datatypes are those that are not defined in terms of other datatypes; they exist ab initio. Primitive types are always atomic and built-in. @@ -152,7 +151,6 @@ from their "itemType" (see below), but their "baseType" is always the xs:anySimpleType. - 3. Atomic datatypes are those having values which are regarded as being indivisible. Atomic datatypes can be built-in or user-defined, and primitive or derived. They are always simple types. @@ -195,8 +193,6 @@ - The empty-sequence() - - xs:anyType*, xs:anySimpleType*, and xs:untyped* - - XML Data Mode and XMLSchema both define 45 atomic, built-in types (including xs:anyAtomicType and xs:untypedAtomic). For each such atomic type T, we preallocate 4 XQType objs representing the sequence tyoes T, T?, T*, and T+. @@ -207,9 +203,9 @@ or processing-instruction. - N(xs:untyped), N(xs:untyped)?, N(xs:untyped)+, N(xs:untyped)*, where N is - one of node or document. Note that these types are not really expressible - via the SequenceType syntax, but we include them in zorba because they are - convenient for certain type-related optimizations. + one of "node" or "document-node". Note that these types are not really + expressible via the SequenceType syntax, but we include them in zorba + because they are convenient for certain type-related optimizations. - element(*, xs:anyType), element(*, xs:anyType)?, element(*, xs:anyType)+, element(*, xs:anyType)* @@ -226,6 +222,12 @@ - structured-item(), structured-item()?, structured-item()+, structured-item()* + We also preallocate XQType objs for the following XML-Schema types: + + - xs:anyType, xs:anySimpleType, and xs:untyped + + - xs:NMTOKENS, xs:IDREFS, and xs:ENTITIES + - The none type @@ -354,6 +356,14 @@ int card() const; + bool isAtomicAny() const; + + bool isAtomicOne() const; + + bool isBuiltinAtomicAny() const; + + bool isBuiltinAtomicOne() const; + virtual bool isList() const { return false; } virtual content_kind_t content_kind() const { return MIXED_CONTENT_KIND; }; @@ -666,20 +676,36 @@ or attribute node, or (b) a sequence type whose ItemType is a user0defined atomic type. - Note: unless the user-defined tpye is an atomic one, the quentifier of - "this" must be QUANT_ONE. + Note: For list types, the associated quantifier is always STAR. For user- + defined atomic types, the associated quantifier can be anything. For all + other user-defined types, associated quantifier must be ONE. - m_qname : The name of this user-defined type. The actual type - definition is stored in the TypeManger that created this - type (and is pointed to my theManager). The TypeManager - also stores the mapping from the type name to the type - definition. - m_base_type : The baseType of this type. NULL for list or union types. - m_typeCategory : Whether this is an atomic, list, union, or complex type. - m_contentKind : This type's content kind, if this is a complex type. One - of empty, simple, element-only, or mixed. - m_listItemType : This type's itemType, if this is a list type. - m_unionItemTypes : This type's memberTypes, if this is a union type. + m_qname: + -------- + The name of this user-defined type. The actual type definition is stored in + the TypeManger that created this type (and is pointed to my theManager). The + TypeManager also stores the mapping from the type name to the type definition. + + m_base_type: + ------------ + The baseType of this type. NULL for list or union types. + + m_typeCategory: + --------------- + Whether this is an atomic, list, union, or complex type. + + m_contentKind: + -------------- + This type's content kind, if this is a complex type. One of empty, simple, + element-only, or mixed. + + m_listItemType: + --------------- + This type's itemType, if this is a list type. + + m_unionItemTypes: + ----------------- + This type's memberTypes, if this is a union type. ********************************************************************************/ class UserDefinedXQType : public XQType { @@ -689,12 +715,9 @@ ATOMIC_TYPE, // atomic types: ex: int, date, token, string LIST_TYPE, // list of simple types: ex: list of int: "1 2 33" UNION_TYPE, // union of simple types: ShirtSize int or string: "8", "small" - // ATOMIC, LIST and UNION types are all SIMPLE types: i.e. - // their representation is a text value COMPLEX_TYPE // complex types: they represent structure }; - private: store::Item_t m_qname; xqtref_t m_baseType; @@ -711,40 +734,42 @@ public: // constructor for Atomic and Complex types UserDefinedXQType( - const TypeManager *manager, - store::Item_t qname, - const xqtref_t& baseType, - TypeConstants::quantifier_t quantifier, - type_category_t typeCategory, - content_kind_t contentKind); + const TypeManager* manager, + store::Item_t qname, + const xqtref_t& baseType, + TypeConstants::quantifier_t quantifier, + type_category_t typeCategory, + content_kind_t contentKind, + bool builtin = false); // Constructor for List types UserDefinedXQType( - const TypeManager *manager, - store::Item_t qname, - const xqtref_t& baseType, - TypeConstants::quantifier_t quantifier, - const XQType* listItemType); + const TypeManager* manager, + store::Item_t qname, + const xqtref_t& baseType, + const XQType* listItemType, + bool builtin = false); // Constructor for Union types UserDefinedXQType( - const TypeManager *manager, - store::Item_t qname, - const xqtref_t& baseType, - TypeConstants::quantifier_t quantifier, - std::vector& unionItemTypes); + const TypeManager* manager, + store::Item_t qname, + const xqtref_t& baseType, + TypeConstants::quantifier_t quantifier, + const std::vector& unionItemTypes, + bool builtin = false); virtual ~UserDefinedXQType() {} virtual content_kind_t content_kind() const { return m_contentKind; }; - store::Item_t get_qname() const { return m_qname; } + store::Item_t get_qname() const { return m_qname; } - bool isAtomic() const { return m_typeCategory == ATOMIC_TYPE; } + bool isAtomic() const { return m_typeCategory == ATOMIC_TYPE; } - bool isList() const { return m_typeCategory == LIST_TYPE; } + bool isList() const { return m_typeCategory == LIST_TYPE; } - bool isUnion() const { return m_typeCategory == UNION_TYPE; } + bool isUnion() const { return m_typeCategory == UNION_TYPE; } bool isComplex() const { return m_typeCategory == COMPLEX_TYPE; } @@ -768,44 +793,44 @@ }; -/***************************************************************************//** - xs:untyped -********************************************************************************/ -class UntypedXQType : public XQType +/****************************************************************************** + xs:anyType +*******************************************************************************/ +class AnyXQType : public XQType { public: - UntypedXQType(const TypeManager* manager, bool builtin = false) + AnyXQType(const TypeManager* manager, bool builtin = false) : - XQType(manager, UNTYPED_KIND, TypeConstants::QUANT_STAR, builtin) + XQType(manager, ANY_TYPE_KIND, TypeConstants::QUANT_STAR, builtin) { } store::Item_t get_qname() const; public: - SERIALIZABLE_CLASS(UntypedXQType) - SERIALIZABLE_CLASS_CONSTRUCTOR2(UntypedXQType, XQType) + SERIALIZABLE_CLASS(AnyXQType) + SERIALIZABLE_CLASS_CONSTRUCTOR2(AnyXQType, XQType) void serialize(::zorba::serialization::Archiver& ar); }; -/****************************************************************************** - xs:anyType -*******************************************************************************/ -class AnyXQType : public XQType +/***************************************************************************//** + xs:untyped +********************************************************************************/ +class UntypedXQType : public XQType { public: - AnyXQType(const TypeManager* manager, bool builtin = false) + UntypedXQType(const TypeManager* manager, bool builtin = false) : - XQType(manager, ANY_TYPE_KIND, TypeConstants::QUANT_STAR, builtin) + XQType(manager, UNTYPED_KIND, TypeConstants::QUANT_STAR, builtin) { } store::Item_t get_qname() const; public: - SERIALIZABLE_CLASS(AnyXQType) - SERIALIZABLE_CLASS_CONSTRUCTOR2(AnyXQType, XQType) + SERIALIZABLE_CLASS(UntypedXQType) + SERIALIZABLE_CLASS_CONSTRUCTOR2(UntypedXQType, XQType) void serialize(::zorba::serialization::Archiver& ar); }; diff -Nru zorba-2.7.0-0/src/types/typemanager.h zorba-2.8.0-0/src/types/typemanager.h --- zorba-2.7.0-0/src/types/typemanager.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/typemanager.h 2013-01-16 18:28:18.000000000 +0000 @@ -111,13 +111,16 @@ store::Item* qname, TypeConstants::quantifier_t q, const QueryLoc& loc, - const Error& error = zerr::ZXQP0000_NO_ERROR) const = 0; + bool raiseError) const = 0; + + virtual xqtref_t create_named_simple_type( + store::Item* qname) const = 0; virtual xqtref_t create_named_type( store::Item* qname, TypeConstants::quantifier_t q, const QueryLoc& loc, - const Error& error = zerr::ZXQP0000_NO_ERROR) const = 0; + bool raiseError = false) const = 0; virtual xqtref_t create_structured_item_type(TypeConstants::quantifier_t q) const = 0; diff -Nru zorba-2.7.0-0/src/types/typemanagerimpl.cpp zorba-2.8.0-0/src/types/typemanagerimpl.cpp --- zorba-2.7.0-0/src/types/typemanagerimpl.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/typemanagerimpl.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -65,6 +65,20 @@ /***************************************************************************//** ********************************************************************************/ +TypeManagerImpl::TypeManagerImpl(TypeManager* parent) + : + TypeManager(parent ? parent->level() + 1 : 0), + m_parent(parent), + m_schema(NULL) +{ + // This is too expensive. Do it only if relly necessary + //initializeSchema(); +} + + +/***************************************************************************//** + +********************************************************************************/ void TypeManager::serialize(::zorba::serialization::Archiver& ar) { ar & m_level; @@ -233,7 +247,7 @@ store::Item* qname, TypeConstants::quantifier_t quantifier, const QueryLoc& loc, - const Error& error) const + bool raiseError) const { // Try to resolve the type name as a builtin atomic type RootTypeManager::qnametype_map_t& myMap = GENV_TYPESYSTEM.m_atomic_qnametype_map; @@ -247,11 +261,10 @@ // type (because, otherwise it would have been found above). So we return NULL. if (ZSTREQ(qname->getNamespace(), XML_SCHEMA_NS)) { - if (error != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { - throw XQUERY_EXCEPTION_VAR(error, - ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), - ERROR_LOC(loc)); + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); } else { @@ -268,11 +281,10 @@ if (namedType == NULL) { - if (error != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { - throw XQUERY_EXCEPTION_VAR(error, - ERROR_PARAMS(qname->getStringValue(), ZED( NotAmongInScopeSchemaTypes)), - ERROR_LOC(loc)); + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); } else { @@ -290,11 +302,10 @@ } #endif - if (error != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { - throw XQUERY_EXCEPTION_VAR(error, - ERROR_PARAMS(qname->getStringValue(), ZED( NotAmongInScopeSchemaTypes)), - ERROR_LOC(loc)); + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); } else { @@ -306,13 +317,75 @@ /***************************************************************************//** + Create an XML Schema type from the given typename. The typename is assumed to + be of a simple type. If not, or if no type with this name is found in the + in-scope schema, the method will return NULL. +********************************************************************************/ +xqtref_t TypeManagerImpl::create_named_simple_type(store::Item* qname) const +{ + // Try to resolve the type name as a builtin atomic type + RootTypeManager::qnametype_map_t& myMap = GENV_TYPESYSTEM.m_atomic_qnametype_map; + + store::SchemaTypeCode code = store::XS_LAST; + + if (myMap.get(qname, code)) + return create_builtin_atomic_type(code, TypeConstants::QUANT_ONE); + + // If the type name is an XML Schema builtin type, then it can only be one of + // xs:NMTOKES, xs:IDREFS, or xs:ENTITIES. + if (ZSTREQ(qname->getNamespace(), XML_SCHEMA_NS)) + { + RootTypeManager& rtm = GENV_TYPESYSTEM; + + if (qname->equals(rtm.XS_NMTOKENS_QNAME)) + return rtm.XS_NMTOKENS_TYPE; + + if (qname->equals(rtm.XS_IDREFS_QNAME)) + return rtm.XS_IDREFS_TYPE; + + if (qname->equals(rtm.XS_ENTITIES_QNAME)) + return rtm.XS_ENTITIES_TYPE; + + if (qname->equals(rtm.XS_ANY_SIMPLE_TYPE_QNAME)) + return rtm.ANY_SIMPLE_TYPE; + + return NULL; + } + +#ifndef ZORBA_NO_XMLSCHEMA + // See if there is a type declaration for this type name in the in-scope + // schema, if any. + if (m_schema != NULL) + { + xqtref_t namedType = m_schema->createXQTypeFromTypeName(this, qname); + + if (namedType == NULL) + { + return NULL; + } + + ZORBA_ASSERT(namedType->type_kind() == XQType::USER_DEFINED_KIND); + + const UserDefinedXQType* udt = + reinterpret_cast(namedType.getp()); + + if (udt->isAtomic() || udt->isList() || udt->isUnion()) + return create_type(*namedType, TypeConstants::QUANT_ONE); + } +#endif + + return NULL; +} + + +/***************************************************************************//** Create an XMLSchema type from the given typename and quantifier. ********************************************************************************/ xqtref_t TypeManagerImpl::create_named_type( store::Item* qname, TypeConstants::quantifier_t quant, const QueryLoc& loc, - const Error& error) const + bool raiseError) const { RootTypeManager& RTM = GENV_TYPESYSTEM; @@ -347,11 +420,10 @@ if (namedType == NULL) { - if (error != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { - throw XQUERY_EXCEPTION_VAR(error, - ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), - ERROR_LOC(loc)); + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); } else { @@ -365,11 +437,10 @@ } #endif - if (error != zerr::ZXQP0000_NO_ERROR) + if (raiseError) { - throw XQUERY_EXCEPTION_VAR(error, - ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes)), - ERROR_LOC(loc)); + RAISE_ERROR(err::XPTY0004, loc, + ERROR_PARAMS(qname->getStringValue(), ZED(NotAmongInScopeSchemaTypes))); } else { @@ -651,7 +722,7 @@ return create_named_atomic_type(item->getType(), quant, loc, - err::XPTY0004); + true); } else if (item->isNode()) { @@ -665,7 +736,7 @@ xqtref_t contentType = create_named_type(item->getType(), quant, loc, - err::XPTY0004); + true); return create_node_type(nodeKind, item->getNodeName(), @@ -773,11 +844,8 @@ { if (m_schema == NULL) { - throw XQUERY_EXCEPTION( - err::XPST0008, - ERROR_PARAMS( elemName->getStringValue(), ZED( SchemaElementName ) ), - ERROR_LOC( loc ) - ); + RAISE_ERROR(err::XPST0008, loc, + ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); } xqtref_t contentType = @@ -803,7 +871,7 @@ if (m_schema == NULL) { RAISE_ERROR(err::XPST0008, loc, - ERROR_PARAMS(elemName->getStringValue(), ZED(SchemaElementName))); + ERROR_PARAMS(ZED(XPST0008_SchemaElementName_2), elemName->getStringValue())); } m_schema->getTypeNameFromElementName(elemName, typeName, loc); @@ -824,7 +892,7 @@ if (m_schema == NULL) { RAISE_ERROR(err::XPST0008, loc, - ERROR_PARAMS(attrName->getStringValue(), ZED(SchemaAttributeName))); + ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), attrName->getStringValue())); } xqtref_t contentType = @@ -851,7 +919,7 @@ if (m_schema == NULL) { RAISE_ERROR(err::XPST0008, loc, - ERROR_PARAMS(attrName->getStringValue(), ZED(SchemaAttributeName))); + ERROR_PARAMS(ZED(XPST0008_SchemaAttributeName_2), attrName->getStringValue())); } m_schema->getTypeNameFromAttributeName(attrName, typeName, loc); @@ -945,12 +1013,31 @@ case XQType::USER_DEFINED_KIND: { const UserDefinedXQType& udt = static_cast(type); - return xqtref_t(new UserDefinedXQType(this, - udt.get_qname(), - udt.getBaseType(), - quantifier, - udt.getTypeCategory(), - udt.content_kind())); + + if (udt.isList()) + { + return new UserDefinedXQType(this, + udt.get_qname(), + udt.getBaseType(), + udt.getListItemType()); + } + else if (udt.isUnion()) + { + return new UserDefinedXQType(this, + udt.get_qname(), + udt.getBaseType(), + quantifier, + udt.getUnionItemTypes()); + } + else + { + return new UserDefinedXQType(this, + udt.get_qname(), + udt.getBaseType(), + quantifier, + udt.getTypeCategory(), + udt.content_kind()); + } } default: ZORBA_ASSERT(false); @@ -1011,7 +1098,7 @@ ident.getUri().c_str(), NULL, ident.getLocalName().c_str()); - return create_named_type(i, q, QueryLoc::null, err::XPTY0004); + return create_named_type(i, q, QueryLoc::null, true); } case IdentTypes::ELEMENT_TYPE: diff -Nru zorba-2.7.0-0/src/types/typemanagerimpl.h zorba-2.8.0-0/src/types/typemanagerimpl.h --- zorba-2.7.0-0/src/types/typemanagerimpl.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/typemanagerimpl.h 2013-01-16 18:28:18.000000000 +0000 @@ -69,13 +69,7 @@ void serialize(::zorba::serialization::Archiver& ar); public: - TypeManagerImpl(TypeManager* parent) - : - TypeManager(parent ? parent->level() + 1 : 0), - m_parent(parent), - m_schema(NULL) - { - } + TypeManagerImpl(TypeManager* parent); virtual ~TypeManagerImpl(); @@ -102,84 +96,87 @@ xqtref_t create_any_function_type(TypeConstants::quantifier_t q) const; xqtref_t create_function_type( - const std::vector& aArgs, - const xqtref_t& aReturn, - TypeConstants::quantifier_t aQuant) const; + const std::vector& aArgs, + const xqtref_t& aReturn, + TypeConstants::quantifier_t aQuant) const; xqtref_t create_builtin_atomic_type( - store::SchemaTypeCode type_code, - TypeConstants::quantifier_t quant) const; + store::SchemaTypeCode type_code, + TypeConstants::quantifier_t quant) const; xqtref_t create_named_atomic_type( - store::Item* qname, - TypeConstants::quantifier_t quant, - const QueryLoc& loc, - const Error& error = zerr::ZXQP0000_NO_ERROR) const; + store::Item* qname, + TypeConstants::quantifier_t quant, + const QueryLoc& loc, + bool raiseError) const; + + virtual xqtref_t create_named_simple_type( + store::Item* qname) const; xqtref_t create_named_type( - store::Item* qname, - TypeConstants::quantifier_t quant, - const QueryLoc& loc, - const Error& error = zerr::ZXQP0000_NO_ERROR) const; + store::Item* qname, + TypeConstants::quantifier_t quant, + const QueryLoc& loc, + bool raiseError = false) const; xqtref_t create_structured_item_type(TypeConstants::quantifier_t q) const; #ifdef ZORBA_WITH_JSON xqtref_t create_json_type( - store::StoreConsts::JSONItemKind kind, - TypeConstants::quantifier_t quantifier) const; + store::StoreConsts::JSONItemKind kind, + TypeConstants::quantifier_t quantifier) const; #endif xqtref_t create_node_type( - store::StoreConsts::NodeKind nodeKind, - const store::Item_t& nodeName, - const xqtref_t& contentType, - TypeConstants::quantifier_t quant, - bool nillable, - bool schematest) const; + store::StoreConsts::NodeKind nodeKind, + const store::Item_t& nodeName, + const xqtref_t& contentType, + TypeConstants::quantifier_t quant, + bool nillable, + bool schematest) const; xqtref_t create_value_type( - const store::Item* item, - const QueryLoc& loc = QueryLoc::null) const; + const store::Item* item, + const QueryLoc& loc = QueryLoc::null) const; xqtref_t create_type(const TypeIdentifier& ident) const; #ifndef ZORBA_NO_XMLSCHEMA xqtref_t create_schema_element_type( - const store::Item_t& elemName, - TypeConstants::quantifier_t quant, - const QueryLoc& loc) const; + const store::Item_t& elemName, + TypeConstants::quantifier_t quant, + const QueryLoc& loc) const; void get_schema_element_typename( - const store::Item* elemName, - store::Item_t& typeName, - const QueryLoc& loc); + const store::Item* elemName, + store::Item_t& typeName, + const QueryLoc& loc); xqtref_t create_schema_attribute_type( - const store::Item_t& attrName, - TypeConstants::quantifier_t quant, - const QueryLoc& loc) const; + const store::Item_t& attrName, + TypeConstants::quantifier_t quant, + const QueryLoc& loc) const; void get_schema_attribute_typename( - const store::Item* attrName, - store::Item_t& typeName, - const QueryLoc& loc); + const store::Item* attrName, + store::Item_t& typeName, + const QueryLoc& loc); #endif xqtref_t create_type( - const XQType& type, - TypeConstants::quantifier_t quant) const; + const XQType& type, + TypeConstants::quantifier_t quant) const; xqtref_t create_type_x_quant( - const XQType& type, - TypeConstants::quantifier_t quant) const; + const XQType& type, + TypeConstants::quantifier_t quant) const; private: xqtref_t create_builtin_node_type( - store::StoreConsts::NodeKind nodeKind, - TypeConstants::quantifier_t quantifier, - bool untyped) const; + store::StoreConsts::NodeKind nodeKind, + TypeConstants::quantifier_t quantifier, + bool untyped) const; }; } diff -Nru zorba-2.7.0-0/src/types/typeops.cpp zorba-2.8.0-0/src/types/typeops.cpp --- zorba-2.7.0-0/src/types/typeops.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/typeops.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -167,52 +167,6 @@ /******************************************************************************* ********************************************************************************/ -bool TypeOps::is_atomic(const TypeManager* tm, const XQType& type) -{ - CHECK_IN_SCOPE(tm, type, QueryLoc::null); - - if (type.get_quantifier() == TypeConstants::QUANT_ONE) - { - if (type.type_kind() == XQType::ATOMIC_TYPE_KIND) - { - return true; - } - else if (type.type_kind() == XQType::USER_DEFINED_KIND) - { - return reinterpret_cast(type).isAtomic(); - } - } - - return false; -} - - -/******************************************************************************* - -********************************************************************************/ -bool TypeOps::is_builtin_atomic(const TypeManager* tm, const XQType& type) -{ - CHECK_IN_SCOPE(tm, type, QueryLoc::null); - - return type.get_quantifier() == TypeConstants::QUANT_ONE && - type.type_kind() == XQType::ATOMIC_TYPE_KIND; -} - - -/******************************************************************************* - -********************************************************************************/ -bool TypeOps::is_builtin_simple(const TypeManager* tm, const XQType& type) -{ - CHECK_IN_SCOPE(tm, type, QueryLoc::null); - - return type.type_kind() == XQType::ATOMIC_TYPE_KIND; -} - - -/******************************************************************************* - -********************************************************************************/ bool TypeOps::is_numeric(store::SchemaTypeCode type) { return store::XS_FLOAT <= type && type <= store::XS_POSITIVE_INTEGER; @@ -371,12 +325,16 @@ if (type.get_quantifier() == TypeConstants::QUANT_ONE) return &type; - const UserDefinedXQType& udType = static_cast(type); + const UserDefinedXQType& udt = static_cast(type); - return tm->create_named_type(udType.get_qname(), - TypeConstants::QUANT_ONE, - QueryLoc::null, - err::XPTY0004); + if (udt.isAtomic()) + { + return tm->create_type(type, TypeConstants::QUANT_ONE); + } + else + { + return &type; + } } default: @@ -475,6 +433,9 @@ CHECK_IN_SCOPE(tm, subtype, loc); CHECK_IN_SCOPE(tm, supertype, loc); + if (&subtype == &supertype) + return true; + if (subtype.type_kind() == XQType::NONE_KIND) return true; @@ -816,7 +777,7 @@ xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), TypeConstants::QUANT_ONE, loc, - err::XPTY0004); + true); switch(subtype->type_kind()) { case XQType::ATOMIC_TYPE_KIND: @@ -905,7 +866,7 @@ xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), TypeConstants::QUANT_ONE, loc, - err::XPTY0004); + true); switch (subtype->type_kind()) { case XQType::ATOMIC_TYPE_KIND: @@ -950,7 +911,7 @@ xqtref_t subtype = tm->create_named_atomic_type(subitem->getType(), TypeConstants::QUANT_ONE, loc, - err::XPTY0004); + true); const UserDefinedXQType& udSuperType = static_cast(supertype); @@ -1488,15 +1449,14 @@ case XQType::USER_DEFINED_KIND: { - ZORBA_ASSERT(nested || is_atomic(tm, type)); + ZORBA_ASSERT(nested || type.isAtomicOne()); store::Item* lQname = type.get_qname().getp(); return TypeIdentifier::createNamedType( - Unmarshaller::newString( lQname->getNamespace() ), - Unmarshaller::newString( lQname->getLocalName() ), - q - ); + Unmarshaller::newString(lQname->getNamespace()), + Unmarshaller::newString(lQname->getLocalName()), + q); } default: break; @@ -1519,17 +1479,6 @@ /******************************************************************************* ********************************************************************************/ -std::string TypeOps::toString(const XQType& type) -{ - std::ostringstream os; - serialize(os, type); - return os.str (); -} - - -/******************************************************************************* - -********************************************************************************/ const char* TypeOps::decode_quantifier(TypeConstants::quantifier_t quant) { switch (quant) diff -Nru zorba-2.7.0-0/src/types/typeops.h zorba-2.8.0-0/src/types/typeops.h --- zorba-2.7.0-0/src/types/typeops.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/types/typeops.h 2013-01-16 18:28:18.000000000 +0000 @@ -71,24 +71,6 @@ static bool is_in_scope(const TypeManager* tm, const XQType& type); /** - * Returns true if the quantifier of the given sequence type is QUANT_ONE and - * its ItemType is an atomic type. - */ - static bool is_atomic(const TypeManager* tm, const XQType& type); - - /** - * Returns true if the quantifier of the given sequence type is QUANT_ONE and - * its ItemType is a builtin atomic type. - */ - static bool is_builtin_atomic(const TypeManager* tm, const XQType& type); - - /** - * Returns true if the ItemType of the given sequence type is a builtin - * atomic type. - */ - static bool is_builtin_simple(const TypeManager* tm, const XQType& type); - - /** * Returns true is the given sequence type is a subtype of an atomic builtin * numeric type (xs:decimal, xs:double, or xs:float) */ @@ -224,11 +206,6 @@ static std::ostream& serialize(std::ostream& os, const XQType& type); /* - * Returns a string with a textual representation of the given type. - */ - static std::string toString(const XQType& type); - - /* * Returns a string with a textual representation of the given quantifier. */ static const char* decode_quantifier(TypeConstants::quantifier_t quant); diff -Nru zorba-2.7.0-0/src/unit_tests/CMakeLists.txt zorba-2.8.0-0/src/unit_tests/CMakeLists.txt --- zorba-2.7.0-0/src/unit_tests/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -17,15 +17,13 @@ test_base64.cpp test_base64_streambuf.cpp test_fs_iterator.cpp + test_hashmaps.cpp test_json_parser.cpp test_string.cpp + test_time_parse.cpp test_uri.cpp test_uuid.cpp unit_tests.cpp - test_uri.cpp - test_json_parser.cpp - test_fs_iterator.cpp -# memory_manager.cpp ) IF (NOT ZORBA_NO_FULL_TEXT) diff -Nru zorba-2.7.0-0/src/unit_tests/memory_manager.cpp zorba-2.8.0-0/src/unit_tests/memory_manager.cpp --- zorba-2.7.0-0/src/unit_tests/memory_manager.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/memory_manager.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -30,7 +30,7 @@ } static void print_exception( char const *expr, char const *testName, - std::exception const &e ) { + std::exception const &e ) { std::cout << "FAILED " << testName << ": exception: " << e.what() << std::endl; ++failures; @@ -40,19 +40,19 @@ #define ASSERT_EXCEPTION( EXPR, EXCEPTION ) \ try { EXPR; assert_true( #EXPR, testName, false); } \ - catch (EXCEPTION const& ) { } \ - catch ( std::exception const &e ){ print_exception( #EXPR, testName, e ); } \ + catch ( EXCEPTION const& ) { } \ + catch ( std::exception const &e ) { print_exception( #EXPR, testName, e ); } \ catch ( ... ) { assert_true ( #EXPR, testName, false ); } #define ASSERT_NO_EXCEPTION( EXPR ) \ - try {EXPR; } \ - catch ( std::exception const &e ){ print_exception( #EXPR, testName, e ); } \ + try { EXPR; } \ + catch ( std::exception const &e ) { print_exception( #EXPR, testName, e ); } \ catch ( ... ) { assert_true (#EXPR, testName, false ); } #define ASSERT_TRUE_AND_NO_EXCEPTION( EXPR ) \ try { ASSERT_TRUE ( EXPR ); } \ catch ( std::exception const &e ) { print_exception( #EXPR, testName, e ); } \ - catch ( ... ) {assert_true( #EXPR, testName, false ); } + catch ( ... ) { assert_true( #EXPR, testName, false ); } #define TEST( TESTNAME ) \ static void TESTNAME () { \ @@ -177,9 +177,11 @@ ASSERT_TRUE(hugePage == mem); END_TEST -namespace zorba { namespace UnitTests{ - /////////////////////////////////////////////////////////////////////////////// + +namespace zorba { +namespace UnitTests { + int test_mem_manager( int, char*[] ) { PageCreationAllocatesMemoryDeletionFreesIt(); @@ -201,4 +203,7 @@ return failures ? 1 : 0; } -}} //namespace zorba::UnitTests +} // namespace UnitTests +} // namespace zorba + +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/unit_tests/test_base64.cpp zorba-2.8.0-0/src/unit_tests/test_base64.cpp --- zorba-2.7.0-0/src/unit_tests/test_base64.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_base64.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -53,11 +53,13 @@ #define ASSERT_NO_EXCEPTION( NO, EXPR ) \ try { EXPR; } \ - catch ( std::exception const &e ) { print_exception( NO, #EXPR, __LINE__, e ); } + catch ( exception const &e ) { print_exception( NO, #EXPR, __LINE__, e ); } \ + catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); } #define ASSERT_EXCEPTION( NO, EXPR, EXCEPTION ) \ try { EXPR; assert_true( NO, #EXPR, __LINE__, false ); } \ - catch ( EXCEPTION const& ) { } + catch ( EXCEPTION const& ) { } \ + catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); } ///////////////////////////////////////////////////////////////////////////////} diff -Nru zorba-2.7.0-0/src/unit_tests/test_base64_streambuf.cpp zorba-2.8.0-0/src/unit_tests/test_base64_streambuf.cpp --- zorba-2.7.0-0/src/unit_tests/test_base64_streambuf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_base64_streambuf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -51,7 +51,8 @@ #define ASSERT_TRUE_AND_NO_EXCEPTION( NO, EXPR ) \ try { ASSERT_TRUE( NO, EXPR ); } \ - catch ( std::exception const &e ) { print_exception( NO, #EXPR, __LINE__, e ); } + catch ( exception const &e ) { print_exception( NO, #EXPR, __LINE__, e ); } \ + catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); } /////////////////////////////////////////////////////////////////////////////// diff -Nru zorba-2.7.0-0/src/unit_tests/test_hashmaps.cpp zorba-2.8.0-0/src/unit_tests/test_hashmaps.cpp --- zorba-2.7.0-0/src/unit_tests/test_hashmaps.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_hashmaps.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,253 @@ +#include "stdafx.h" + +#include +#include +#include + +#include "zorbautils/hashmap.h" +#include "util/hashmap32.h" +#include "util/hashmap.h" +#include "util/unordered_map.h" +#include "util/hash/hash.h" + +namespace zorba { + +namespace UnitTests { + + +class IntCompFunc +{ +public: + static bool equal(uint64_t k1, uint64_t k2) + { + return k1 == k2; + } + + static uint32_t hash(uint64_t key) + { +#if 1 + return static_cast(key); +#else + char buf[9]; + buf[0] = (unsigned char)(key>>56); + buf[1] = (unsigned char)(key>>48); + buf[2] = (unsigned char)(key>>40); + buf[3] = (unsigned char)(key>>32); + buf[4] = (unsigned char)(key>>24); + buf[5] = (unsigned char)(key>>16); + buf[6] = (unsigned char)(key>>8 ); + buf[7] = (unsigned char)(key ); + buf[8] = 0; + return (uint32_t)hashfun::h64((void*)buf,8,FNV_64_INIT); +#endif + } +}; + + +class StrCompFunc +{ +public: + static bool equal(const std::string& k1, const std::string& k2) + { + return k1 == k2; + } + + static uint32_t hash(const std::string& key) + { + return hashfun::h32(key.c_str(), FNV_32_INIT); + } +}; + + +int test_hashmaps(int argc, char* argv[]) +{ + if (argc < 4) + return 1; + + int test_id = atoi(argv[1]); + + double load_factor = atof(argv[2]); + + int num = atoi(argv[3]); + + uint64_t* int_buf = new uint64_t[num]; + + for (int i = 0; i < num; ++i) + { + int_buf[i] = rand() % num; + } + + std::string* str_buf = new std::string[num]; + + for (int i = 0; i < num; ++i) + { + char tmp[20]; + sprintf(tmp, "%d", rand() % num); + str_buf[i] = tmp; + + //std::cout << str_buf[i] << std::endl; + } + + + HashMap map1(1024, false); + HashMap map2(1024, false); + + std::unordered_map map3(1024); + std::unordered_map map4(1024); + + hash64map map5(1024, load_factor); + hashmap map6(1024, load_factor); + + map1.set_load_factor(load_factor); + map2.set_load_factor(load_factor); + + if (test_id == 1) + { + zorba::time::walltime startTime; + zorba::time::get_current_walltime(startTime); + + for (int i = 0; i < num; ++i) + { + uint64_t key = int_buf[i]; + int value = 1; + (void)map1.insert(key, value); + } + + zorba::time::walltime stopTime; + time::get_current_walltime(stopTime); + + double time = time::get_walltime_elapsed(startTime, stopTime); + + std::cout << "Load factor = " << load_factor << std::endl + << "Num numeric insertions = " << num << std::endl + << "HashMap entries = " << map1.size() << std::endl + << "HashMap capacity = " << map1.capacity() << std::endl + << "HashMap colisions = " << map1.collisions() << std::endl + << "Time = " << time << std::endl; + } + else if (test_id == 2) + { + zorba::time::walltime startTime; + zorba::time::get_current_walltime(startTime); + + for (int i = 0; i < num; ++i) + { + int value = 1; + (void)map2.insert(str_buf[i], value); + } + + zorba::time::walltime stopTime; + time::get_current_walltime(stopTime); + + double time = time::get_walltime_elapsed(startTime, stopTime); + + std::cout << "Load factor = " << load_factor << std::endl + << "Num string insertions = " << num << std::endl + << "HashMap entries = " << map2.size() << std::endl + << "HashMap buckets = " << map2.bucket_count() << std::endl + << "HashMap capacity = " << map2.capacity() << std::endl + << "Time = " << time << std::endl; + } + else if (test_id == 3) + { + zorba::time::walltime startTime; + zorba::time::get_current_walltime(startTime); + + for (int i = 0; i < num; ++i) + { + uint64_t key = int_buf[i]; + int value = 1; + (void)map3.insert(std::pair(key, value)); + } + + zorba::time::walltime stopTime; + time::get_current_walltime(stopTime); + + double time = time::get_walltime_elapsed(startTime, stopTime); + + std::cout << "Load factor = " << load_factor << std::endl + << "Num numeric insertions = " << num << std::endl + << "UnorderedMap entries = " << map3.size() << std::endl + << "UnorderedMap buckets = " << map3.bucket_count() << std::endl + << "Time = " << time << std::endl; + } + else if (test_id == 4) + { + zorba::time::walltime startTime; + zorba::time::get_current_walltime(startTime); + + for (int i = 0; i < num; ++i) + { + int value = 1; + (void)map4.insert(std::pair(str_buf[i], value)); + } + + zorba::time::walltime stopTime; + time::get_current_walltime(stopTime); + + double time = time::get_walltime_elapsed(startTime, stopTime); + + std::cout << "Load factor = " << load_factor << std::endl + << "Num string insertions = " << num << std::endl + << "UnorderedMap entries = " << map4.size() << std::endl + << "UnorderedMap buckets = " << map4.bucket_count() << std::endl + << "Time = " << time << std::endl; + } + else if (test_id == 5) + { + zorba::time::walltime startTime; + zorba::time::get_current_walltime(startTime); + + for (int i = 0; i < num; ++i) + { + uint64_t key = int_buf[i]; + int value = 1; + (void)map5.put_unsync(key, value); + } + + zorba::time::walltime stopTime; + time::get_current_walltime(stopTime); + + double time = time::get_walltime_elapsed(startTime, stopTime); + + std::cout << "Load factor = " << load_factor << std::endl + << "Num numeric insertions = " << num << std::endl + << "hashmap entries = " << map5.size() << std::endl + << "Time = " << time << std::endl; + } + else if (test_id == 6) + { + zorba::time::walltime startTime; + zorba::time::get_current_walltime(startTime); + + for (int i = 0; i < num; ++i) + { + int value = 1; + (void)map6.put(str_buf[i], value, false); + } + + zorba::time::walltime stopTime; + time::get_current_walltime(stopTime); + + double time = time::get_walltime_elapsed(startTime, stopTime); + + std::cout << "Load factor = " << load_factor << std::endl + << "Num string insertions = " << num << std::endl + << "hashmap entries = " << map6.size() << std::endl + << "Time = " << time << std::endl; + } + else + { + std::cout << "Invalid test id" << std::endl; + return 2; + } + + delete [] int_buf; + delete [] str_buf; + + return 0; +} + + +} +} diff -Nru zorba-2.7.0-0/src/unit_tests/test_icu_streambuf.cpp zorba-2.8.0-0/src/unit_tests/test_icu_streambuf.cpp --- zorba-2.7.0-0/src/unit_tests/test_icu_streambuf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_icu_streambuf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -15,9 +15,11 @@ */ #include "stdafx.h" + #include #include #include +#include #include "util/transcode_streambuf.h" @@ -71,7 +73,8 @@ #define ASSERT_TRUE_AND_NO_EXCEPTION( NO, EXPR ) \ try { ASSERT_TRUE( NO, EXPR ); } \ - catch ( std::exception const &e ) { print_exception( NO, #EXPR, __LINE__, e ); } + catch ( exception const &e ) { print_exception( NO, #EXPR, __LINE__, e ); } \ + catch ( ... ) { assert_true( NO, #EXPR, __LINE__, false ); } /////////////////////////////////////////////////////////////////////////////// diff -Nru zorba-2.7.0-0/src/unit_tests/test_json_parser.cpp zorba-2.8.0-0/src/unit_tests/test_json_parser.cpp --- zorba-2.7.0-0/src/unit_tests/test_json_parser.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_json_parser.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -55,7 +55,8 @@ #define ASSERT_EXCEPTION( EXPR, EXCEPTION ) \ try { EXPR; assert_true( #EXPR, __LINE__, false ); } \ - catch ( EXCEPTION const& ) { } + catch ( EXCEPTION const& ) { } \ + catch ( ... ) { assert_true( #EXPR, __LINE__, false ); } #define ASSERT_NO_EXCEPTION( EXPR ) \ try { EXPR; } \ diff -Nru zorba-2.7.0-0/src/unit_tests/test_string.cpp zorba-2.8.0-0/src/unit_tests/test_string.cpp --- zorba-2.7.0-0/src/unit_tests/test_string.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_string.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -82,7 +82,8 @@ #define ASSERT_EXCEPTION( EXPR, EXCEPTION ) \ try { EXPR; assert_true( #EXPR, __LINE__, false ); } \ - catch ( EXCEPTION const& ) { } + catch ( EXCEPTION const& ) { } \ + catch ( ... ) { assert_true( #EXPR, __LINE__, false ); } #define ASSERT_NO_EXCEPTION( EXPR ) \ try { EXPR; } \ diff -Nru zorba-2.7.0-0/src/unit_tests/test_time_parse.cpp zorba-2.8.0-0/src/unit_tests/test_time_parse.cpp --- zorba-2.7.0-0/src/unit_tests/test_time_parse.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_time_parse.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,419 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "stdafx.h" + +#include +#include +#include +#include +#include + +#include "util/stl_util.h" +#include "util/time_parse.h" +#include "zorbatypes/zstring.h" +#include "zorbautils/locale.h" + +using namespace std; +using namespace zorba; +using namespace zorba::locale; +using namespace zorba::time; + +namespace zloc = zorba::locale; + +/////////////////////////////////////////////////////////////////////////////// + +static int failures; + +static bool assert_true( char const *expr, int line, bool result ) { + if ( !result ) { + cout << "FAILED, line " << line << ": " << expr << endl; + ++failures; + } + return result; +} + +static void print_exception( char const *expr, int line, + std::exception const &e ) { + assert_true( expr, line, false ); + cout << "+ exception: " << e.what() << endl; +} + +#define ASSERT_TRUE( EXPR ) assert_true( #EXPR, __LINE__, !!(EXPR) ) + +#define ASSERT_EXCEPTION( EXPR, EXCEPTION ) \ + try { EXPR; assert_true( #EXPR, __LINE__, false ); } \ + catch ( EXCEPTION const& ) { } \ + catch ( ... ) { assert_true( #EXPR, __LINE__, false ); } + +#define ASSERT_NO_EXCEPTION( EXPR ) \ + try { EXPR; } \ + catch ( std::exception const &e ) { print_exception( #EXPR, __LINE__, e ); } \ + catch ( ... ) { assert_true( #EXPR, __LINE__, false ); } + +#define ASSERT_TRUE_AND_NO_EXCEPTION( EXPR ) \ + try { ASSERT_TRUE( EXPR ); } \ + catch ( std::exception const &e ) { print_exception( #EXPR, __LINE__, e ); } \ + catch ( ... ) { assert_true( #EXPR, __LINE__, false ); } + +/////////////////////////////////////////////////////////////////////////////// + +static void test_ampm() { + char const fmt[] = "%l%M %p"; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + char const *bp; + + { + zstring const buf = "0123 " + get_time_ampm( false ); + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, fmt, lang, country, &tm ) ); + ASSERT_TRUE( bp = buf.c_str() + buf.length() ); + ASSERT_TRUE( tm.tm_hour == 1 ); + ASSERT_TRUE( tm.tm_min == 23 ); + } + { + zstring const buf = "0123 " + get_time_ampm( true ); + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, fmt, lang, country, &tm ) ); + ASSERT_TRUE( bp = buf.c_str() + buf.length() ); + ASSERT_TRUE( tm.tm_hour == 13 ); // note 1300 hours + ASSERT_TRUE( tm.tm_min == 23 ); + } +} + +/////////////////////////////////////////////////////////////////////////////// + +static void test_literals() { + char const buf[] = "JUNK 14 % JUNK JUNK 15"; + char const fmt[] = "JUNK %k %% JUNK %t JUNK %n %M"; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + char const *bp; + + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, fmt, lang, country, &tm ) ); + ASSERT_TRUE( bp == buf + ::strlen( buf ) ); + ASSERT_TRUE( tm.tm_hour == 14 ); + ASSERT_TRUE( tm.tm_min == 15 ); +} + +/////////////////////////////////////////////////////////////////////////////// + +typedef zstring (*locale_fn_type)(unsigned,iso639_1::type,iso3166_1::type); +typedef int ztm::*ztm_int_ptr; + +static void test_locale( char const *conv, locale_fn_type locale_fn, int limit, + ztm_int_ptr ztm_mbr ) { + zstring const junk( "JUNK" ); + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + + for ( int i = 0; i < limit; ++i ) { + char const *bp; + { + zstring const buf = (*locale_fn)( i, lang, country ); + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, conv, lang, country, &tm ) ) + ASSERT_TRUE( bp == buf.c_str() + buf.size() ); + ASSERT_TRUE( tm.*ztm_mbr == i ); + } + { + zstring buf = (*locale_fn)( i, lang, country ); + buf += junk; + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, conv, lang, country, &tm ) ) + ASSERT_TRUE( bp == buf.c_str() + buf.size() - junk.size() ); + ASSERT_TRUE( tm.*ztm_mbr == i ); + } + } + ASSERT_EXCEPTION( + time::parse( "JUNK", conv, lang, country, &tm ), invalid_value + ); +} + +/////////////////////////////////////////////////////////////////////////////// + +typedef int (*unary_fn_type)(int); + +int my_identity( int i ) { + return i; +} + +int minus_1( int i ) { + return i - 1; +} + +int minus_1900( int i ) { + return i - 1900; +} + +int mod_12( int i ) { + return i % 12; +} + +int num_digits( int i ) { + int n = !i; + while ( i ) + i /= 10, ++n; + return n; +} + +static void test_range( char const *conv, int low, int high, + ztm_int_ptr ztm_mbr, + unary_fn_type unary_fn = &my_identity ) { + ztd::itoa_buf_type buf; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + + for ( int i = low; i <= high; ++i ) { + ztd::itoa( i, buf ); + size_t const len = ::strlen( buf ); + char const *bp; + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, conv, lang, country, &tm ) ) + ASSERT_TRUE( bp == buf + len ); + ASSERT_TRUE( tm.*ztm_mbr == (*unary_fn)(i) ); + } + ASSERT_EXCEPTION( + time::parse( "JUNK", conv, lang, country, &tm ), invalid_value + ); + + ztd::itoa( --low, buf ); + ASSERT_EXCEPTION( + time::parse( buf, conv, lang, country, &tm ), invalid_value + ); + + int const high2 = high + 1; + if ( num_digits( high2 ) == num_digits( high ) ) { + ztd::itoa( ++high, buf ); + ASSERT_EXCEPTION( + time::parse( buf, conv, lang, country, &tm ), invalid_value + ); + } +} + +/////////////////////////////////////////////////////////////////////////////// + +static void test_bad_dates() { + struct bad_date { + char const *conv; + char const *date; + }; + static bad_date bad_dates[] = { + { "%F", " 2011-02-29" }, // not a leap year + { "%F", " 2011-04-31" }, // Apr 31 is invalid + { "%F", " 2011-06-31" }, // Jun 31 is invalid + { "%F", " 2011-09-31" }, // Sep 31 is invalid + { "%F", " 2011-11-31" }, // Nov 31 is invalid + { "%w %F", " 1 2012-01-01" }, // date is a Sun (0) + { "%w %F", " 2 2012-01-01" }, // date is a Sun (0) + { "%w %F", " 3 2012-01-01" }, // date is a Sun (0) + { "%w %F", " 4 2012-01-01" }, // date is a Sun (0) + { "%w %F", " 5 2012-01-01" }, // date is a Sun (0) + { "%w %F", " 6 2012-01-01" }, // date is a Sun (0) + { "%w %F", " 0 2013-01-01" }, // date is a Tue (2) + { "%w %F", " 1 2013-01-01" }, // date is a Tue (2) + { "%w %F", " 3 2013-01-01" }, // date is a Tue (2) + { "%w %F", " 4 2013-01-01" }, // date is a Tue (2) + { "%w %F", " 5 2013-01-01" }, // date is a Tue (2) + { "%w %F", " 6 2013-01-01" }, // date is a Tue (2) + { "%j %F", " 1 2013-01-01" }, // day is 0 + { "%j %F", "31 2013-02-01" }, // day is 32 + { "%j %F", "33 2013-02-01" }, // day is 32 + { "%j %F", "60 2012-03-01" }, // day is 61 + { "%j %F", "62 2012-03-01" }, // day is 61 + 0 + }; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + + for ( bad_date const *p = bad_dates; p->date; ++p ) { + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_EXCEPTION( + time::parse( p->date, p->conv, lang, country, &tm ), invalid_value + ); + } +} + +static void test_D() { // %m/%d/%y + char const *const buf = "1/2/12"; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + char const *bp; + + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, "%D", lang, country, &tm ) ) + ASSERT_TRUE( bp == buf + ::strlen( buf ) ); + ASSERT_TRUE( tm.tm_mon == 0 ); + ASSERT_TRUE( tm.tm_mday == 2 ); + ASSERT_TRUE( tm.tm_year == 112 ); // years since 1900 +} + +static void test_F() { // %Y-%m-%d + char const *const buf = "2012-1-2"; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + char const *bp; + + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, "%F", lang, country, &tm ) ) + ASSERT_TRUE( bp == buf + ::strlen( buf ) ); + ASSERT_TRUE( tm.tm_mon == 0 ); + ASSERT_TRUE( tm.tm_mday == 2 ); + ASSERT_TRUE( tm.tm_year == 112 ); // years since 1900 +} + +static void test_invalid_specification() { + static char const bad_specs[] = "fgGiJKLNoPqQ"; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + char spec[3]; + spec[0] = '%'; + spec[2] = '\0'; + + for ( char const *s = bad_specs; *s; ++s ) { + spec[1] = *s; + ASSERT_EXCEPTION( + time::parse( "JUNK", spec, lang, country, &tm ), invalid_specification + ); + } +} + +static void test_j() { // dat of year: 001-366 + char const *const buf = "2012-1-2"; + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + char const *bp; + + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( bp = time::parse( buf, "%F", lang, country, &tm ) ) + ASSERT_TRUE( bp == buf + ::strlen( buf ) ); + ASSERT_TRUE( tm.tm_yday == 0 ); +} + +static void test_zZ() { + struct gmt_test { + char const* s_off; + long l_off; + }; + static gmt_test const gmt_tests[] = { + { "0000", 0 }, + { "0030", 30 * 60 }, + { "0100", 1 * 60 * 60 + 0 * 60 }, + { "2300", 23 * 60 * 60 + 0 * 60 }, + { "2400", 24 * 60 * 60 + 0 * 60 }, + { "+0000", 0 }, + { "+0030", 30 * 60 }, + { "+0100", 1 * 60 * 60 + 0 * 60 }, + { "+2300", 23 * 60 * 60 + 0 * 60 }, + { "+2400", 24 * 60 * 60 + 0 * 60 }, + { "-0000", 0 }, + { "-0030", -30 * 60 }, + { "-0100", -1 * 60 * 60 + 0 * 60 }, + { "-2300", -23 * 60 * 60 + 0 * 60 }, + { "GMT" , 0 }, + { "UTC" , 0 }, + { "UT" , 0 }, + { "EDT" , -4 * 60 * 60 + 0 * 60 }, + { "EST" , -5 * 60 * 60 + 0 * 60 }, + { "CDT" , -5 * 60 * 60 + 0 * 60 }, + { "CST" , -6 * 60 * 60 + 0 * 60 }, + { "MDT" , -6 * 60 * 60 + 0 * 60 }, + { "MST" , -7 * 60 * 60 + 0 * 60 }, + { "PDT" , -7 * 60 * 60 + 0 * 60 }, + { "PST" , -8 * 60 * 60 + 0 * 60 }, + { 0, 0 } + }; + + iso639_1::type lang = iso639_1::unknown; + iso3166_1::type country = iso3166_1::unknown; + ztm tm; + + for ( gmt_test const *p = gmt_tests; p->s_off; ++p ) { + char const *bp; + ::memset( &tm, 0, sizeof( tm ) ); + ASSERT_NO_EXCEPTION( + bp = time::parse( p->s_off, "%z", lang, country, &tm ) + ); + ASSERT_TRUE( bp == p->s_off + ::strlen( p->s_off ) ); + ASSERT_TRUE( tm.ZTM_GMTOFF == p->l_off ); + ASSERT_TRUE( tm.tm_isdst == (p->s_off[1] == 'D') ); + } + + static char const *const bad_gmts[] = { + "*0000", + "00A0", + "9960", + "XXX", + 0 + }; + for ( char const *const *p = bad_gmts; *p; ++p ) + ASSERT_EXCEPTION( + time::parse( *p, "%z", lang, country, &tm ), invalid_value + ); +} + +/////////////////////////////////////////////////////////////////////////////// + +namespace zorba { +namespace UnitTests { + +int test_time_parse( int, char*[] ) { + + test_locale( "%A", &get_weekday_abbr, 7, &ztm::tm_wday ); + test_locale( "%A", &get_weekday_name, 7, &ztm::tm_wday ); + test_locale( "%a", &get_weekday_abbr, 7, &ztm::tm_wday ); + test_locale( "%a", &get_weekday_name, 7, &ztm::tm_wday ); + test_locale( "%b", &get_month_abbr , 12, &ztm::tm_mon ); + test_locale( "%B", &get_month_name , 12, &ztm::tm_mon ); + + test_range( "%d", 1, 31, &ztm::tm_mday ); + test_range( "%j", 1, 366, &ztm::tm_yday, &minus_1 ); + test_range( "%k", 0, 23, &ztm::tm_hour ); + test_range( "%H", 0, 23, &ztm::tm_hour ); + test_range( "%l", 1, 12, &ztm::tm_hour, &mod_12 ); + test_range( "%I", 1, 12, &ztm::tm_hour, &mod_12 ); + test_range( "%m", 1, 12, &ztm::tm_mon , &minus_1 ); + test_range( "%M", 0, 59, &ztm::tm_min ); + test_range( "%u", 1, 7, &ztm::tm_wday, &minus_1 ); + test_range( "%w", 0, 6, &ztm::tm_wday ); + test_range( "%Y", 0, 9999, &ztm::tm_year, &minus_1900 ); + + test_ampm(); + test_bad_dates(); + test_D(); + test_F(); + test_invalid_specification(); + test_literals(); + test_zZ(); + + cout << failures << " test(s) failed\n"; + return failures ? 1 : 0; +} + +} // namespace UnitTests +} // namespace zorba +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/unit_tests/test_unordered_map.cpp zorba-2.8.0-0/src/unit_tests/test_unordered_map.cpp --- zorba-2.7.0-0/src/unit_tests/test_unordered_map.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_unordered_map.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -53,7 +53,8 @@ #define ASSERT_EXCEPTION( EXPR, EXCEPTION ) \ try { EXPR; assert_true( #EXPR, __LINE__, false ); } \ - catch ( EXCEPTION const& ) { } + catch ( EXCEPTION const& ) { } \ + catch ( ... ) { assert_true( #EXPR, __LINE__, false ); } /////////////////////////////////////////////////////////////////////////////// @@ -194,8 +195,9 @@ } static void test_rehash() { - unordered_map m; - unordered_map::size_type const initial_buckets = m.bucket_count(); + typedef unordered_map map_type; + map_type m; + map_type::size_type const initial_buckets = m.bucket_count(); // Add elements until bucket_count() changes which implies a rehash was done. for ( int i = 0; m.bucket_count() == initial_buckets; ++i ) @@ -204,8 +206,7 @@ ASSERT_TRUE( m.bucket_count() > initial_buckets ); // Ensure all the elements are still there. - unordered_map::size_type const size = m.size(); - for ( int i = 0; i < size; ++i ) + for ( int i = 0; (unsigned)i < m.size(); ++i ) ASSERT_TRUE_AND_NO_EXCEPTION( m.at( i ) == i ); } diff -Nru zorba-2.7.0-0/src/unit_tests/test_unordered_set.cpp zorba-2.8.0-0/src/unit_tests/test_unordered_set.cpp --- zorba-2.7.0-0/src/unit_tests/test_unordered_set.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/test_unordered_set.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -38,12 +38,6 @@ return result; } -static void print_exception( char const *expr, int line, - std::exception const &e ) { - assert_true( expr, line, false ); - cout << "+ exception: " << e.what() << endl; -} - #define ASSERT_TRUE( EXPR ) assert_true( #EXPR, __LINE__, !!(EXPR) ) /////////////////////////////////////////////////////////////////////////////// @@ -168,10 +162,11 @@ } static void test_rehash() { - unordered_set set; - unordered_set::const_iterator i; + typedef unordered_set set_type; + set_type set; + set_type::const_iterator i; - unordered_set::size_type const initial_buckets = set.bucket_count(); + set_type::size_type const initial_buckets = set.bucket_count(); // Add elements until bucket_count() changes which implies a rehash was done. for ( int n = 0; set.bucket_count() == initial_buckets; ++n ) @@ -180,11 +175,9 @@ ASSERT_TRUE( set.bucket_count() > initial_buckets ); // Ensure all the elements are still there. - unordered_set::size_type const size = set.size(); - for ( int n = 0; n < size; ++n ) { + for ( int n = 0; (unsigned)n < set.size(); ++n ) if ( ASSERT_TRUE( (i = set.find( n )) != set.end() ) ) ASSERT_TRUE( *i == n ); - } } static void test_swap() { diff -Nru zorba-2.7.0-0/src/unit_tests/unit_test_list.h zorba-2.8.0-0/src/unit_tests/unit_test_list.h --- zorba-2.7.0-0/src/unit_tests/unit_test_list.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/unit_test_list.h 2013-01-16 18:28:18.000000000 +0000 @@ -25,34 +25,50 @@ namespace UnitTests { int runUriTest(int argc, char* argv[]); + int runDebuggerProtocolTest(int argc, char* argv[]); + int test_base64( int, char*[] ); + int test_base64_streambuf( int, char*[] ); + int test_fs_iterator( int, char*[] ); + #ifndef ZORBA_NO_ICU int test_icu_streambuf( int, char*[] ); #endif /* ZORBA_NO_ICU */ + int test_json_parser( int, char*[] ); + int test_string( int, char*[] ); + int test_time_parse( int, char*[] ); + int test_unique_ptr( int, char*[] ); + int test_fs_iterator( int, char*[] ); - //int test_mem_manager( int, char*[] ); + #ifndef ZORBA_NO_FULL_TEXT int test_stemmer( int, char*[] ); int test_thesaurus( int, char*[] ); int test_tokenizer( int, char*[] ); #endif /* ZORBA_NO_FULL_TEXT */ + #ifndef ZORBA_HAVE_UNIQUE_PTR int test_unique_ptr( int, char*[] ); #endif /* ZORBA_HAVE_UNIQUE_PTR */ + int test_uuid( int, char*[] ); + #ifndef ZORBA_HAVE_UNORDERED_MAP int test_unordered_map( int, char*[] ); #endif /* ZORBA_HAVE_UNORDERED_MAP */ + #ifndef ZORBA_HAVE_UNORDERED_SET int test_unordered_set( int, char*[] ); #endif /* ZORBA_HAVE_UNORDERED_SET */ + int test_hashmaps(int argc, char* argv[]); + void initializeTestList(); } // namespace UnitTests diff -Nru zorba-2.7.0-0/src/unit_tests/unit_tests.cpp zorba-2.8.0-0/src/unit_tests/unit_tests.cpp --- zorba-2.7.0-0/src/unit_tests/unit_tests.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/unit_tests/unit_tests.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -38,29 +38,42 @@ void initializeTestList() { libunittests["base64"] = test_base64; + libunittests["base64_streambuf"] = test_base64_streambuf; + libunittests["fs_iterator"] = test_fs_iterator; - //libunittests["memory_manager"] = test_mem_manager; + #ifndef ZORBA_NO_ICU libunittests["icu_streambuf"] = test_icu_streambuf; #endif /* ZORBA_NO_ICU */ + libunittests["json_parser"] = test_json_parser; + libunittests["string"] = test_string; + libunittests["time_parse"] = test_time_parse; + #ifndef ZORBA_NO_FULL_TEXT libunittests["stemmer"] = test_stemmer; libunittests["thesaurus"] = test_thesaurus; libunittests["tokenizer"] = test_tokenizer; #endif /* ZORBA_NO_FULL_TEXT */ + #ifndef ZORBA_HAVE_UNIQUE_PTR libunittests["unique_ptr"] = test_unique_ptr; #endif /* ZORBA_HAVE_UNIQUE_PTR */ + libunittests["uuid"] = test_uuid; + #ifndef ZORBA_HAVE_UNORDERED_MAP libunittests["unordered_map"] = test_unordered_map; #endif /* ZORBA_HAVE_UNORDERED_MAP */ + #ifndef ZORBA_HAVE_UNORDERED_SET libunittests["unordered_set"] = test_unordered_set; #endif /* ZORBA_HAVE_UNORDERED_SET */ + + libunittests["hashmaps"] = test_hashmaps; + libunittests["uri"] = runUriTest; #ifdef ZORBA_WITH_DEBUGGER diff -Nru zorba-2.7.0-0/src/util/CMakeLists.txt zorba-2.8.0-0/src/util/CMakeLists.txt --- zorba-2.7.0-0/src/util/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -25,6 +25,8 @@ mem_streambuf.cpp regex.cpp string_util.cpp + time_util.cpp + time_parse.cpp unicode_util.cpp unicode_categories.cpp uri_util.cpp @@ -35,6 +37,10 @@ http_util.h http_util.cpp) +IF (NOT ZORBA_CXX_NULLPTR) + LIST(APPEND UTIL_SRCS cxx_util.cpp) +ENDIF (NOT ZORBA_CXX_NULLPTR) + IF(ZORBA_WITH_FILE_ACCESS) LIST(APPEND UTIL_SRCS mmap_file.cpp) ENDIF(ZORBA_WITH_FILE_ACCESS) @@ -51,6 +57,4 @@ HEADER_GROUP_SUBFOLDER(UTIL_SRCS fx) HEADER_GROUP_SUBFOLDER(UTIL_SRCS win32) -IF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET)) - ADD_SRC_SUBFOLDER(UTIL_SRCS hash UTIL_HASH_SRCS) -ENDIF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET)) +ADD_SRC_SUBFOLDER(UTIL_SRCS hash UTIL_HASH_SRCS) diff -Nru zorba-2.7.0-0/src/util/ascii_util.cpp zorba-2.8.0-0/src/util/ascii_util.cpp --- zorba-2.7.0-0/src/util/ascii_util.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/ascii_util.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -15,10 +15,15 @@ */ #include "stdafx.h" +// standard #include +#include +// local #include "ascii_util.h" +using namespace std; + namespace zorba { namespace ascii { @@ -32,6 +37,17 @@ return true; } +ostream& printable_char( ostream &o, char c ) { + if ( ascii::is_print( c ) ) + o << c; + else { + ios::fmtflags const old_flags = o.flags(); + o << "#x" << uppercase << hex << (static_cast( c ) & 0xFF); + o.flags( old_flags ); + } + return o; +} + size_type remove_chars( char *s, size_type s_len, char const *chars ) { char *end = s + s_len; char *c; diff -Nru zorba-2.7.0-0/src/util/ascii_util.h zorba-2.8.0-0/src/util/ascii_util.h --- zorba-2.7.0-0/src/util/ascii_util.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/ascii_util.h 2013-01-16 18:28:18.000000000 +0000 @@ -17,11 +17,14 @@ #ifndef ZORBA_STRING_UTIL_ASCII_UTIL_H #define ZORBA_STRING_UTIL_ASCII_UTIL_H +// standard #include #include #include #include +// local +#include "omanip.h" #include "stl_util.h" namespace zorba { @@ -919,7 +922,7 @@ * @param s The string. */ template inline -void trim_end_whitespace( StringType &s, char const *chars ) { +void trim_end_whitespace( StringType &s ) { trim_end( s, whitespace ); } @@ -967,6 +970,20 @@ ////////// Miscellaneous ////////////////////////////////////////////////////// /** + * Prints the given character in a printable way: if \c is_print(c) is \c true, + * prints \a c as-is; otherwise prints \c #x followed by the hexadecimal value + * of the character. + * + * @param o The ostream to print to. + * @param c The \c char to print. + * @return Returns \a o. + */ +std::ostream& printable_char( std::ostream &o, char c ); + +// An ostream manipulator version of the above. +DEF_OMANIP1( printable_char, char ) + +/** * Reverses the characters in a string. * * @tparam InputStringType The input string type. diff -Nru zorba-2.7.0-0/src/util/cxx_util.cpp zorba-2.8.0-0/src/util/cxx_util.cpp --- zorba-2.7.0-0/src/util/cxx_util.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/util/cxx_util.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include + +/////////////////////////////////////////////////////////////////////////////// + +#ifndef ZORBA_CXX_NULLPTR + +#include "cxx_util.h" + +zorba::nullptr_type const zorba_nullptr = { }; + +#endif /* ZORBA_CXX_NULLPTR */ + +/////////////////////////////////////////////////////////////////////////////// + +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/util/cxx_util.h zorba-2.8.0-0/src/util/cxx_util.h --- zorba-2.7.0-0/src/util/cxx_util.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/cxx_util.h 2013-01-16 18:28:18.000000000 +0000 @@ -23,13 +23,15 @@ #ifndef ZORBA_CXX_NULLPTR +namespace zorba { + /** - * See: http://www2.research.att.com/~bs/C++0xFAQ.html#nullptr + * A \c nullptr type. * - * We use "zorba_nullptr" in combination with a macro to elimimate a - * "identifier 'nullptr' will become a keyword in C++0x" warning. + * See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf + * section 1.1: "Alternative #1: A Library Implementation of nullptr," p. 3. */ -class nullptr_t { +class nullptr_type { public: template // convertible to any type operator T*() const { // of null non-member @@ -41,7 +43,19 @@ } private: void operator&() const; // whose address can't be taken -} const zorba_nullptr = {}; // and whose name is nullptr +}; + +} // namespace zorba + +/** + * We use "zorba_nullptr" in combination with a macro to elimimate an + * "identifier 'nullptr' will become a keyword in C++0x" warning. + * + * We also use a singleton object since using multiple instances as shown in + * Bjarne's paper has a slight performance penalty. + */ +ZORBA_DLL_PUBLIC +extern zorba::nullptr_type const zorba_nullptr; #define nullptr ::zorba_nullptr diff -Nru zorba-2.7.0-0/src/util/error_util.cpp zorba-2.8.0-0/src/util/error_util.cpp --- zorba-2.7.0-0/src/util/error_util.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/error_util.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -61,7 +61,7 @@ if ( function && *function ) { using namespace internal::diagnostic; parameters::value_type result = - diagnostic::dict::lookup( ZED( FunctionFailed_12o ) ); + diagnostic::dict::lookup( ZED( FunctionFailed_23o ) ); parameters const params( ERROR_PARAMS( function, err_string ) ); params.substitute( &result ); return result; @@ -77,7 +77,7 @@ parameters::value_type result; if ( function && *function ) { result = diagnostic::dict::lookup( - ZED( FunctionFailedErrorCodeMessage_123 ) + ZED( FunctionFailedErrorCodeMessage_234 ) ); params = ERROR_PARAMS( function, code, err_string ); } else { diff -Nru zorba-2.7.0-0/src/util/fs_util.h zorba-2.8.0-0/src/util/fs_util.h --- zorba-2.7.0-0/src/util/fs_util.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/fs_util.h 2013-01-16 18:28:18.000000000 +0000 @@ -465,6 +465,37 @@ ////////// File information /////////////////////////////////////////////////// +/** + * Gets the base name of the given path name, i.e., the file name without the + * path leading up to it. + * + * @param path The full path to get the base name of. + * @return Returns the base name. Note that if \a path is just a file name, + * then returns \a path. + */ +inline char const* base_name( char const *path ) { + if ( char const *const sep = ::strrchr( path, dir_separator ) ) + return sep + 1; + return path; +} + +/** + * Gets the base name of the given path name, i.e., the file name without the + * path leading up to it. + * + * @tparam PathStringType The \a path string type. + * @param path The full path to get the base name of. + * @return Returns the base name. Note that if \a path is just a file name, + * then returns \a path. + */ +template inline +typename std::enable_if::value, + char const*>::type +base_name( PathStringType const &path ) { + return base_name( path.c_str() ); +} + #ifdef ZORBA_WITH_FILE_ACCESS /** diff -Nru zorba-2.7.0-0/src/util/hash/CMakeLists.txt zorba-2.8.0-0/src/util/hash/CMakeLists.txt --- zorba-2.7.0-0/src/util/hash/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/hash/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -14,5 +14,9 @@ SET(UTIL_HASH_SRCS hash.cpp - rehash_policy.cpp - ) +) + +IF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET)) + LIST(APPEND UTIL_HASH_SRCS + rehash_policy.cpp) +ENDIF (NOT (ZORBA_HAVE_UNORDERED_MAP AND ZORBA_HAVE_UNORDERED_SET)) diff -Nru zorba-2.7.0-0/src/util/hash/hash.cpp zorba-2.8.0-0/src/util/hash/hash.cpp --- zorba-2.7.0-0/src/util/hash/hash.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/hash/hash.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -14,8 +14,11 @@ * limitations under the License. */ +#include "stdafx.h" // standard -#include +#ifdef ZORBA_HASH_FN_PJW +# include +#endif /* ZORBA_HASH_FN_PJW */ // local #include "hash.h" diff -Nru zorba-2.7.0-0/src/util/icu_streambuf.cpp zorba-2.8.0-0/src/util/icu_streambuf.cpp --- zorba-2.7.0-0/src/util/icu_streambuf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/icu_streambuf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -58,7 +58,7 @@ } icu_streambuf::icu_streambuf( char const *charset, streambuf *orig ) : - proxy_streambuf( orig ), + internal::proxy_streambuf( orig ), no_conv_( !is_necessary( charset ) ), external_conv_( no_conv_ ? nullptr : create_conv( charset ) ), utf8_conv_( no_conv_ ? nullptr : create_conv( "UTF-8" ) ) @@ -151,7 +151,7 @@ } icu_streambuf::int_type icu_streambuf::overflow( int_type c ) { -#if ZORBA_DEBUG_ICU_STREAMBUF +#ifdef ZORBA_DEBUG_ICU_STREAMBUF printf( "overflow()\n" ); #endif if ( no_conv_ ) @@ -233,7 +233,7 @@ #endif /* GCC_PRAGMA_DIAGNOSTIC_PUSH */ icu_streambuf::int_type icu_streambuf::underflow() { -#if ZORBA_DEBUG_ICU_STREAMBUF +#ifdef ZORBA_DEBUG_ICU_STREAMBUF printf( "underflow()\n" ); #endif if ( no_conv_ ) @@ -263,7 +263,7 @@ } streamsize icu_streambuf::xsgetn( char_type *to, streamsize size ) { -#if ZORBA_DEBUG_ICU_STREAMBUF +#ifdef ZORBA_DEBUG_ICU_STREAMBUF printf( "xsgetn()\n" ); #endif if ( no_conv_ ) @@ -301,7 +301,7 @@ } streamsize icu_streambuf::xsputn( char_type const *from, streamsize size ) { -#if ZORBA_DEBUG_ICU_STREAMBUF +#ifdef ZORBA_DEBUG_ICU_STREAMBUF printf( "xsputn()\n" ); #endif if ( no_conv_ ) diff -Nru zorba-2.7.0-0/src/util/icu_streambuf.h zorba-2.8.0-0/src/util/icu_streambuf.h --- zorba-2.7.0-0/src/util/icu_streambuf.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/icu_streambuf.h 2013-01-16 18:28:18.000000000 +0000 @@ -18,7 +18,7 @@ #define ZORBA_ICU_STREAMBUF_H #include -#include +#include #include "util/utf8_util.h" @@ -38,7 +38,7 @@ * is.ios::rdbuf( &xbuf ); * \endcode * Note that the %icu_streambuf must exist for as long as it's being used by - * the stream. If you are replacing the streabuf for a stream you did not + * the stream. If you are replacing the streambuf for a stream you did not * create, you should set it back to the original streambuf: * \code * void f( ostream &os ) { @@ -46,19 +46,19 @@ * try { * os.ios::rdbuf( &xbuf ); * // ... + * os.ios::rdbuf( xbuf.original() ); * } * catch ( ... ) { * os.ios::rdbuf( xbuf.original() ); * throw; * } - * os.ios::rdbuf( xbuf.original() ); * } * \endcode * * While %icu_streambuf does support seeking, the positions are relative to the * original byte stream. */ -class icu_streambuf : public proxy_streambuf { +class icu_streambuf : public internal::proxy_streambuf { public: /** * Constructs an %icu_streambuf. diff -Nru zorba-2.7.0-0/src/util/json_parser.cpp zorba-2.8.0-0/src/util/json_parser.cpp --- zorba-2.7.0-0/src/util/json_parser.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/json_parser.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -15,6 +15,7 @@ */ #include "stdafx.h" + #include "diagnostics/assert.h" #include "ascii_util.h" @@ -23,7 +24,6 @@ #include "utf8_util.h" #define DEBUG_JSON_PARSER 0 - #if DEBUG_JSON_PARSER # include "indent.h" #endif /* DEBUG_JSON_PARSER */ @@ -79,7 +79,10 @@ } illegal_character::illegal_character( location const &loc, char c ) : - exception( loc, BUILD_STRING( '\'', c, "': illegal character" ) ), + exception( + loc, + BUILD_STRING( '\'', ascii::printable_char( c ), "': illegal character" ) + ), c_( c ) { } @@ -100,7 +103,12 @@ } illegal_escape::illegal_escape( location const &loc, char c ) : - exception( loc, BUILD_STRING( "\"\\", c, "\": illegal character escape" ) ), + exception( + loc, + BUILD_STRING( + "\"\\", ascii::printable_char( c ), "\": illegal character escape" + ) + ), esc_( c ) { } @@ -148,9 +156,7 @@ /////////////////////////////////////////////////////////////////////////////// -token::token() : - type_( none ) -{ +token::token() : type_( none ) { } ostream& operator<<( ostream &o, token::type tt ) { @@ -556,7 +562,20 @@ /////////////////////////////////////////////////////////////////////////////// -parser::parser( istream &in ) : lexer_( in ) { +parser::parser( std::istream &in, bool allow_multiple ) : + allow_multiple_( allow_multiple ), + lexer_( in ) +{ + init(); +} + +void parser::clear() { + peeked_token_.clear(); + ztd::clear_stack( state_stack_ ); + init(); +} + +void parser::init() { #if DEBUG_JSON_PARSER get_indent( cout ) = 0; #endif /* DEBUG_JSON_PARSER */ @@ -601,7 +620,7 @@ switch ( state_ ) { // ::= | - case J0: PUSH_STATE( J1 ); + case J0: PUSH_STATE( allow_multiple_ ? J0 : J1 ); switch ( PEEK_TOKEN() ) { case token::begin_array : GOTO_STATE( A0 ); case token::begin_object: GOTO_STATE( O0 ); diff -Nru zorba-2.7.0-0/src/util/json_parser.h zorba-2.8.0-0/src/util/json_parser.h --- zorba-2.7.0-0/src/util/json_parser.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/json_parser.h 2013-01-16 18:28:18.000000000 +0000 @@ -501,8 +501,15 @@ * Constructs a %parser on the given istream. * * @param in The istream to read from. + * @param allow_multiple If \c true, allow multiple top-level JSON items. */ - parser( std::istream &in ); + parser( std::istream &in, bool allow_multiple = false ); + + /** + * Resets this %parser to its almost-initial state. (It does not, however, + * reset the file location.) + */ + void clear(); /** * Gets the next token, if any. @@ -546,6 +553,7 @@ friend std::ostream& operator<<( std::ostream&, state ); + void init(); bool get_token( token* ); bool get_token_debug( int, token* ); bool matches_token( token::type, token* ); @@ -555,6 +563,7 @@ void require_token( token::type, token* ); void require_token_debug( int, token::type, token* ); + bool allow_multiple_; lexer lexer_; token peeked_token_; std::stack state_stack_; diff -Nru zorba-2.7.0-0/src/util/mem_streambuf.cpp zorba-2.8.0-0/src/util/mem_streambuf.cpp --- zorba-2.7.0-0/src/util/mem_streambuf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/mem_streambuf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -52,7 +52,7 @@ mem_streambuf::int_type mem_streambuf::pbackfail( int_type c ) { if ( !traits_type::eq_int_type( c, traits_type::eof() ) ) { - *pptr() = traits_type::to_int_type( c ); + *pptr() = traits_type::to_char_type( c ); pbump( -1 ); } return traits_type::to_int_type( *pptr() ); diff -Nru zorba-2.7.0-0/src/util/oseparator.h zorba-2.8.0-0/src/util/oseparator.h --- zorba-2.7.0-0/src/util/oseparator.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/oseparator.h 2013-01-16 18:28:18.000000000 +0000 @@ -40,6 +40,14 @@ } /** + * Constructs an %oseparator. + * + * @param sep The separator character. + */ + explicit oseparator( char sep ) : sep_( 1, sep ), print_( false ) { + } + + /** * Gets the printing state of this %oseparator. * * @return Returns \c true only if this %oseparator is currently printing. diff -Nru zorba-2.7.0-0/src/util/passthru_streambuf.cpp zorba-2.8.0-0/src/util/passthru_streambuf.cpp --- zorba-2.7.0-0/src/util/passthru_streambuf.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/passthru_streambuf.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -84,7 +84,8 @@ } passthru_streambuf::int_type passthru_streambuf::pbackfail( int_type c ) { - return original()->sputbackc( traits_type::to_char_type( c ) ); + return traits_type::eq_int_type( c, traits_type::eof() ) ? + c : proxy_buf_->sputbackc( traits_type::to_char_type( c ) ); } passthru_streambuf::int_type passthru_streambuf::uflow() { diff -Nru zorba-2.7.0-0/src/util/stl_util.h zorba-2.8.0-0/src/util/stl_util.h --- zorba-2.7.0-0/src/util/stl_util.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/stl_util.h 2013-01-16 18:28:18.000000000 +0000 @@ -155,6 +155,18 @@ /////////////////////////////////////////////////////////////////////////////// /** + * Clears the given stack. + * + * @tparam T The stack's \c value_type. + * @param s The stack to clear. + */ +template inline +void clear_stack( std::stack &s ) { + while ( !s.empty() ) + s.pop(); +} + +/** * A less-verbose way to determine whether the given map or set contains a * particular element. */ @@ -353,7 +365,7 @@ // warning-free. // // Note: the use of "!!" is to work around a compiler problem on Windows; -// see: http://stackoverflow.com/questions/9285657/sfinae-differentiation-between-signed-and-unsigned +// see http://stackoverflow.com/q/9285657 // template inline diff -Nru zorba-2.7.0-0/src/util/string_util.cpp zorba-2.8.0-0/src/util/string_util.cpp --- zorba-2.7.0-0/src/util/string_util.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/string_util.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -21,6 +21,7 @@ #include "ascii_util.h" #include "cxx_util.h" #include "string_util.h" +#include "zorbatypes/zstring.h" #ifdef WIN32 namespace std { @@ -55,67 +56,90 @@ /////////////////////////////////////////////////////////////////////////////// -#define ENABLE_CLIPPING 0 +static void no_digits( char const *buf ) { + throw std::invalid_argument( BUILD_STRING( '"', buf, "\": no digits" ) ); +} -template -static void check_parse_number( char const *s, char *end, T *result ) { - if ( errno == ERANGE ) { - if ( result ) { -#if ENABLE_CLIPPING - if ( *ascii::trim_start_whitespace( s ) == '-' ) - *result = numeric_limits::min(); - else - *result = numeric_limits::max(); -#endif /* ENABLE_CLIPPING */ - } else - throw std::range_error( - BUILD_STRING( '"', s, "\": number too big/small" ) - ); - } - if ( end == s ) - throw std::invalid_argument( BUILD_STRING( '"', s, "\": no digits" ) ); +static void too_big_or_small( char const *buf, char const *end ) { + zstring const s( buf, end ); + throw std::range_error( BUILD_STRING( '"', s, "\": number too big/small" ) ); +} + +inline void check_errno( char const *buf, char const *end ) { + if ( errno == ERANGE ) + too_big_or_small( buf, end ); +} + +static void check_trailing_chars_impl( char const *end ) { for ( ; *end; ++end ) // remaining characters, if any, ... if ( !ascii::is_space( *end ) ) // ... may only be whitespace throw std::invalid_argument( - BUILD_STRING( '"', *end, "\": invalid character" ) + BUILD_STRING( '\'', *end, "': invalid character" ) ); } -double atod( char const *s ) { - char *end; - errno = 0; - double result = std::strtod( s, &end ); - check_parse_number( s, end, &result ); +inline void check_parse_number( char const *buf, char const *end, + bool check_trailing_chars ) { + if ( end == buf ) + no_digits( buf ); + if ( check_trailing_chars ) + check_trailing_chars_impl( end ); +} + +class aton_context { +public: + aton_context( char const **&end ) { + if ( end ) { + check_trailing_chars_ = false; + } else { + end = &end_; + check_trailing_chars_ = true; + } + errno = 0; + } + bool check_trailing_chars() const { + return check_trailing_chars_; + } +private: + bool check_trailing_chars_; + char const *end_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +double atod( char const *buf, char const **end ) { + aton_context const ctx( end ); + double const result = std::strtod( buf, (char**)end ); + check_parse_number( buf, *end, ctx.check_trailing_chars() ); return result; } -float atof( char const *s ) { - char *end; - errno = 0; - float result = std::strtof( s, &end ); - check_parse_number( s, end, &result ); +float atof( char const *buf, char const **end ) { + aton_context const ctx( end ); + float const result = std::strtof( buf, (char**)end ); + check_parse_number( buf, *end, ctx.check_trailing_chars() ); return result; } -long long atoll( char const *s ) { - char *end; - errno = 0; - long long const result = std::strtoll( s, &end, 10 ); - check_parse_number( s, end, static_cast( nullptr ) ); +long long atoll( char const *buf, char const **end ) { + aton_context const ctx( end ); + long long const result = std::strtoll( buf, (char**)end, 10 ); + check_errno( buf, *end ); + check_parse_number( buf, *end, ctx.check_trailing_chars() ); return result; } -unsigned long long atoull( char const *s ) { +unsigned long long atoull( char const *buf, char const **end ) { + aton_context const ctx( end ); // // We have to check for '-' ourselves since strtoull(3) allows it (oddly). // - s = ascii::trim_start_whitespace( s ); - bool const minus = *s == '-'; + buf = ascii::trim_start_whitespace( buf ); + bool const minus = *buf == '-'; - char *end; - errno = 0; - unsigned long long const result = std::strtoull( s, &end, 10 ); - check_parse_number( s, end, static_cast( nullptr ) ); + unsigned long long const result = std::strtoull( buf, (char**)end, 10 ); + check_errno( buf, *end ); + check_parse_number( buf, *end, ctx.check_trailing_chars() ); if ( minus && result ) { // @@ -123,7 +147,7 @@ // Hence, this allows "-0" and treats it as "0". // throw std::invalid_argument( - "\"-\": invalid character for unsigned integer" + "'-': invalid character for unsigned integer" ); } return result; diff -Nru zorba-2.7.0-0/src/util/string_util.h zorba-2.8.0-0/src/util/string_util.h --- zorba-2.7.0-0/src/util/string_util.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/string_util.h 2013-01-16 18:28:18.000000000 +0000 @@ -46,8 +46,8 @@ * the resultant string to some function. See the BUILD_STRING macro for usage. * Note that you can use either "<<" or "," to taste. * - * See http://stackoverflow.com/questions/5666678/ as to why a class like this - * is needed rather than just using an ostringstream directly. + * See http://stackoverflow.com/q/5666678 as to why a class like this is + * needed rather than just using an ostringstream directly. */ class string_builder { public: @@ -408,61 +408,76 @@ /** * Parses the given string for a \c double. * - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the \c double value. - * @throws invalid_argument if \a s contains characters other than digits or + * @throws invalid_argument if \a buf contains characters other than digits or * leading/trailing whitespace, or contains no digits at all. * @throws range_error if the number overflows/underflows. */ -double atod( char const *s ); +double atod( char const *buf, char const **end = nullptr ); /** * Parses the given string for a \c float. * - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the \c float value. - * @throws invalid_argument if \a s contains characters other than digits or + * @throws invalid_argument if \a buf contains characters other than digits or * leading/trailing whitespace, or contains no digits at all. * @throws range_error if the number overflows/underflows. */ -float atof( char const *s ); +float atof( char const *buf, char const **end = nullptr ); /** * Parses the given string for a long lomg. * - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the long long value. - * @throws invalid_argument if \a s contains characters other than digits or + * @throws invalid_argument if \a buf contains characters other than digits or * leading/trailing whitespace, or contains no digits at all. * @throws range_error if the number overflows/underflows. */ -long long atoll( char const *s ); +long long atoll( char const *buf, char const **end = nullptr ); /** * Parses the given string for an unsigned long lomg. * - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the unsigned long long value. - * @throws invalid_argument if \a s contains characters other than digits or + * @throws invalid_argument if \a buf contains characters other than digits or * leading/trailing whitespace, or contains no digits at all. * @throws range_error if the number overflows/underflows. */ -unsigned long long atoull( char const *s ); +unsigned long long atoull( char const *buf, char const **end = nullptr ); /** * Parses the given string for a C++ signed integral type. * * @tparam IntegralType The C++ signed integral type to parse for. - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the \c IntegralType value. - * @throws invalid_argument if \a s contains characters other than digits or - * leading/trailing whitespace, or contains no digits at all. - * @throws range_error if the number overflows/underflows. + * @throws invalid_argument if \a buf contains characters other than digits, a + * sign, or leading/trailing whitespace, or contains no digits at all. + * @throws range_error if the number is either too small or too big. */ template inline // @@ -473,8 +488,8 @@ typename std::enable_if::value && ZORBA_TR1_NS::is_signed::value, IntegralType>::type -aton( char const *s ) { - long long const result = atoll( s ); +aton( char const *buf, char const **end = nullptr ) { + long long const result = atoll( buf, end ); if ( result < std::numeric_limits::min() || result > std::numeric_limits::max() ) throw std::range_error( @@ -484,60 +499,137 @@ } /** + * Parses the given string for a C++ signed integral type. + * + * @tparam IntegralType The C++ signed integral type to parse for. + * @param buf The null-terminated C string to parse. Leading and trailing + * whitespace is ignored. + * @param low The lower acceptable bound. + * @param high the higher acceptable bound. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. + * @return Returns the \c IntegralType value. + * @throws invalid_argument if \a buf contains characters other than digits, a + * sign, or leading/trailing whitespace, or contains no digits at all. + * @throws range_error if the number is either too small or too big. + */ +template inline +// +// Note that the is_integral shouldn't be needed since is_signed means "is a +// signed integral type", but Microsoft's implementation is broken and returns +// true for floating point types as well. +// +typename std::enable_if::value + && ZORBA_TR1_NS::is_signed::value, + IntegralType>::type +aton( char const *buf, IntegralType low, IntegralType high, + char const **end = nullptr ) { + long long const result = atoll( buf, end ); + if ( result < low || result > high ) + throw std::range_error( + BUILD_STRING( + '"', result, "\": number not in range ", low, '-', high + ) + ); + return static_cast( result ); +} + +/** * Parses the given string for a C++ unsigned integral types. * * @tparam IntegralType The C++ unsigned integral type to parse for. - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the \c IntegralType value. - * @throws invalid_argument if \a s contains characters other than digits or - * leading/trailing whitespace, or contains no digits at all. - * @throws range_error if the number overflows/underflows. + * @throws invalid_argument if \a buf contains characters other than digits, a + * sign, or leading/trailing whitespace, or contains no digits at all. + * @throws range_error if the number is either too small or too big. */ template inline typename std::enable_if::value, IntegralType>::type -aton( char const *s ) { - unsigned long long const result = atoull( s ); +aton( char const *buf, char const **end = nullptr ) { + unsigned long long const result = atoull( buf, end ); if ( result > std::numeric_limits::max() ) throw std::range_error( BUILD_STRING( '"', result, "\": number too big" ) ); return static_cast( result ); } /** + * Parses the given string for a C++ unsigned integral types. + * + * @tparam IntegralType The C++ unsigned integral type to parse for. + * @param buf The null-terminated C string to parse. Leading and trailing + * whitespace is ignored. + * @param low The lower acceptable bound. + * @param high the higher acceptable bound. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. + * @return Returns the \c IntegralType value. + * @throws invalid_argument if \a buf contains characters other than digits or + * leading/trailing whitespace, or contains no digits at all. + * @throws range_error if the number is either too small or too big. + */ +template inline +typename std::enable_if::value, + IntegralType>::type +aton( char const *buf, IntegralType low, IntegralType high, + char const **end = nullptr ) { + unsigned long long const result = atoull( buf, end ); + if ( result < low || result > high ) + throw std::range_error( + BUILD_STRING( + '"', result, "\": number not in range ", low, '-', high + ) + ); + return static_cast( result ); +} + +/** * Parses the given string for a C++ \c double type. * - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the \c double value. - * @throws invalid_argument if \a s contains characters other than those for a - * valid \c double value or leading/trailing whitespace, or contains no digits - * at all. + * @throws invalid_argument if \a buf contains characters other than those for + * a valid \c double value or leading/trailing whitespace, or contains no + * digits at all. * @throws range_error if the number overflows/underflows. */ template inline typename std::enable_if::value, NumericType>::type -aton( char const *s ) { - return atod( s ); +aton( char const *buf, char const **end = nullptr ) { + return atod( buf, end ); } /** * Parses the given string for a C++ \c float type. * - * @param s The null-terminated C string to parse. Leading and trailing + * @param buf The null-terminated C string to parse. Leading and trailing * whitespace is ignored. + * @param end If not \c null, this is set to point to the character after the + * last numeric character parsed; if \c null, characters past the last numeric + * character may only be whitespace. * @return Returns the \c float value. - * @throws invalid_argument if \a s contains characters other than those for a - * valid \c float value or leading/trailing whitespace, or contains no digits + * @throws invalid_argument if \a buf contains characters other than those for + * a valid \c float value or leading/trailing whitespace, or contains no digits * at all. * @throws range_error if the number overflows/underflows. */ template inline typename std::enable_if::value, NumericType>::type -aton( char const *s ) { - return atof( s ); +aton( char const *buf, char const **end = nullptr ) { + return atof( buf, end ); } ////////// To-string conversion //////////////////////////////////////////////// diff -Nru zorba-2.7.0-0/src/util/time_parse.cpp zorba-2.8.0-0/src/util/time_parse.cpp --- zorba-2.7.0-0/src/util/time_parse.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/util/time_parse.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,646 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "stdafx.h" + +// standard +#include +#include + +// Zorba +#include "ascii_util.h" +#include "cxx_util.h" +#include "string_util.h" +#include "zorbatypes/zstring.h" +#include "zorbautils/locale.h" + +// local +#include "time_parse.h" +#include "time_util.h" + +using namespace std; +using namespace zorba::locale; + +namespace zorba { +namespace time { + +/////////////////////////////////////////////////////////////////////////////// + +static size_t min_len( char const *buf, size_t max_len ) { + size_t len = 0; + for ( char const *p = buf; *p; ++p ) + if ( ++len >= max_len ) + return max_len; + return len; +} + +/////////////////////////////////////////////////////////////////////////////// + +exception::exception( string const &msg ) : + runtime_error( msg ) +{ +} + +exception::~exception() throw() { + // out-of-line since it's virtual +} + +insufficient_buffer::insufficient_buffer() : + exception( "insufficient buffer" ) +{ +} + +invalid_specification::invalid_specification( char spec ) : + invalid_argument( + BUILD_STRING( '\'', ascii::printable_char( spec ), "': invalid %" ) + ), + spec_( spec ) +{ +} + +invalid_specification::~invalid_specification() throw() { + // out-of-line since it's virtual +} + +invalid_value_specs::invalid_value_specs( char spec ) : + specs_( 1, spec ) +{ +} + +invalid_value_specs::invalid_value_specs( char const *specs ) : + specs_( specs ) +{ +} + +invalid_value_value::invalid_value_value( char c ) : + value_( 1, c ) +{ +} + +invalid_value_value::invalid_value_value( char const *buf, size_t len ) : + value_( buf, min_len( buf, len ) ) +{ + ascii::trim_end_whitespace( value_ ); +} + +template +invalid_value_value::invalid_value_value( ValueType const &value ) : + value_( BUILD_STRING( value ) ) +{ +} + +std::string invalid_value::build_msg( string const &value, + string const &specs ) { + return BUILD_STRING( '"', value, "\": invalid value for %", specs ); +} + +invalid_value::invalid_value( char const *buf, size_t len, char spec ) : + invalid_value_value( buf, len ), + invalid_value_specs( spec ), + exception( build_msg( value_, specs_ ) ) +{ +} + +invalid_value::invalid_value( char const *buf, size_t len, char const *specs ) : + invalid_value_value( buf, len ), + invalid_value_specs( specs ), + exception( build_msg( value_, specs_ ) ) +{ +} + +template +invalid_value::invalid_value( ValueType const &value, char spec ) : + invalid_value_value( value ), + invalid_value_specs( spec ), + exception( build_msg( value_, specs_ ) ) +{ +} + +template +invalid_value::invalid_value( ValueType const &value, char const *specs ) : + invalid_value_value( value ), + invalid_value_specs( specs ), + exception( build_msg( value_, specs_ ) ) +{ +} + +invalid_value::~invalid_value() throw() { + // out-of-line since it's virtual +} + +literal_mismatch::literal_mismatch( char expected, char got ) : + exception( + BUILD_STRING( + '\'', ascii::printable_char( got ), "': literal character mismatched '", + expected, '\'' + ) + ), + expected_( expected ), + got_( got ) +{ +} + +literal_mismatch::~literal_mismatch() throw() { + // out-of-line since it's virtual +} + +/////////////////////////////////////////////////////////////////////////////// + +struct rfc2822_obs_zone { + char const *name; + long gmtoff; + bool isdst; +}; + +// +// See RFC 2822: "Internet Message Format," section 4.3, "Obsolete Date and +// Time." +// +static rfc2822_obs_zone const rfc2822_obs_zones[] = { + { "GMT", 0 }, + { "UTC", 0 }, // non-RFC: be liberal in what you accept.... + { "UT" , 0 }, // must go after "UTC" + { "EDT", -4 * 60 * 60, true }, + { "EST", -5 * 60 * 60 }, + { "CDT", -5 * 60 * 60, true }, + { "CST", -6 * 60 * 60 }, + { "MDT", -6 * 60 * 60, true }, + { "MST", -7 * 60 * 60 }, + { "PDT", -7 * 60 * 60, true }, + { "PST", -8 * 60 * 60 }, + { 0, 0, 0 } +}; + +/////////////////////////////////////////////////////////////////////////////// + +typedef zstring (*locale_fn_type)(unsigned,iso639_1::type,iso3166_1::type); + +template inline +bool bits_set( IntType flags, IntType bits ) { + return (flags & bits) == bits; +} + +// +// This is an adapter function to adapt locale::get_time_ampm(bool) to a +// function that takes an unsigned parameter so that locale_find() can be used +// for it. +// +static zstring get_time_ampm( unsigned pm, iso639_1::type lang, + iso3166_1::type country ) { + return locale::get_time_ampm( !!pm, lang, country ); +} + +static void locale_find( char conv, char const **bpp, locale_fn_type locale_fn, + iso639_1::type lang, iso3166_1::type country, + int limit, int *result, bool *found = nullptr ) { + using namespace locale; + + char const *&bp = *bpp; + size_t len_sum = 0; + + for ( int i = 0; i < limit; ++i ) { + zstring const s( locale_fn( i, lang, country ) ); + len_sum += s.size(); + if ( ::strncmp( bp, s.c_str(), s.size() ) == 0 ) { + *result = i; + if ( found ) + *found = true; + bp += s.size(); + return; + } + } + if ( !found ) { + // + // Since we don't know the extent of the value in the buffer, extract a + // representative chunk whose length is the average length of all the legal + // values. + // + throw invalid_value( bp, len_sum / limit, conv ); + } + *found = false; +} + +static void parse_num( char conv, char const **bpp, unsigned low, + unsigned high, int *result ) { + char const *&bp = *bpp; + char c = *bp; + if ( !ascii::is_digit( c ) ) + throw invalid_value( c, conv ); + + unsigned limit = high; // "high" also determines the number of digits + unsigned n = 0; + + do { + n = n * 10 + c - '0'; + limit /= 10; + c = *++bp; + } while ( limit && ascii::is_digit( c ) ); + + if ( n < low || n > high ) + throw invalid_value( n, conv ); + *result = n; +} + +/////////////////////////////////////////////////////////////////////////////// + +/*- + * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code was contributed to The NetBSD Foundation by Klaus Klein. + * Heavily optimised by David Laight + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +// +// We do not implement alternate representations. However, we always check +// whether a given modifier is allowed for a certain conversion. +// +int const ALT_E = 0x01; +int const ALT_O = 0x02; +#define CHECK_ALT(x) \ + do { if ( alt_format & ~(x) ) throw invalid_specification( c ); } while (0) + +static char const* parse_impl( char const *buf, char const *fmt, + iso639_1::type lang, iso3166_1::type country, + ztm *tm, unsigned *set_fields ) { + char const *bp = buf; + char c; + bool found; + zstring recurse_fmt; + bool split_year = false; + + while ( (c = *fmt++) ) { + if ( !*bp ) + throw insufficient_buffer(); + + if ( ascii::is_space( c ) ) { + bp = ascii::trim_start_whitespace( bp ); + continue; + } + + int alt_format = 0; + int n; + + if ( c != '%' ) { // literal +literal: + CHECK_ALT(0); + if ( *bp != c ) + throw literal_mismatch( c, *bp ); + ++bp; + continue; + } + +again: + switch ( c = *fmt++ ) { + case '%': + goto literal; + + case 'a': // abbreviated weekday name + case 'A': // full weekday name + CHECK_ALT(0); + locale_find( + c, &bp, &locale::get_weekday_name, lang, country, 7, &tm->tm_wday, + &found + ); + if ( !found ) + locale_find( + c, &bp, &locale::get_weekday_abbr, lang, country, 7, &tm->tm_wday + ); + *set_fields |= set_wday; + break; + + case 'b': // abbreviated month name + case 'B': // full month name + case 'h': // same as %b + CHECK_ALT(0); + locale_find( + c, &bp, &locale::get_month_name, lang, country, 12, &tm->tm_mon, + &found + ); + if ( !found ) + locale_find( + c, &bp, &locale::get_month_abbr, lang, country, 12, &tm->tm_mon + ); + *set_fields |= set_mon; + break; + + case 'c': // date and time + CHECK_ALT(ALT_E); + recurse_fmt = locale::get_date_time_format(); + goto recurse; + + case 'C': // century number + CHECK_ALT(ALT_E); + parse_num( c, &bp, 0, 99, &n ); + n = n * 100 - TM_YEAR_BASE; + if ( split_year ) + n += tm->tm_year % 100; + else + split_year = true; + tm->tm_year = n; + *set_fields |= set_year; + break; + + case 'D': + CHECK_ALT(0); + recurse_fmt = "%m/%d/%y"; + goto recurse; + + case 'd': // day of month: 01-31 + case 'e': // day of month: 1-31 + CHECK_ALT(ALT_O); + parse_num( c, &bp, 1, 31, &tm->tm_mday ); + *set_fields |= set_mday; + break; + + case 'E': // "%E?" alternative conversion modifier + alt_format = ALT_E; + goto again; + + case 'F': + CHECK_ALT(0); + recurse_fmt = "%Y-%m-%d"; + goto recurse; + + case 'H': // hour: 00-23 + CHECK_ALT(ALT_O); +case_H: parse_num( c, &bp, 0, 23, &tm->tm_hour ); + *set_fields |= set_hour; + break; + + case 'I': // hour: 01-12 + CHECK_ALT(ALT_O); +case_I: parse_num( c, &bp, 1, 12, &tm->tm_hour ); + if ( tm->tm_hour == 12 ) + tm->tm_hour = 0; // assume AM until %p + *set_fields |= set_hour; + break; + + case 'j': // day of year: 001-366 + CHECK_ALT(0); + parse_num( c, &bp, 1, 366, &n ); + tm->tm_yday = n - 1; + *set_fields |= set_yday; + break; + + case 'k': // hour: 0-23 + CHECK_ALT(0); + goto case_H; + + case 'l': // hour: 1-12 + CHECK_ALT(0); + goto case_I; + + case 'm': // month: 01-12 + CHECK_ALT(ALT_O); + parse_num( c, &bp, 1, 12, &n ); + tm->tm_mon = n - 1; + *set_fields |= set_mon; + break; + + case 'M': // minute: 00-59 + CHECK_ALT(ALT_O); + parse_num( c, &bp, 0, 59, &tm->tm_min ); + *set_fields |= set_min; + break; + + case 'n': // newline + case 't': // tab + CHECK_ALT(0); + bp = ascii::trim_start_whitespace( bp ); + break; + + case 'O': // "%O?" alternative conversion modifier + alt_format = ALT_O; + goto again; + + case 'p': // AM/PM + CHECK_ALT(0); + locale_find( c, &bp, &get_time_ampm, lang, country, 2, &n ); + if ( tm->tm_hour > 11 ) + throw invalid_value( tm->tm_hour, "Il" ); + if ( n /* i.e., PM */ ) + tm->tm_hour += 12; + break; + + case 'r': + CHECK_ALT(0); + recurse_fmt = "%I:%M:%S %p"; + goto recurse; + + case 'R': + CHECK_ALT(0); + recurse_fmt = "%H:%M"; + goto recurse; + + case 'S': // seconds: 00-60 (60 for leap second) + CHECK_ALT(ALT_O); + parse_num( c, &bp, 0, 60, &tm->tm_sec ); + *set_fields |= set_sec; + break; + +#if 0 + case 's': // number of seconds since epoch + break; +#endif + + case 'T': + CHECK_ALT(0); + recurse_fmt = "%H:%M:%S"; + goto recurse; + + case 'u': // day of week, beginning on Monday: 1-7 + CHECK_ALT(ALT_O); + parse_num( c, &bp, 1, 7, &n ); + tm->tm_wday = n - 1; + *set_fields |= set_wday; + break; + + case 'v': + CHECK_ALT(0); + recurse_fmt = "%e-%b-%Y"; + goto recurse; + + case 'V': // week of year, beginning on Monday: 01-53 + CHECK_ALT(ALT_O); + // + // This is bogus since we can not assume any valid information present + // in the tm structure at this point to calculate a real value, so just + // check the range for now. + // + parse_num( c, &bp, 1, 53, &n ); + break; + + case 'U': // week of year, beginning on Sunday: 00-53 + case 'W': // week of year, beginning on Monday: 00-53 + CHECK_ALT(ALT_O); + // + // This is bogus since we can not assume any valid information present + // in the tm structure at this point to calculate a real value, so just + // check the range for now. + // + parse_num( c, &bp, 0, 53, &n ); + break; + + case 'w': // day of week, beginning on Sunday: 0-6 + CHECK_ALT(ALT_O); + parse_num( c, &bp, 0, 6, &tm->tm_wday ); + *set_fields |= set_wday; + break; + + case 'x': // date + CHECK_ALT(ALT_E); + recurse_fmt = locale::get_date_format(); + goto recurse; + + case 'X': // time + CHECK_ALT(ALT_E); + recurse_fmt = locale::get_time_format(); + goto recurse; + + case 'y': // year within 100 years of the epoch + CHECK_ALT(ALT_E | ALT_O); + parse_num( c, &bp, 0, 99, &n ); + if ( split_year ) // preserve century + n += (tm->tm_year / 100) * 100; + else { + n += (n <= 68 ? 2000 : 1900) - TM_YEAR_BASE; + split_year = true; + } + tm->tm_year = n; + *set_fields |= set_year; + break; + + case 'Y': // year: 0-9999 + CHECK_ALT(ALT_E); + parse_num( c, &bp, 0, 9999, &n ); + tm->tm_year = n - TM_YEAR_BASE; + *set_fields |= set_year; + break; + + case 'z': { // RFC 2822 timezone offset or name: [+|-]HHMM | ZZZ + CHECK_ALT(0); + char const *const bp0 = bp; + int sign; + switch ( *bp ) { + case '+': sign = 1; ++bp; break; + case '-': sign = -1; ++bp; break; + default : sign = 0; + } + if ( ascii::is_digit( *bp ) ) { // start of HHMM + int hour = (*bp - '0') * 10; + if ( !ascii::is_digit( *++bp ) ) + goto bad_tz; + hour += *bp - '0'; + // + // We don't need to check the hour because values [-99,99] are legal. + // + if ( !ascii::is_digit( *++bp ) ) + goto bad_tz; + int minute = (*bp - '0') * 10; + if ( !ascii::is_digit( *++bp ) ) + goto bad_tz; + minute += *bp++ - '0'; + if ( minute > 59 ) + goto bad_tz; + long gmtoff = hour * 60 * 60 + minute * 60; + if ( sign ) + gmtoff *= sign; + tm->ZTM_GMTOFF = gmtoff; + tm->tm_isdst = 0; + *set_fields |= set_gmtoff; + break; + } else if ( sign ) // sign followed by non-digit +bad_tz: throw invalid_value( bp0, 4 + !!sign, c ); + // no break; + } // case 'z' + + case 'Z': { // RFC 2822 timezone name only: ZZZ + CHECK_ALT(0); + for ( rfc2822_obs_zone const *z = rfc2822_obs_zones; z->name; ++z ) { + size_t const len = ::strlen( z->name ); + if ( ::strncmp( bp, z->name, len ) == 0 ) { + tm->ZTM_GMTOFF = z->gmtoff; + tm->tm_isdst = z->isdst; + *set_fields |= set_gmtoff; + bp += len; + goto next_outer_loop; + } + } + throw invalid_value( bp, 3 /* assume */, c ); + } // case 'Z' + + default: // unknown/unsupported conversion + throw invalid_specification( c ); + } // switch + +next_outer_loop: + continue; + +recurse: + bp = parse_impl( bp, recurse_fmt.c_str(), lang, country, tm, set_fields ); + } // while + + if ( bits_set( *set_fields, set_mday | set_mon | set_year ) ) { + int const year = TM_YEAR_BASE + tm->tm_year; + if ( !is_mday_valid( tm->tm_mday, tm->tm_mon, year ) ) + throw invalid_value( tm->tm_mday, "de" ); + if ( (*set_fields & set_wday) && + !is_wday_valid( tm->tm_wday, tm->tm_mday, tm->tm_mon, year ) ) + throw invalid_value( tm->tm_wday, "uw" ); + if ( (*set_fields & set_yday) && + !is_yday_valid( tm->tm_yday, tm->tm_mday, tm->tm_mon, year ) ) + throw invalid_value( tm->tm_yday, 'j' ); + } + + return bp; +} + +char const* parse( char const *buf, char const *fmt, iso639_1::type lang, + iso3166_1::type country, ztm *tm, unsigned *set_fields ) { + unsigned local_fields; + if ( !set_fields ) + set_fields = &local_fields; + *set_fields = 0; + return parse_impl( buf, fmt, lang, country, tm, set_fields ); +} + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace time +} // namespace zorba +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/util/time_parse.h zorba-2.8.0-0/src/util/time_parse.h --- zorba-2.7.0-0/src/util/time_parse.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/util/time_parse.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,453 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ZORBA_STRPTIME_H +#define ZORBA_STRPTIME_H + +// standard +#include + +// Zorba +#include +#include "cxx_util.h" +#include "string_util.h" +#include "time_util.h" +#include "zorbautils/locale.h" + +namespace zorba { +namespace time { + +/////////////////////////////////////////////////////////////////////////////// + +/** + * An %exception is the root of time::parse %exception hierarchy. + */ +class exception : public std::runtime_error { +public: + ~exception() throw(); +protected: + exception( std::string const &msg ); +}; + +/** + * This exception is thrown when the buffer is exhausted before the format + * string. + */ +class insufficient_buffer : public exception { +public: + insufficient_buffer(); +}; + +/** + * This exception is thrown when an invalid conversion specification is given, + * i.e., an invalid character after a \c %. + */ +class invalid_specification : public std::invalid_argument { +public: + invalid_specification( char spec ); + ~invalid_specification() throw(); + + /** + * Gets the invalid specification. + * + * @return Returns said specification character. + */ + char get_spec() const { + return spec_; + } + +private: + char spec_; +}; + +/** + * This is a helper class for invalid_value. + */ +class invalid_value_specs { +protected: + invalid_value_specs( char spec ); + invalid_value_specs( char const *specs ); + + std::string specs_; +}; + +/** + * This is a helper class for invalid_value. + */ +class invalid_value_value { +protected: + invalid_value_value( char c ); + invalid_value_value( char const *buf, size_t len ); + + template + invalid_value_value( ValueType const &value ); + + std::string value_; +}; + +/** + * This exception is thrown when an invalid value for a given specification was + * given. + */ +class invalid_value : + protected invalid_value_value, + protected invalid_value_specs, + public exception { +public: + invalid_value( char const *buf, size_t len, char spec ); + invalid_value( char const *buf, size_t len, char const *specs ); + + template + invalid_value( ValueType const &value, char spec ); + + template + invalid_value( ValueType const &value, char const *specs ); + + ~invalid_value() throw(); + + /** + * Gets the conversion specification character(s) the value is invalid for. + * + * @return Returns said character(s). + */ + std::string const& get_specs() const { + return specs_; + } + + /** + * Gets the invalid value. + * + * @return Returns said value. + */ + std::string const& get_value() const { + return value_; + } + +private: + static std::string build_msg( std::string const &value, + std::string const &specs ); +}; + +/** + * This exception is thrown when a literal character in the \a buf parameter of + * the parse() function does not match is corresponding character in the + * \a fmt parameter. + */ +class literal_mismatch : public exception { +public: + literal_mismatch( char expected, char got ); + ~literal_mismatch() throw(); + + /** + * Gets the character that was expected. + * + * @return Returns said character. + */ + char get_expected() const { + return expected_; + } + + /** + * Gets the character that was actually gotten. + * + * @return Returns said character. + */ + char get_got() const { + return got_; + } + +private: + char expected_; + char got_; +}; + +/////////////////////////////////////////////////////////////////////////////// + +// +// The bit-wise-or of these constants comprise the value returned by the +// set_fields parameter of the parse() function. +// +unsigned const set_gmtoff = 0x001; // minutes: 0-59 +unsigned const set_hour = 0x002; // hour: 0-23 +unsigned const set_mday = 0x004; // month day: 1-{28,29,30,31} +unsigned const set_min = 0x008; // minutes: 0-59 +unsigned const set_mon = 0x010; // month: 0-11 +unsigned const set_sec = 0x020; // seconds: 0-60 +unsigned const set_wday = 0x040; // weekday: 0-6 +unsigned const set_yday = 0x080; // day of the year: 0-365 +unsigned const set_year = 0x100; + +/** + * Parses the string in the buffer according to the given format and fills in + * the given \c tm structure. + * + * @param buf The buffer to parse. + * @param fmt The format string containing zero or more directives. Each + * specification is of one of the following: + * - one or more white-space characters + * - an ordinary character (neither \c '%' nor a whitespace character) + * - a conversion specification + * All whitespace characters in \a fmt match one or more whitespace characters + * in \a buf. + * Every ordinary character in \a fmt must exactly match the same character in + * the same position in \a buf. + * A conversion specification is composed of a \c '%' character followed by a + * conversion character that specifies the replacement required. The following + * conversion specifications are supported: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
    %a + * The day of the week using the locale's weekday names; + * either the abbreviated or full name may be specified. + *
    %ASame as \c %a.
    %b + * The month using the locale's month names; + * either the abbreviated or full name may be specified. + *
    %BSame as \c %a.
    %c + * The locale's appropriate date and time representation. + *
    %C + * The century number [00,99]; leading zeros are permitted but not + * required. + *
    %d + * The day of the month [01,31]; leading zeros are permitted but not + * required. + *
    %DSame as %m/%d/%y.
    %eSame as \c %d.
    %hSame as \c %b.
    %H + * The hour (24-hour clock) [00,23]; leading zeros are permitted but not + * required. + *
    %I + * The hour (12-hour clock) [01,12]; leading zeros are permitted but not + * required. + *
    %j + * The day number of the year [001,366]; leading zeros are permitted but + * not required. + *
    %m + * The month number [01,12]; leading zeros are permitted but not + * required. + *
    %M + * The minute [00,59]; leading zeros are permitted but not required. + *
    %nAny whitespace.
    %p + * The locale's equivalent of \c AM or \c PM. + *
    %r + * The 12-hour clock time using the AM/PM notation. + *
    %RSame as %H:%M.
    %S + * The seconds [00,60]; leading zeros are permitted but not required. + *
    %tAny whitespace.
    %TSame as %H:%M:%S.
    %U + * The week number of the year (Sunday as the first day of the week) + * [00,53]; leading zeros are permitted but not required. + *
    %w + * The weekday [0,6] with 0 representing Sunday; leading zeros are + * permitted but not required. + *
    %W + * The week number of the year (Monday as the first day of the week) + * [00,53]; leading zeros are permitted but not required. + *
    %x + * The date using the locale's date format. + *
    %X + * The time using the locale's time format. + *
    %y + * The year within century. When a century is not otherwise specified + * (via \c %C), values in the range [69,99] shall refer to years 1969 to + * 1999 and values in the range [00,68] shall refer to years 2000 to + * 2068; leading zeros are permitted but not required. + *
    %Y + * The year including the century (for example, 1988). + *
    %%Literal \c %.
    + * @param lang The language of the locale to use. + * @param country The country of the locale to use. + * @param tm The tm structure to fill in. + * @param set_fields If not null, this is set to the bit-wise-or of the tm + * structure fields that have been set. + * @return Returns a pointer to the first character in \a buf past the last + * character parsed. + * @throws insufficient_buffer if \a buf is insufficient for \a fmt. + * @throws invalid_specification if \a fmt contains an invalid character + * following \c % + * @throws invalid_value if \a buf contains an invalid value for a + * specification. + * @throws literal_mismatch if a literal character in \a buf does not match is + * corresponding character in \a fmt. + */ +char const* parse( char const *buf, char const *fmt, + locale::iso639_1::type lang, + locale::iso3166_1::type country, + ztm *tm, unsigned *set_fields = nullptr ); + +// +// Template version of parse(). +// +template inline +typename std::enable_if< + ztd::has_c_str::value, + char const* +>::type +parse( BufferType const &buf, char const *fmt, + locale::iso639_1::type lang, locale::iso3166_1::type country, + ztm *tm, unsigned *set_fields = nullptr ) { + return parse( buf.c_str(), fmt, lang, country, tm, set_fields ); +} + +// +// Template version of parse(). +// +template inline +typename std::enable_if< + ztd::has_c_str::value, + char const* +>::type +parse( char const *buf, FormatType const &fmt, + locale::iso639_1::type lang, locale::iso3166_1::type country, + ztm *tm, unsigned *set_fields = nullptr ) { + return parse( buf, fmt.c_str(), lang, country, tm, set_fields ); +} + +// +// Template version of parse(). +// +template inline +typename std::enable_if< + ztd::has_c_str::value && + ztd::has_c_str::value, + char const* +>::type +parse( BufferType const &buf, FormatType const &fmt, + locale::iso639_1::type lang, locale::iso3166_1::type country, + ztm *tm, unsigned *set_fields = nullptr ) { + return parse( buf.c_str(), fmt.c_str(), lang, country, tm, set_fields ); +} + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace time +} // namespace zorba +#endif /* ZORBA_STRPTIME_H */ +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/util/time_util.cpp zorba-2.8.0-0/src/util/time_util.cpp --- zorba-2.7.0-0/src/util/time_util.cpp 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/util/time_util.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,205 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "stdafx.h" + +#include +#ifdef WIN32 +# include +# include /* for gmtime_s() */ +# if defined(_MSC_VER) || defined(_MSC_EXTENSIONS) +# define DELTA_EPOCH_IN_USEC 11644473600000000Ui64 +# else +# define DELTA_EPOCH_IN_USEC 11644473600000000ULL +# endif +#else +# include +# include +#endif /* WIN32 */ + +// local +#include "time_util.h" + +namespace zorba { +namespace time { + +/////////////////////////////////////////////////////////////////////////////// + +static unsigned const yday_mon[][13] = { + // 0 1 2 3 4 5 6 7 8 9 10 11 12 + { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }, // non-leap + { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } // leap +}; + +/////////////////////////////////////////////////////////////////////////////// + +bool calc_mday_mon( unsigned yday, unsigned *mday, unsigned *mon, + unsigned year ) { + assert( yday < 365 + is_leap_year( year ) ); + + unsigned const *const ym = yday_mon[ is_leap_year( year ) ]; + for ( unsigned m = 1; m <= 12; ++m ) + if ( ym[ m ] > yday ) { + --m; + if ( mday ) + *mday = yday - ym[ m ] + 1; + if ( mon ) + *mon = m; + return true; + } + return false; +} + +/** + * Tondering's algorithm for calculating the weekday given a date; see: + * http://www.tondering.dk/claus/calendar.html + * + * COPYRIGHT: + * These functions are Copyright (c) 2008 by Claus Tondering + * (claus@tondering.dk). + * + * LICENSE: + * The code is distributed under the Boost Software License, which + * says: + * + * Boost Software License - Version 1.0 - August 17th, 2003 + * + * Permission is hereby granted, free of charge, to any person or + * organization obtaining a copy of the software and accompanying + * documentation covered by this license (the "Software") to use, + * reproduce, display, distribute, execute, and transmit the + * Software, and to prepare derivative works of the Software, and + * to permit third-parties to whom the Software is furnished to do + * so, all subject to the following: + * + * The copyright notices in the Software and this entire + * statement, including the above license grant, this restriction + * and the following disclaimer, must be included in all copies of + * the Software, in whole or in part, and all derivative works of + * the Software, unless such copies or derivative works are solely + * in the form of machine-executable object code generated by a + * source language processor. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND + * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR + * ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR + * OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * @param mday Month day: 1-31. + * @param mon Month: 0-11. + * @param year Year. + * @return Returns the weekday where 0 = Sunday. + */ +unsigned calc_wday( unsigned mday, unsigned mon, unsigned year ) { + assert( mday >= 1 ); + assert( mday <= days_in_month( mon, year ) ); + assert( mon < 12 ); + + ++mon; // Tondering's algorithm assumes month value in range 1-12. + unsigned const a = (14 - mon) / 12; + unsigned const y = year - a; + unsigned const m = mon + 12 * a - 2; + return (mday + y + y/4 - y/100 + y/400 + (31 * m) / 12) % 7; +} + +unsigned calc_yday( unsigned mday, unsigned mon, unsigned year ) { + assert( mday >= 1 ); + assert( mday <= days_in_month( mon, year ) ); + return yday_mon[ is_leap_year( year ) ][ mon ] + mday - 1; +} + +unsigned days_in_month( unsigned mon, unsigned year ) { + static unsigned const days[] = { + 31, // 0: Jan + 28, // 1: Feb + 31, // 2: Mar + 30, // 3: Apr + 31, // 4: May + 30, // 5: Jun + 31, // 6: Jul + 31, // 7: Aug + 30, // 8: Sep + 31, // 9: Oct + 30, // 10: Nov + 31 // 11: Dec + }; + assert( mon < 12 ); + return days[ mon ] + (mon == 1 /* Feb */ && is_leap_year( year )); +} + +void get_epoch( time_t *sec, usec_type *usec ) { +#ifdef WIN32 + FILETIME ft; + ::GetSystemTimeAsFileTime( &ft ); + unsigned __int64 temp = ((__int64)ft.dwHighDateTime << 32) | ft.dwLowDateTime; + temp /= 10; // nanosec -> usec + temp -= DELTA_EPOCH_IN_USEC; // 1601 -> 1970 + *sec = (time_t)(temp / 1000000UL); // usec -> sec + if ( usec ) + *usec = (usec_type)(temp % 1000000UL); +#else + timeval tv; + ::gettimeofday( &tv, nullptr ); + *sec = tv.tv_sec; + if ( usec ) + *usec = tv.tv_usec; +#endif /* WIN32 */ +} + +void get_gmtime( ztm *tm, time_t when ) { + if ( !when ) + get_epoch( &when ); +#ifdef WIN32 + ::gmtime_s( tm, &when ); + tm->ZTM_GMTOFF = 0; +#else + ::gmtime_r( &when, tm ); +#endif /* WIN32 */ +} + +void get_localtime( ztm *tm, time_t when ) { + if ( !when ) + get_epoch( &when ); +#ifdef WIN32 + ::localtime_s( tm, &when ); + tm->ZTM_GMTOFF = - _timezone; // seconds west -> east +#else + ::localtime_r( &when, tm ); +#endif /* WIN32 */ +} + +long get_gmt_offset() { +#ifdef WIN32 + TIME_ZONE_INFORMATION tz; + ::GetTimeZoneInformation( &tz ); + return tz.Bias * -60; // minutes west -> seconds east +#else + time_t const now = ::time( nullptr ); + ztm tm; + ::localtime_r( &now, &tm ); + return ::timegm( &tm ) - now; +#endif /* WIN32 */ +} + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace time +} // namespace zorba +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/util/time_util.h zorba-2.8.0-0/src/util/time_util.h --- zorba-2.7.0-0/src/util/time_util.h 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/src/util/time_util.h 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,205 @@ +/* + * Copyright 2006-2008 The FLWOR Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef ZORBA_TIME_UTIL_H +#define ZORBA_TIME_UTIL_H + +// standard +#include /* for struct tm */ +#ifdef ZORBA_HAVE_TZFILE_H +# include /* for TM_YEAR_BASE */ +#endif /* ZORBA_HAVE_TZFILE_H */ + +// Zorba +#include +#include "cxx_util.h" + +#ifndef TM_YEAR_BASE +# define TM_YEAR_BASE 1900 +#endif + +namespace zorba { +namespace time { + +/////////////////////////////////////////////////////////////////////////////// + +#ifdef WIN32 +typedef unsigned long usec_type; +#else +typedef suseconds_t usec_type; +#endif /* WIN32 */ + +// +// If the OS's tm struct has a GMT-timezone offset field, simply typedef tm as +// ztm; otherwise declare ztm as a struct derived from tm that adds a +// GMT-timezone offset field. +// +#if defined(ZORBA_HAVE_STRUCT_TM_TM_GMTOFF) || \ + defined(ZORBA_HAVE_STRUCT_TM___TM_GMTOFF) +typedef struct tm ztm; +#else +struct ztm : tm { + long tm_gmtoff; +}; +#endif + +// +// Always use this macro to access the tm_gmtoff field of the tm struct since +// its name varies across plattorms. +// +#ifdef ZORBA_HAVE_STRUCT_TM___TM_GMTOFF +# define ZTM_GMTOFF __tm_gmtoff +#else +# define ZTM_GMTOFF tm_gmtoff +#endif + +/////////////////////////////////////////////////////////////////////////////// + +/** + * Calculates the day of the month and month from the given day of the year. + * + * @param yday The year day (0-365) where 0 = January 1. + * @param mday A pointer to the result for the month day (1-31) or \c null if + * this is not desired. + * @param mon A pointer to the result for the month (0-11) or \c null if this + * is not desired. + * @param year The year. + * @return Returns \c true if \a yday and \a year are a valid combination and + * a result is yielded. + */ +bool calc_mday_mon( unsigned yday, unsigned *mday, unsigned *mon, + unsigned year ); + +/** + * Calculates the weekday for the given date. + * + * @param mday The month day (1-31). + * @param mon The month (0-11). + * @param year The year. + * @return Returns the weekday (0-6) where 0 = Sunday. + */ +unsigned calc_wday( unsigned mday, unsigned mon, unsigned year ); + +/** + * Calculates the day of the year for the given date. + * + * @param mday The month day (1-31). + * @param mon The month (0-11). + * @param year The year. + * @return Returns the day of the year (0-365) where 0 = January 1. + */ +unsigned calc_yday( unsigned mday, unsigned mon, unsigned year ); + +/** + * Gets the number of days in the given month. + * + * @param mon The month (0-11). + * @param year The year. + * @return Returns said number of days (1-31). + */ +unsigned days_in_month( unsigned mon, unsigned year ); + +/** + * Gets the number of seconds and microseconds since epoch. + * + * @param sec A pointer to the result in seconds. + * @param usec A pointer to the result in microseconds or \c null if this is + * not desired. + */ +void get_epoch( time_t *sec, usec_type *usec = nullptr ); + +/** + * Gets the Greenwich time and populates the given ztm structure. + * + * @param tm A pointer to the ztm struct to populate. + * @param when If > 0, populates \a tm based on \a when number of seconds + * since \e epoch; if 0, populates \a when based on \e now. + */ +void get_gmtime( ztm *tm, time_t when = 0 ); + +/** + * Gets the offset of the current timezone from Greenwich time. + * + * @return Returns the offset in seconds with positive values being east of the + * prime meridian. + */ +long get_gmt_offset(); + +/** + * Gets the local time and populates the given ztm structure. + * + * @param tm A pointer to the ztm struct to populate. + * @param when If > 0, populates \a tm based on \a when number of seconds + * since \e epoch; if 0, populates \a when based on \e now. + */ +void get_localtime( ztm *tm, time_t when = 0 ); + +/** + * Checks whether the given year is a leap year. + * + * @param year The year to check. + * @return Returns \c true only if \a year is a leap year. + */ +inline bool is_leap_year( unsigned year ) { + return !(year % 4) && ((year % 100) || !(year % 400)); +} + +/** + * Checks whether the given day of the month is valid. + * + * @param mday The month day (1-31). + * @param mon The month (0-11). + * @param year The year. + * @return Returns \a true only if the given day of the month is valid. + */ +inline bool is_mday_valid( unsigned mday, unsigned mon, unsigned year ) { + return mday >= 1 && mday <= days_in_month( mon, year ); +} + +/** + * Checks whether the given weekday is valid. + * + * @param wday The weekday (0-6) where 0 = Sunday. + * @param mday The month day (1-31). + * @param mon The month (0-11). + * @param year The year. + * @return Returns \a true only if the given weekday is valid. + */ +inline bool is_wday_valid( unsigned wday, unsigned mday, unsigned mon, + unsigned year ) { + return wday == calc_wday( mday, mon, year ); +} + +/** + * Checks whether the given day of the year is valid. + * + * @param yday The day of the year (0-365). + * @param mday The month day (1-31). + * @param mon The month (0-11). + * @param year The year. + * @return Returns \a true only if the given day of the year is valid. + */ +inline bool is_yday_valid( unsigned yday, unsigned mday, unsigned mon, + unsigned year ) { + return yday == calc_yday( mday, mon, year ); +} + +/////////////////////////////////////////////////////////////////////////////// + +} // namespace time +} // namespace zorba +#endif /* ZORBA_TIME_UTIL_H */ +/* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/src/util/transcode_streambuf.h zorba-2.8.0-0/src/util/transcode_streambuf.h --- zorba-2.7.0-0/src/util/transcode_streambuf.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/util/transcode_streambuf.h 2013-01-16 18:28:18.000000000 +0000 @@ -18,6 +18,7 @@ #define ZORBA_TRANSCODE_STREAMBUF_H #include +#include /////////////////////////////////////////////////////////////////////////////// diff -Nru zorba-2.7.0-0/src/zorbaserialization/bin_archiver.cpp zorba-2.8.0-0/src/zorbaserialization/bin_archiver.cpp --- zorba-2.7.0-0/src/zorbaserialization/bin_archiver.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbaserialization/bin_archiver.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -137,7 +137,7 @@ BinArchiver::BinArchiver(std::ostream* os) : Archiver(true), - theStringPool(1024, false, false), + theStringPool(1024, false), theFirstBinaryString(0) { this->is = NULL; diff -Nru zorba-2.7.0-0/src/zorbaserialization/class_serializer.h zorba-2.8.0-0/src/zorbaserialization/class_serializer.h --- zorba-2.7.0-0/src/zorbaserialization/class_serializer.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbaserialization/class_serializer.h 2013-01-16 18:28:18.000000000 +0000 @@ -29,6 +29,8 @@ #include #include +#include + #include "zorbaserialization/archiver_consts.h" namespace zorba diff -Nru zorba-2.7.0-0/src/zorbaserialization/serialize_basic_types.cpp zorba-2.8.0-0/src/zorbaserialization/serialize_basic_types.cpp --- zorba-2.7.0-0/src/zorbaserialization/serialize_basic_types.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbaserialization/serialize_basic_types.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -377,7 +377,7 @@ if (ar.is_serializing_out()) { FloatImpl zorba_float(obj); - zstring float_str = zorba_float.toString(); + zstring float_str = zorba_float.toString(); if (isdigit(float_str.c_str()[0])) { diff -Nru zorba-2.7.0-0/src/zorbatypes/URI.cpp zorba-2.8.0-0/src/zorbatypes/URI.cpp --- zorba-2.7.0-0/src/zorbatypes/URI.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/URI.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -945,26 +945,30 @@ { if ( lIndex + 2 >= lEnd ) { - throw XQUERY_EXCEPTION( - err::XQST0046, ERROR_PARAMS( uri, ZED( BadHexSequence ) ) - ); + throw XQUERY_EXCEPTION(err::XQST0046, + ERROR_PARAMS(uri, ZED(BadHexSequence))); } + unicode::code_point lHex1 = lCodepoints[++lIndex]; - if(!ascii::is_xdigit(lHex1)) - throw XQUERY_EXCEPTION( - err::XQST0046, ERROR_PARAMS( uri, ZED( BadHexDigit_3 ), lHex1 ) - ); + + if (!ascii::is_xdigit(lHex1)) + { + throw XQUERY_EXCEPTION(err::XQST0046, + ERROR_PARAMS(uri, ZED(XQST0046_BadHexDigit_3), lHex1)); + } + unicode::code_point lHex2 = lCodepoints[++lIndex]; - if(!ascii::is_xdigit(lHex2)) - throw XQUERY_EXCEPTION( - err::XQST0046, ERROR_PARAMS( uri, ZED( BadHexDigit_3 ), lHex2 ) - ); + + if (!ascii::is_xdigit(lHex2)) + { + throw XQUERY_EXCEPTION(err::XQST0046, + ERROR_PARAMS(uri, ZED(XQST0046_BadHexDigit_3), lHex2)); + } } else if (!is_unreserved_char(lCp) && !is_path_character(lCp) && valid) { - throw XQUERY_EXCEPTION( - err::XQST0046, ERROR_PARAMS( uri, ZED( BadUnicodeChar_3 ), lCp ) - ); + throw XQUERY_EXCEPTION(err::XQST0046, + ERROR_PARAMS(uri, ZED(BadUnicodeChar_3), lCp)); } ++lIndex; } diff -Nru zorba-2.7.0-0/src/zorbatypes/binary.cpp zorba-2.8.0-0/src/zorbatypes/binary.cpp --- zorba-2.7.0-0/src/zorbatypes/binary.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/binary.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -28,16 +28,16 @@ #include "util/base64_util.h" #include "util/stl_util.h" -#define CATCH_BASE64_EXCEPTION() \ - catch ( base64::exception const &e ) { \ - throw XQUERY_EXCEPTION( \ - err::FORG0001, ERROR_PARAMS( e.invalid_char(), ZED( Base64BadChar ) ) \ - ); \ - } \ - catch ( std::invalid_argument const& ) { \ - throw XQUERY_EXCEPTION( \ - err::FORG0001, ERROR_PARAMS( "", ZED( Base64Multiple4 ) ) \ - ); \ +#define CATCH_BASE64_EXCEPTION() \ + catch (const base64::exception& e) \ + { \ + throw XQUERY_EXCEPTION(err::FORG0001, \ + ERROR_PARAMS(ZED(FORG0001_Base64BadChar_2), e.invalid_char())); \ + } \ + catch (const std::invalid_argument& ) \ + { \ + throw XQUERY_EXCEPTION(err::FORG0001, \ + ERROR_PARAMS(ZED(FORG0001_Base64Multiple4))); \ } using namespace std; @@ -330,9 +330,8 @@ if (len % 2 != 0) { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( "", ZED( HexBinaryMustBeEven ) ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_HexBinaryMustBeEven))); } for (size_t i = 0; i < len; ++i) @@ -349,9 +348,8 @@ } else { - throw XQUERY_EXCEPTION( - err::FORG0001, ERROR_PARAMS( lChar, ZED( BadHexDigit_3 ), lChar ) - ); + throw XQUERY_EXCEPTION(err::FORG0001, + ERROR_PARAMS(ZED(FORG0001_BadHexDigit_2), lChar)); } } } diff -Nru zorba-2.7.0-0/src/zorbatypes/datetime/datetimetype.cpp zorba-2.8.0-0/src/zorbatypes/datetime/datetimetype.cpp --- zorba-2.7.0-0/src/zorbatypes/datetime/datetimetype.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/datetime/datetimetype.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -1196,7 +1196,7 @@ { // validate timezone value (-14 .. +14 H) if (tz_seconds > 14*3600 || tz_seconds < -14*3600) - throw InvalidTimezoneException(); + throw InvalidTimezoneException( tz_seconds ); d = Duration(Duration::DAYTIMEDURATION_FACET, (tz_seconds < 0), 0, 0, 0, 0, 0, tz_seconds, 0); @@ -1222,7 +1222,7 @@ // validate timezone value (-14 .. +14 H) if (tz_seconds > 14*3600 || tz_seconds < -14*3600) - throw InvalidTimezoneException(); + throw InvalidTimezoneException( tz_seconds ); // If $timezone is not specified, then $timezone is the value of the implicit timezone in the dynamic context. context_tz = std::auto_ptr(new Duration(Duration::DAYTIMEDURATION_FACET, (tz_seconds<0), 0, 0, 0, 0, 0, tz_seconds, 0)); @@ -1282,7 +1282,7 @@ d->getSeconds() != Integer::zero() || d->getHours()*3600 + d->getMinutes()*60 > 14*3600 || d->getHours()*3600 + d->getMinutes()*60 < -14*3600) - throw InvalidTimezoneException(); + throw InvalidTimezoneException( d->getHours()*3600 + d->getMinutes()*60 ); // If $arg does not have a timezone component and $timezone is not the // empty sequence, then the result is $arg with $timezone as the timezone diff -Nru zorba-2.7.0-0/src/zorbatypes/datetime.h zorba-2.8.0-0/src/zorbatypes/datetime.h --- zorba-2.7.0-0/src/zorbatypes/datetime.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/datetime.h 2013-01-16 18:28:18.000000000 +0000 @@ -42,6 +42,13 @@ class InvalidTimezoneException : public std::exception { +public: + InvalidTimezoneException( int tz_seconds ) : tz_seconds_( tz_seconds ) { } + + int get_tz_seconds() const { return tz_seconds_; } + +private: + int tz_seconds_; }; diff -Nru zorba-2.7.0-0/src/zorbatypes/integer.cpp zorba-2.8.0-0/src/zorbatypes/integer.cpp --- zorba-2.7.0-0/src/zorbatypes/integer.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/integer.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -77,6 +77,14 @@ value_ = ztd::itoa( n, buf ); } +#if ZORBA_SIZEOF_INT == ZORBA_SIZEOF_LONG +TEMPLATE_DECL(T) +INTEGER_IMPL(T)::IntegerImpl( unsigned int n ) { + ztd::itoa_buf_type buf; + value_ = ztd::itoa( n, buf ); +} +#endif /* ZORBA_SIZEOF_INT == ZORBA_SIZEOF_LONG */ + IntegerImpl::IntegerImpl( unsigned long n ) { ztd::itoa_buf_type buf; value_ = ztd::itoa( n, buf ); diff -Nru zorba-2.7.0-0/src/zorbatypes/integer.h zorba-2.8.0-0/src/zorbatypes/integer.h --- zorba-2.7.0-0/src/zorbatypes/integer.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/integer.h 2013-01-16 18:28:18.000000000 +0000 @@ -524,6 +524,8 @@ friend xs_int to_xs_int( INTEGER_IMPL_LL const& ); friend xs_long to_xs_long( INTEGER_IMPL_LL const& ); + friend xs_unsignedByte to_xs_unsignedByte( INTEGER_IMPL_LL const& ); + friend xs_unsignedShort to_xs_unsignedShort( INTEGER_IMPL_LL const& ); friend xs_unsignedInt to_xs_unsignedInt( INTEGER_IMPL_LL const& ); friend xs_unsignedLong to_xs_unsignedLong( INTEGER_IMPL_LL const& ); @@ -576,23 +578,31 @@ TEMPLATE_DECL(I) inline INTEGER_IMPL(I)::IntegerImpl( unsigned char c ) : - value_( static_cast( c ) ) + value_( static_cast( (unsigned long)c ) ) { } TEMPLATE_DECL(I) inline INTEGER_IMPL(I)::IntegerImpl( unsigned short n ) : - value_( static_cast( n ) ) + value_( static_cast( (unsigned long)n ) ) { } +#ifdef ZORBA_WITH_BIG_INTEGER +#if ZORBA_SIZEOF_INT != ZORBA_SIZEOF_LONG +TEMPLATE_DECL(T) +inline INTEGER_IMPL(T)::IntegerImpl( unsigned int n ) : + value_( static_cast( (unsigned long)n ) ) +{ +} +#endif /* ZORBA_SIZEOF_INT == ZORBA_SIZEOF_LONG */ +#else /* ZORBA_WITH_BIG_INTEGER */ TEMPLATE_DECL(I) inline INTEGER_IMPL(I)::IntegerImpl( unsigned int n ) : - value_( static_cast( n ) ) + value_( static_cast( n ) ) { } -#ifndef ZORBA_WITH_BIG_INTEGER TEMPLATE_DECL(I) inline INTEGER_IMPL(I)::IntegerImpl( unsigned long n ) : value_( static_cast( n ) ) diff -Nru zorba-2.7.0-0/src/zorbatypes/numconversions.cpp zorba-2.8.0-0/src/zorbatypes/numconversions.cpp --- zorba-2.7.0-0/src/zorbatypes/numconversions.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/numconversions.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -70,6 +70,28 @@ } #endif /* ZORBA_WITH_BIG_INTEGER */ +xs_unsignedByte to_xs_unsignedByte( xs_integer const &i ) { +#ifdef ZORBA_WITH_BIG_INTEGER + zstring const temp( i.toString() ); + return ztd::aton( temp.c_str() ); +#else + if ( i.is_xs_unsignedByte() ) + return static_cast( i.value_ ); + throw RANGE_ERROR( i, "xs:unsignedByte" ); +#endif /* ZORBA_WITH_BIG_INTEGER */ +} + +xs_unsignedShort to_xs_unsignedShort( xs_integer const &i ) { +#ifdef ZORBA_WITH_BIG_INTEGER + zstring const temp( i.toString() ); + return ztd::aton( temp.c_str() ); +#else + if ( i.is_xs_unsignedShort() ) + return static_cast( i.value_ ); + throw RANGE_ERROR( i, "xs:unsignedShort" ); +#endif /* ZORBA_WITH_BIG_INTEGER */ +} + xs_unsignedInt to_xs_unsignedInt( xs_integer const &i ) { #ifdef ZORBA_WITH_BIG_INTEGER zstring const temp( i.toString() ); diff -Nru zorba-2.7.0-0/src/zorbatypes/numconversions.h zorba-2.8.0-0/src/zorbatypes/numconversions.h --- zorba-2.7.0-0/src/zorbatypes/numconversions.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbatypes/numconversions.h 2013-01-16 18:28:18.000000000 +0000 @@ -69,6 +69,26 @@ #endif /* ZORBA_WITH_BIG_INTEGER */ /** + * Converts an \c xs:integer value to an \c xs:unsignedByte. + * + * @param i The \c xs:integer value to convert. + * @return Returns said value. + * @throws std::range_error if the \c xs:integer value can not be accurately + * represented as an \c xs:unsignedByte. + */ +xs_unsignedByte to_xs_unsignedByte( xs_integer const &i ); + +/** + * Converts an \c xs:integer value to an \c xs:unsignedShort. + * + * @param i The \c xs:integer value to convert. + * @return Returns said value. + * @throws std::range_error if the \c xs:integer value can not be accurately + * represented as an \c xs:unsignedShort. + */ +xs_unsignedShort to_xs_unsignedShort( xs_integer const &i ); + +/** * Converts an \c xs:integer value to an \c xs:unsignedInt. * * @param i The \c xs:integer value to convert. diff -Nru zorba-2.7.0-0/src/zorbautils/hashmap.h zorba-2.8.0-0/src/zorbautils/hashmap.h --- zorba-2.7.0-0/src/zorbautils/hashmap.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbautils/hashmap.h 2013-01-16 18:28:18.000000000 +0000 @@ -16,6 +16,7 @@ #ifndef ZORBA_UTILS_HASHMAP_H #define ZORBA_UTILS_HASHMAP_H +#include #include #include @@ -23,9 +24,10 @@ #include "common/common.h" #include "zorbautils/fatal.h" -#include "zorbautils/checked_vector.h" #include "zorbautils/mutex.h" +#include "store/api/shared_types.h" + namespace zorba { @@ -42,18 +44,81 @@ template class HashEntry { + struct KeyHolder + { + char theKey[sizeof(T)]; + }; + + struct ValueHolder + { + char theValue[sizeof(V)]; + }; + public: bool theIsFree; - T theItem; - V theValue; + KeyHolder theKey; + ValueHolder theValue; ptrdiff_t theNext; // offset from "this" to the next entry. - HashEntry() : theIsFree(true), theNext(0) { } + HashEntry() + : + theIsFree(true), + theNext(0) + { + } + + HashEntry(const HashEntry& other) + { + theIsFree = other.theIsFree; + theNext = other.theNext; + if (!theIsFree) + { + new (&theKey) T(other.key()); + new (&theValue) V(other.value()); + } + } ~HashEntry() { - theIsFree = true; - theNext = 0; + if (!theIsFree) + { + key().~T(); + value().~V(); + } + } + + HashEntry& operator = (const HashEntry& other) + { + if (theIsFree) + { + assert(false); + + if (!other.theIsFree) + { + new (&theKey) T(other.key()); + new (&theValue) V(other.value()); + } + } + else + { + if (!other.theIsFree) + { + key() = other.key(); + value() = other.value(); + } + else + { + assert(false); + + key().~T(); + value().~V(); + } + } + + theIsFree = other.theIsFree; + theNext = other.theNext; + + return *this; } bool isFree() const @@ -63,15 +128,39 @@ void setFree() { - theItem.~T(); + key().~T(); + value().~V(); theIsFree = true; + theNext = 0; } void unsetFree() { + new (&theKey) T; + new (&theValue) V; theIsFree = false; } + T& key() + { + return *reinterpret_cast(&theKey); + } + + const T& key() const + { + return *reinterpret_cast(&theKey); + } + + const V& value() const + { + return *reinterpret_cast(&theValue); + } + + V& value() + { + return *reinterpret_cast(&theValue); + } + void setNext(HashEntry* nextEntry) { theNext = (nextEntry == NULL ? 0 : nextEntry - this); @@ -105,17 +194,17 @@ theHashTab : The hash table. The table is implemented as a vector of hash entries and is devided in 2 areas: Each entry between 0 and - theHashTabSize - 1 is the head of a hash bucket. Each entry - between theHashTabSize+1 and theHashTab.size()-1 is either + theNumBuckets - 1 is the head of a hash bucket. Each entry + between theNumBuckets+1 and theHashTab.size()-1 is either a "collision" entry (i.e., it belongs to a hash bucket with more than one entries) or a "free" entry (i.e. it does not currently belong to any bucket, but is available for allocation as a collision entry when needed). Free entries in the collision area are linked in a free list. Entry - theHashTab[theHashTabSize] is reserved as the head of this + theHashTab[theNumBuckets] is reserved as the head of this free list. - theHashTabSize : The current number of hash buckets in theHashTab. - theInitialSize : The initial number of hash buckets. + theNumBuckets : The current number of hash buckets in theHashTab. + theLoadFactor : The max fraction of non-empty hash buckets after which the hash table is doubled in size. @@ -130,11 +219,11 @@ friend class HashMap; protected: - checked_vector >* theHashTab; - size_t thePos; + std::vector >* theHashTab; + csize thePos; protected: - iterator(checked_vector >* ht, size_t pos) + iterator(std::vector >* ht, csize pos) : theHashTab(ht), thePos(pos) @@ -150,7 +239,7 @@ HashEntry& entry = (*theHashTab)[thePos]; - return entry.theItem; + return entry.key(); } public: @@ -194,7 +283,7 @@ const HashEntry& entry = (*theHashTab)[thePos]; - return std::pair(entry.theItem, entry.theValue); + return std::pair(entry.key(), entry.value()); } const T& getKey() const @@ -203,16 +292,25 @@ const HashEntry& entry = (*theHashTab)[thePos]; - return entry.theItem; + return entry.key(); + } + + const V& getValue() const + { + ZORBA_FATAL(thePos < theHashTab->size(), ""); + + HashEntry& entry = (*theHashTab)[thePos]; + + return entry.value(); } - V& getValue() const + V& getValue() { ZORBA_FATAL(thePos < theHashTab->size(), ""); HashEntry& entry = (*theHashTab)[thePos]; - return entry.theValue; + return entry.value(); } void setValue(const V& val) @@ -221,7 +319,7 @@ HashEntry& entry = (*theHashTab)[thePos]; - entry.theValue = val; + entry.value() = val; } }; @@ -230,20 +328,22 @@ static const double DEFAULT_LOAD_FACTOR; protected: - ulong theNumEntries; + std::vector > theHashTab; + + csize theNumBuckets; + + csize theNumEntries; + + double theLoadFactor; - size_t theHashTabSize; - size_t theInitialSize; - checked_vector > theHashTab; - double theLoadFactor; - C theCompareFunction; + double theMaxLoad; - bool theUseTransfer; + C theCompareFunction; - SYNC_CODE(mutable Mutex theMutex;) - SYNC_CODE(Mutex * theMutexp;) + SYNC_CODE(mutable Mutex theMutex;) + SYNC_CODE(Mutex * theMutexp;) - int numCollisions; + csize theNumCollisions; public: @@ -257,19 +357,20 @@ depends on some parametrs (e.g. the collation or timezone). These parameters are provided as data members of the given comparison-function obj. ********************************************************************************/ -HashMap(const C& compFunction, size_t size, bool sync, bool useTransfer = false) +HashMap(const C& compFunction, csize size, bool sync) : + theNumBuckets(size), theNumEntries(0), - theHashTabSize(size), - theInitialSize(size), - theHashTab(computeTabSize(size)), theLoadFactor(DEFAULT_LOAD_FACTOR), theCompareFunction(compFunction), - theUseTransfer(useTransfer), - numCollisions(0) + theNumCollisions(0) { + theHashTab.resize(computeCapacity(size)); + formatCollisionArea(); + theMaxLoad = theNumBuckets * theLoadFactor; + SYNC_CODE(theMutexp = (sync ? &theMutex : NULL);) } @@ -284,18 +385,19 @@ theCompareFunction data member is initialized with the default constructor of the C class. ********************************************************************************/ -HashMap(size_t size, bool sync, bool useTransfer = false) +HashMap(csize size, bool sync) : + theNumBuckets(size), theNumEntries(0), - theHashTabSize(size), - theInitialSize(size), - theHashTab(computeTabSize(size)), theLoadFactor(DEFAULT_LOAD_FACTOR), - theUseTransfer(useTransfer), - numCollisions(0) + theNumCollisions(0) { + theHashTab.resize(computeCapacity(size)); + formatCollisionArea(); + theMaxLoad = theNumBuckets * theLoadFactor; + SYNC_CODE(theMutexp = (sync ? &theMutex : NULL);) } @@ -340,7 +442,7 @@ /******************************************************************************* ********************************************************************************/ -ulong size() const +csize size() const { return theNumEntries; } @@ -349,7 +451,7 @@ /******************************************************************************* ********************************************************************************/ -size_t capacity() const +csize capacity() const { return theHashTab.size(); } @@ -358,6 +460,24 @@ /******************************************************************************* ********************************************************************************/ +csize bucket_count() const +{ + return theNumBuckets; +} + + +/******************************************************************************* + +********************************************************************************/ +csize collisions() const +{ + return theNumCollisions; +} + + +/******************************************************************************* + +********************************************************************************/ C get_compare_function() { return theCompareFunction; @@ -388,13 +508,17 @@ void clearNoSync() { theNumEntries = 0; - numCollisions = 0; + theNumCollisions = 0; + + csize n = theHashTab.size(); - size_t n = theHashTab.size(); + HashEntry* entry = &theHashTab[0]; + HashEntry* lastentry = &theHashTab[n-1]; - for (size_t i = 0; i < n; ++i) + for (; entry <= lastentry; ++entry) { - theHashTab[i].~HashEntry(); + if (!entry->isFree()) + entry->setFree(); } formatCollisionArea(); @@ -406,13 +530,13 @@ ********************************************************************************/ iterator begin() const { - return iterator(const_cast >*>(&theHashTab), 0); + return iterator(const_cast >*>(&theHashTab), 0); } iterator end() const { - return iterator(const_cast >*>(&theHashTab), + return iterator(const_cast >*>(&theHashTab), theHashTab.size()); } @@ -437,7 +561,7 @@ while (entry != NULL) { - if (equal(entry->theItem, item)) + if (equal(entry->key(), item)) return true; entry = entry->getNext(); @@ -468,7 +592,7 @@ while (entry != NULL) { - if (equal(entry->theItem, item)) + if (equal(entry->key(), item)) return iterator(&theHashTab, entry - &theHashTab[0]); entry = entry->getNext(); @@ -498,9 +622,9 @@ while (entry != NULL) { - if (equal(entry->theItem, item)) + if (equal(entry->key(), item)) { - value = entry->theValue; + value = entry->value(); return true; } @@ -527,8 +651,8 @@ if (!found) { - entry->theItem = pair.first; - entry->theValue = pair.second; + entry->key() = pair.first; + entry->value() = pair.second; } return !found; @@ -552,12 +676,12 @@ if (!found) { - entry->theItem = item; - entry->theValue = value; + entry->key() = item; + entry->value() = value; } else { - value = entry->theValue; + value = entry->value(); } return !found; @@ -586,7 +710,7 @@ while (entry != NULL) { - if (equal(entry->theItem, item)) + if (equal(entry->key(), item)) { found = true; break; @@ -602,7 +726,7 @@ } else { - entry->theValue = value; + entry->value() = value; return true; } } @@ -616,13 +740,13 @@ { SYNC_CODE(AutoMutex lock(theMutexp);) - if (ite.thePos < theHashTabSize) + if (ite.thePos < theNumBuckets) { eraseEntry(&theHashTab[ite.thePos], NULL); } else { - const T& item = theHashTab[ite.thePos].theItem; + const T& item = theHashTab[ite.thePos].key(); ulong hval = hash(item); @@ -665,7 +789,7 @@ // If the item to remove is in the 1st entry of a bucket, then if the // bucket has no other entries, just call the destructor on that entry, // else copy the 2nd entry to the 1st entry and freeup the 2nd entry. - if (equal(entry->theItem, item)) + if (equal(entry->key(), item)) { eraseEntry(entry, NULL); return true; @@ -678,7 +802,7 @@ while (entry != NULL) { - if (equal(entry->theItem, item)) + if (equal(entry->key(), item)) { eraseEntry(entry, preventry); return true; @@ -698,9 +822,9 @@ /******************************************************************************* ********************************************************************************/ -size_t computeTabSize(size_t size) const +csize computeCapacity(csize size) const { - return size + 32 + size/5; + return size + 32 + static_cast(size / (5 - 10 * (theLoadFactor - 0.7))); } @@ -724,7 +848,7 @@ ********************************************************************************/ HashEntry* bucket(ulong hvalue) { - return &theHashTab[hvalue % theHashTabSize]; + return &theHashTab[hvalue % theNumBuckets]; } @@ -733,7 +857,7 @@ ********************************************************************************/ const HashEntry* bucket(ulong hvalue) const { - return &theHashTab[hvalue % theHashTabSize]; + return &theHashTab[hvalue % theNumBuckets]; } @@ -742,7 +866,7 @@ ********************************************************************************/ HashEntry* freelist() { - return &theHashTab[theHashTabSize]; + return &theHashTab[theNumBuckets]; } @@ -755,41 +879,38 @@ { if (entry->theNext == 0) { - entry->~HashEntry(); + entry->setFree(); } else { HashEntry* nextEntry = entry->getNext(); *entry = *nextEntry; entry->setNext(nextEntry->getNext()); - nextEntry->~HashEntry(); + nextEntry->setFree(); nextEntry->setNext(freelist()->getNext()); freelist()->setNext(nextEntry); } - theNumEntries--; + --theNumEntries; - if (theHashTabSize > theInitialSize && - theNumEntries < (theHashTabSize / 2) * theLoadFactor) + if (theNumEntries < theMaxLoad / 2) { - resizeHashTab(theHashTabSize / 2); + resizeHashTab(theNumBuckets / 2); } } else { preventry->setNext(entry->getNext()); - entry->~HashEntry(); + entry->setFree(); entry->setNext(freelist()->getNext()); freelist()->setNext(entry); - theNumEntries--; - numCollisions--; + --theNumEntries; - if (theHashTabSize > theInitialSize && - theNumEntries < (theHashTabSize / 2) * theLoadFactor) + if (theNumEntries < theMaxLoad / 2) { - resizeHashTab(theHashTabSize / 2); + resizeHashTab(theNumBuckets / 2); } } } @@ -812,7 +933,7 @@ // If the hash bucket is empty, its 1st entry is used to store the new string. if (headEntry->isFree()) { - theNumEntries++; + ++theNumEntries; headEntry->unsetFree(); return headEntry; } @@ -822,7 +943,7 @@ while (currEntry != NULL) { - if (equal(currEntry->theItem, item)) + if (equal(currEntry->key(), item)) { found = true; return currEntry; @@ -836,22 +957,22 @@ // Do garbage collection if the hash table is more than 60% full. Note that // gc does NOT resize theHashTab, so after gc, the item still belongs to the // same bucket as before gc. - if (theNumEntries > theHashTabSize * theLoadFactor) + if (theNumEntries > theMaxLoad) { garbageCollect(); if (headEntry->isFree()) { - theNumEntries++; + ++theNumEntries; headEntry->unsetFree(); return headEntry; } } // Double the size of the hash table if it is more than 60% full. - if (theNumEntries > theHashTabSize * theLoadFactor) + if (theNumEntries > theMaxLoad) { - resizeHashTab(theHashTabSize * 2); + resizeHashTab(theNumBuckets * 2); goto retry; } @@ -859,8 +980,8 @@ // collision list for its bucket. We place the new item right after the // headEntry for the bucket. - theNumEntries++; - numCollisions++; + ++theNumEntries; + ++theNumCollisions; // If no free entry exists, we extend the collision area of the hash table. if (freelist()->getNext() == 0) @@ -886,10 +1007,15 @@ ********************************************************************************/ void extendCollisionArea() { - size_t oldSize = theHashTab.size(); - size_t numCollisionEntries = oldSize - theHashTabSize; - size_t newSize = theHashTabSize + 2 * numCollisionEntries; - + csize oldSize = theHashTab.size(); + csize numCollisionEntries = oldSize - theNumBuckets; + csize newSize = theNumBuckets + 2 * numCollisionEntries; + + /* + std::cout << "Extending collision area" << std::endl + << "numBuckets = " << theNumBuckets << " numCollisionEntries = " + << numCollisionEntries << std::endl << std::endl; + */ //foo(); for setting a breakpoint theHashTab.resize(newSize); @@ -909,7 +1035,8 @@ firstentry = freelist(); HashEntry* lastentry = &theHashTab[theHashTab.size() - 1]; - for (HashEntry* entry = firstentry; entry < lastentry; entry++) + + for (HashEntry* entry = firstentry; entry < lastentry; ++entry) entry->theNext = 1; lastentry->theNext = 0; @@ -919,31 +1046,34 @@ /******************************************************************************* ********************************************************************************/ -void resizeHashTab(size_t newSize) +void resizeHashTab(csize newSize) { - HashEntry* entry; - HashEntry* oldentry; + if (newSize == 0) + newSize = 3; + + csize oldcap = theHashTab.size(); + csize newcap = computeCapacity(newSize); // Create a new vector of new size and swap theHashTab with this new vector - checked_vector > oldTab(computeTabSize(newSize)); + std::vector > oldTab(newcap); theHashTab.swap(oldTab); - size_t oldsize = oldTab.size(); - theHashTabSize = newSize; + theNumBuckets = newSize; + theMaxLoad = theNumBuckets * theLoadFactor; formatCollisionArea(); - numCollisions = 0; + HashEntry* entry; + HashEntry* oldentry = &oldTab[0]; + HashEntry* lastentry = &oldTab[oldcap-1]; // Now rehash every entry - for (size_t i = 0; i < oldsize; i++) + for (; oldentry <= lastentry; ++oldentry) { - oldentry = &oldTab[i]; - if (oldentry->isFree()) continue; - entry = bucket (hash(oldentry->theItem)); + entry = bucket(hash(oldentry->key())); if (!entry->isFree()) { @@ -962,12 +1092,11 @@ freelist()->setNext(entry->getNext()); entry->setNext(headEntry->getNext()); headEntry->setNext(entry); - numCollisions++; } - entry->theItem = oldentry->theItem; - entry->theValue = oldentry->theValue; entry->unsetFree(); + entry->key() = oldentry->key(); + entry->value() = oldentry->value(); } } diff -Nru zorba-2.7.0-0/src/zorbautils/hashset.h zorba-2.8.0-0/src/zorbautils/hashset.h --- zorba-2.7.0-0/src/zorbautils/hashset.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbautils/hashset.h 2013-01-16 18:28:18.000000000 +0000 @@ -45,16 +45,16 @@ typedef typename HashMap::iterator iterator; -HashSet(const C& compFunction, ulong size, bool sync, bool useTransfer = false) +HashSet(const C& compFunction, ulong size, bool sync) : - HashMap(compFunction, size, sync, useTransfer) + HashMap(compFunction, size, sync) { } HashSet(ulong size, bool sync) : - HashMap(size, sync, false) + HashMap(size, sync) { } @@ -100,12 +100,7 @@ if (!found) { - /* - if (this->theUseTransfer) - entry->theItem.transfer(item); - else - */ - entry->theItem = item; + entry->key() = item; } return !found; @@ -129,19 +124,13 @@ entry = this->hashInsert(item, this->hash(item), found); if (!found) { - /* - if (this->theUseTransfer) - entry->theItem.transfer(item); - else - */ - entry->theItem = item; - - outItem = entry->theItem; + entry->key() = item; + outItem = entry->key(); return true; } else { - outItem = entry->theItem; + outItem = entry->key(); return false; } } @@ -164,13 +153,13 @@ entry = this->hashInsert(item, this->hash(item), found); if (!found) { - entry->theItem = item; - outItem = entry->theItem; + entry->key() = item; + outItem = entry->key(); return true; } else { - outItem = entry->theItem; + outItem = entry->key(); return false; } } diff -Nru zorba-2.7.0-0/src/zorbautils/locale.cpp zorba-2.8.0-0/src/zorbautils/locale.cpp --- zorba-2.7.0-0/src/zorbautils/locale.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbautils/locale.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -21,17 +21,24 @@ #else # include # include /* for getenv(3) */ +# include /* for nl_langinfo(3) */ +# include /* for newlocale(3) */ #endif /* WIN32 */ #include #include +#include #include +// Zorba +#include "util/ascii_util.h" #include "util/cxx_util.h" #include "util/less.h" #include "util/stl_util.h" +#include "util/string_util.h" +// local #include "locale.h" #define DEF_END(CHAR_ARRAY) \ @@ -46,6 +53,12 @@ namespace zorba { namespace locale { +#ifdef WIN32 +typedef LCTYPE locale_index_type; +#else +typedef nl_item locale_index_type; +#endif /* WIN32 */ + /////////////////////////////////////////////////////////////////////////////// /** @@ -61,19 +74,116 @@ #ifdef WIN32 /** + * Gets the name of the locale for the given language and country in the format + * that Windows expects. + * + * @param lang The language to use. + * @param country The country to use, if any. + * @return Returns a pointre to the UTF-16 buffer containing the locale name. + */ +static unique_ptr get_wlocale_name( iso639_1::type lang, + iso3166_1::type country ) { + assert( lang ); + + zstring locale_name( iso639_1::string_of[ lang ] ); + if ( country ) { + locale_name += '-'; + locale_name += iso3166_1::string_of[ country ]; + } + + unique_ptr wlocale_name( new WCHAR[ LOCALE_NAME_MAX_LENGTH ] ); + MultiByteToWideChar( + CP_UTF8, 0, locale_name.c_str(), -1, + wlocale_name.get(), LOCALE_NAME_MAX_LENGTH + ); + return wlocale_name; +} + +/** + * Converts a wide character (UTF-16) string to a multibyte (UTF-8) string. + * + * @param ws The wide string to convert. + * @return Returns the equivalent multi-byte string. + */ +static unique_ptr wtoa( LPCWSTR ws ) { + int const len = ::WideCharToMultiByte( + CP_UTF8, 0, ws, -1, NULL, 0, NULL, NULL + ); + unique_ptr s( new char[ len ] ); + ::WideCharToMultiByte( CP_UTF8, 0, ws, -1, s.get(), len, NULL, NULL ); + return s; +} + +/** * Gets a particular piece of information from the user's default locale. * * @param constant The constant specifying which piece of locale information to * get. - * @return Returns said information or \c nullptr. + * @return Returns said information or an emptr string. */ -static char* get_win32_locale_info( int constant ) { - int bytes = ::GetLocaleInfoA( LOCALE_USER_DEFAULT, constant, NULL, 0 ); - ZORBA_FATAL( bytes, "GetLocaleInfoA() failed" ); - unique_ptr info( new char[ bytes ] ); - bytes = ::GetLocaleInfoA( LOCALE_USER_DEFAULT, constant, info.get(), bytes ); - ZORBA_FATAL( bytes, "GetLocaleInfoA() failed" ); - return info.release(); +static zstring get_locale_info( int constant ) { + int wlen = ::GetLocaleInfo( LOCALE_USER_DEFAULT, constant, NULL, 0 ); + if ( !wlen ) + return zstring(); + unique_ptr winfo( new WCHAR[ wlen ] ); + wlen = ::GetLocaleInfo( LOCALE_USER_DEFAULT, constant, winfo.get(), wlen ); + ZORBA_FATAL( wlen, "GetLocaleInfo() failed" ); + unique_ptr const info( wtoa( winfo.get() ) ); + return zstring( info.get() ); +} + +/** + * GetLocaleInfoEx() is available only on Windows Vista and later so we can't + * call it directly since we might be running on Windows XP. Hence, check to + * see if it's available and call it indirectly if so. + */ +static int Zorba_GetLocaleInfoEx( LPCWSTR lpLocaleName, LCTYPE LCType, + LPWSTR lpLCData, int cchData ) { + typedef int (WINAPI *GetLocaleInfoEx_type)( LPCWSTR, LCTYPE, LPWSTR, int ); + + static GetLocaleInfoEx_type GetLocaleInfoEx_ptr; + static bool init; + + if ( !init ) { + GetLocaleInfoEx_ptr = (GetLocaleInfoEx_type)::GetProcAddress( + ::GetModuleHandle( TEXT( "kernel32.dll" ) ), "GetLocaleInfoEx" + ); + init = true; + } + + return GetLocaleInfoEx_ptr ? + GetLocaleInfoEx_ptr( lpLocaleName, LCType, lpLCData, cchData ) : 0; +} + +/** + * Gets a particular piece of information from a locale. + * + * @param constant The constant specifying which piece of locale information to + * get. + * @param lang The language to use, if any. + * @param country The country to use, if any. + * @return Returns said information or an empty string. + */ +static zstring get_locale_info( int constant, iso639_1::type lang, + iso3166_1::type country ) { + LPCWSTR wlocale_name; + unique_ptr wlocale_name_ptr; + + if ( lang && country ) { + wlocale_name_ptr = get_wlocale_name( lang, country ); + wlocale_name = wlocale_name_ptr.get(); + } else + wlocale_name = LOCALE_NAME_USER_DEFAULT; + + int wlen = Zorba_GetLocaleInfoEx( wlocale_name, constant, NULL, 0 ); + if ( !wlen ) + return zstring(); + unique_ptr winfo( new WCHAR[ wlen ] ); + wlen = Zorba_GetLocaleInfoEx( wlocale_name, constant, winfo.get(), wlen ); + ZORBA_FATAL( wlen, "GetLocaleInfoEx() failed" ); + + unique_ptr const info( wtoa( winfo.get() ) ); + return zstring( info.get() ); } #else /* WIN32 */ @@ -96,7 +206,7 @@ * * @return Returns said locale, e.g., "en_US.UTF-8" or \c nullptr. */ -static char* get_unix_locale() { +static zstring get_unix_locale() { // // Try the environment locale first. // @@ -107,7 +217,53 @@ // loc = filter_useless_locale( ::getenv( "LANG" ) ); } - return loc ? ztd::new_strdup( loc ) : nullptr; + zstring result; + if ( loc && *loc ) + result = loc; + return result; +} + +/** + * Gets the locale_t corresponding to the given language and country. It is + * the caller's responsibility to call \c freelocale(3) on the result. + * + * @param lang The language. + * @param country The country. + * @return Returns said \c locale_t or \c (locale_t)0. + */ +static locale_t get_unix_locale_t( iso639_1::type lang, + iso3166_1::type country ) { + zstring locale_name( iso639_1::string_of[ lang ] ); + if ( country ) { + locale_name += '_'; + locale_name += iso3166_1::string_of[ country ]; + } + locale_t loc = ::newlocale( LC_TIME_MASK, locale_name.c_str(), nullptr ); + if ( !loc && country ) // try it without the country + loc = ::newlocale( LC_TIME_MASK, iso639_1::string_of[ lang ], nullptr ); + return loc; +} + +/** + * Gets a particular piece of information from a locale. + * + * @param item The constant specifying which piece of locale information to + * get. + * @param lang The language to use, if any. + * @param country The country to use, if any. + * @return Returns said information or an empty string. + */ +static zstring get_locale_info( nl_item item, iso639_1::type lang, + iso3166_1::type country ) { + if ( lang ) { + if ( locale_t const loc = get_unix_locale_t( lang, country ) ) { + char const *const info = nl_langinfo_l( item, loc ); + ::freelocale( loc ); + return info; + } + return zstring(); + } + return nl_langinfo( item ); } #endif /* WIN32 */ @@ -849,44 +1005,107 @@ return iso639_2_to_639_1[ iso639_2::find( lang ) ]; } -iso3166_1::type get_host_country() { +zstring get_date_format( iso639_1::type lang, iso3166_1::type country ) { +#ifdef WIN32 + zstring const w32_format( + get_locale_info( LOCALE_SSHORTDATE, lang, country ) + ); + zstring format; // - // ICU's Locale::getDefault().getLanguage() should be used here, but it - // sometimes returns "root" which isn't useful. + // Convert Windows' date format for that used by strptime(3); see: + // http://msdn.microsoft.com/en-us/library/windows/desktop/dd317787(v=vs.85).aspx // - static unique_ptr country_name; - static iso3166_1::type country_code; + for ( char const *i = w32_format.c_str(); *i; ++i ) { + switch ( *i ) { - if ( !country_name ) { -# ifdef WIN32 - char *loc_info = get_win32_locale_info( LOCALE_SISO3166CTRYNAME ); -# else - char *loc_info = get_unix_locale(); - if ( loc_info ) { - // - // Extract just the country's name from the locale, e.g., convert - // "en_US.UTF-8" to "US". - // - if ( char *const sep = ::strchr( loc_info, '.' ) ) - *sep = '\0'; - if ( char *const sep = ::strpbrk( loc_info, "_-" ) ) { + case 'd': + if ( i[1] == 'd' ) + if ( i[2] == 'd' ) + if ( i[3] == 'd' ) + format += "%A", i += 3; // dddd = full weekday name + else + format += "%a", i += 2; // ddd = abbreviated weekday name + else + format += "%d", i += 1; // dd = day of month: 01-31 + else + format += "%e"; // d = day of month: 1-31 + break; + + case 'g': // period/era // - // We have to allocate a new string for just the country since - // unique_ptr can't point to a character that isn't the first otherwise - // its call to delete[] will be undefined. + // There's no equivalent strftime(3) conversion specification: just + // ignore it and hope for the best. // - unique_ptr const old_loc_info( loc_info ); - loc_info = ztd::new_strdup( sep + 1 ); - } - } + if ( i[1] == 'g' ) + ++i; // gg = same as g + break; + + case 'M': + if ( i[1] == 'M' ) + if ( i[2] == 'M' ) + if ( i[3] == 'M' ) + format += "%B", i += 3; // MMMM = full month name + else + format += "%b", i += 2; // MMM = abbreviated month name + else + format += "%m", i += 1; // MM = month: 01-12 + else + format += "%m"; // M = month: 1-12 + break; + + case 'y': + if ( i[1] == 'y' ) + if ( i[2] == 'y' ) + if ( i[3] == 'y' ) { + format += "%Y", i += 3; // yyyy = 4-digit year + if ( i[3] == 'y' ) + ++i; // yyyyy = same as yyyy + } else + ; + else + format += "%y", i += 1; // yy = 2-digit year + else + format += "%y"; // y = 1-digit year + break; + + default: + format += *i; + } // switch + } // for + return format; +#else + return get_locale_info( D_FMT, lang, country ); +#endif /* WIN32 */ +} + +zstring get_date_time_format( iso639_1::type lang, iso3166_1::type country ) { +#ifdef WIN32 + // + // Windows has no equivalent for both date and time, so glue its date and + // time together and hope for the best. + // + return get_date_format( lang, country ) + ' ' + + get_time_format( lang, country ); +#else + return get_locale_info( D_T_FMT, lang, country ); +#endif /* WIN32 */ +} + +iso3166_1::type get_host_country() { + static bool got; + static iso3166_1::type country; + + if ( !got ) { +# ifdef WIN32 + zstring const name( get_locale_info( LOCALE_SISO3166CTRYNAME ) ); + country = iso3166_1::find( name ); +# else + zstring const loc_info( get_unix_locale() ); + parse( loc_info, nullptr, &country ); # endif /* WIN32 */ - if ( loc_info ) { - country_name.reset( loc_info ); - if ( iso3166_1::type const found_code = iso3166_1::find( loc_info ) ) - country_code = found_code; - } + got = true; } - return country_code; + return country; } iso639_1::type get_host_lang() { @@ -894,30 +1113,219 @@ // ICU's Locale::getDefault().getLanguage() should be used here, but it // sometimes returns "root" which isn't useful. // - static unique_ptr lang_name; - static iso639_1::type lang_code = iso639_1::en; + static bool got; + static iso639_1::type lang; - if ( !lang_name ) { + if ( !got ) { # ifdef WIN32 - char *const loc_info = get_win32_locale_info( LOCALE_SISO639LANGNAME ); + zstring const name( get_locale_info( LOCALE_SISO639LANGNAME ) ); + lang = find_lang( name ); # else - char *const loc_info = get_unix_locale(); - if ( loc_info ) { - // - // Extract just the language from the locale, e.g., convert "en_US.UTF-8" - // to "en". - // - if ( char *const sep = ::strpbrk( loc_info, "-_" ) ) - *sep = '\0'; - } + zstring const loc_info( get_unix_locale() ); + parse( loc_info, &lang ); # endif /* WIN32 */ - if ( loc_info ) { - lang_name.reset( loc_info ); - if ( iso639_1::type const found_code = find_lang( loc_info ) ) - lang_code = found_code; + if ( !lang ) + lang = iso639_1::en; // default to English + got = true; + } + return lang; +} + +zstring get_month_abbr( unsigned month_index, iso639_1::type lang, + iso3166_1::type country ) { + static locale_index_type const month_abbr[] = { +#ifdef WIN32 + LOCALE_SABBREVMONTHNAME1, LOCALE_SABBREVMONTHNAME2, + LOCALE_SABBREVMONTHNAME3, LOCALE_SABBREVMONTHNAME4, + LOCALE_SABBREVMONTHNAME5, LOCALE_SABBREVMONTHNAME6, + LOCALE_SABBREVMONTHNAME7, LOCALE_SABBREVMONTHNAME8, + LOCALE_SABBREVMONTHNAME9, LOCALE_SABBREVMONTHNAME10, + LOCALE_SABBREVMONTHNAME11, LOCALE_SABBREVMONTHNAME12 +#else + ABMON_1, ABMON_2, ABMON_3, ABMON_4, ABMON_5, ABMON_6, + ABMON_7, ABMON_8, ABMON_9, ABMON_10, ABMON_11, ABMON_12 +#endif /* WIN32 */ + }; + + if ( month_index > 11 ) + throw invalid_argument( BUILD_STRING( month_index, " not in range 0-11" ) ); + return get_locale_info( month_abbr[ month_index ], lang, country ); +} + +zstring get_month_name( unsigned month_index, iso639_1::type lang, + iso3166_1::type country ) { + static locale_index_type const month_name[] = { +#ifdef WIN32 + LOCALE_SMONTHNAME1, LOCALE_SMONTHNAME2, LOCALE_SMONTHNAME3, + LOCALE_SMONTHNAME4, LOCALE_SMONTHNAME5, LOCALE_SMONTHNAME6, + LOCALE_SMONTHNAME7, LOCALE_SMONTHNAME8, LOCALE_SMONTHNAME9, + LOCALE_SMONTHNAME10, LOCALE_SMONTHNAME11, LOCALE_SMONTHNAME12 +#else + MON_1, MON_2, MON_3, MON_4, MON_5, MON_6, + MON_7, MON_8, MON_9, MON_10, MON_11, MON_12 +#endif /* WIN32 */ + }; + + if ( month_index > 11 ) + throw invalid_argument( BUILD_STRING( month_index, " not in range 0-11" ) ); + return get_locale_info( month_name[ month_index ], lang, country ); +} + +zstring get_time_ampm( bool pm, iso639_1::type lang, iso3166_1::type country ) { + static locale_index_type const ampm[] = { +#ifdef WIN32 + LOCALE_S1159, LOCALE_S2359 +#else + AM_STR, PM_STR +#endif /* WIN32 */ + }; + return get_locale_info( ampm[ pm ], lang, country ); +} + +zstring get_time_format( iso639_1::type lang, iso3166_1::type country ) { +#ifdef WIN32 + zstring const w32_format( + get_locale_info( LOCALE_STIMEFORMAT, lang, country ) + ); + zstring format; + // + // Convert Windows' time format for that used by strptime(3); see: + // http://msdn.microsoft.com/en-us/library/windows/desktop/dd318148(v=vs.85).aspx + // + for ( char const *i = w32_format.c_str(); *i; ++i ) { + switch ( *i ) { + + case 'h': + if ( i[1] == 'h' ) + format += "%I", ++i; + else + format += "%l"; + break; + + case 'H': + if ( i[1] == 'H' ) + format += "%H", ++i; + else + format += "%k"; + break; + + case 'm': + format += "%M"; + if ( i[1] == 'm' ) + ++i; + break; + + case 's': + format += "%S"; + if ( i[1] == 's' ) + ++i; + break; + + case 't': + format += "%p"; + if ( i[1] == 't' ) + ++i; + break; + + default: + format += *i; + } // switch + } // for + return format; +#else + return get_locale_info( T_FMT, lang, country ); +#endif /* WIN32 */ +} + +zstring get_weekday_abbr( unsigned day_index, iso639_1::type lang, + iso3166_1::type country ) { + static locale_index_type const weekday_abbr[] = { +#ifdef WIN32 + LOCALE_SABBREVDAYNAME7 /* Sun */, + LOCALE_SABBREVDAYNAME1 /* Mon */, + LOCALE_SABBREVDAYNAME2 /* Tue */, + LOCALE_SABBREVDAYNAME3 /* Wed */, + LOCALE_SABBREVDAYNAME4 /* Thu */, + LOCALE_SABBREVDAYNAME5 /* Fri */, + LOCALE_SABBREVDAYNAME6 /* Sat */ +#else + ABDAY_1, ABDAY_2, ABDAY_3, ABDAY_4, ABDAY_5, ABDAY_6, ABDAY_7 +#endif /* WIN32 */ + }; + + if ( day_index > 6 ) + throw invalid_argument( BUILD_STRING( day_index, " not in range 0-6" ) ); + return get_locale_info( weekday_abbr[ day_index ], lang, country ); +} + +zstring get_weekday_name( unsigned day_index, iso639_1::type lang, + iso3166_1::type country ) { + static locale_index_type const weekday_name[] = { +#ifdef WIN32 + LOCALE_SDAYNAME7 /* Sun */, + LOCALE_SDAYNAME1 /* Mon */, + LOCALE_SDAYNAME2 /* Tue */, + LOCALE_SDAYNAME3 /* Wed */, + LOCALE_SDAYNAME4 /* Thu */, + LOCALE_SDAYNAME5 /* Fri */, + LOCALE_SDAYNAME6 /* Sat */ +#else + DAY_1, DAY_2, DAY_3, DAY_4, DAY_5, DAY_6, DAY_7 +#endif /* WIN32 */ + }; + + if ( day_index > 6 ) + throw invalid_argument( BUILD_STRING( day_index, " not in range 0-6" ) ); + return get_locale_info( weekday_name[ day_index ], lang, country ); +} + +bool is_supported( iso639_1::type lang, iso3166_1::type country ) { +#ifdef WIN32 + unique_ptr const wlocale_name( get_wlocale_name( lang, country ) ); + return !!::IsValidLocaleName( wlocale_name.get() ); +#else + if ( locale_t const loc = get_unix_locale_t( lang, country ) ) { + ::freelocale( loc ); + return true; + } + return false; +#endif /* WIN32 */ +} + +bool parse( char const *locale_str, iso639_1::type *lang, + iso3166_1::type *country ) { + zstring lang_str, country_str; + char const *p = locale_str; + + if ( !(ascii::is_alpha( *p++ ) && ascii::is_alpha( *p++ )) ) + return false; + lang_str.assign( locale_str, 2 ); + if ( *p ) { + if ( ascii::is_alpha( *p ) ) // ISO 639-2 3-letter code + lang_str += *p++; + if ( *p ) { + if ( !(*p == '-' || *p == '_') ) + return false; + ++p; + if ( !(ascii::is_alpha( p[0] ) && ascii::is_alpha( p[1] )) ) + return false; + country_str.assign( p, 2 ); + if ( *(p += 2) && *p != '.' ) + return false; } } - return lang_code; + + if ( lang ) { + ascii::to_lower( lang_str ); + *lang = find_lang( lang_str ); + } + if ( country ) { + ascii::to_upper( country_str ); + *country = country_str.empty() ? + iso3166_1::unknown : iso3166_1::find( country_str ); + } + + return true; } /////////////////////////////////////////////////////////////////////////////// diff -Nru zorba-2.7.0-0/src/zorbautils/locale.h zorba-2.8.0-0/src/zorbautils/locale.h --- zorba-2.7.0-0/src/zorbautils/locale.h 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/src/zorbautils/locale.h 2013-01-16 18:28:18.000000000 +0000 @@ -21,6 +21,9 @@ #include +#include "util/string_util.h" +#include "zorbatypes/zstring.h" + namespace zorba { namespace locale { @@ -297,7 +300,19 @@ * @return Returns said enumeration or \c unknown. */ type find( char const *country ); - } + + // + // Template version of find(). + // + template inline + typename std::enable_if< + ztd::has_c_str::value, + type + >::type + find( StringType const &country ) { + return find( country.c_str() ); + } + } // namespace iso3166_1 /////////////////////////////////////////////////////////////////////////// @@ -322,7 +337,19 @@ * @return Returns said enumeration or \c unknown. */ type find( char const *lang ); - } + + // + // Template version of find(). + // + template inline + typename std::enable_if< + ztd::has_c_str::value, + type + >::type + find( StringType const &lang ) { + return find( lang.c_str() ); + } + } // namespace iso639_1 /////////////////////////////////////////////////////////////////////////// @@ -474,7 +501,19 @@ * @return Returns said enumeration or \c unknown. */ type find( char const *lang ); - } + + // + // Template version of find(). + // + template inline + typename std::enable_if< + ztd::has_c_str::value, + type + >::type + find( StringType const &lang ) { + return find( lang.c_str() ); + } + } // namespace iso639_2 /////////////////////////////////////////////////////////////////////////// @@ -486,6 +525,40 @@ */ iso639_1::type find_lang( char const *lang ); + // + // Template version of find_lang(). + // + template inline + typename std::enable_if< + ztd::has_c_str::value, + iso639_1::type + >::type + find_lang( StringType const &lang ) { + return find_lang( lang.c_str() ); + } + + /** + * Gets the date format for the current locale. The format is that used by + * strptime(3). + * + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said date format. + */ + zstring get_date_format( iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Gets the date and time format for the current locale. The format is + * that used by strptime(3). + * + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said date format. + */ + zstring get_date_time_format( iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown); + /** * Gets the ISO 3166-1 country code enumeration for the host system. * @@ -500,12 +573,117 @@ */ iso639_1::type get_host_lang(); + /** + * Gets a month's abbreviation in the current locale. + * + * @param month_index The index of the month to get in the range 0-11. + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said abbreviation. + */ + zstring get_month_abbr( unsigned month_index, + iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Gets a month's full name in the current locale. + * + * @param month_index The index of the month to get in the range 0-11. + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said full name. + */ + zstring get_month_name( unsigned month_index, + iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Gets the time AM or PM string in the current locale. + * + * @param pm If \c true, gets the PM string; else the AM string. + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said string. + */ + zstring get_time_ampm( bool pm, iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Gets the time format for the current locale. The format is that used by + * strptime(3). + * + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said time format. + */ + zstring get_time_format( iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Gets a weekday's abbreviation in the current locale. + * + * @param day_index The index of the weekday to get in the range 0-6. + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said abbreviation. + */ + zstring get_weekday_abbr( unsigned day_index, + iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Gets a weekday's full name in the current locale. + * + * @param day_index The index of the month to get in the range 0-6. + * @param lang The language to use. Defaults to host language. + * @param country The country to use. Defaults to host country. + * @return Returns said full name. + */ + zstring get_weekday_name( unsigned day_index, + iso639_1::type lang = iso639_1::unknown, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Checks if the given locale is supported by the OS. + * + * @param lang The language to use. + * @param country The country to use. Defaults to none. + * @return Returns \a true only if the given locale is supported by the OS. + */ + bool is_supported( iso639_1::type lang, + iso3166_1::type country = iso3166_1::unknown ); + + /** + * Parses a locale string. + * + * @param locale_str A locale string of the form \c ll{-_}CC[.enc] where + * \c ll is a 2 letter ISO 639-1 (or 3 letter 639-2) language code, \c CC + * is a 2 letter ISO 3166-1 country code, and \c enc is an optional + * encoding (which is ignored). + * @param lang A pointer to receive the language, if any. + * @param country A pointer to receive the country, if any. + * @return Returns \c true if at least a language is parsed. + */ + bool parse( char const *locale_str, iso639_1::type *lang = nullptr, + iso3166_1::type *country = nullptr ); + + // + // Template version of parse(). + // + template inline + typename std::enable_if< + ztd::has_c_str::value, + bool + >::type + parse( StringType const &locale_str, iso639_1::type *lang = nullptr, + iso3166_1::type *country = nullptr ) { + return parse( locale_str.c_str(), lang, country ); + } + /////////////////////////////////////////////////////////////////////////// } // namespace locale } // namespace zorba -#undef DEF_OSTREAM_INSERT_OPERATOR - #endif /* ZORBA_CORE_LOCALE_H */ /* vim:set et sw=2 ts=2: */ diff -Nru zorba-2.7.0-0/swig/java/CMakeLists.txt zorba-2.8.0-0/swig/java/CMakeLists.txt --- zorba-2.7.0-0/swig/java/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/swig/java/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -75,29 +75,28 @@ SET (JAVA_SITEARCH_DIR ${CMAKE_INSTALL_PREFIX}/share/java) ENDIF (${CMAKE_INSTALL_PREFIX} EQUAL "/usr/local") - FILE(GLOB JAVA_SWIG_FILES "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar") - SET(ZORBA_JAVA_JAR "${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar" PARENT_SCOPE ) + SET(ZORBA_JAVA_JAR ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar PARENT_SCOPE ) IF ( APPLE ) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_SWIG_LIB_PREFIX}libzorba_api.jnilib DESTINATION ${JAVA_SITEARCH_DIR}) - INSTALL(FILES ${JAVA_SWIG_FILES} DESTINATION ${JAVA_SITEARCH_DIR}) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR}) ELSE ( APPLE ) IF(NOT WIN32) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libzorba_api.so DESTINATION ${JAVA_SITEARCH_DIR}) - INSTALL(FILES ${JAVA_SWIG_FILES} DESTINATION ${JAVA_SITEARCH_DIR}) + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION ${JAVA_SITEARCH_DIR}) ELSE(NOT WIN32) IF (MSVC_IDE) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/zorba_api.dll DESTINATION share/java COMPONENT "java_swig") - INSTALL(FILES ${JAVA_SWIG_FILES} + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION share/java COMPONENT "java_swig") ELSE (MSVC_IDE) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.dll DESTINATION share/java COMPONENT "java_swig") - INSTALL(FILES ${JAVA_SWIG_FILES} + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.jar DESTINATION share/java COMPONENT "java_swig") ENDIF (MSVC_IDE) diff -Nru zorba-2.7.0-0/swig/python/CMakeLists.txt zorba-2.8.0-0/swig/python/CMakeLists.txt --- zorba-2.7.0-0/swig/python/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/swig/python/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -27,6 +27,11 @@ SET_PROPERTY( TARGET _zorba_api_python PROPERTY LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/swig/python ) SET_PROPERTY( TARGET _zorba_api_python PROPERTY LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/swig/python ) ENDIF (MSVC_IDE) + + # FIX FOR PYTHON_D.LIB ERROR ON WINDOWS + IF (WIN32) + CONFIGURE_FILE(${PYTHON_DEBUG_LIBRARIES} ${CMAKE_CURRENT_BINARY_DIR} COPYONLY) + ENDIF (WIN32) EXECUTE_PROCESS ( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig;print sysconfig.get_python_lib(0)" diff -Nru zorba-2.7.0-0/swig/xqj/CMakeLists.txt zorba-2.8.0-0/swig/xqj/CMakeLists.txt --- zorba-2.7.0-0/swig/xqj/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/swig/xqj/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -40,7 +40,7 @@ FIND_PACKAGE (Java COMPONENTS Development) -IF (Java_Development_FOUND) +IF (Java_JAVAC_EXECUTABLE) # TESTING... SET (XQJ_LOAD_PATH "${CMAKE_BINARY_DIR}/swig/xqj") @@ -126,6 +126,6 @@ INSTALL(FILES ${XQJAPI_JAR_FILE} DESTINATION share/xqj COMPONENT "XQJ_SWIG") ENDIF(NOT WIN32) -ELSEIF (Java_Development_FOUND) +ELSEIF (Java_JAVAC_EXECUTABLE) MESSAGE ( STATUS "SWIG Java: Not generating XQJ API because JNI headers not found.") -ENDIF (Java_Development_FOUND) +ENDIF (Java_JAVAC_EXECUTABLE) diff -Nru zorba-2.7.0-0/swig/xqj/tck/xqj_test.bat.in zorba-2.8.0-0/swig/xqj/tck/xqj_test.bat.in --- zorba-2.7.0-0/swig/xqj/tck/xqj_test.bat.in 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/swig/xqj/tck/xqj_test.bat.in 2013-01-16 18:28:18.000000000 +0000 @@ -28,18 +28,18 @@ "@Java_JAVAC_EXECUTABLE@" -source 1.6 -target 1.6 -d tck "%JAVA_LOAD_PATH%\*.java" ECHO "xqj_test.bat: Creating API JAR..." -cd tck +pushd tck "@Java_JAR_EXECUTABLE@" -cf "zorba_api.jar" org -cd.. +popd RD /S /Q "%XQJ_LOAD_PATH%\tck\org" ECHO "xqj_test.bat: Compile XQJ API ..." "@Java_JAVAC_EXECUTABLE@" -source 1.6 -target 1.6 -cp tck\xqjapi.jar;tck\zorba_api.jar -d tck *.java ECHO "xqj_test.bat: Creating XQJ JAR..." -cd tck +pushd tck "@Java_JAR_EXECUTABLE@" -cf "zorba_xqj.jar" org -cd.. +popd RD /S /Q "%XQJ_LOAD_PATH%\tck\org" ECHO "xqj_test.bat: Compiling Managers Tests..." diff -Nru zorba-2.7.0-0/test/CMakeLists.txt zorba-2.8.0-0/test/CMakeLists.txt --- zorba-2.7.0-0/test/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -37,6 +37,11 @@ ADD_SUBDIRECTORY(update) ADD_SUBDIRECTORY(sax2) +ADD_SUBDIRECTORY(fots) + +INSTALL(DIRECTORY fots_driver + DESTINATION share/zorba-${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER}) + SET (TEST_PLAN_SERIALIZER_SRCS test_plan_serializer.cpp timer.cpp) diff -Nru zorba-2.7.0-0/test/fots/CMakeLists.txt zorba-2.8.0-0/test/fots/CMakeLists.txt --- zorba-2.7.0-0/test/fots/CMakeLists.txt 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,1229 @@ +# Copyright 2006-2008 The FLWOR Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Add a target to import FOTS +ADD_CUSTOM_TARGET(fots-import + COMMAND "${CMAKE_COMMAND}" + -D "ZORBA=${ZORBA_EXE}" + -D "BUILDDIR=${PROJECT_BINARY_DIR}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/ImportFOTS.cmake") + +# Create cached version of activate setting +SET (ZORBA_FOTS_ACTIVATE inactive CACHE STRING "Which FOTS tests to activate") +MARK_AS_ADVANCED (ZORBA_FOTS_ACTIVATE) + +# Add targets to set activate flag +ADD_CUSTOM_TARGET(fots-activate-sets + COMMAND "${CMAKE_COMMAND}" + -D "ZORBA_FOTS_ACTIVATE=sets" "${PROJECT_SOURCE_DIR}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}") +ADD_CUSTOM_TARGET(fots-activate-cases + COMMAND "${CMAKE_COMMAND}" + -D "ZORBA_FOTS_ACTIVATE=cases" "${PROJECT_SOURCE_DIR}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}") +ADD_CUSTOM_TARGET(fots-deactivate + COMMAND "${CMAKE_COMMAND}" + -D "ZORBA_FOTS_ACTIVATE=inactive" "${PROJECT_SOURCE_DIR}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}") + +# Load FOTS test scripts (if they exist) depending on flag +IF ("${ZORBA_FOTS_ACTIVATE}" STREQUAL "sets") + MESSAGE (STATUS "Adding FOTS test-set tests") + SET (_fotsscript "${CMAKE_CURRENT_BINARY_DIR}/FOTSSetTests.cmake") +ELSEIF ("${ZORBA_FOTS_ACTIVATE}" STREQUAL "cases") + MESSAGE (STATUS "Adding FOTS test-case tests (may take a while...)") + SET (_fotsscript "${CMAKE_CURRENT_BINARY_DIR}/FOTSCaseTests.cmake") +ELSE ("${ZORBA_FOTS_ACTIVATE}" STREQUAL "sets") + SET (_fotsscript "") +ENDIF ("${ZORBA_FOTS_ACTIVATE}" STREQUAL "sets") +IF (NOT _fotsscript STREQUAL "") + IF (EXISTS "${_fotsscript}") + INCLUDE ("${_fotsscript}") + ELSE (EXISTS "${_fotsscript}") + MESSAGE (WARNING "...${_fotsscript} does not exist, not adding FOTS tests " + "after all (did you forget to run the 'fots-import' target?)") + ENDIF (EXISTS "${_fotsscript}") +ENDIF (NOT _fotsscript STREQUAL "") + + +# Customized macro for FOTS tests +MACRO (expected_fots_failure) + PARSE_ARGUMENTS (EFF "" "" "SLOW;CRASH" ${ARGN}) + LIST (LENGTH EFF_DEFAULT_ARGS _numargs) + IF (NOT _numargs EQUAL 3) + MESSAGE (FATAL_ERROR "Invalid arguments to EXPECTED_FOTS_FAILURE: ${ARGN}") + ENDIF (NOT _numargs EQUAL 3) + LIST (GET EFF_DEFAULT_ARGS 0 test_set) + LIST (GET EFF_DEFAULT_ARGS 1 test_case) + LIST (GET EFF_DEFAULT_ARGS 2 bugid) + + # First add test_set name to list of test_sets, if it's not already there + GET_PROPERTY (_test_sets GLOBAL PROPERTY "_ALL_FOTS_TEST_SETS_") + LIST (FIND _test_sets ${test_set} _found) + IF (_found EQUAL -1) + SET_PROPERTY (GLOBAL APPEND PROPERTY "_ALL_FOTS_TEST_SETS_" ${test_set}) + ENDIF (_found EQUAL -1) + + # Determine "notrun" status + SET (_notrun) + IF (EFF_SLOW OR EFF_CRASH) + SET (_notrun true) + ENDIF (EFF_SLOW OR EFF_CRASH) + + # Append three values per test case - case name, bugnum, notRun + SET_PROPERTY (GLOBAL APPEND PROPERTY "_FOTS_${test_set}_CASES_" + ${test_case} ${bugid} "${_notrun}") +ENDMACRO (expected_fots_failure) + +## +## Place all known failing FOTS tests here! +## +#"slow" test +EXPECTED_FOTS_FAILURE (SLOW fn-subsequence cbcl-subsequence-011 1069794) +EXPECTED_FOTS_FAILURE (SLOW fn-subsequence cbcl-subsequence-012 1069794) +EXPECTED_FOTS_FAILURE (SLOW fn-subsequence cbcl-subsequence-013 1069794) +EXPECTED_FOTS_FAILURE (SLOW fn-subsequence cbcl-subsequence-014 1069794) + +#"crashing" test +EXPECTED_FOTS_FAILURE (CRASH fn-matches.re re00975 1070533) +EXPECTED_FOTS_FAILURE (CRASH fn-matches.re re00976 1070533) +EXPECTED_FOTS_FAILURE (CRASH fn-matches.re re00976a 1070533) +EXPECTED_FOTS_FAILURE (CRASH fn-unparsed-text-lines fn-unparsed-text-lines-052 1073175) + +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog001 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog002 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog003 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog004 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog005 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog006 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog007 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog008 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog009 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog010 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog011 0) +EXPECTED_FOTS_FAILURE (app-CatalogCheck Catalog012 0) +EXPECTED_FOTS_FAILURE (app-Demos sudoku 0) +EXPECTED_FOTS_FAILURE (app-Demos currencysvg 0) +EXPECTED_FOTS_FAILURE (app-Demos itunes 0) +EXPECTED_FOTS_FAILURE (app-FunctxFn functx-fn-number-all 0) +EXPECTED_FOTS_FAILURE (app-FunctxFunctx functx-functx-copy-attributes-1 0) +EXPECTED_FOTS_FAILURE (app-FunctxFunctx functx-functx-copy-attributes-all 0) +EXPECTED_FOTS_FAILURE (app-FunctxFunctx functx-functx-id-from-element-1 0) +EXPECTED_FOTS_FAILURE (app-FunctxFunctx functx-functx-sort-as-numeric-all 0) +EXPECTED_FOTS_FAILURE (app-FunctxFunctx functx-functx-sort-case-insensitive-all 0) +EXPECTED_FOTS_FAILURE (app-FunctxFunctx functx-functx-sort-all 0) +EXPECTED_FOTS_FAILURE (app-UseCaseNS ns-queries-results-q5 0) +EXPECTED_FOTS_FAILURE (app-UseCaseNS ns-queries-results-q8 0) +EXPECTED_FOTS_FAILURE (app-UseCaseSTRING string-queries-results-q1 0) +EXPECTED_FOTS_FAILURE (app-UseCaseSTRING string-queries-results-q2 0) +EXPECTED_FOTS_FAILURE (app-UseCaseSTRING string-queries-results-q4 0) +EXPECTED_FOTS_FAILURE (app-UseCaseSTRING string-queries-results-q5 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q2 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q3 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q8 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q9 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q10 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q11 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q12 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q13 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q14 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q15 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q16 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q17 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q18 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q19 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-Q20 0) +EXPECTED_FOTS_FAILURE (app-XMark XMark-All 0) +EXPECTED_FOTS_FAILURE (fn-adjust-date-to-timezone cbcl-adjust-date-to-timezone-002 0) +EXPECTED_FOTS_FAILURE (fn-adjust-date-to-timezone cbcl-adjust-date-to-timezone-003 0) +EXPECTED_FOTS_FAILURE (fn-adjust-dateTime-to-timezone cbcl-adjust-dateTime-to-timezone-002 0) +EXPECTED_FOTS_FAILURE (fn-adjust-dateTime-to-timezone cbcl-adjust-dateTime-to-timezone-003 0) +EXPECTED_FOTS_FAILURE (fn-analyze-string analyzeString-008 0) +EXPECTED_FOTS_FAILURE (fn-analyze-string analyzeString-017 0) +EXPECTED_FOTS_FAILURE (fn-analyze-string analyzeString-017a 0) +EXPECTED_FOTS_FAILURE (fn-available-environment-variables fn-available-environment-variables-011 0) +EXPECTED_FOTS_FAILURE (fn-avg cbcl-avg-002 0) +EXPECTED_FOTS_FAILURE (fn-avg cbcl-avg-003 0) +EXPECTED_FOTS_FAILURE (fn-codepoints-to-string K-CodepointToStringFunc-13 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-4 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-4d 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-5 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-5d 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-6 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-8 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-9 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-10 0) +EXPECTED_FOTS_FAILURE (fn-collection fn-collection-10d 0) +EXPECTED_FOTS_FAILURE (fn-compare compare-010 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-56 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-57 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-58 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-59 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-60 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-61 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K-SeqDeepEqualFunc-62 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-36 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-37 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-38 0) +EXPECTED_FOTS_FAILURE (fn-deep-equal K2-SeqDeepEqualFunc-39 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-mixed-args-005 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-mixed-args-006 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-mixed-args-009 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-mixed-args-010 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-mixed-args-011 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-mixed-args-018 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-mixed-args-032 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values fn-distinct-values-2 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-002b 0) +EXPECTED_FOTS_FAILURE (fn-distinct-values cbcl-distinct-values-003 0) +EXPECTED_FOTS_FAILURE (fn-doc fn-doc-25 0) +EXPECTED_FOTS_FAILURE (fn-doc fn-doc-33 0) +EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-005 0) +EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-006 0) +EXPECTED_FOTS_FAILURE (fn-environment-variable environment-variable-007 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-001d 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-001g 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-005 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-006 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-007a 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-007b 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-007c 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-008a 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-008b 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-008c 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-009 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-010 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-014 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-015 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-016 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-017 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-018 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-019 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-020 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-021 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-022 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-023 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-024 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-025 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-026 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-027 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en117 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en118 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en123 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en124 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en125 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en126 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en127 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en128 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en129 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en130 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en131 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en132 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en133 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en134 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en141 0) +EXPECTED_FOTS_FAILURE (fn-format-date format-date-en151 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-001d 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-001g 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-002g 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-002h 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-002i 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-003d 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-003g 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-003m 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-003n 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-003p 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-005 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-006 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-009 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-010 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-011 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-012 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-013p 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-013s 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-013u 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-014 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-015 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-016 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-017 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-018 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-en141 0) +EXPECTED_FOTS_FAILURE (fn-format-dateTime format-dateTime-en151 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-025 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-026 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-030 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-031 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-033 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-035 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-038 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-039 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-043 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-044 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-049 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-050 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-052 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-055 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-056 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-057 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-058 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-059 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-060 0) +EXPECTED_FOTS_FAILURE (fn-format-integer format-integer-061 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat14 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat15 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat34 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat38 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat40 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat41 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat42 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat60a 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat60m 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat60o 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat60q 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat63 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat64 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat70 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat71 0) +EXPECTED_FOTS_FAILURE (fn-format-number numberformat86 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-002g 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-002h 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-002i 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-013p 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-013s 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-013u 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-014 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-015 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-016 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-017 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-018 0) +EXPECTED_FOTS_FAILURE (fn-format-time format-time-816err 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-001 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-002 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-003 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-004 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-005 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-006 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-012 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-013 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-014 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-015 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-017 0) +EXPECTED_FOTS_FAILURE (fn-generate-id generate-id-018 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-5 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-7 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-8 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-9 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-12 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-13 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-15 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-16 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-17 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-18 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-19 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-20 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-21 0) +EXPECTED_FOTS_FAILURE (fn-id fn-id-dtd-23 0) +EXPECTED_FOTS_FAILURE (fn-id K2-SeqIDFunc-11 0) +EXPECTED_FOTS_FAILURE (fn-id K2-SeqIDFunc-12 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-5 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-7 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-8 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-9 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-12 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-13 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-14 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-15 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-16 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-17 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-18 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-19 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-20 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-21 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-23 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-24 0) +EXPECTED_FOTS_FAILURE (fn-idref fn-idref-dtd-25 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes fn-in-scope-prefixes-21 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes fn-in-scope-prefixes-22 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes fn-in-scope-prefixes-24 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes fn-in-scope-prefixes-25 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes K2-InScopePrefixesFunc-11 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes K2-InScopePrefixesFunc-12 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes K2-InScopePrefixesFunc-18 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes K2-InScopePrefixesFunc-26 0) +EXPECTED_FOTS_FAILURE (fn-in-scope-prefixes K2-InScopePrefixesFunc-28 0) +EXPECTED_FOTS_FAILURE (fn-iri-to-uri fn-iri-to-uri-18 0) +EXPECTED_FOTS_FAILURE (fn-iri-to-uri fn-iri-to-uri-18A 0) +EXPECTED_FOTS_FAILURE (fn-last last-11 0) +EXPECTED_FOTS_FAILURE (fn-last last-24 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc001 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc002 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc003 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc004 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc005 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc018 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc019 0) +EXPECTED_FOTS_FAILURE (fn-local-name-from-QName LocalNameFromQNameFunc020 0) +EXPECTED_FOTS_FAILURE (fn-matches caselessmatch10 0) +EXPECTED_FOTS_FAILURE (fn-matches caselessmatch11 0) +EXPECTED_FOTS_FAILURE (fn-matches cbcl-matches-038 0) +EXPECTED_FOTS_FAILURE (fn-matches cbcl-matches-039 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00041 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00055 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00058 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00059 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00060 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00063 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00071 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00072 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00127a 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00129a 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00130a 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00288 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00370 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00480 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00498 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00501 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00506 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00589 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00590 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00613 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00680 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00693 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00694 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00695 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00696 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00697 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00698 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00702 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00703 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00704 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00705 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00706 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00707 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00708 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00709 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00710 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00711 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00712 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00713 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00717 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00718 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00719 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00720 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00721 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00722 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00723 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00730 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00732 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00736 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00739 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00740 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00744 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00745 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00746 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00749 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00750 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00754 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00763 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00767 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00768 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00769 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00770 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00771 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00779 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00780 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00795 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00804 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00805 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00806 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00814 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00867 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00868 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00869 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00870 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00871 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00872 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00873 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00874 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00875 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00876 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00881 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00882 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00890 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00891 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00905 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00912 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00913 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00914 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00919 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00939 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00940 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00941 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00957 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00970 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00977 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00978 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00982 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00983 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00984 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00987 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00988 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00989 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00994 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00998 0) +EXPECTED_FOTS_FAILURE (fn-matches.re re00999 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc001 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc002 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc003 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc004 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc005 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc018 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc019 0) +EXPECTED_FOTS_FAILURE (fn-namespace-uri-from-QName NamespaceURIFromQNameFunc020 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-33 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-35 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-37 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-38 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-39 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-41 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-44 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-45 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-46 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-47 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-48 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-49 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-50 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-51 0) +EXPECTED_FOTS_FAILURE (fn-nilled fn-nilled-52 0) +EXPECTED_FOTS_FAILURE (fn-nilled cbcl-nilled-002 0) +EXPECTED_FOTS_FAILURE (fn-nilled cbcl-nilled-005 0) +EXPECTED_FOTS_FAILURE (fn-normalize-space fn-normalize-space-23 0) +EXPECTED_FOTS_FAILURE (fn-normalize-space fn-normalize-space-25 0) +EXPECTED_FOTS_FAILURE (fn-normalize-unicode cbcl-fn-normalize-unicode-001 0) +EXPECTED_FOTS_FAILURE (fn-normalize-unicode cbcl-fn-normalize-unicode-006 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml parse-xml-001 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-001 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-005 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-006 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-007 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-008 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-009 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-010 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-011 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-012 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-013 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-014 0) +EXPECTED_FOTS_FAILURE (fn-parse-xml-fragment parse-xml-fragment-015 0) +EXPECTED_FOTS_FAILURE (fn-position position-23 0) +EXPECTED_FOTS_FAILURE (fn-replace fn-replace-34 0) +EXPECTED_FOTS_FAILURE (fn-replace fn-replace-35 0) +EXPECTED_FOTS_FAILURE (fn-replace fn-replace-42 0) +EXPECTED_FOTS_FAILURE (fn-replace K2-ReplaceFunc-8 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even fn-round-half-to-even-9 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even fn-round-half-to-even-30 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even fn-round-half-to-even-31 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even fn-round-half-to-even-32 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even fn-round-half-to-even-33 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even fn-round-half-to-even-34 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even fn-round-half-to-even-35 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even cbcl-round-half-to-even-001 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even cbcl-round-half-to-even-003 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even cbcl-round-half-to-even-005 0) +EXPECTED_FOTS_FAILURE (fn-round-half-to-even cbcl-round-half-to-even-012 0) +EXPECTED_FOTS_FAILURE (fn-serialize serialize-xml-007a 0) +EXPECTED_FOTS_FAILURE (fn-serialize serialize-xml-008 0) +EXPECTED_FOTS_FAILURE (fn-string fn-string-22 0) +EXPECTED_FOTS_FAILURE (fn-string-length fn-string-length-22 0) +EXPECTED_FOTS_FAILURE (fn-string-length fn-string-length-24 0) +EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-004 0) +EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-017 0) +EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-018 0) +EXPECTED_FOTS_FAILURE (fn-subsequence cbcl-subsequence-024 0) +EXPECTED_FOTS_FAILURE (fn-substring-after fn-substring-after-24 0) +EXPECTED_FOTS_FAILURE (fn-substring-before fn-substring-before-24 0) +EXPECTED_FOTS_FAILURE (fn-tokenize fn-tokenize-31 0) +EXPECTED_FOTS_FAILURE (fn-tokenize fn-tokenize-32 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-001 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-002 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-003 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-004 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-005 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-006 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-007 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-008 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-009 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-010 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-011 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-012 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-013 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-014 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-015 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-016 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-017 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-018 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-019 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-020 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-021 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-022 0) +EXPECTED_FOTS_FAILURE (fn-unordered fn-unordered-mix-args-023 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-013 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-014 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-037 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-038 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-039 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-042 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text fn-unparsed-text-050 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-available fn-unparsed-text-available-013 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-available fn-unparsed-text-available-014 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-available fn-unparsed-text-available-023 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-available fn-unparsed-text-available-024 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-available fn-unparsed-text-available-036 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-available fn-unparsed-text-available-037 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-available fn-unparsed-text-available-038 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-013 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-014 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-037 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-038 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-039 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-040 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-042 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-047 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-048 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-049 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-050 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-051 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-053 0) +EXPECTED_FOTS_FAILURE (fn-unparsed-text-lines fn-unparsed-text-lines-054 0) +EXPECTED_FOTS_FAILURE (math-acos math-acos-003 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FOAR0001_9 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FOAR0002_1 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FOAR0002-5 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FOCA0001_1 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FOCA0003_1 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-1 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-10 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-11 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-12 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-2 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-3 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-4 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-5 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-6 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-7 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-8 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0001-9 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-1 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-2 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-3 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-4 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-6 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-7 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-8 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes FODT0002-9 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XPTY0004_45 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQDY0091 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQST0046_13 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQST0046_14 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQST0085 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQTY0086_2 0) +EXPECTED_FOTS_FAILURE (misc-CombinedErrorCodes XQTY0086_3 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-5 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-7 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-8 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-9 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-12 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-13 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-15 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-16 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-17 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-18 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-19 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-20 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-21 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-id-23 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-5 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-7 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-8 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-9 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-15 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-16 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-17 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-18 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-19 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-20 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-21 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-23 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-30 0) +EXPECTED_FOTS_FAILURE (misc-MiscFunctions fn-idref-31 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-1 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-2 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-3 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-4 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-5 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-6 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-9 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-10 0) +EXPECTED_FOTS_FAILURE (misc-Serialization K2-Serialization-11 0) +EXPECTED_FOTS_FAILURE (misc-XMLEdition XML10-4ed-Excluded-char-1 0) +EXPECTED_FOTS_FAILURE (misc-XMLEdition XML10-5ed-Included-char-1 0) +EXPECTED_FOTS_FAILURE (misc-XMLEdition XML11-1ed-Included-char-1 0) +EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-002 0) +EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-004 0) +EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-006 0) +EXPECTED_FOTS_FAILURE (op-add-dayTimeDurations cbcl-plus-008 0) +EXPECTED_FOTS_FAILURE (op-add-dayTimeDuration-to-date cbcl-add-dayTimeDuration-to-date-003 0) +EXPECTED_FOTS_FAILURE (op-add-dayTimeDuration-to-dateTime cbcl-add-dayTimeDuration-to-dateTime-003 0) +EXPECTED_FOTS_FAILURE (op-add-yearMonthDuration-to-date cbcl-add-yearMonthDuration-to-date-003 0) +EXPECTED_FOTS_FAILURE (op-add-yearMonthDuration-to-dateTime cbcl-add-yearMonthDuration-to-dateTime-003 0) +EXPECTED_FOTS_FAILURE (op-date-greater-than cbcl-date-gt-001 0) +EXPECTED_FOTS_FAILURE (op-date-greater-than cbcl-date-le-001 0) +EXPECTED_FOTS_FAILURE (op-date-less-than cbcl-date-ge-001 0) +EXPECTED_FOTS_FAILURE (op-date-less-than cbcl-date-lt-001 0) +EXPECTED_FOTS_FAILURE (op-divide-dayTimeDuration cbcl-divide-dayTimeDuration-003 0) +EXPECTED_FOTS_FAILURE (op-divide-dayTimeDuration-by-dayTimeDuration cbcl-divide-dayTimeDuration-by-dayTimeDuration-001 0) +EXPECTED_FOTS_FAILURE (op-divide-dayTimeDuration-by-dayTimeDuration cbcl-divide-dayTimeDuration-by-dayTimeDuration-002 0) +EXPECTED_FOTS_FAILURE (op-divide-dayTimeDuration-by-dayTimeDuration cbcl-divide-dayTimeDuration-by-dayTimeDuration-003 0) +EXPECTED_FOTS_FAILURE (op-divide-yearMonthDuration cbcl-divide-yearMonthDuration-003 0) +EXPECTED_FOTS_FAILURE (op-divide-yearMonthDuration-by-yearMonthDuration cbcl-divide-yearMonthDuration-by-yearMonthDuration-001 0) +EXPECTED_FOTS_FAILURE (op-intersect fn-intersect-node-args-002 0) +EXPECTED_FOTS_FAILURE (op-intersect fn-intersect-node-args-015 0) +EXPECTED_FOTS_FAILURE (op-intersect fn-intersect-node-args-016 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-1 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-2 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-3 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-4 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-5 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-6 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-7 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-8 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-9 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-10 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-11 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-12 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-13 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-14 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-15 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-16 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-17 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-18 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-19 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-20 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-21 0) +EXPECTED_FOTS_FAILURE (op-NOTATION-equal Comp-notation-22 0) +EXPECTED_FOTS_FAILURE (op-numeric-divide op-numeric-divide-big-01 0) +EXPECTED_FOTS_FAILURE (op-numeric-integer-divide cbcl-numeric-idivide-002 0) +EXPECTED_FOTS_FAILURE (op-numeric-subtract op-numeric-subtract-big-01 0) +EXPECTED_FOTS_FAILURE (op-subtract-dates cbcl-subtract-dates-001 0) +EXPECTED_FOTS_FAILURE (op-subtract-dates cbcl-subtract-dates-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-dates cbcl-subtract-dates-003 0) +EXPECTED_FOTS_FAILURE (op-subtract-dates cbcl-subtract-dates-004 0) +EXPECTED_FOTS_FAILURE (op-subtract-dateTimes cbcl-subtract-dateTimes-001 0) +EXPECTED_FOTS_FAILURE (op-subtract-dateTimes cbcl-subtract-dateTimes-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-dateTimes cbcl-subtract-dateTimes-003 0) +EXPECTED_FOTS_FAILURE (op-subtract-dateTimes cbcl-subtract-dateTimes-004 0) +EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDuration-from-date cbcl-subtract-dayTimeDuration-from-date-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDuration-from-dateTime cbcl-subtract-dayTimeDuration-from-dateTime-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-subtract-dayTimeDurations-003 0) +EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-004 0) +EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-006 0) +EXPECTED_FOTS_FAILURE (op-subtract-dayTimeDurations cbcl-minus-008 0) +EXPECTED_FOTS_FAILURE (op-subtract-times cbcl-subtract-times-001 0) +EXPECTED_FOTS_FAILURE (op-subtract-times cbcl-subtract-times-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-times cbcl-subtract-times-003 0) +EXPECTED_FOTS_FAILURE (op-subtract-times cbcl-subtract-times-004 0) +EXPECTED_FOTS_FAILURE (op-subtract-yearMonthDuration-from-date cbcl-subtract-yearMonthDuration-from-date-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-yearMonthDuration-from-dateTime cbcl-subtract-yearMonthDuration-from-dateTime-002 0) +EXPECTED_FOTS_FAILURE (op-subtract-yearMonthDurations cbcl-subtract-yearMonthDurations-003 0) +EXPECTED_FOTS_FAILURE (op-union fn-union-node-args-015 0) +EXPECTED_FOTS_FAILURE (op-union fn-union-node-args-016 0) +EXPECTED_FOTS_FAILURE (op-union fn-union-node-args-017 0) +EXPECTED_FOTS_FAILURE (prod-AllowingEmpty outer-013 0) +EXPECTED_FOTS_FAILURE (prod-AllowingEmpty outer-016 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-3 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-26 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-27 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-28 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-1 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-2 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-3 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-4 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-5 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-6 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-7 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-8 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-9 0) +EXPECTED_FOTS_FAILURE (prod-Annotation annotation-assertion-10 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep Axes085 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep Axes086 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep Axes089 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep cbcl-childAxis-001 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep cbcl-wild-002 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-3 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-5 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-6 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-8 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-14 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-16 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-17 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-18 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-19 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-20 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-21 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.abbr abbreviatedSyntax-25 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.ancestor ancestor-15 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.ancestor-or-self ancestorself-13 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.ancestor-or-self ancestorself-15 0) +EXPECTED_FOTS_FAILURE (prod-AxisStep.ancestor-or-self unabbreviatedSyntax-11 0) +EXPECTED_FOTS_FAILURE (prod-BaseURIDecl base-URI-4 0) +EXPECTED_FOTS_FAILURE (prod-BaseURIDecl K2-BaseURIProlog-5 0) +EXPECTED_FOTS_FAILURE (prod-BoundarySpaceDecl boundary-space-005 0) +EXPECTED_FOTS_FAILURE (prod-BoundarySpaceDecl boundary-space-007 0) +EXPECTED_FOTS_FAILURE (prod-BoundarySpaceDecl boundary-space-009 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr CastableAs648 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr Castable-UnionType-1 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr Castable-ListType-2 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-date-001 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-date-002 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-dateTime-001 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-dateTime-002 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-duration-001 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-duration-002 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-yearMonthDuration-001 0) +EXPECTED_FOTS_FAILURE (prod-CastableExpr cbcl-castable-yearMonthDuration-002 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr CastAs673a 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr CastAs674a 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr CastAsNamespaceSensitiveType-10 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr K-SeqExprCast-71b 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-date-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-date-002 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-dateTime-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-dateTime-002 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-decimal-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-decimal-002 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-decimal-003 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-decimal-004 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-duration-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-duration-002 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-integer-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-integer-002 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-integer-003 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-integer-004 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-ncname-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-normalizedString-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-normalizedString-001b 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-token-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-token-001b 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-yearMonthDuration-001 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.derived cbcl-cast-yearMonthDuration-002 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-1 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-2 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-3 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-5 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-6 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-9 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-10 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-11 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-12 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-16 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-19 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-20 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-21 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-25 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-27 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-28 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-29 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-33 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-UnionType-34 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-1 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-2 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-4 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-7 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-11 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-12 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-14 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-21 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-22 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-28 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-29 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-30 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-31 0) +EXPECTED_FOTS_FAILURE (prod-CastExpr.schema CastAs-ListType-32 0) +EXPECTED_FOTS_FAILURE (prod-Comment XQueryComment012 0) +EXPECTED_FOTS_FAILURE (prod-CompAttrConstructor K2-ComputeConAttr-51 0) +EXPECTED_FOTS_FAILURE (prod-CompAttrConstructor K2-ComputeConAttr-53 0) +EXPECTED_FOTS_FAILURE (prod-CompAttrConstructor K2-ComputeConAttr-58 0) +EXPECTED_FOTS_FAILURE (prod-CompDocConstructor K2-ConDocNode-2 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-001 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-002 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-003 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-004 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-005 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-006 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-010 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-011 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-012 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-013 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-014 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-015 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-022 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-027 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-028 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-030 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-031 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-032 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-033 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-034 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-035 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-036 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-037 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-038 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-039 0) +EXPECTED_FOTS_FAILURE (prod-CompNamespaceConstructor nscons-041 0) +EXPECTED_FOTS_FAILURE (prod-CompTextConstructor K2-ConText-4 0) +EXPECTED_FOTS_FAILURE (prod-ContextItemDecl contextDecl-016 0) +EXPECTED_FOTS_FAILURE (prod-ContextItemDecl contextDecl-017 0) +EXPECTED_FOTS_FAILURE (prod-ContextItemDecl contextDecl-031 0) +EXPECTED_FOTS_FAILURE (prod-ContextItemDecl contextDecl-047 0) +EXPECTED_FOTS_FAILURE (prod-ContextItemDecl contextDecl-049 0) +EXPECTED_FOTS_FAILURE (prod-ContextItemDecl contextDecl-055 0) +EXPECTED_FOTS_FAILURE (prod-CopyNamespacesDecl copynamespace-3 0) +EXPECTED_FOTS_FAILURE (prod-CopyNamespacesDecl K2-CopyNamespacesProlog-5 0) +EXPECTED_FOTS_FAILURE (prod-CountClause count-007 0) +EXPECTED_FOTS_FAILURE (prod-CountClause count-008 0) +EXPECTED_FOTS_FAILURE (prod-DecimalFormatDecl decimal-format-14 0) +EXPECTED_FOTS_FAILURE (prod-DecimalFormatDecl decimal-format-907err 0) +EXPECTED_FOTS_FAILURE (prod-DecimalFormatDecl decimal-format-908err 0) +EXPECTED_FOTS_FAILURE (prod-DecimalFormatDecl decimal-format-910err 0) +EXPECTED_FOTS_FAILURE (prod-DecimalFormatDecl decimal-format-911err 0) +EXPECTED_FOTS_FAILURE (prod-DefaultNamespaceDecl defaultnamespacedeclerr-6 0) +EXPECTED_FOTS_FAILURE (prod-DefaultNamespaceDecl defaultnamespacedeclerr-8 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList Constr-attr-nsprein-3 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList Constr-attr-nsprein-4 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList Constr-attr-ws-3 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList Constr-attr-ws-4 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList Constr-attr-ws-5 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList Constr-attr-entref-1 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList Constr-attr-entref-2 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList K2-DirectConElemAttr-75 0) +EXPECTED_FOTS_FAILURE (prod-DirAttributeList DirectConElemAttr-1 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor Constr-pi-content-5 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor Constr-comment-5 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-35 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-46 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-49 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-50 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-51 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-52 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-53 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-54 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-66 0) +EXPECTED_FOTS_FAILURE (prod-DirectConstructor K2-DirectConOther-70 0) +EXPECTED_FOTS_FAILURE (prod-DirElemConstructor Constr-elem-curlybr-3 0) +EXPECTED_FOTS_FAILURE (prod-DirElemConstructor Constr-elem-curlybr-4 0) +EXPECTED_FOTS_FAILURE (prod-DirElemConstructor K2-DirectConElem-38 0) +EXPECTED_FOTS_FAILURE (prod-DirElemConstructor K2-DirectConElem-48 0) +EXPECTED_FOTS_FAILURE (prod-DirElemConstructor K2-DirectConElem-49 0) +EXPECTED_FOTS_FAILURE (prod-DirElemConstructor K2-DirectConElem-52 0) +EXPECTED_FOTS_FAILURE (prod-DirElemConstructor K2-DirectConElem-53a 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-eol-3 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-eol-4 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-entref-1 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-entref-3 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-cdata-1 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-nsmode-5 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-nsmode-6 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-nsmode-7 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-nsmode-8 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-nsmode-10 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent Constr-cont-nsmode-11 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent K2-DirectConElemContent-28 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.namespace K2-DirectConElemNamespace-40 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.namespace K2-DirectConElemNamespace-56 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.namespace Constr-inscope-10 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.namespace Constr-inscope-12 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.namespace Constr-inscope-21 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.namespace Constr-inscope-22 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-15 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-16 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-17 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-18 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-19 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-20 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-21 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-22 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-23 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-enclexpr-24 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-genchref-1 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-genchref-2 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-genchref-3 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace Constr-ws-genchref-4 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace K2-DirectConElemWhitespace-10 0) +EXPECTED_FOTS_FAILURE (prod-DirElemContent.whitespace K2-DirectConElemWhitespace-25 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType025 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType026 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType027 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType037 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType038 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType039 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType040 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType041 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType042 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType043 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType044 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType048 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType049 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType050 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType051 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType052 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr ForExprType053 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr step-expr-si-2 0) +EXPECTED_FOTS_FAILURE (prod-FLWORExpr step-expr-si-3 0) +EXPECTED_FOTS_FAILURE (prod-ForClause ForExpr004 0) +EXPECTED_FOTS_FAILURE (prod-ForClause ForExpr013 0) +EXPECTED_FOTS_FAILURE (prod-ForClause ForExprType022 0) +EXPECTED_FOTS_FAILURE (prod-ForClause ForExprType023 0) +EXPECTED_FOTS_FAILURE (prod-ForClause ForExprType024 0) +EXPECTED_FOTS_FAILURE (prod-ForClause ForExprType036 0) +EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-003 0) +EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-005 0) +EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-009 0) +EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-011 0) +EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-036 0) +EXPECTED_FOTS_FAILURE (prod-FunctionCall FunctionCall-037 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-001 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-001a 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-002 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-002a 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-003 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-003a 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-004 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-007 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-010 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-011 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-013 0) +EXPECTED_FOTS_FAILURE (prod-GroupByClause group-014 0) +EXPECTED_FOTS_FAILURE (prod-IfExpr CondExpr012 0) +EXPECTED_FOTS_FAILURE (prod-IfExpr CondExpr017 0) +EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof112 0) +EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof116 0) +EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof118 0) +EXPECTED_FOTS_FAILURE (prod-InstanceofExpr instanceof119 0) +EXPECTED_FOTS_FAILURE (prod-InstanceofExpr cbcl-instance-of-001 0) +EXPECTED_FOTS_FAILURE (prod-LetClause LetExpr020a 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals056 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals056a 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals057 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals057a 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals058a 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals059a 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals060a 0) +EXPECTED_FOTS_FAILURE (prod-Literal Literals061a 0) +EXPECTED_FOTS_FAILURE (prod-Literal K-Literals-30 0) +EXPECTED_FOTS_FAILURE (prod-Literal K-Literals-31a 0) +EXPECTED_FOTS_FAILURE (prod-Literal K-Literals-46 0) +EXPECTED_FOTS_FAILURE (prod-Literal K-Literals-47a 0) +EXPECTED_FOTS_FAILURE (prod-Literal K-Literals-49 0) +EXPECTED_FOTS_FAILURE (prod-Literal K-Literals-50 0) +EXPECTED_FOTS_FAILURE (prod-Literal K2-Literals-7 0) +EXPECTED_FOTS_FAILURE (prod-Literal K2-Literals-20 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-1 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-2 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-3 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-8 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-10 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-12 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-17 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-18 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport module-URIs-19 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport modules-collide-var-001 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport modules-collide-fn-001 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport modules-circular 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport modules-pub-priv-30 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport modules-pub-priv-34 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport cbcl-module-001 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport cbcl-module-002 0) +EXPECTED_FOTS_FAILURE (prod-ModuleImport cbcl-module-004 0) +EXPECTED_FOTS_FAILURE (prod-NamespaceDecl namespaceDecl-23 0) +EXPECTED_FOTS_FAILURE (prod-NameTest K2-NameTest-30 0) +EXPECTED_FOTS_FAILURE (prod-NameTest K2-NameTest-31 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-003 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-004 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-005 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-011 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-025 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-026 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-028 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-031 0) +EXPECTED_FOTS_FAILURE (prod-OptionDecl.serialization Serialization-032 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy20 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy21 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy40 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy41 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy49 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy50 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy51 0) +EXPECTED_FOTS_FAILURE (prod-OrderByClause orderBy59 0) +EXPECTED_FOTS_FAILURE (prod-PathExpr PathExpr-1 0) +EXPECTED_FOTS_FAILURE (prod-PathExpr PathExpr-2 0) +EXPECTED_FOTS_FAILURE (prod-PathExpr PathExpr-5p 0) +EXPECTED_FOTS_FAILURE (prod-PathExpr PathExpr-7p 0) +EXPECTED_FOTS_FAILURE (prod-PathExpr PathExpr-8p 0) +EXPECTED_FOTS_FAILURE (prod-PathExpr PathExpr-9p 0) +EXPECTED_FOTS_FAILURE (prod-Predicate K2-FilterExpr-5 0) +EXPECTED_FOTS_FAILURE (prod-Predicate K2-FilterExpr-7 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-static-typing-1-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-1-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-2-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-3-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-4-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-6-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-7-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-8-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-higher-order-function-9-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature prohibit-schema-aware-1-s 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature prohibit-schema-aware-2-s 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature prohibit-higher-order-function-1-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature prohibit-higher-order-function-2-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature prohibit-higher-order-function-3-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature prohibit-higher-order-function-4-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature unknown-feature 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature well-formed-feature-1 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature well-formed-feature-2 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature well-formed-feature-3 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature well-formed-feature-4 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-prohibit-1 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-prohibit-2 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-prohibit-3 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-prohibit-4 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-prohibit-5 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-all-extensions-1 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-all-optional-features-1-ns3 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-all-optional-features-3-ns3 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-all-optional-features-2-ns2 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature prohibit-all-optional-features-1 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-all-optional-features-5-ns 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature require-all-optional-features-7-s 0) +EXPECTED_FOTS_FAILURE (prod-RequireProhibitFeature separate-modules-8-ns 0) +EXPECTED_FOTS_FAILURE (prod-ReturnClause ReturnExpr010 0) +EXPECTED_FOTS_FAILURE (prod-ReturnClause ReturnExpr016 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema005 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema016 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema031 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema032 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema032a 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema032b 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema032c 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema040 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema040a 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport qischema070 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-001 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-002 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-003 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-004 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-005 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-006 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-007 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-008 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-009 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-010 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport substitution-011 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-schema-element-1 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-schema-element-2 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-schema-element-4 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-schema-element-5 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-schema-element-8 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-validated-schema-element-1 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-validated-schema-element-3 0) +EXPECTED_FOTS_FAILURE (prod-SchemaImport cbcl-validated-schema-element-4 0) +EXPECTED_FOTS_FAILURE (prod-TryCatchExpr try-catch-all-dynamic-errors-caught-14 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-nomatch 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-nomatch-2 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-branch-1 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-branch-1-dup 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-branch-2 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-branch-2-dup 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-branch-both 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-branch-both-dup 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-union-multi 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-in-xpath 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-112 0) +EXPECTED_FOTS_FAILURE (prod-TypeswitchExpr typeswitch-116 0) +EXPECTED_FOTS_FAILURE (prod-ValidateExpr validateexpr-27 0) +EXPECTED_FOTS_FAILURE (prod-ValidateExpr validateexpr-35 0) +EXPECTED_FOTS_FAILURE (prod-ValidateExpr validate-as-101 0) +EXPECTED_FOTS_FAILURE (prod-ValidateExpr validate-as-102 0) +EXPECTED_FOTS_FAILURE (prod-ValidateExpr validate-as-104 0) +EXPECTED_FOTS_FAILURE (prod-ValidateExpr validate-as-105 0) +EXPECTED_FOTS_FAILURE (prod-ValidateExpr validate-as-106 0) +EXPECTED_FOTS_FAILURE (prod-VarDecl.external K2-ExternalVariablesWithout-18 0) +EXPECTED_FOTS_FAILURE (prod-VarDecl.external extvardeclwithtype-23 0) +EXPECTED_FOTS_FAILURE (prod-VarDecl.external K2-ExternalVariablesWith-22 0) +EXPECTED_FOTS_FAILURE (prod-VarDefaultValue extvardef-003a 0) +EXPECTED_FOTS_FAILURE (prod-VarDefaultValue extvardef-006b 0) +EXPECTED_FOTS_FAILURE (prod-VarDefaultValue extvardef-016a 0) +EXPECTED_FOTS_FAILURE (prod-VarDefaultValue extvardef-016b 0) +EXPECTED_FOTS_FAILURE (prod-VersionDecl VersionDecl-v1-processor-and-v3-query 0) +EXPECTED_FOTS_FAILURE (prod-VersionDecl version_declaration-023-v3 0) +EXPECTED_FOTS_FAILURE (prod-WhereClause WhereExpr001 0) +EXPECTED_FOTS_FAILURE (prod-WhereClause WhereExpr003 0) +EXPECTED_FOTS_FAILURE (prod-WhereClause WhereExpr022 0) +EXPECTED_FOTS_FAILURE (prod-WhereClause WhereExpr024 0) +EXPECTED_FOTS_FAILURE (prod-WhereClause WhereExpr025 0) +EXPECTED_FOTS_FAILURE (prod-WhereClause WhereExpr026 0) +EXPECTED_FOTS_FAILURE (prod-WindowClause WindowingUseCase07S 0) +EXPECTED_FOTS_FAILURE (prod-WindowClause WindowingUseCase11S 0) +EXPECTED_FOTS_FAILURE (prod-WindowClause WindowingUseCase13S 0) +EXPECTED_FOTS_FAILURE (prod-WindowClause SlidingWindowExpr507 0) +EXPECTED_FOTS_FAILURE (prod-WindowClause TumblingWindowExpr507 0) +EXPECTED_FOTS_FAILURE (xs-base64Binary base64-115 0) +EXPECTED_FOTS_FAILURE (xs-normalizedString cbcl-normalizedstring-002 0) +EXPECTED_FOTS_FAILURE (xs-normalizedString cbcl-normalizedstring-002b 0) +EXPECTED_FOTS_FAILURE (xs-normalizedString cbcl-normalizedstring-004 0) +EXPECTED_FOTS_FAILURE (xs-token cbcl-token-002 0) +EXPECTED_FOTS_FAILURE (xs-token cbcl-token-002b 0) +EXPECTED_FOTS_FAILURE (xs-token cbcl-token-004 0) + +# Initialize FOTSExpectedFailures.xml +SET (fots_expected_failures_file "${CMAKE_BINARY_DIR}/FOTSExpectedFailures.xml") +# QQQ For now, we output the outer element so we can load this +# using fn:doc(). This should probably go away. +FILE (WRITE "${fots_expected_failures_file}" "\n") + +# Loop through test sets +GET_PROPERTY (_test_sets GLOBAL PROPERTY "_ALL_FOTS_TEST_SETS_") +FOREACH (_test_set ${_test_sets}) + FILE (APPEND "${fots_expected_failures_file}" + " \n") + # Loop through the test cases for each test set + GET_PROPERTY (_test_cases GLOBAL PROPERTY "_FOTS_${_test_set}_CASES_") + WHILE (_test_cases) + # Pop off three items and write out entry + LIST (GET _test_cases 0 _test_case) + LIST (GET _test_cases 1 _bugnum) + LIST (GET _test_cases 2 _notrun) + LIST (REMOVE_AT _test_cases 0 1 2) + IF (_notrun) + SET (_notrun " notRun=\"true\"") + ENDIF (_notrun) + FILE (APPEND "${fots_expected_failures_file}" + " \n") + ENDWHILE (_test_cases) + FILE (APPEND "${fots_expected_failures_file}" " \n") +ENDFOREACH (_test_set) + +# QQQ Have to close this outer element, which means you can't call +# EXPECTED_FOTS_FAILURE from any other CMakeLists.txt. +FILE (APPEND "${fots_expected_failures_file}" "\n") diff -Nru zorba-2.7.0-0/test/fots/ImportFOTS.cmake zorba-2.8.0-0/test/fots/ImportFOTS.cmake --- zorba-2.7.0-0/test/fots/ImportFOTS.cmake 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots/ImportFOTS.cmake 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,106 @@ +# Copyright 2006-2008 The FLWOR Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# +# Downloads the latest FOTS archive and prepares for CTest integration. +# Required argument: BUILDDIR (should be ${PROJECT_BINARY_DIR}) +# Required argument: ZORBA (full path to Zorba command-line executable) + + +# Change this to publish updated FOTS archives +SET (FOTS_ARCHIVE "FOTS_191212.tgz") + +# Change this to modify which elements in FOTS driver results are output +# as CDATA +SET (FOTS_CDATA_ELEMENTS "fots:query test assert-xml") + +# Download and unpack pre-created archive +SET (_outdir "${BUILDDIR}/test/fots") +MESSAGE (STATUS "Downloading FOTS archive...") +FILE (DOWNLOAD http://zorbatest.lambda.nu:8080/~ceej/${FOTS_ARCHIVE} + "${_outdir}/${FOTS_ARCHIVE}" STATUS _dlstat SHOW_PROGRESS) +LIST (GET _dlstat 0 _dlcode) +IF (NOT _dlcode EQUAL 0) + LIST (GET _dlstat 1 _dlmsg) + MESSAGE (FATAL_ERROR "Error downloading FOTS archive: ${_dlmsg}") +ENDIF (NOT _dlcode EQUAL 0) + +MESSAGE (STATUS "Unpacking FOTS archive...") +EXECUTE_PROCESS (COMMAND "${CMAKE_COMMAND}" -E tar xf ${FOTS_ARCHIVE} + WORKING_DIRECTORY "${_outdir}" RESULT_VARIABLE _unpackstat) +IF (NOT _unpackstat EQUAL 0) + MESSAGE (FATAL_ERROR "Error unpackaging FOTS archive: ${_unpackstat}") +ENDIF (NOT _unpackstat EQUAL 0) + +# Scan FOTS catalogs and create ADD_TEST scripts. First, create a list +# of test sets. We assume that the FOTS driver is in a sibling directory +# named fots_driver. +MESSAGE (STATUS "Creating CTest scripts...") +EXECUTE_PROCESS (COMMAND "${ZORBA}" --omit-xml-declaration -f -q + "${CMAKE_CURRENT_LIST_DIR}/../fots_driver/cli.xq" + -e "fotsPath:=${_outdir}/2011/QT3-test-suite/catalog.xml" + -e mode:=list-test-sets + OUTPUT_VARIABLE _testsetsstring RESULT_VARIABLE _zstat) +IF (NOT _zstat EQUAL 0) + MESSAGE (FATAL_ERROR "Zorba failed with message: ${_zstat}\n" + "(perhaps you haven't built Zorba yet?)") +ENDIF (NOT _zstat EQUAL 0) +STRING (REGEX REPLACE "[\n\r]+" ";" _testsets ${_testsetsstring}) + +SET (_setscript "${_outdir}/FOTSSetTests.cmake") +SET (_casescript "${_outdir}/FOTSCaseTests.cmake") +FILE (REMOVE "${_setscript}") +FILE (REMOVE "${_casescript}") + +# Iterate through all test sets. +FOREACH (_testset ${_testsets}) + # Add a test for the whole test set. + FILE (APPEND "${_setscript}" + "ZORBA_ADD_TEST (FOTS/${_testset} zorbacmd -f -q " + "${CMAKE_CURRENT_LIST_DIR}/../fots_driver/cli.xq " + "-e fotsPath:=${_outdir}/2011/QT3-test-suite/catalog.xml " + "-e mode:=run-test-sets -e testSetPrefixes:=${_testset} " + "-e expectedFailuresPath:=${BUILDDIR}/FOTSExpectedFailures.xml " + "--disable-http-resolution --indent " + "-z \"cdata-section-elements=${FOTS_CDATA_ELEMENTS}\")\n" + "ZORBA_SET_TEST_PROPERTY (FOTS/${_testset} " + "FAIL_REGULAR_EXPRESSION \"result=\\\"fail\\\"\")\n") + + # Iterate through the test cases for this test set. +# EXECUTE_PROCESS (COMMAND "${ZORBA}" --omit-xml-declaration -f -q +# "${CMAKE_CURRENT_LIST_DIR}/../fots_driver/cli.xq" +# -e "fotsPath:=${_outdir}/2011/QT3-test-suite/catalog.xml" +# -e mode:=list-test-cases -e testSetPrefixes:=${_testset} +# OUTPUT_VARIABLE _testcasesstring) +# STRING (REGEX REPLACE "[\n\r]+" ";" _testcases ${_testcasesstring}) + EXECUTE_PROCESS (COMMAND "${ZORBA}" --omit-xml-declaration -f -q + "${CMAKE_CURRENT_LIST_DIR}/get-tests.xq" + --base-uri "${_outdir}/2011/QT3-test-suite/catalog.xml" + -e testSet:=${_testset} + OUTPUT_VARIABLE _testcases) + FOREACH (_testcase ${_testcases}) + # Add a test for the test case. + FILE (APPEND "${_casescript}" + "ZORBA_ADD_TEST (FOTS/${_testset}/${_testcase} zorbacmd -f -q " + "${CMAKE_CURRENT_LIST_DIR}/../fots_driver/cli.xq " + "-e fotsPath:=${_outdir}/2011/QT3-test-suite/catalog.xml " + "-e mode:=run-test-case " + "-e testSetName:=${_testset} -e testCaseName:=${_testcase} " + "-e expectedFailuresPath:=${BUILDDIR}/FOTSExpectedFailures.xml " + "--disable-http-resolution --indent " + "-z \"cdata-section-elements=${FOTS_CDATA_ELEMENTS}\")\n" + "ZORBA_SET_TEST_PROPERTY (FOTS/${_testset}/${_testcase} " + "PASS_REGULAR_EXPRESSION \"name=\\\"${_testcase}\\\" result=\\\"pass\\\"\")\n") + ENDFOREACH (_testcase) +ENDFOREACH (_testset) diff -Nru zorba-2.7.0-0/test/fots/README.TXT zorba-2.8.0-0/test/fots/README.TXT --- zorba-2.7.0-0/test/fots/README.TXT 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots/README.TXT 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,26 @@ +This directory contains scripts for integrating the Zorba FOTS Driver +(contained in the directory ../fots_driver) with CTest. + +It adds four targets to the Zorba project: one to download and import +FOTS, and three to configure which kinds of CTests are added to the +project. + + fots-import: This target will download FOTS and create CTest + scripts. This is somewhat slow (around a minute), but you only need + to do it once. You should not need to repeat this target unless you + delete your build directory, or you want to update to a newer FOTS. + + fots-activate-sets: This target will re-configure your project to + include one CTest test for each FOTS test set (roughly 370 tests). + This is the recommended approach for running FOTS tests as it + provides a good tradeoff between testing time and test granularity. + + fots-activate-cases: This target will re-configure your project to + include one CTest test for each FOTS test case (roughly 27000 + tests). This is only recommended when debugging a problem reported + with a specific test case, because CTest really isn't designed for + such a large number of tests; it will slow down considerably. + + fots-deactivate: This target will re-configure your project to + include no CTest tests for FOTS. Use this when doing normal + development. diff -Nru zorba-2.7.0-0/test/fots/get-tests.xq zorba-2.8.0-0/test/fots/get-tests.xq --- zorba-2.7.0-0/test/fots/get-tests.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots/get-tests.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,25 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +declare namespace c = "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare variable $fotsPath as xs:string external := ""; +declare variable $testSet as xs:string external := ""; + +let $catalog := fn:doc(fn:static-base-uri())/c:catalog +let $test-set := $catalog/c:test-set[@name = $testSet] +let $test-relfile := fn:trace(data($test-set/@file), "Loading") +return fn:string-join(data(fn:doc($test-relfile)/c:test-set/c:test-case/@name), ';') diff -Nru zorba-2.7.0-0/test/fots_driver/FOTSZorbaManifest.xml zorba-2.8.0-0/test/fots_driver/FOTSZorbaManifest.xml --- zorba-2.7.0-0/test/fots_driver/FOTSZorbaManifest.xml 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/FOTSZorbaManifest.xml 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru zorba-2.7.0-0/test/fots_driver/README.TXT zorba-2.8.0-0/test/fots_driver/README.TXT --- zorba-2.7.0-0/test/fots_driver/README.TXT 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/README.TXT 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,51 @@ +Information about the W3C XQuery/XPath/XSLT 3.* Test Suite can be found at: + http://dev.w3.org/2011/QT3-test-suite. + +In order to use the Zorba FOTS driver (written in XQuery) one has to follow +these steps: + +0) Build Zorba with ZORBA_WITH_BIG_INTEGER flag set to ON. + + For example with CMake: + cmake -DZORBA_WITH_BIG_INTEGER=ON .. + make + +1) Download the FOTS testsuite from W3C + Since currently there is no official release, a simple "cvs get" will do: + + $ export CVSROOT=":pserver:anonymous@dev.w3.org:/sources/public" + $ cvs login + (Logging in to anonymous@dev.w3.org) + CVS password: anonymous + $ cvs get 2011/QT3-test-suite + +3) run + ./zorba -f + -q ../../test/fots_driver/cli.xq + +Zorba FOTS driver usage examples: +If you run Zorba from a checkout of the trunk and the build/bin folder, +- /path/to/cli.xq can be set to ../../test/fots_driver/cli.xq + +Always try to output the result back to an XML file with nice indentation: +./zorba -f -q ../../test/fots_driver/cli.xq -e SET_CLI_OPTIONS_HERE -o output.xml --indent + + This way you will see trace information in the CLI window and detailed + results of the test cases in the 'output.xml'. + +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e fotsZorbaManifestPath:=/path/to/Zorba_manifest.xml -e mode:=list-test-sets +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets -e testSetPrefixes:=prod,app +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e testSetPrefixes:=prod-Literal +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e dependency:=higherOrderFunctions +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e dependency:=higherOrderFunctions -e assertType:=assert-count +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-matching-test-cases -e pattern:=catch +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -o result.xml --indent +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e expectedFailuresPath:=ExpectedFailures.xml -o result.xml --indent +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e dependency:=higherOrderFunctions_false -o result.xml --indent +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e assertType:=assert-count -o result.xml --indent +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod-Literal -e verbose:=false -o result.xml --indent +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-case -e testSetName:=prod-Literal -e testCaseName:=Literals001 -o result.xml --indent +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-and-report -o report.xml --indent +zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=report -e failuresFilePath:=failures.xml -e verbose:=false -o report.xml --indent +zorba -f -q /path/to/cli.xq -e mode:=generate-expected-failures -e failuresFilePath:=failures.xml -o ExpectedFailures.xml --indent diff -Nru zorba-2.7.0-0/test/fots_driver/cli.xq zorba-2.8.0-0/test/fots_driver/cli.xq --- zorba-2.7.0-0/test/fots_driver/cli.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/cli.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,196 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver CLI + : @author Ghislain Fourny, Sorin Nasoi + :) + +import module namespace d = + "http://www.zorba-xquery.com/fots-driver" at "fots-driver.xq"; +import module namespace r = + "http://www.zorba-xquery.com/fots-driver/reporting" at "reporting.xq"; + +(:~ path to the place where FOTS can be found :) +declare variable $fotsPath as xs:string external := ""; + +(:~ path to the place where the FOTS Zorba manifest can be found :) +declare variable $fotsZorbaManifestPath as xs:string external := + "FOTSZorbaManifest.xml"; + +(:~ Path to the results from a previous run :) +declare variable $failuresFilePath as xs:string external := ""; + +(:~ choose the CLI option you want to run :) +declare variable $mode as xs:string external := ""; + +(:~ name/criteria for the test sets :) +declare variable $testSetPrefixes as xs:string external := ""; + +(:~ name/criteria for the test cases :) +declare variable $testCasePrefixes as xs:string external := ""; + +(:~ name for the test set :) +declare variable $testSetName as xs:string external := ""; + +(:~ name for the test case :) +declare variable $testCaseName as xs:string external := ""; + +(:~ Enable or disable verbose output :) +declare variable $verbose as xs:string external := "true"; + +(:~ assertion type :) +declare variable $assertType as xs:string external := ""; + +(:~ dependency: used in 'list-test-cases' and 'run-test-sets' modes:) +declare variable $dependency as xs:string external := ""; + +(:~ regex for the tests in the 'list-matching-test-cases' option :) +declare variable $pattern as xs:string external := ""; + +(:~ flags for the tests in the 'list-matching-test-cases' option :) +declare variable $flags as xs:string external := ""; + +(:~ Path to the ExpectedFailures file :) +declare variable $expectedFailuresPath as xs:string external :=""; + +(:~ Tokenize comma or empty string :) +declare %private function local:tokenize( + $input as xs:string +) as xs:string* +{ + let $tokens := tokenize($input, ",") + return if (exists($tokens)) then $tokens else "" +}; + +declare function local:usage() as xs:string +{ + string-join(( + "Zorba FOTS driver usage examples:", + "If you run Zorba from a checkout of the trunk and the build/bin folder,", + "- /path/to/cli.xq can be set to ../../test/fots_driver/cli.xq", + "", + "Always try to output the result back to an XML file with nice indentation:", + "./zorba -f -q ../../test/fots_driver/cli.xq -e SET_CLI_OPTIONS_HERE -o output.xml --indent", + "", + " This way you will see trace information in the CLI window and detailed", + " results of the test cases in the 'output.xml'.", + "", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e fotsZorbaManifestPath:=/path/to/Zorba_manifest.xml -e mode:=list-test-sets", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-sets -e testSetPrefixes:=prod,app", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e testSetPrefixes:=prod-Literal", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e dependency:=higherOrderFunctions", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-test-cases -e dependency:=higherOrderFunctions -e assertType:=assert-count", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=list-matching-test-cases -e pattern:=catch", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -o result.xml --indent", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e expectedFailuresPath:=ExpectedFailures.xml -o result.xml --indent", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e dependency:=higherOrderFunctions_false -o result.xml --indent", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod -e assertType:=assert-count -o result.xml --indent", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-sets -e testSetPrefixes:=prod-Literal -e verbose:=false -o result.xml --indent", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-test-case -e testSetName:=prod-Literal -e testCaseName:=Literals001 -o result.xml --indent", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=run-and-report -o report.xml --indent", + "zorba -f -q /path/to/cli.xq -e fotsPath:=/path/to/QT3-test-suite/catalog.xml -e mode:=report -e failuresFilePath:=failures.xml -e verbose:=false -o report.xml --indent", + "zorba -f -q /path/to/cli.xq -e mode:=generate-expected-failures -e failuresFilePath:=failures.xml -o ExpectedFailures.xml --indent", + "" + ), " ") +}; + +(:~ The test cases in this list have bugs assigned and should not be run :) +variable $exceptedTestCases := ( +"cbcl-subsequence-011", "cbcl-subsequence-012", "cbcl-subsequence-013", +"cbcl-subsequence-014" (:see bug lp:1069794 :) +, "re00975", "re00976", "re00976a" (:see bug lp:1070533 :) +, "fn-unparsed-text-lines-052" (:see bug lp:1073175 :) +); + +(:~ The test in this list have bugs assigned already and should not be run :) +variable $exceptedTestSets := (); + +switch ($mode) +case "list-test-sets" + return + string-join( + (d:list-test-sets( + trace($fotsPath, "Path to FOTS catalog.xml set to: "), + local:tokenize(trace($testSetPrefixes, "'testSetPrefixes' set to: ")))), + " ") +case "list-test-cases" + return + string-join( + (d:list-test-cases( trace($fotsPath, + "Path to FOTS catalog.xml set to: "), + local:tokenize(trace($testSetPrefixes, + "'testSetPrefixes' set to: ")), + "", + trace($dependency, + "'dependency' set to:"), + trace($assertType, + "'assertType' set to: "))), + " ") +case "list-matching-test-cases" + return string-join((d:list-matching-test-cases( + trace($fotsPath, + "Path to FOTS catalog.xml set to: "), + trace($pattern, + "pattern set to: "), + trace($flags, + "flags were set to: ")), ""), + " ") +case "run-test-sets" + return d:run-fots($fotsPath, + $fotsZorbaManifestPath, + d:list-test-sets($fotsPath, + local:tokenize(trace($testSetPrefixes, + "'testSetPrefixes' set to: "))), + d:list-test-cases($fotsPath, + local:tokenize($testSetPrefixes), + local:tokenize(trace($testCasePrefixes, + "'testCasePrefixes' set to: ")), + trace($dependency, + "'dependency' set to:"), + trace($assertType, + "'assertType' set to: ")), + $exceptedTestCases, + $exceptedTestSets, + xs:boolean($verbose), + $expectedFailuresPath) +case "run-test-case" + return d:run-fots($fotsPath, + $fotsZorbaManifestPath, + trace($testSetName, "'testSetName' set to: "), + trace($testCaseName,"'testCaseName' set to: "), + $exceptedTestCases, + $exceptedTestSets, + xs:boolean($verbose), + $expectedFailuresPath) +case "run-and-report" + return r:run-and-report($fotsPath, + $fotsZorbaManifestPath, + $exceptedTestCases, + $exceptedTestSets, + (: the reports to W3C are always generated with verbose set to false:) + fn:false()) +case "report" + return r:report($fotsPath, + $failuresFilePath, + $exceptedTestCases, + $exceptedTestSets, + xs:boolean($verbose)) +case "generate-expected-failures" + return r:generate-expected-failures($failuresFilePath) +default + return local:usage() diff -Nru zorba-2.7.0-0/test/fots_driver/environment.xq zorba-2.8.0-0/test/fots_driver/environment.xq --- zorba-2.7.0-0/test/fots_driver/environment.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/environment.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,562 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver environment + : @author Sorin Nasoi + :) + +module namespace env = + "http://www.zorba-xquery.com/fots-driver/environment"; + +import module namespace xqxq = + "http://www.zorba-xquery.com/modules/xqxq"; +import module namespace util = + "http://www.zorba-xquery.com/fots-driver/util" at "util.xq"; + +declare namespace fots = + "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare namespace ann = + "http://www.zorba-xquery.com/annotations"; + + +declare variable $env:hof as xs:string := + string-join( + ( "declare namespace op = 'http://www.zorba-xquery.com/options/features';", + "declare namespace f = 'http://www.zorba-xquery.com/features';", + "declare option op:enable 'f:hof';"), + " "); + + +(:~ + : If there is a dependency on XQuery 3.0 and there is at least one HOF + : function in the test, return the strings for enabling the HOF feature. + : + : @param $deps the dependencies of the test set and test case + : @param $test the Query test. + : @return the strings for enabling the HOF feature + :) +declare function env:enable-HOF-feature( + $deps as element(fots:dependency)*, + $test as xs:string +) as xs:string? +{ + let $depSpec := string-join(distinct-values( for $dep in $deps + where $dep[@type="spec"] + return data($dep/@value)),""), + $depFeature := string-join(distinct-values(for $dep in $deps + where $dep[@type="feature"] + return data($dep/@value)),"") + return + if ((contains($depSpec,"XQ30") or contains($depSpec,"XP30")) and + contains($depFeature,"higherOrderFunctions")) + then $env:hof else () +}; + + +(:~ + : Check if an XQuery version declaration needs to be added. + : + : @param $deps the dependencies of the test set and test case. + : @param $test the Query test. + : @return the XQuery version declaration. + :) +declare function env:add-xquery-version-decl( + $deps as element(fots:dependency)*, + $test as xs:string +) as xs:string? +{ + let $dependencies := string-join(distinct-values(for $dep in $deps + where $dep[@type="spec"] + return data($dep/@value)),"") + return + if ((contains($dependencies,"XQ30") or contains($dependencies,"XP30")) and + not(contains($test, "xquery version "))) + then 'xquery version "3.0";' + else if(contains($dependencies,"XQ10") and + not(contains($test, "xquery version "))) + then 'xquery version "1.0";' + else () +}; + + +(:~ + : Sets the declared default element namespace. + : + : @param $env the environment of the catalog/test-set (given with 'ref'). + : @param $envCase the environment of the test-case. + : @return the declare default element namespace. + :) +declare function env:decl-def-elem-namespace( + $env as element(fots:environment)?, + $envCase as element(fots:environment)? +) as xs:string? +{ + for $ns in ($env/fots:namespace, $envCase/fots:namespace) + where $ns[@prefix=""] + return concat('declare default element namespace "', + data($ns/@uri), + '";') +}; + + +(:~ + : Adds the declare namespace statements. + : + : @param $env the environment of the catalog/test-set (given with 'ref'). + : @param $case the test-case. + : @param $testSetBaseURI the URI of the test set file. + : @return the declare namespace statements. + :) +declare %ann:nondeterministic function env:decl-namespaces( + $env as element(fots:environment)?, + $case as element(fots:test-case), + $testSetBaseURI as xs:anyURI +) as xs:string? +{ + string-join( + for $ns in ($env/fots:namespace, $case/fots:environment/fots:namespace) + where not($ns[@prefix=""]) and + not(env:is-schema-prefix-bound(data($ns/@prefix), + $case, + $testSetBaseURI)) + return concat('declare namespace ', + data($ns/@prefix), + ' = "', + data($ns/@uri), + '";') + ," ") +}; + + +(:~ + : Return true if the prefix will be bound to a schema in the Query + : It's a bug in the FOTS if this function returns true: TODO report to W3C + :) +declare %private %ann:nondeterministic function env:is-schema-prefix-bound( + $prefix as xs:string, + $case as element(fots:test-case), + $testSetBaseURI as xs:anyURI +) as xs:boolean +{ + contains(util:get-value($case, + $testSetBaseURI, + "test"), + concat("import schema namespace ", + $prefix)) +}; + + +(:~ + : Returns the the declare base-uri prolog statement. + : + : @param $env the environment of the catalog/test-set (given with 'ref'). + : @param $envCase the environment of the test-case. + : @return the declare base-uri prolog statement. + :) +declare function env:decl-base-uri( + $env as element(fots:environment)?, + $envCase as element(fots:environment)? +) as xs:string? +{ + for $baseURI in ($env/fots:static-base-uri, $envCase/fots:static-base-uri) + return concat("declare base-uri '", + data($baseURI/@uri), + "';") +}; + + +(:~ + : Add the decimal format declarations. + : + : @param $decimal-formats decimal formats. + : @return the decimal formats declarations. + :) +declare function env:decl-decimal-formats( + $decimal-formats as element(fots:decimal-format)* +) as xs:string* +{ + if(empty($decimal-formats)) + then () + else + for $tmp in $decimal-formats + let $default := if(exists($tmp/@name)) + then () + else "default" + let $name := if(exists($tmp/@name)) + then data($tmp/@name) + else () + return + string-join(("declare", + $default, + "decimal-format", + $name, + env:set-properties($tmp), + ";"),' ') +}; + + +declare %private function env:set-properties( + $decimal-format as element(fots:decimal-format) +) as xs:string* +{ + for $att in $decimal-format/attribute::* + let $name := node-name($att) + let $value := data($att) + return + if(exists(index-of(("decimal-separator", "grouping-separator", "infinity", + "minus-sign", "NaN", "percent", "per-mille", + "zero-digit", "digit", "pattern-separator"), + xs:string($name)))) + then concat($name, '="' , $value, '"') + else () +}; + + +(:~ + : Adds the variable declarations. + : @param $env environment. + : @param $case test case. + : @param $envBaseURI the relative URI for the environment. + : @param $testSetBaseURI the URI of the test set. + : @return the variable declarations. + :) +declare %ann:nondeterministic function env:add-var-decl( + $env as element(fots:environment)?, + $case as element(fots:test-case), + $envBaseURI as xs:anyURI, + $testSetBaseURI as xs:anyURI +) as xs:string? +{ + concat( env:var-decl-with-value($env, + $envBaseURI), + env:var-decl-with-value($case/fots:environment, + $testSetBaseURI), + env:var-decl-without-value($env, + $case/fots:environment)) +}; + + +declare %private function env:var-decl-with-value( + $env as element(fots:environment)?, + $baseURI as xs:anyURI +) as xs:string? +{ + string-join( + for $param in $env/fots:param + let $select := $param/@select + let $file := $env/fots:source[@uri = translate($select, "'", "")]/@file + let $type := $param/@as + let $varValue := if(starts-with($select, "'") and + ends-with($select, "'") and + exists($file)) + then concat('"', + resolve-uri($file, $baseURI), + '"') + else $select + where (exists($select) and +(: if there is an attribute 'declared' set to true, this means that the variable + is declared within the 'test' itself so no additional variable declaration + is needed :) + empty($param[@declared="true"])) + return concat("declare variable $", + $param/@name, + ((concat(" as ", $type)))[$type], + " := ", + $varValue, + ";") + ," ") +}; + + +declare %private function env:var-decl-without-value( + $env as element(fots:environment)?, + $envCase as element(fots:environment)? +) as xs:string? +{ + string-join( + (for $param in ($env/fots:param, $envCase/fots:param) + let $select := $param/@select + let $type := $param/@as + where (empty($select) and + empty($param[@declared="true"])) + return concat("declare variable $", + $param/@name, + ((concat(" as ", $type)))[$type], + " external;"), + for $source in ($env/fots:source, $envCase/fots:source) + let $role := $source/@role + where starts-with($role,"$") + return concat("declare variable ", + $role, + " external;")) + ," ") +}; + + +(:~ + : Returns the string for setting the context item if needed. + : @param $env environment. + : @param $envBaseURI test base URI of the environment. + : @return the string for setting the context item if needed. + :) +declare function env:set-context-item( + $env as element(fots:environment)?, + $envBaseURI as xs:anyURI? +) as xs:string? { + if (exists($env/fots:source[@role = "."])) + then string-join((env:declare-context-item($env, $envBaseURI), + 'xqxq:bind-context-item($queryID, $contextItem);') + ," ") + else () +}; + + +declare %private function env:declare-context-item( + $env as element(fots:environment)?, + $envBaseURI as xs:anyURI? +) as xs:string +{ + let $ciURI := resolve-uri($env/fots:source[@role = "."]/@file, $envBaseURI) + return + if(empty($env/fots:source[@validation = "strict"])) + then concat('variable $contextItem := doc("', $ciURI, '");') + else string-join( + (" ", + "variable $contextItemQuery := xqxq:prepare-main-module('", + env:get-schema-import($env), + concat('validate { doc("', $ciURI, '")', "}',", " "), + "resolver:url-resolver#2, ());", + "variable $contextItem := xqxq:evaluate($contextItemQuery);") + ," ") +}; + + +(:~ + : Returns the strings for variable binding in XQXQ. + : + : @param $env the environment of the catalog/test-set (given with 'ref'). + : @param $envBaseURI the relative URI for the environment. + : @return the strings for variable binding in XQXQ. + :) +declare function env:set-variables( + $env as element(fots:environment)?, + $envBaseURI as xs:anyURI +) as xs:string? +{ + if(empty($env)) + then () + else + let $srcNames := for $source in $env/fots:source + where starts-with(data($source/@role),"$") + return substring-after(data($source/@role),"$"), + $srcValues := for $srcName in $srcNames + return concat('doc("', + resolve-uri($env/fots:source[@role = concat("$",$srcName)]/@file, $envBaseURI), + '")') + return + string-join( + (for $srcName in $srcNames + let $index := index-of($srcNames, $srcName) + return + concat('xqxq:bind-variable( $queryID, xs:QName("', $srcName, '")', ', ', + $srcValues[$index], ');'), + + for $param in $env/fots:param + let $select:= $param/@select + let $file := $env/fots:source[@uri = translate($select, "'", "")]/@file + let $varValue := if(starts-with($select, "'") and + ends-with($select, "'") and + exists($file)) + then concat('"', + resolve-uri($file, $envBaseURI), + '"') + else $select + let $varName := $param/@name + where (exists($select) and +(: if there is an attribute 'declared' set to true, this means that the variable + is declared within the 'test' itself :) + exists($param[@declared="true"])) + return + concat('xqxq:bind-variable( $queryID, xs:QName("', + $param/@name, + '")', ', ', + $varValue, ');')) + , " ") +}; + + +declare %private function env:get-schema-import ( + $env as element(fots:environment)? +) as xs:string +{ + if (empty($env)) + then "" + else + let $namespace := $env/fots:namespace[@uri = data($env/fots:schema/@uri)] + let $prefix as xs:string := if(exists($namespace)) + then xs:string(data($namespace/@prefix)) + else "p" + return + if($prefix = "") + then concat('import schema default element namespace "', + $env/fots:schema/@uri, + '"; ') + else concat('import schema namespace ', + $prefix, + ' = "', + $env/fots:schema/@uri, + '"; ') +}; + + +(:~ + : Returns the XQXQ URL resolver declaration. + : @param $case the test case. + : @param $env the environment. + : @param $envBaseURI URI of the environment. + : @param $testSetBaseURI URI to the test set that defines the test case. + : @return the XQXQ URL resolver declaration. + :) +declare function env:resolver( + $case as element(fots:test-case), + $env as element(fots:environment)?, + $envBaseURI as xs:anyURI?, + $testSetBaseURI as xs:anyURI +) as xs:string? +{ + let $envSchema := $env/fots:schema, + $tcSchema := $case/fots:environment/fots:schema, + $schemas := ($envSchema, $tcSchema), + $modules := $case/fots:module, + $resources := ($env/fots:resource, $case/fots:environment/fots:schema) + return + if (empty($schemas) and empty($modules) and empty($resources)) + then () + else string-join( + ("declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver';", + $env:hof, + "declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) {", + "switch($entity)", + if (exists($schemas)) + then string-join(("case 'schema'", + " return switch($namespace)", + (for $schema in $envSchema + return concat(" case '", + data($schema/@uri), + "' return doc('", + resolve-uri($schema/@file, $envBaseURI), + "')"), + for $schema in $tcSchema + return concat(" case '", + data($schema/@uri), + "' return doc('", + resolve-uri($schema/@file, $testSetBaseURI), + "')")), + " default return ()"), + " ") + else (), + if (exists($modules)) + then string-join(("case 'module'", + " return switch($namespace)", + for $module in $modules + return concat(" case '", + data($module/@uri), + "' return unparsed-text('", + resolve-uri($module/@file, $testSetBaseURI), + "') "), + " default return ()"), + " ") + else (), + if (exists($resources)) then + string-join(("case ''", + " return switch($namespace)", + for $resource in $resources + return concat(" case '", + data($resource/@uri), + "' return unparsed-text('", + resolve-uri($resource/@file, $envBaseURI), + "'", + if(exists($resource/@encoding)) + then concat (",'", + data($resource/@encoding), + "'") + else (), + ") "), + " default return ()") + ," ") + else () + , "default return ()","};"), + " ") +}; + + +(:~ + : Checks the dependencies according to the Zorba manifest. + : + : @param $deps the dependencies of the test set and test case + : @param $zorbaManifest Zorba manifest document. + : @return if true empty string, otherwise returns a string with the + : dependencies that were not matched. + :) +declare function env:check-dependencies( + $deps as element(fots:dependency)*, + $zorbaManifest +) as xs:string* +{ + if(empty($deps)) + then () + else + for $dep in $deps + let $satisfied := if(exists($dep/@satisfied)) + then data($dep/@satisfied) + else "true" + let $zorbaDep := $zorbaManifest//fots:dependency[ @type = $dep/@type and + @value = $dep/@value and + @satisfied = $satisfied] + return + if(empty($zorbaDep)) + then concat("Dependency (type=", + $dep/@type, + ", value=", + $dep/@value, + ", satisfied=", + $satisfied, + ") was not met. ") + else () +}; + + +(:~ + : Retrieves the environment from a test-set/catalog given an environment name. + : @param $catalog FOTS catalog file. + : @param $testSet test set. + : @param $envName name of the environment. + : @return the environment with the given name. + :) +declare function env:get-environment ( + $catalog, + $testSet as element (fots:test-set), + $envName as xs:string +) as element(fots:environment)? +{ + let $envTestSet := $testSet/test-set//environment[@name = $envName] + return + if (empty($envTestSet)) + then $catalog/catalog//environment[@name = $envName] + else $envTestSet +}; diff -Nru zorba-2.7.0-0/test/fots_driver/errors.xq zorba-2.8.0-0/test/fots_driver/errors.xq --- zorba-2.7.0-0/test/fots_driver/errors.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/errors.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,36 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver errors + : @author Sorin Nasoi + :) + +module namespace err = + "http://www.zorba-xquery.com/fots-driver/errors"; + +(:~ + : Errors namespace URI. +:) +declare variable $err:errNS as xs:string := + "http://www.zorba-xquery.com/fots-driver/errors"; + +(:~ + : xs:QName with + : namespace URI = "http://www.w3.org/2010/09/qt-fots-catalog/errors" + : and local name "err:errNA" +:) +declare variable $err:errNA as xs:QName := fn:QName($err:errNS, "check:errNA"); diff -Nru zorba-2.7.0-0/test/fots_driver/evaluate.xq zorba-2.8.0-0/test/fots_driver/evaluate.xq --- zorba-2.7.0-0/test/fots_driver/evaluate.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/evaluate.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,517 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver evaluate + : @author Sorin Nasoi + :) + +module namespace eval = + "http://www.zorba-xquery.com/fots-driver/evaluate"; + +import schema namespace output = + "http://www.w3.org/2010/xslt-xquery-serialization"; + +import module namespace xqxq = + "http://www.zorba-xquery.com/modules/xqxq"; +import module namespace schema = + "http://www.zorba-xquery.com/modules/schema"; + +import module namespace fots-err = + "http://www.zorba-xquery.com/fots-driver/errors" at "errors.xq"; +import module namespace util = + "http://www.zorba-xquery.com/fots-driver/util" at "util.xq"; + +declare namespace err = + "http://www.w3.org/2005/xqt-errors"; +declare namespace fots = + "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare namespace ann = + "http://www.zorba-xquery.com/annotations"; + + +(:~ + : Checks if the result matches the assertions. + : @param $result actual result. + : @param $expResult expected result. + : @return the results of assertion evaluations. + :) +declare %ann:sequential function eval:result( + $result as item()*, + $expResult as element() +) as element()* { + let $err := eval:check-assertion($result, + $expResult, + (), + "") + return if(empty($err)) + then () + else + + {$expResult} + {$result} + {$err} + +}; + +(:~ + : Checks if the error found matches the expected error (if any). + : @param $result actual result. + : @param $expResult expected result. + : @param $code err:code. + : @param $errorDescription err:description. + : @return the results of error evaluation. + :) +declare %ann:sequential function eval:error( + $result as item()*, + $expResult as element(), + $code as xs:QName?, + $errorDescription as xs:string? +) as element()* { + if(empty($result)) then + let $err := eval:error-code($code, + $errorDescription, + $expResult) + return + if(empty($err)) + then () + else + + {$expResult} + {$result} + {$err} + + else + + {$expResult} + {$result} + {concat("Expected error [", + data($expResult/@code), + "], found result.")} + +}; + +declare %private %ann:sequential function eval:error-code( + $code as xs:QName?, + $errorDescription as xs:string?, + $expResult as element() +) as xs:string* { + let $assertName := local-name($expResult) + return + if( $assertName = "error") + then + if (exists($expResult[@code = "*"]) or + exists($expResult[@code = local-name-from-QName($code)])) + then () + else if(exists($code)) + then concat("Expected error: ", + data($expResult/@code), + ". Found error: ", + local-name-from-QName($code)) + else concat("Expected error: ", + data($expResult/@code), + ". Found empty result.") + else if (($assertName = "any-of") or ($assertName = "all-of")) + then eval:check-assertion((), + $expResult, + $code, + $errorDescription) + else concat("Expected result, found error ", + local-name-from-QName($code), + " - ", + $errorDescription) +}; + +declare %private %ann:sequential function eval:check-assertion( + $result as item()*, + $expResult as element(), + $code as xs:QName?, + $errorDescription as xs:string? +) as xs:string* { + let $test := local-name($expResult) + return switch($test) + case 'all-of' + return eval:assert-all-of($result, + $expResult, + $code, + $errorDescription) + case 'any-of' + return eval:assert-any-of($result, + $expResult, + $code, + $errorDescription) + case 'assert' + return eval:assert($result, + $expResult) + case 'assert-count' + return eval:assert-count($result, + $expResult) + case 'assert-deep-eq' + return eval:assert-deep-eq($result, + $expResult) + case 'assert-empty' + return eval:assert-empty($result) + case 'assert-eq' + return eval:assert-eq($result, + $expResult) + case 'assert-false' + return eval:assert-false($result) + case 'assert-permutation' + return eval:assert-permutation($result, + $expResult) + case 'assert-xml' + return eval:assert-xml($result, + $expResult) + case 'assert-serialization-error' + return eval:assert-serialization-error($result, + $expResult) + case 'assert-string-value' + return eval:assert-string-value($result, + $expResult) + case 'assert-true' + return eval:assert-true($result) + case 'assert-type' + return eval:assert-type($result, + $expResult) + case 'serialization-matches' + return eval:serialization-matches($result, + $expResult) + case 'error' + return eval:error($result, + $expResult, + $code, + $errorDescription) + default + return error($fots-err:errNA, + " The requested assertion type is not implemented.") +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_any-of :) +declare %private %ann:sequential function eval:assert-any-of( + $result as item()*, + $expResult as element(), + $code as xs:QName?, + $errorDescription as xs:string? +) as xs:string? { + let $results := + for $tmp in $expResult/* + return { + for $r in eval:check-assertion($result, + $tmp, + $code, + $errorDescription) + return {$r} + } + where every $result in $results satisfies $result/item + return concat("'Assert-any-of' returned: ", + string-join(util:serialize-result($results/data(item)), ' ')) +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_all-of :) +declare %private %ann:sequential function eval:assert-all-of( + $result as item()*, + $expResult as element(), + $code as xs:QName?, + $errorDescription as xs:string? +) as xs:string* { + for $tmp in $expResult/* + return eval:check-assertion($result, + $tmp, + $code, + $errorDescription) +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert :) +declare %private %ann:sequential function eval:assert( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + { + variable $queryText := concat( + "xquery version '3.0';", + "declare namespace o = 'http://www.zorba-xquery.com/options/features';", + "declare option o:enable 'hof';", + "declare variable $result external; ", + xs:string($expResult)); + variable $queryKey := xqxq:prepare-main-module($queryText), + $queryKeyResult := xqxq:bind-variable($queryKey, + xs:QName('result'), + $result), + $queryResult := xqxq:evaluate($queryKey); + + if($queryResult) + then () + else concat("Assertion ", $expResult, " failed.") + } + } catch * { + concat("'assert' returned: fail with error ", + $err:code, " : ", $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-count :) +declare %private function eval:assert-count( + $result as item()*, + $expResult as element() +) as xs:string? { + if(count($result) eq xs:integer($expResult)) + then () + else "'assert-count' returned: actual number of items is different than the expected number of items." +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-deep-eq :) +declare %private %ann:sequential function eval:assert-deep-eq( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + { + variable $queryText := concat( + "xquery version '3.0';", + "declare namespace o = 'http://www.zorba-xquery.com/options/features';", + "declare option o:enable 'hof';", + "declare variable $x external;", + "let $y := (",string(data($expResult)),") return ", + "every $i in 1 to max((count($x),count($y))) satisfies deep-equal($x[$i],$y[$i])"); + variable $queryKey := xqxq:prepare-main-module($queryText), + $queryKeyResult := xqxq:bind-variable($queryKey, + xs:QName('x'), + $result), + $queryResult := xqxq:evaluate($queryKey); + if($queryResult) + then () + else "'assert-deep-eq' returned: actual result is not deep-equal to expected result." + } + } catch * { + concat("'assert-deep-eq' returned: fail with error ", + $err:code, " : ", $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-empty :) +declare %private function eval:assert-empty( + $result as item()* +) as xs:string? { + if(empty($result)) + then () + else "'assert-empty' returned: result is not empty as expected." +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-eq :) +declare %private %ann:sequential function eval:assert-eq( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + { + variable $type := if (empty($result[1]) or (count($result) gt 1)) + then () + else + let $tmp := xs:string(schema:schema-type($result[1])) +(: add exception for the types defined in schemas available in the environment of the tests :) + return + if (starts-with($tmp, 'xs:')) + then $tmp + else (); + variable $queryText := concat( + "declare variable $x external;", + "$x eq ", + if (starts-with(data($expResult), $type)) + then data($expResult) + else concat($type,"(", data($expResult), ")")); + variable $queryKey := xqxq:prepare-main-module($queryText); + + xqxq:bind-variable($queryKey, + xs:QName('x'), + $result); + variable $queryResult := xqxq:evaluate($queryKey); + if($queryResult) + then () + else "'assert-eq' returned: result doesn't match expected result." + } + } catch * { + concat("'assert-eq' returned: comparison failed with error ", + $err:code, " : ", $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-true :) +declare %private function eval:assert-true( + $result as item()* +) as xs:string? { + if($result eq fn:true()) + then () + else "'assert-true' returned: query doesn't evaluate to true." +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-false :) +declare %private function eval:assert-false( + $result as item()* +) as xs:string? { + if($result eq fn:false()) + then () + else "'assert-false' returned: query doesn't evaluate to false." +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-permutation :) +declare %private %ann:sequential function eval:assert-permutation( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + { + variable $queryText := concat( + "xquery version '3.0';", + "declare namespace o = 'http://www.zorba-xquery.com/options/features';", + "declare option o:enable 'hof';", + "declare variable $x external;", + "let $y := (",string(data($expResult)),") return ", + (: if count(intersection(M1,M2)) = count(union(M1,M2)) = count(M1) then the sequences are identical :) + "(count(distinct-values($x[ . = $y])) = count(distinct-values(($x, $y)))) = count(distinct-values($x))"); + variable $queryKey := xqxq:prepare-main-module($queryText), + $queryKeyResult := xqxq:bind-variable($queryKey, + xs:QName('x'), + $result), + $queryResult := xqxq:evaluate($queryKey); + if($queryResult) + then () + else "'assert-permutation' returned: result isn't a permutation of expected result." + } + } catch * { + concat("'assert-permutation' returned: fail with error ", + $err:code, " : ", $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-xml :) +declare %private function eval:assert-xml( + $result as item()*, + $expResult as element() +) { +(:TODO call xml-canonicalization after bug #1076919 is implemented.:) + try { + let $serRes := util:serialize-result($result), + $result1 as xs:string := string-join($serRes,''), + $result2 as xs:string := string-join($serRes,' ') + return + if((normalize-space($result1) eq normalize-space(string($expResult))) or + (normalize-space($result2) eq normalize-space(string($expResult)))) + then () + else "'assert-xml' returned: result is different from the expected result." + } catch * { + concat("'assert-xml' returned: fail with error ", + $err:code, " : ", $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-serialization-error :) +declare %private %ann:sequential function eval:assert-serialization-error( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + let $serializedResult as xs:string := string-join( + util:serialize-result($result), '') + return + "'assert-serialization-error' returned: expected serialization error but got result." + } catch * { + eval:error((), + $expResult, + $err:code, + $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_serialization-matches :) +declare %private function eval:serialization-matches( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + let $serResult := string-join(util:serialize-result($result, + $util:serParamXml), + ''), + $serExpResult := string-join(util:serialize-result(data($expResult), + $util:serParamXml), + '') + let $matchesFlags := data($expResult/@flags) + return + if(exists($matchesFlags)) + then + if(matches($serResult, $serExpResult, $matchesFlags)) + then () + else concat("'serialization-matches' returned: result does not match expected result with flags '", + $matchesFlags, + "'.") + else + if(matches($serResult, $serExpResult)) + then () + else "'serialization-matches' returned: result does not match expected result." + } catch * { + concat("'serialization-matches' returned: fail with error ", + $err:code, " : ", $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-string-value :) +declare %private function eval:assert-string-value( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + let $serRes := string-join(util:serialize-result($result), ' '), + $res := if (empty($expResult[@normalize-space="true"])) + then $serRes + else normalize-space($serRes), + $expRes := if (empty($expResult[@normalize-space="true"])) + then xs:string($expResult) + else normalize-space(xs:string($expResult)) + return + if($res eq $expRes) + then () + else "'assert-string-value' returned: result different from expected result." + } catch * { + concat("'assert-string-value' returned: failed with error ", + $err:code, " : ", $err:description) + } +}; + +(: http://dev.w3.org/2011/QT3-test-suite/catalog-schema.html#elem_assert-type :) +declare %private %ann:sequential function eval:assert-type( + $result as item()*, + $expResult as element() +) as xs:string? { + try { + { + variable $queryText := concat( "declare variable $x external; $x instance of ", + data($expResult)); + variable $queryKey := xqxq:prepare-main-module($queryText), + $queryKeyResult := xqxq:bind-variable($queryKey, + xs:QName('x'), + $result), + $queryResult := xqxq:evaluate($queryKey); + if($queryResult) + then () + else concat("'assert-type' returned: result doesn't have type '", + data($expResult), "'") + } + } catch * { + concat("'assert-type' returned: failed with error ", + $err:code, " : ", $err:description) + } +}; diff -Nru zorba-2.7.0-0/test/fots_driver/feedback.xq zorba-2.8.0-0/test/fots_driver/feedback.xq --- zorba-2.7.0-0/test/fots_driver/feedback.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/feedback.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,331 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver feedback + : @author Sorin Nasoi + :) + +module namespace feedback = + "http://www.zorba-xquery.com/fots-driver/feedback"; + +declare namespace ann = + "http://www.zorba-xquery.com/annotations"; + +declare namespace fots = + "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare namespace err = + "http://www.w3.org/2005/xqt-errors"; + +declare function feedback:check-pass( + $result as item()*, + $testCaseName as xs:string?, + $testSetName as xs:string?, + $expectedFailure as element(Test)? +) as xs:boolean { +(: if the exact error code was not found, report the test as 'Pass' + with an attribute correctError=false :) + let $resultTestRun as xs:boolean := + (empty($result) or + (exists($result) and + contains(string-join($result/fots:errors,''), "Expected error:") and + contains(string-join($result/fots:errors,''), "Found error:"))) + + let $expectedFailure as xs:boolean := + if (exists($expectedFailure)) + then fn:true() + else fn:false() + +(:if test PASSED and was expected to FAIL OR test FAILED and wasn't expected to + FAIL => report as FAIL, a.k.a. regression; + otherwise report as PASS:) + return ($resultTestRun eq not($expectedFailure)) +}; + +declare %ann:sequential function feedback:pass( + $case as element(fots:test-case), + $result as item()*, + $zorbaQuery as xs:string, + $env as element(fots:environment)?, + $duration as xs:dayTimeDuration, + $verbose as xs:boolean, + $expectedFailure as xs:boolean +) as element(fots:test-case)? { + if ($expectedFailure) + then feedback:pass-expected-FOTS-failure( $case, + $result, + $zorbaQuery, + $env, + $verbose) + else feedback:pass( $case, + $result, + $zorbaQuery, + $env, + $duration, + $verbose) +}; + +(:~ + : Feedback on a test case that failed but is marked as EXPECTED_FOTS_FAILURE. + : + : @param $case test case. + : @return the test case after certain information was added. + :) +declare %private %ann:sequential function feedback:pass-expected-FOTS-failure( + $case as element(fots:test-case), + $result as item()*, + $zorbaQuery as xs:string, + $env as element(fots:environment)?, + $verbose as xs:boolean +) as element(fots:test-case)? { + variable $info := "Test case failed but it is marked with EXPECTED_FOTS_FAILURE in test/fots/CMakeLists.txt"; + + if($verbose) + then { + let $tmp := $case + return { + insert node + attribute result{'pass'} + as last into $tmp; + + insert node + attribute comment{$info} + as last into $tmp; + + insert node + + {$env} + {$zorbaQuery} + {($result/fots:expected-result, + $result/fots:result, + $result/fots:errors)} + + as last into $tmp; + + delete node $tmp/fots:description; + delete node $tmp/fots:created; + delete node $tmp/fots:result; + + $tmp + } + } + else +}; +(:~ + : Gives feedback on a test case run with success. + : + : @param $case test case. + : @return the test case after certain information was added. + :) +declare %private %ann:sequential function feedback:pass( + $case as element(fots:test-case), + $result as item()*, + $zorbaQuery as xs:string, + $env as element(fots:environment)?, + $duration as xs:dayTimeDuration, + $verbose as xs:boolean +) as element(fots:test-case)? { + if($verbose) + then { + let $tmp := $case + return { + insert node + attribute result{'pass'} + as last into $tmp; + + if(exists($result/fots:errors)) then + insert node + attribute correctError{'false'} + as last into $tmp; + else (); + + if(exists($result/fots:errors)) then + insert node + attribute comment{$result/fots:errors} + as last into $tmp; + else (); + + insert node + attribute executionTime{$duration} + as last into $tmp; + + insert node + + {$env} + {$zorbaQuery} + {$result/descendant::*} + + as last into $tmp; + + delete node $tmp/description; + delete node $tmp/created; + delete node $tmp/fots:result; + + $tmp + } + } + else if(empty($result/fots:errors)) + then + else +}; + +(:~ + : Gives feedback on a test case run without success. + : + : @param $case test case. + : @return the test case after certain information was added. + :) +declare %ann:sequential function feedback:fail( + $case as element(fots:test-case), + $result as item()*, + $zorbaQuery as xs:string, + $testSetName as xs:string?, + $env as element(fots:environment)?, + $duration as xs:dayTimeDuration, + $verbose as xs:boolean, + $expectedFailure as xs:boolean +) as element(fots:test-case)? { + trace($testSetName, "test set name"); + trace("above test case failed", "result"); + + variable $info := "Test case passed but it is marked with EXPECTED_FOTS_FAILURE in test/fots/CMakeLists.txt"; + + if ($verbose) + then { + let $tmp := $case + return { + insert node + attribute result{'fail'} + as last into $tmp; + + if ($expectedFailure) + then + insert node + attribute comment{$info} + as last into $tmp; + else (); + + insert node + + {$env} + {$zorbaQuery} + {($result/fots:expected-result, + $result/fots:result, + $result/fots:errors)} + + as last into $tmp; + + delete node $tmp/fots:description; + delete node $tmp/fots:created; + delete node $tmp/fots:result; + + $tmp + } + } + else if ($expectedFailure) + then + + else +}; + +(:~ + : Gives feedback on a test case that is not run (because it Seg Faults, hangs). + : + : @param $case test case. + : @return the test case. + :) +declare %ann:sequential function feedback:not-run( + $case as element(fots:test-case), + $verbose as xs:boolean +) as element(fots:test-case)? { + trace(data($case/@name), "processing test case :"); + trace("Above test case was not run.",""); + + if($verbose) + then { + let $tmp := $case + return { + insert node + attribute result{'notRun'} + as last into $tmp; + + delete node $tmp/fots:description; + delete node $tmp/fots:created; + + $tmp + } + } + else + +}; + +(:~ + : Gives feedback on a test case that is not run when dependencies are not met. + : + : @param $case test case. + : @param $dependencyError test error returned by the dependency checking. + : @return the test case. + :) +declare %ann:sequential function feedback:not-applicable( + $case as element(fots:test-case), + $env as element(fots:environment)?, + $dependencyError as xs:string, + $verbose as xs:boolean +) as element(fots:test-case)? { + trace(data($case/@name), "processing test case :"); + trace($dependencyError, "Dependency error :"); + + if($verbose) + then { + let $tmp := $case + return { + insert node + attribute result{'not applicable'} + as last into $tmp; + + insert node + attribute comment{$dependencyError} + as last into $tmp; + + insert node + {$env} + as last into $tmp; + + delete node $tmp/fots:description; + delete node $tmp/fots:created; + + $tmp + } + } + else + +}; diff -Nru zorba-2.7.0-0/test/fots_driver/fots-driver.xq zorba-2.8.0-0/test/fots_driver/fots-driver.xq --- zorba-2.7.0-0/test/fots_driver/fots-driver.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/fots-driver.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,601 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver + : @author Sorin Nasoi + :) + +module namespace driver = + "http://www.zorba-xquery.com/fots-driver"; + +import module namespace functx = + "http://www.functx.com/"; + +import module namespace xqxq = + "http://www.zorba-xquery.com/modules/xqxq"; +import module namespace datetime = + "http://www.zorba-xquery.com/modules/datetime"; + +import module namespace eval = + "http://www.zorba-xquery.com/fots-driver/evaluate" at "evaluate.xq"; +import module namespace feedback = + "http://www.zorba-xquery.com/fots-driver/feedback" at "feedback.xq"; +import module namespace env = + "http://www.zorba-xquery.com/fots-driver/environment" at "environment.xq"; +import module namespace util = + "http://www.zorba-xquery.com/fots-driver/util" at "util.xq"; +import module namespace fots-err = + "http://www.zorba-xquery.com/fots-driver/errors" at "errors.xq"; + + +declare namespace err = + "http://www.w3.org/2005/xqt-errors"; +declare namespace fots = + "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare namespace ann = + "http://www.zorba-xquery.com/annotations"; + +(:~ + : Loops through the FOTS catalog and returns all available test set names. + : @param $fotsPath path to the FOTS catalog file. + : @param $testSetPrefixes name/criteria for the test sets + : (empty string means all). + : @return available FOTS test sets. + :) +declare %ann:nondeterministic function driver:list-test-sets( + $fotsPath as xs:string, + $testSetPrefixes as xs:string* +) as xs:string* { + let $doc := doc(resolve-uri($fotsPath)) + return + if(string-join($testSetPrefixes,'') = '') + then + for $testSet in $doc/fots:catalog/fots:test-set + return data($testSet/@name) + else + for $prefix in $testSetPrefixes + for $testSet in $doc/fots:catalog/fots:test-set[starts-with(@name, $prefix)] + return data($testSet/@name) +}; + +declare %private function driver:matches-dependency( + $dependencies as element(fots:dependency)*, + $filter as xs:string +) as xs:boolean { + let $filter := tokenize($filter, '_') + let $depValue := $filter[1] + let $depSatisfied as xs:string := if(exists($filter[2]) and + ($filter[2] = 'true' or $filter[2]='false')) + then $filter[2] + else 'true' + return + if(xs:boolean($depSatisfied)) + + (: $depSatisfied = 'true' :) + then (exists($dependencies[@value = $depValue and + @satisfied = $depSatisfied]) or + exists($dependencies[@value = $depValue and empty(@satisfied)])) + + (: $depSatisfied = 'false' :) + else exists($dependencies[@value = $depValue and + @satisfied = $depSatisfied]) +}; + +declare %private function driver:list-assertions( + $case as element(fots:test-case) +) as xs:string* { + distinct-values(for $assert in $case/fots:result/descendant-or-self::* + return local-name-from-QName(node-name($assert))) +}; + +(:~ + : Loops through the given test set and returns the test cases that have the + : given dependencies defined. + : @param $testSet test set document. + : @param $dependency defined dependency + : (empty string means all test cases). + : @param $assert lists of tests that contain a certain assert-type(empty + : string means all tests). + : @return matching test case names. + :) +declare %private function driver:list-test-cases( + $testSetDoc as document-node(), + $dependency as xs:string*, + $assert as xs:string* +) as xs:string* { + if(string-join($dependency,'') = '') + then $testSetDoc//fots:test-case/@name + else for $testCase in $testSetDoc//fots:test-case + let $matchDep := driver:matches-dependency(($testSetDoc/fots:test-set/fots:dependency, + $testCase/fots:dependency), + $dependency) + let $matchAssert := (($assert = '') or + exists(functx:value-intersect( + driver:list-assertions($testCase), + $assert))) + where ($matchDep and $matchAssert) + return $testCase/@name + +}; + +(:~ + : Loops through the given test sets and returns the corresponding test cases. + : @param $fotsPath path to the FOTS catalog file. + : @param $testSetPrefixes name/criteria for the test sets + : (empty string means all test cases). + : @param $dependency type of dependency that has to be met + : (empty string means all test cases). + : @param $assert lists of tests that contain a certain assert-type(empty + : string means all tests). + : @return available FOTS test cases. + :) +declare %ann:nondeterministic function driver:list-test-cases( + $fotsPath as xs:string, + $testSetPrefixes as xs:string*, + $dependency as xs:string*, + $assert as xs:string* +) as xs:string* { + let $doc := doc(resolve-uri($fotsPath)), + $baseUri:= resolve-uri(util:parent-folder($fotsPath)) + return + if(string-join($testSetPrefixes,'') = '') + then + for $testSet in $doc/fots:catalog/fots:test-set + let $testSetDoc := doc(resolve-uri($testSet/@file, $baseUri)) + return driver:list-test-cases($testSetDoc, $dependency, $assert) + else + for $prefix in $testSetPrefixes + for $testSet in $doc/fots:catalog/fots:test-set[starts-with(@name, $prefix)] + let $testSetDoc := doc(resolve-uri($testSet/@file, $baseUri)) + return driver:list-test-cases($testSetDoc, $dependency, $assert) +}; + +(:~ + : Loops through the given test sets and returns the corresponding test cases. + : @param $fotsPath path to the FOTS catalog file. + : @param $testSetPrefixes name/criteria for the test sets + : (empty string means all test cases). + : @param $testCasePrefixes name/criteria for the test cases + : (empty string means all test cases). + : @param $dependency type of dependency that has to be met + : (empty string means all test cases). + : @param $assert lists of tests that contain a certain assert-type(empty + : string means all tests). + : @return available FOTS test cases. + :) +declare %ann:nondeterministic function driver:list-test-cases( + $fotsPath as xs:string, + $testSetPrefixes as xs:string*, + $testCasePrefixes as xs:string*, + $dependency as xs:string*, + $assert as xs:string* +) as xs:string* { + let $doc := doc(resolve-uri($fotsPath)), + $baseUri:= resolve-uri(util:parent-folder($fotsPath)), + $testCaseNames := driver:list-test-cases($fotsPath, + $testSetPrefixes, + $dependency, + $assert) + return + for $prefix in $testCasePrefixes + return + for $name in $testCaseNames + where starts-with($name, + $prefix) + return $name +}; + +(:~ + : Loops through all the test cases and returns those that have a 'test' node + : that matches given pattern using given flags. + : @param $fotsPath path to the FOTS catalog file. + : @param $pattern pattern. + : @param $flags flags. + : @return available FOTS test cases matching given pattern and flags. + :) +declare %ann:nondeterministic function driver:list-matching-test-cases( + $fotsPath as xs:string, + $pattern as xs:string, + $flags as xs:string? +) as xs:string* { + let $doc := doc(resolve-uri($fotsPath)), + $baseUri:= resolve-uri(util:parent-folder($fotsPath)) + return + for $testSet in $doc/fots:catalog/fots:test-set + let $uri := resolve-uri($testSet/@file, $baseUri), + $testSetDoc := doc($uri) + for $testCase in $testSetDoc//fots:test-case + where matches(util:get-value($testCase, + util:parent-folder($uri), + "test"), + $pattern, + $flags) + return + concat(resolve-uri($testSet/@file, $baseUri), + ", test name:", + data($testCase/@name)) +}; + +(:~ + : Loops through the FOTS catalog and evaluates all test cases that have + : a certain assert-type. + : This is useful for testing the implementation of a certain assert type. + : @param $FOTSCatalogFilePath path to the FOTS catalog file. + : @param $FOTSZorbaManifestPath the path to the file that describes optional + : features and implementation defined items in Zorba. + : @param $testSetNames list of test set names (empty string means all). + : @param $testCaseNames list of test case names (empty string means all). + : @param $exceptedTestCases lists of test cases that should not be run(empty + : string means all tests will be run). + : @param $exceptedTestSets lists of test sets that should not be run(empty + : string means all tests will be run). + : @param $verbose if set to TRUE it will also output the actual failures. + : @param $expectedFailuresPath path to the ExpectedFailures.xml file. + : @return an element containing all failed tests + :) +declare %ann:sequential function driver:run-fots( + $FOTSCatalogFilePath as xs:string, + $FOTSZorbaManifestPath as xs:string, + $testSetNames as xs:string*, + $testCaseNames as xs:string*, + $exceptedTestCases as xs:string*, + $exceptedTestSets as xs:string*, + $verbose as xs:boolean, + $expectedFailuresPath as xs:string +) as element(fots:test-cases) { + try { + let $FOTSCatalog := doc(trace(resolve-uri($FOTSCatalogFilePath), + "Path to FOTS catalog.xml set to: ")), + $FOTSZorbaManifest := doc(trace(resolve-uri($FOTSZorbaManifestPath), + "Path to FOTSZorbaManifest set to:")), + $expectedFailures := if($expectedFailuresPath = '') + then () + else doc(trace($expectedFailuresPath, + "Path to ExpectedFailures.xml set to:")) + return driver:run($FOTSCatalog, + resolve-uri(util:parent-folder($FOTSCatalogFilePath)), + $FOTSZorbaManifest, + $testSetNames, + $testCaseNames, + $exceptedTestCases, + $exceptedTestSets, + trace($verbose, "'Verbose' parameter set to: "), + $expectedFailures) + } + catch * { + error($err:code, + concat(" Please make sure the passed 'fotsPath' points to the", + " exact location of the FOTS catalog.xml: ", + resolve-uri($FOTSCatalogFilePath), + " that the passed 'fotsZorbaManifestPath' points to", + " a file in the same folder as cli.xq: ", + resolve-uri($FOTSZorbaManifestPath), + " that the passed 'expectedFailuresPath' points to", + " the ExpectedFailures.xml file: ", + $expectedFailuresPath)) + } +}; + +(:~ + : Loops through the FOTS catalog and evaluates all test cases + : + : @param $FOTSCatalog the FOTS catalog.xml file. + : @param $FOTSZorbaManifest the file that describes optional features and + : implementation defined items in Zorba. + : @param $testSetNames list of test set names (empty string means all). + : @param $testCaseNames list of test case names (empty string means all). + : @param $exceptedTestCases lists of test cases that should not be run(empty + : string means all tests will be run). + : @param $exceptedTestSets lists of test sets that should not be run(empty + : string means all tests will be run). + : @param $verbose if set to TRUE it will also output the actual failures. + : @param $expectedFailures the ExpectedFailures.xml file. + : @return an element containing all failed tests + :) +declare %ann:sequential function driver:run( + $FOTSCatalog as document-node(), + $catalogBaseURI as xs:anyURI, + $FOTSZorbaManifest as document-node(), + $testSetNames as xs:string*, + $testCaseNames as xs:string*, + $exceptedTestCases as xs:string*, + $exceptedTestSets as xs:string*, + $verbose as xs:boolean, + $expectedFailures as document-node()? +) as element(fots:test-cases) { + { + let $catalogTestSetNames := $FOTSCatalog//fots:test-set/@name, + $testSetNames := if ($testSetNames = '') + then functx:value-except($catalogTestSetNames, + $exceptedTestSets) + else functx:value-except( + functx:value-intersect($testSetNames, + $catalogTestSetNames), + $exceptedTestSets) + for $testSetName in $testSetNames + let $testSet := $FOTSCatalog//fots:test-set[@name=$testSetName], + $testSetURI := resolve-uri($testSet/@file, + $catalogBaseURI), + $testSetDoc := doc($testSetURI), + $depMet as xs:string*:= env:check-dependencies($testSetDoc/fots:test-set/fots:dependency, + $FOTSZorbaManifest) + return + if(exists($depMet)) + then + { + for $testCase in $testSetDoc/fots:test-set/fots:test-case + let $envName := data($testCase/fots:environment/@ref), + $envTestSet := $testSetDoc/fots:test-set/fots:environment[@name = $envName], + $envCatalog := $FOTSCatalog/fots:catalog/fots:environment[@name = $envName], + $isExcepted := exists(index-of($exceptedTestCases, + xs:string(data($testCase/@name))) + ), + $shouldRun := ($testCaseNames = '') or + exists(index-of($testCaseNames, + xs:string($testCase/@name))) + where $shouldRun + return + if($isExcepted) + then feedback:not-run($testCase, $verbose) + else feedback:not-applicable($testCase, + $envTestSet, + string-join($depMet,''), + $verbose) + } + else + { + for $testCase in $testSetDoc/fots:test-set/fots:test-case + let $envName := data($testCase/fots:environment/@ref), + $envTestSet := $testSetDoc/fots:test-set/fots:environment[@name = $envName], + $envCatalog := $FOTSCatalog/fots:catalog/fots:environment[@name = $envName], + $isExcepted := exists(index-of($exceptedTestCases, + xs:string(data($testCase/@name))) + ), + $shouldRun := ($testCaseNames = '') or + exists(index-of($testCaseNames, + xs:string($testCase/@name))) + where $shouldRun + return + if($isExcepted) + then + (if(exists($expectedFailures) and + empty($expectedFailures/failures/TestSet[@name=$testSetName]/Test[@name=xs:string($testCase/@name)])) + then feedback:fail($testCase, + (), + '', + $testSetName, + (), + xs:dayTimeDuration("PT0S"), + $verbose, + fn:false()) + else feedback:not-run($testCase, $verbose) + ) + else if(exists(env:check-dependencies($testCase/fots:dependency, + $FOTSZorbaManifest))) + then feedback:not-applicable($testCase, + $envTestSet, + string-join(distinct-values(env:check-dependencies($testCase/fots:dependency, + $FOTSZorbaManifest)), + ''), + $verbose) + else if(empty($envTestSet)) + then driver:test( $FOTSZorbaManifest, + $testCase, + $envCatalog, + $catalogBaseURI, + ($testCase/fots:dependency, + $testSetDoc/fots:test-set/fots:dependency), + $testSetName, + $testSetURI, + $verbose, + $expectedFailures/failures/TestSet[@name=$testSetName]/Test[@name=xs:string($testCase/@name)]) + else driver:test( $FOTSZorbaManifest, + $testCase, + $envTestSet, + $testSetURI, + ($testCase/fots:dependency, + $testSetDoc/fots:test-set/fots:dependency), + $testSetName, + $testSetURI, + $verbose, + $expectedFailures/failures/TestSet[@name=$testSetName]/Test[@name=xs:string($testCase/@name)]) + } + } +}; + +(:~ + : Creates the complete query that will be evaluated by adding the necessary + : XQXQ URL resolvers. + : @param $queryText the test-case/test after all the additional prolog + : statements were added. + : @param $case the test case. + : @param $env the environment. + : @param $envBaseURI URI of the environment. + : @param $testSetBaseURI URI of the test set that defines the test case. + : @return the query that will be evaluated. + :) +declare %private function driver:create-XQXQ-query( + $queryText as xs:string, + $case as element(fots:test-case), + $env as element(fots:environment)?, + $envBaseURI as xs:anyURI?, + $testSetBaseURI as xs:anyURI +) as xs:string { + let $resolver as xs:string? := env:resolver($case, + $env, + $envBaseURI, + $testSetBaseURI) + return string-join( + ("import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq';", + if (exists($resolver)) + then $resolver + else (), + (concat("variable $queryID := xqxq:prepare-main-module('", + " ", + replace($queryText,"'","''"), + "'", + " ", + if (exists($resolver)) + then ", resolver:url-resolver#2, ());" + else ");")), + env:set-context-item($env, $envBaseURI), + env:set-context-item($case/fots:environment, + $testSetBaseURI), + env:set-variables($env, + $envBaseURI), + env:set-variables($case/fots:environment, + $testSetBaseURI), + "xqxq:evaluate($queryID)" + ), + " ") +}; + +(:~ + : XQXQ invoke. + : @param $xqxqQueryText the query that will be run. + : @param $case the test case. + : @param $verbose if set to TRUE it will also output the actual result. + : @param $testSetBaseURI the URI of the test set. + : @return the result of running the query with XQXQ. + :) +declare %private %ann:sequential function driver:xqxq-invoke( + $xqxqQueryText as xs:string, + $case as element(fots:test-case), + $verbose as xs:boolean?, + $testSetBaseURI as xs:anyURI +) { + try { + { + variable $queryKey := xqxq:prepare-main-module($xqxqQueryText); + variable $queryResult := xqxq:evaluate-sequential($queryKey); + (:TODO check if this works:) + (:variable $expResult := util:get-value($case, $testSetBaseURI, "result");:) + eval:result($queryResult, + $case/fots:result/*) + } + } catch * { + eval:error((), + $case/fots:result/*, + $err:code, + $err:description) + } +}; + +(:~ + : Runs a single test case. + : + : @param $FOTSZorbaManifest the file that describes optional features and + : implementation defined items in Zorba. + : @param $case test case. + : @param $env the environment. + : @param $envBaseURI the relative URI used to calculate the full URI for the + : different children of the environment that have a "file" attribute. + : @param $deps the dependencies that should be checked for given test case. + : @param $testSetName the name of the test set. + : @param $testSetBaseURI the URI of the test set. + : @param $verbose if set to TRUE it will also output the actual failures. + : @param $expectedFailures the Test element from the ExpectedFailures.xml file. + : @return the result of running the test case depending on $verbose. + :) +declare %ann:sequential function driver:test( + $FOTSZorbaManifest as document-node(), + $case as element(fots:test-case), + $env as element(fots:environment)?, + $envBaseURI as xs:anyURI?, + $deps as element(fots:dependency)*, + $testSetName as xs:string?, + $testSetBaseURI as xs:anyURI, + $verbose as xs:boolean, + $expectedFailure as element(Test)? +) as element(fots:test-case)? { +(:TODO Cover the "(:%VARDECL%:)"when there are tests in FOTS that use it:) +try { +{ + variable $queryName := trace(data($case/@name), + "processing test case :"); + + variable $test := util:get-value($case, + $testSetBaseURI, + "test"); + variable $enableHOF := env:enable-HOF-feature(($deps, $case//fots:dependency), + $test); + variable $query := string-join((env:add-xquery-version-decl(($deps, $case//fots:dependency), + $test), + env:decl-def-elem-namespace($env, + $case/fots:environment), + env:decl-base-uri($env, + $case/fots:environment), + env:decl-namespaces($env, + $case, + $testSetBaseURI), + $enableHOF, + env:decl-decimal-formats(($env/fots:decimal-format, + $case/fots:environment/fots:decimal-format)), + env:add-var-decl($env, + $case, + $envBaseURI, + $testSetBaseURI), + $test + )," "), + $xqxqQuery := driver:create-XQXQ-query($query, + $case, + $env, + $envBaseURI, + $testSetBaseURI), + $startDateTime := datetime:current-dateTime (), + $result := driver:xqxq-invoke($xqxqQuery, + $case, + $verbose, + $testSetBaseURI), + $duration := (datetime:current-dateTime () - $startDateTime); + + if(feedback:check-pass($result, + $queryName, + $testSetName, + $expectedFailure)) + then feedback:pass($case, + $result, + $xqxqQuery, + $env, + $duration, + $verbose, + exists($expectedFailure)) + else + feedback:fail($case, + $result, + $xqxqQuery, + $testSetName, + $env, + $duration, + $verbose, + exists($expectedFailure)) +} +} catch * { + feedback:fail($case, + eval:error((), + $case/fots:result/*, + $err:code, + $err:description), + "fots-driver.xq:driver:test catch", + $testSetName, + $env, + xs:dayTimeDuration("PT0S"), + $verbose, + exists($expectedFailure)) +} +}; diff -Nru zorba-2.7.0-0/test/fots_driver/reporting.xq zorba-2.8.0-0/test/fots_driver/reporting.xq --- zorba-2.7.0-0/test/fots_driver/reporting.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/reporting.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,309 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver reporting + : @author Sorin Nasoi + :) + +module namespace reporting = + "http://www.zorba-xquery.com/fots-driver/reporting"; + +import module namespace file = + "http://expath.org/ns/file"; + +import module namespace driver = + "http://www.zorba-xquery.com/fots-driver" at "fots-driver.xq"; +import module namespace util = + "http://www.zorba-xquery.com/fots-driver/util" at "util.xq"; +import module namespace fots-err = + "http://www.zorba-xquery.com/fots-driver/errors" at "errors.xq"; +import module namespace functx = + "http://www.functx.com/"; + +declare namespace err = + "http://www.w3.org/2005/xqt-errors"; +declare namespace fots = + "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare namespace ann = + "http://www.zorba-xquery.com/annotations"; + +(:~ + : Loops through the test-sets, runs then and creates statistics. + : @param $FOTSCatalogFilePath path to the FOTS catalog file. + : @param $FOTSZorbaManifestPath path to the FOTS Zorba manifest file. + : @param $testSetPrefixes name/criteria for the test sets( empty string means + : all). + : @param $testCasePrefixes name/criteria for the test cases(empty string means + : all). + : @param $exceptedTestCases lists of test cases that are not run( empty string + : means all tests will be run). + : @param $exceptedTestSets lists of test sets that are not run(empty string + : means all tests will be run). + : @param $verbose if set to TRUE it will also output the actual failures. + : @return a report of tests run. + :) +declare %ann:sequential function reporting:run-and-report( + $FOTSCatalogFilePath as xs:string, + $FOTSZorbaManifestPath as xs:string, + $exceptedTestCases as xs:string*, + $exceptedTestSets as xs:string*, + $verbose as xs:boolean +) { +try { + { + variable $FOTSCatalog := doc(trace(resolve-uri($FOTSCatalogFilePath), + "Path to FOTS catalog.xml set to: ")); + + variable $catalogBaseURI := resolve-uri(util:parent-folder($FOTSCatalogFilePath)); + + variable $FOTSZorbaManifest := doc(trace(resolve-uri($FOTSZorbaManifestPath), + "Path to FOTSZorbaManifest set to:")); + + variable $failures := { + ( $FOTSZorbaManifest//fots:implementation, + $FOTSZorbaManifest//fots:dependencies-satisfied, + driver:run($FOTSCatalog, + $catalogBaseURI, + $FOTSZorbaManifest, + '', + '', + $exceptedTestCases, + $exceptedTestSets, + $verbose, + ()) + ) + }; + + file:write("failures.xml", + $failures, + $util:writeXML); + + reporting:do-reporting($FOTSCatalog, + $catalogBaseURI, + $failures, + $exceptedTestCases, + $exceptedTestSets, + $verbose) + } +} +catch * +{ + error($err:code, + $err:description, + concat(" Please make sure the passed 'fotsPath' points to the ", + "exact location of the FOTS catalog.xml: ", + resolve-uri($FOTSCatalogFilePath), + " and that the passed 'fotsZorbaManifestPath' points to", + " a file in the same folder as cli.xq: ", + resolve-uri($FOTSZorbaManifestPath))) +} +}; + +(:~ + : Loops through the test cases report and creates statistics. + : @param $pathFOTSCatalog path to the FOTS catalog file. + : @param $pathResults path to the FOTS results. + : @param $exceptedTestCases lists of test cases that are not run( empty string + : means all tests will be run). + : @param $exceptedTestSets lists of test sets that are not run(empty string + : means all tests will be run). + : @param $verbose if set to TRUE it will also output the actual failures. + : @param $showResult if set to TRUE it will also show the actual result of the + : Query run. + : @return a report of tests run. + :) +declare %ann:nondeterministic function reporting:report( + $FOTSCatalogFilePath as xs:string, + $pathResults as xs:string, + $exceptedTestCases as xs:string*, + $exceptedTestSets as xs:string*, + $verbose as xs:boolean +) as element(fots:report) { + try { + { + if(not(file:is-file($pathResults))) + then + { + error($fots-err:errNA, + "The file results file was not found. Suggestion: use driver:run-fots to generate it or use reporting:run-and-report function."); + } + else (); + + variable $results := parse-xml(file:read-text($pathResults)); + + variable $FOTSCatalog := doc(trace(resolve-uri($FOTSCatalogFilePath), + "Path to FOTS catalog.xml set to: ")); + + variable $catalogBaseURI := resolve-uri(util:parent-folder($FOTSCatalogFilePath)); + + reporting:do-reporting($FOTSCatalog, + $catalogBaseURI, + $results, + $exceptedTestCases, + $exceptedTestSets, + $verbose) + } + } + catch * + { + error($err:code, $err:description) + } +}; + + +(:~ + : Loops through the test-sets and creates statistics. + : @param $FOTSCatalog FOTS catalog file. + : @param $failures the test reported by Zorba as failed. + : @param $exceptedTestCases lists of test cases that are not run(empty string + : means all tests will be run). + : @param $exceptedTestSets lists of test sets that are not run(empty string + : means all tests will be run). + : @param $verbose is set to TRUE it will also output the actual failures. + : @return a report of tests run. + :) +declare %ann:nondeterministic function reporting:do-reporting( + $FOTSCatalog as document-node(), + $catalogBaseURI as xs:anyURI, + $failures, + $exceptedTestCases as xs:string*, + $exceptedTestSets as xs:string*, + $verbose as xs:boolean +) as element(fots:report) { + let $excepted := count($exceptedTestCases) + return + + { + let $totalNoTests := count($failures//fots:test-set//fots:test-case), + $totalPass := sum(for $testSet in $failures//fots:test-set + return count($testSet//fots:test-case[@result ='pass'])), + $totalFail := sum(for $testSet in $failures//fots:test-set + return count($testSet//fots:test-case[@result ='fail'])), + $totalNotApplicable := sum(for $testSet in $failures//fots:test-set + return count($testSet//fots:test-case[@result ='not applicable'])), + $totalNotRun := sum(for $testSet in $failures//fots:test-set + return count($testSet//fots:test-case[@result ='notRun'])), + $executionTime := sum(for $testCase in $failures//fots:test-set//fots:test-case return xs:dayTimeDuration($testCase/@executionTime)) + return + + } + { + for $testSetFile in $FOTSCatalog//fots:test-set + let $testSetURI := resolve-uri($testSetFile/@file, + $catalogBaseURI), + $testSetDoc := doc($testSetURI), + $testSetName := data($testSetDoc/fots:test-set/@name), + $totalNoTestCases := count($testSetDoc//fots:test-case), + $totalFailures := for $testCase in $failures//fots:test-set[@name = $testSetName]//fots:test-case[@result ="fail"] + return $testCase, + $percent := round((1 - (count($totalFailures) div $totalNoTestCases))*100,2), + $executionTime := sum(for $testCase in $failures//fots:test-set[@name = $testSetName]//fots:test-case + return xs:dayTimeDuration($testCase/@executionTime)) + order by count($totalFailures) descending + return + + {if (not($verbose)) then $totalFailures else ()} + + } + +}; + +(:~ + : Loops through the results and creates ExpectedFailures.xml. + : @param $pathResults path to the FOTS results. + : @return ExpectedFailures.xml. + :) +declare %ann:nondeterministic function reporting:generate-expected-failures( + $pathResults as xs:string +) as element(failures) { + try { + { + if(not(file:is-file($pathResults))) + then + { + error($fots-err:errNA, + "The file results file was not found. Suggestion: use driver:run-fots to generate it."); + } + else (); + + variable $results := parse-xml(file:read-text($pathResults)); + + { + for $testSet in $results//fots:test-set + let $countFailures := count($testSet//fots:test-case[@result ="fail"]) + let $countNotRun := count($testSet//fots:test-case[@result ="notRun"]) + let $testSetName := xs:string($testSet/@name) + where ($countFailures gt xs:integer(0)) or + ($countNotRun gt xs:integer(0)) + return + { + (for $testCase in $testSet//fots:test-case[@result ="fail"] + return + + , + for $testCase in $testSet//fots:test-case[@result ="notRun"] + return + + )}} + } + } + catch * + { + error($err:code, $err:description) + } +}; + +declare function reporting:regressions( +) as xs:string* { + let $old_report:=fn:parse-xml(file:read-text('/home/spungi/work/zorba/repo/fots-ctest/build/bin/report_04_Dec.xml')) + let $new_report:=fn:parse-xml(file:read-text('/home/spungi/work/zorba/repo/fots-ctest/build/bin/report_18_Dec.xml')) + + for $testSetOld in $old_report/*:report/*:test-set + let $testSetNew := $new_report/*:report/*:test-set[@name = data($testSetOld/@name)] + let $regression := if (exists($testSetNew)) + then xs:decimal(data($testSetOld/@noFailures)) - xs:decimal(data($testSetNew/@noFailures)) + else xs:decimal(0) + let $testsOld as xs:string* := tokenize(data($testSetOld/@failedTestNames),",") + let $testsNew as xs:string* := tokenize(data($testSetNew/@failedTestNames),",") + where $regression < xs:decimal(0) + order by $regression ascending + return + concat(data($testSetOld/@name), + " ", + $regression, + " ", + string-join((functx:value-except($testsNew, $testsOld)),","), + " ") +}; + diff -Nru zorba-2.7.0-0/test/fots_driver/tools/dependencies.xq zorba-2.8.0-0/test/fots_driver/tools/dependencies.xq --- zorba-2.7.0-0/test/fots_driver/tools/dependencies.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/tools/dependencies.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,27 @@ +(: this query loads a rezults.xml file and reports the number of 'non applicable' tests grouped by feature :) +(: + sample usage + ./zorba -f -q ../../test/fots_driver/tools/dependencies.xq + -e pathFailures:=results_12_nov.xml + -o driver_dependencies.xml + --indent +:) + + import module namespace file = "http://expath.org/ns/file"; + + declare default element namespace "http://www.w3.org/2010/09/qt-fots-catalog"; + declare namespace fots = "http://www.w3.org/2010/09/qt-fots-catalog"; + + declare variable $pathFailures external; + + variable $failures := fn:parse-xml(file:read-text($pathFailures)); + + { + for $d in distinct-values(data($failures/fots:test-cases/fots:test-set/fots:test-case[@result="not applicable"]/@comment)) + order by $d + return + { + + } + } + \ No newline at end of file diff -Nru zorba-2.7.0-0/test/fots_driver/tools/process.xq zorba-2.8.0-0/test/fots_driver/tools/process.xq --- zorba-2.7.0-0/test/fots_driver/tools/process.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/tools/process.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,130 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Run every test case that matches a given criterion in a different process + : and report every test case that HANGS or ends in a SEG FAULT. + : + : @author Sorin Nasoi + :) + + +import module namespace proc = + "http://www.zorba-xquery.com/modules/process"; +import module namespace util = + "http://www.zorba-xquery.com/fots-driver/util" at "../util.xq"; +import module namespace d = + "http://www.zorba-xquery.com/fots-driver" at "../fots-driver.xq"; +import module namespace fots-err = + "http://www.zorba-xquery.com/fots-driver/errors" at "../errors.xq"; + +declare namespace ann = + "http://www.zorba-xquery.com/annotations"; +declare namespace fots = + "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare variable $fotsPath as xs:string external := ""; +declare variable $dependency as xs:string external := ""; +declare variable $testSetPrefixes as xs:string external := ""; + + +(:~ + : Return the exit-code after invoking the FOTS driver with given $params. + : + : @param $params additional params. + : @return the exit-code returned by the invoked application. + :) +declare %ann:sequential function local:exec( + $params as xs:string* +) as xs:string { + variable $pathZorba := normalize-space(xs:string(proc:exec("pwd")/proc:stdout)); + + proc:exec(string-join(($pathZorba, "/zorba"),''), + ("-f", "-q", concat($pathZorba, "/../../test/fots_driver/cli.xq"), + "-e", concat("fotsPath:=", $fotsPath), + "-e", "verbose:=false", + $params + ) + )/proc:exit-code +}; + +declare %private %ann:sequential function local:invoke-exec( + $testSets as element(fots:test-set)*, + $baseUri as xs:anyURI, + $dependency as xs:string* +) as xs:string* { + for $testSet in $testSets + let $testSetDoc := doc(resolve-uri($testSet/@file, $baseUri)) + let $testSetName := xs:string($testSet/@name) + let $testCaseNames as xs:string* := d:list-test-cases($testSetDoc, + $dependency) + return + for $testCaseName in $testCaseNames + let $exit-code := + trace(local:exec(("-e", "mode:=run-test-case", + "-e", concat("testSetName:=", $testSetName), + "-e", concat("testCaseName:=", trace($testCaseName, "processing test case :")) + ) + ),"exit-code") + where (xs:integer($exit-code) gt xs:integer(134)) + return $testCaseName +}; + +(:~ + : Return the name of the test cases that return an exit-code > 134. + : + : @param $fotsPath path to the FOTS catalog file. + : @param $testSetPrefixes name/criteria for the test sets. + : @param $dependency defined dependency. + : @return the exit-codes returned by the invoked applications. + :) +declare %ann:sequential function local:list-test-cases( + $fotsPath as xs:string, + $testSetPrefixes as xs:string*, + $dependency as xs:string* +) as xs:string* { + variable $doc := doc(resolve-uri($fotsPath)), + $baseUri:= resolve-uri(util:parent-folder($fotsPath)); + + if(string-join($testSetPrefixes,'') = '') + then local:invoke-exec($doc/fots:catalog/fots:test-set, + $baseUri, + $dependency) + else + for $prefix in $testSetPrefixes + return + local:invoke-exec($doc/fots:catalog/fots:test-set[starts-with(@name, $prefix)], + $baseUri, + $dependency) +}; + +if( $fotsPath = '') +then fn:error($fots-err:errNA, + "please set the external variable $fotsPath to point to FOTS catalog.xml file.") +else +concat("'", + string-join(local:list-test-cases($fotsPath, $testSetPrefixes, $dependency),"', '"), + "'") + + +(: +local:exec( + ("-e", "mode:=run-test-case", + "-e", concat("testSetName:=", "misc-HigherOrderFunctions"), + "-e", concat("testCaseName:=", "xqhof2") + ) + ) +:) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/fots_driver/util.xq zorba-2.8.0-0/test/fots_driver/util.xq --- zorba-2.7.0-0/test/fots_driver/util.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/fots_driver/util.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,119 @@ +(: + : Copyright 2006-2011 The FLWOR Foundation. + : + : Licensed under the Apache License, Version 2.0 (the "License"); + : you may not use this file except in compliance with the License. + : You may obtain a copy of the License at + : + : http://www.apache.org/licenses/LICENSE-2.0 + : + : Unless required by applicable law or agreed to in writing, software + : distributed under the License is distributed on an "AS IS" BASIS, + : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + : See the License for the specific language governing permissions and + : limitations under the License. + :) + +(:~ + : Zorba FOTS driver util + : @author Sorin Nasoi + :) + +module namespace util = + "http://www.zorba-xquery.com/fots-driver/util"; + +import schema namespace output = + "http://www.w3.org/2010/xslt-xquery-serialization"; + +import module namespace file = + "http://expath.org/ns/file"; + +import module namespace fots-err = + "http://www.zorba-xquery.com/fots-driver/errors" at "errors.xq"; + +declare namespace err = + "http://www.w3.org/2005/xqt-errors"; +declare namespace fots = + "http://www.w3.org/2010/09/qt-fots-catalog"; + +declare namespace ann = + "http://www.zorba-xquery.com/annotations"; + + +(:~ + : The serialization parameters for XML serialization. + :) + declare variable $util:serParamXml := + + + + + ; + +(:~ + : The serialization parameters for XML serialization. + :) + declare variable $util:writeXML := + + + + + ; + +(:~ + : Retrieve the value of from the given node that is either given as text node + : or in a file attribute. + : + : @param $case test-case element. + : @param $path the path of the test-set. + : @return the query text. + :) +declare %ann:nondeterministic function util:get-value( + $case as element(fots:test-case), + $envBaseURI as xs:anyURI, + $node-name as xs:string +) as xs:string { + try { + for $node in $case/descendant-or-self::* + where (fn:local-name-from-QName(fn:node-name($node)) = $node-name) + return + if(exists($node/@file)) + then fn:unparsed-text(resolve-uri($node/@file, $envBaseURI)) + else fn:data($node) + } catch * { + fn:error($fots-err:errNA, $err:description) + } +}; + +(:~ + : returns the parent folder of the given file path. + : example: util:parent-folder('/home/user/file.ext') returns '/home/user'. + : @param $path Path. + : @return the parent folder of the given file. + :) + +declare function util:parent-folder( + $path as xs:string +) as xs:anyURI { + xs:anyURI(fn:substring-before($path, + file:base-name($path))) +}; + +declare function util:serialize-result( + $result as item()* +) as xs:string* { +util:serialize-result($result, + $util:serParamXml) +}; + +declare function util:serialize-result( + $result as item()*, + $SerParams +) as xs:string* { + for $res in $result + return + if($res instance of node()) + then fn:serialize($res, + $SerParams) + else fn:string($res) +}; diff -Nru zorba-2.7.0-0/test/parser/CMakeLists.txt zorba-2.8.0-0/test/parser/CMakeLists.txt --- zorba-2.7.0-0/test/parser/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/parser/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -15,12 +15,12 @@ CONFIGURE_FILE(parsertestdriverconfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/parsertestdriverconfig.h) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ZORBA_GENERATE_EXE("parsertestdriver" "parsertestdriver.cpp" "" "" "") +#ZORBA_GENERATE_EXE("parsertestdriver" "parsertestdriver.cpp" "" "" "") # collect all queries (suffix .xq) in all subdirectories of the Queries dir -FILE(GLOB_RECURSE TESTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/Queries/ *.xq) +#FILE(GLOB_RECURSE TESTFILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/Queries/ *.xq) -MESSAGE(STATUS "Adding parser tests for CTest") +#MESSAGE(STATUS "Adding parser tests for CTest") FOREACH(TESTFILE ${TESTFILES}) STRING(LENGTH ${TESTFILE} TESTFILELENGTH) diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_dynamic_zorba_collection.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_dynamic_zorba_collection.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_dynamic_zorba_collection.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_dynamic_zorba_collection.iter 2013-01-16 18:28:18.000000000 +0000 @@ -6,19 +6,11 @@ - - - - - + - - - - - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_static_zorba_collection.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_static_zorba_collection.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_static_zorba_collection.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_static_zorba_collection.iter 2013-01-16 18:28:18.000000000 +0000 @@ -24,19 +24,11 @@ - - - - - + - - - - - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_w3c_collection.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_w3c_collection.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_w3c_collection.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_w3c_collection.iter 2013-01-16 18:28:18.000000000 +0000 @@ -6,19 +6,11 @@ - - - - - + - - - - - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9065.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9065.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9065.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9065.iter 2013-01-16 18:28:18.000000000 +0000 @@ -16,7 +16,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -38,7 +38,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9066.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9066.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9066.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9066.iter 2013-01-16 18:28:18.000000000 +0000 @@ -5,7 +5,7 @@ - + @@ -17,7 +17,7 @@ - + @@ -27,7 +27,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9067.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9067.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9067.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9067.iter 2013-01-16 18:28:18.000000000 +0000 @@ -33,7 +33,7 @@ - + @@ -41,12 +41,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9068.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9068.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9068.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9068.iter 2013-01-16 18:28:18.000000000 +0000 @@ -40,7 +40,7 @@ - + @@ -48,12 +48,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9197.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9197.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9197.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9197.iter 2013-01-16 18:28:18.000000000 +0000 @@ -36,7 +36,7 @@ - + @@ -44,12 +44,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9198.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9198.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9198.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9198.iter 2013-01-16 18:28:18.000000000 +0000 @@ -36,7 +36,7 @@ - + @@ -44,12 +44,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9199.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9199.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9199.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9199.iter 2013-01-16 18:28:18.000000000 +0000 @@ -36,7 +36,7 @@ - + @@ -44,12 +44,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9204.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9204.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9204.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9204.iter 2013-01-16 18:28:18.000000000 +0000 @@ -33,7 +33,7 @@ - + @@ -41,7 +41,7 @@ - + @@ -51,7 +51,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9207.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9207.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9207.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/9207.iter 2013-01-16 18:28:18.000000000 +0000 @@ -36,7 +36,7 @@ - + @@ -44,12 +44,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/gary1.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/gary1.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/gary1.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/gary1.iter 2013-01-16 18:28:18.000000000 +0000 @@ -147,7 +147,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -193,7 +193,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx1.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx1.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx1.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx1.iter 2013-01-16 18:28:18.000000000 +0000 @@ -28,17 +28,15 @@ - - - - - - - - - - - + + + + + + + + + @@ -66,13 +64,11 @@ - - - - - - - + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx2.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx2.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx2.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx2.iter 2013-01-16 18:28:18.000000000 +0000 @@ -36,13 +36,11 @@ - - - - - - - + + + + + @@ -58,17 +56,15 @@ - - - - - - - - - - - + + + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx4.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx4.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx4.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx4.iter 2013-01-16 18:28:18.000000000 +0000 @@ -62,13 +62,13 @@ - + - + @@ -83,7 +83,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter 2013-01-16 18:28:18.000000000 +0000 @@ -19,94 +19,40 @@ - - + + - + - - - - + + + + + + + + + + - - - + - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-c.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-c.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-c.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-c.iter 2013-01-16 18:28:18.000000000 +0000 @@ -46,16 +46,8 @@ - - - - - - - - - - + + @@ -69,11 +61,7 @@ - - - - - + @@ -195,11 +183,7 @@ - - - - - + @@ -224,11 +208,7 @@ - - - - - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-nc.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-nc.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-nc.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-nc.iter 2013-01-16 18:28:18.000000000 +0000 @@ -46,16 +46,8 @@ - - - - - - - - - - + + @@ -69,11 +61,7 @@ - - - - - + @@ -195,11 +183,7 @@ - - - - - + @@ -224,11 +208,7 @@ - - - - - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9065.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9065.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9065.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9065.iter 2013-01-16 18:28:18.000000000 +0000 @@ -16,7 +16,7 @@ - + @@ -28,7 +28,7 @@ - + @@ -38,7 +38,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9198.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9198.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9198.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9198.iter 2013-01-16 18:28:18.000000000 +0000 @@ -36,7 +36,7 @@ - + @@ -44,12 +44,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9199.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9199.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9199.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9199.iter 2013-01-16 18:28:18.000000000 +0000 @@ -36,7 +36,7 @@ - + @@ -44,12 +44,12 @@ - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-gary1.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-gary1.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-gary1.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-gary1.iter 2013-01-16 18:28:18.000000000 +0000 @@ -147,7 +147,7 @@ - + @@ -156,7 +156,7 @@ - + @@ -193,7 +193,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx1.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx1.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx1.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx1.iter 2013-01-16 18:28:18.000000000 +0000 @@ -28,17 +28,15 @@ - - - - - - - - - - - + + + + + + + + + @@ -66,13 +64,11 @@ - - - - - - - + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx4.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx4.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx4.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx4.iter 2013-01-16 18:28:18.000000000 +0000 @@ -62,13 +62,13 @@ - + - + @@ -83,7 +83,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-01.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-01.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-01.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-01.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,35 @@ +Iterator tree for main query: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-02.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-02.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-02.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-02.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,35 @@ +Iterator tree for main query: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-03.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-03.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-03.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/node-copy-03.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,35 @@ +Iterator tree for main query: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q19.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q19.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q19.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q19.iter 2013-01-16 18:28:18.000000000 +0000 @@ -18,15 +18,13 @@ - - - - - - - - - + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test5.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test5.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test5.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test5.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,48 @@ +Iterator tree for main query: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test6.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test6.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test6.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/test6.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,50 @@ +Iterator tree for main query: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/hoist01.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/hoist01.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/hoist01.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/hoist01.iter 2013-01-16 18:28:18.000000000 +0000 @@ -22,6 +22,24 @@ Iterator tree for const-folded expr: + + + + + + + + + + + + +Iterator tree for const-folded expr: + + + + +Iterator tree for const-folded expr: @@ -29,60 +47,22 @@ Iterator tree for const-folded expr: +Iterator tree for const-folded expr: + + +Iterator tree for const-folded expr: + + + + +Iterator tree for testlib:searchUser: + + Iterator tree for main query: - - - + -Iterator tree for testlib:searchUser: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/positioned-access.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/positioned-access.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/positioned-access.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/positioned-access.iter 2013-01-16 18:28:18.000000000 +0000 @@ -17,11 +17,7 @@ - - - - - + @@ -35,11 +31,7 @@ - - - - - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/var_inline_01.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/var_inline_01.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/var_inline_01.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/optim/var_inline_01.iter 2013-01-16 18:28:18.000000000 +0000 @@ -17,47 +17,32 @@ - + - - - - - - - - - - + - - + + - + - - - - - - - + + + - - - - - + + + - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec.iter 1970-01-01 00:00:00.000000000 +0000 @@ -1,42 +0,0 @@ -Iterator tree for main query: - - - - -Iterator tree for local:fib: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec2.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec2.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec2.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec2.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,45 @@ +Iterator tree for const-folded expr: + + + + +Iterator tree for local:fib: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Iterator tree for main query: + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-1.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-1.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-1.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-1.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,68 @@ +Iterator tree for const-folded expr: + + + + +Iterator tree for local:get-request-id2: + + + + + + + + + + + +Iterator tree for local:get-request-id1: + + + + + + + + + + + + + + + + + + + + + + + +Iterator tree for main query: + + + + +Iterator tree for local:get-request-id1: + + + + + + + + + + + + + + + + +Iterator tree for local:get-request-id2: + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-2.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-2.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-2.iter 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-recursive-2.iter 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,49 @@ +Iterator tree for const-folded expr: + + + + +Iterator tree for local:recursion: + + + + + + + + + + + + + + + + + +Iterator tree for const-folded expr: + + +Iterator tree for main query: + + + + + + + + + + + + + +Iterator tree for local:recursion: + + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf1.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf1.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf1.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf1.iter 2013-01-16 18:28:18.000000000 +0000 @@ -31,11 +31,7 @@ - - - - - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/w3c/rdb-queries-results-q5.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/w3c/rdb-queries-results-q5.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/w3c/rdb-queries-results-q5.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/w3c/rdb-queries-results-q5.iter 2013-01-16 18:28:18.000000000 +0000 @@ -78,7 +78,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -182,7 +182,7 @@ - + @@ -197,8 +197,8 @@ - - + + @@ -213,7 +213,7 @@ - + @@ -227,13 +227,13 @@ - + - + - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q10.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q10.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q10.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q10.iter 2013-01-16 18:28:18.000000000 +0000 @@ -32,13 +32,9 @@ - - - - - - - + + + @@ -47,7 +43,7 @@ - + @@ -56,7 +52,7 @@ - + @@ -100,7 +96,7 @@ - + @@ -109,7 +105,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q4.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q4.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q4.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q4.iter 2013-01-16 18:28:18.000000000 +0000 @@ -1,6 +1,11 @@ Iterator tree for const-folded expr: +Iterator tree for const-folded expr: + + + + Iterator tree for main query: @@ -11,60 +16,52 @@ - - - - - - - + + + - + - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + - + - - - + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q9.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q9.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q9.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/windowing/q9.iter 2013-01-16 18:28:18.000000000 +0000 @@ -14,20 +14,16 @@ - - - - - - - + + + - + - + @@ -36,12 +32,12 @@ - + - + @@ -56,8 +52,8 @@ - - + + @@ -66,7 +62,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xmark/q19.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xmark/q19.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xmark/q19.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xmark/q19.iter 2013-01-16 18:28:18.000000000 +0000 @@ -18,15 +18,13 @@ - - - - - - - - - + + + + + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xray/ppm_10.iter zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xray/ppm_10.iter --- zorba-2.7.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xray/ppm_10.iter 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpCompilerResults/IterPlan/zorba/xray/ppm_10.iter 2013-01-16 18:28:18.000000000 +0000 @@ -183,13 +183,6 @@ - - - - - - - @@ -221,13 +214,13 @@ - + - + @@ -238,9 +231,7 @@ - - - + @@ -254,7 +245,7 @@ - + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-040.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +0 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/HigherOrder/hof-041.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +0 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_003.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_003.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_003.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_003.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_005.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_005.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_005.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_005.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +true diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_006.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_006.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_006.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_006.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +true diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_007.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_007.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_007.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_007.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_010.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_010.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_010.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_010.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_011.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_011.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_011.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_011.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +{ "bar" : "foo" } diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_012.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_012.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_012.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_012.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +h diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_013.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_013.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_013.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_013.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +h diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_014.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_014.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_014.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_014.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +test diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_018.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +{ "bar" : "foo", "foo" : [ { "foo" : "bar" } ] } diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/collections/edit/edit_collection_019.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +[ 1, 2, 3, [ { "foo" : "bar" } ] ] diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-la-uD-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-la-uD-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-la-uD-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-la-uD-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +2012-12-28 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-lj-uY-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-lj-uY-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-lj-uY-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-lj-uY-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +2012-12-28 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +2012-12-28 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +2012-12-28 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +2068-01-02 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uD-2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +1969-01-02 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uF-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uF-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uF-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-date-uF-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +1912-12-28 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +2012-12-28T08:00:00-08:00 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +2012-12-28T08:00:00-08:00 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +1912-12-28T05:00:00-08:00 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +11:12:13Z diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +11:12:13Z diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uH-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uH-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uH-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uH-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +23:00:00Z diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uIMS-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uIMS-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uIMS-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uIMS-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +00:34:56Z diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uR-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uR-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uR-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uR-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +23:45:00Z diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uT-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uT-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uT-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/datetime/datetime-parse-time-uT-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +23:45:01Z diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/eval/eval13.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/eval/eval13.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/eval/eval13.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/eval/eval13.xml.res 1970-01-01 00:00:00.000000000 +0000 @@ -1,2 +0,0 @@ - - diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/index/auctions2u.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/index/auctions2u.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/index/auctions2u.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/index/auctions2u.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -256,7 +256,7 @@ TEST 6 (undo without do): -err:XUDY0021 : updates violate constraint +err:XUDY0021 : "id": attribute with the same name already exists diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_02.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_02.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_02.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/index/multi_key_02.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-null-handling.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-null-handling.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-null-handling.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-null-handling.xml.res 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - - - diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-numbers-and-decimals.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-numbers-and-decimals.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-numbers-and-decimals.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-numbers-and-decimals.xml.res 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - - 2.89 - 2E+6 - -1.89 - - diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-numbers.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-numbers.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-numbers.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-numbers.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ + + 2.89 + 2E+6 + -1.89 + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-05.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-05.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-05.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-05.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ + + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-uncommon-chars.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-uncommon-chars.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-uncommon-chars.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-uncommon-chars.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ + + !_"-\?*.$+ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-utf8-01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-utf8-01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-utf8-01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-utf8-01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ + + – + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-uncommon-chars.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-uncommon-chars.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-uncommon-chars.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-uncommon-chars.xml.res 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - - !_"-\?*.$+ - diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-utf-8.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-utf-8.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-utf-8.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/json/json-snelson-utf-8.xml.res 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ - - – - diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +{ "foo" : "bar" } diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/json_doc_2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +[ "bar" ] diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_06.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_06.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_06.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_06.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -1 +1 @@ -Cannot atomize an object item. An object has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item). +can not atomize an object item: an object has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item) diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_10.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_10.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_10.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_10.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -1 +1 @@ -Cannot atomize an array item. An array has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item). +can not atomize an array item: an array has probably been passed where an atomic value is expected (e.g., as a key, or to a function expecting an atomic item) diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-09.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-09.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-09.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-09.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +1 2 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-10.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-10.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-10.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/parse_json-10.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +1 2 3 4 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/jsoniq/serializer-JNSE0022.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -1 +1 @@ -html: invalid serialization method for item type (js:object) text: invalid serialization method for item type (js:object) xml: invalid serialization method for item type (js:object) xhtml: invalid serialization method for item type (js:object) +"html": invalid serialization method for item type (js:object) "text": invalid serialization method for item type (js:object) "xml": invalid serialization method for item type (js:object) "xhtml": invalid serialization method for item type (js:object) diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/baseuri.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/baseuri.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/baseuri.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/baseuri.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +http://x.com/root http://x.com/b http://x.com/b http://y.com/ http://y.com/ diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval12.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval12.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval12.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval12.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ + + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval15.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval15.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval15.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/eval15.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-02.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-02.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-02.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-02.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-03.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-03.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-03.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/node-copy-03.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/recursive_01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/recursive_01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/recursive_01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/recursive_01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +</book> + diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test5.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test5.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test5.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test5.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -1 +1 @@ -<s:name xmlns:s="http://www.zorba-xquery.org/simple">foo</s:name> true +<s:name xmlns:s="http://www.zorba-xquery.org/simple">foo</s:name> false diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test6.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test6.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test6.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/no-copy/test6.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +foo25 + + foo25 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/INF-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/INF-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/INF-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/INF-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +-INF INF -INF INF diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/NaN.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/NaN.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/NaN.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/NaN.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +NaN NaN diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/infinity0.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/infinity0.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/infinity0.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/infinity0.xml.res 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -INF -INF NaN -INF INF 1.0E200 INF -INF NaN INF -INF diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-1.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-1.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-1.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-1.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +INF diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +-INF diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-3.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-3.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-3.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-3.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +INF diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-4.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-4.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-4.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/numerics/overflow-4.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +-INF diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/optim/no_folding_01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/optim/no_folding_01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/optim/no_folding_01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/optim/no_folding_01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +1 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/optim/pos_pred14.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/optim/pos_pred14.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/optim/pos_pred14.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/optim/pos_pred14.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +<a>b</a> diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-02.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-02.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-02.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-02.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-03.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-03.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-03.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-comma-03.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-semicolon-05.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-semicolon-05.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-semicolon-05.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/missing-semicolon-05.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/unexpected-qname-03.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/unexpected-qname-03.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/unexpected-qname-03.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/parser/syntax-errors/unexpected-qname-03.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/paths/following_01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/paths/following_01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/paths/following_01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/paths/following_01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +YZ diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/paths/preceding_pred_01.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/paths/preceding_pred_01.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/paths/preceding_pred_01.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/paths/preceding_pred_01.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +B diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_3.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_3.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_3.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_3.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +{ "foo" : "bar" } diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_4.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_4.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_4.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_4.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +false true diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_5.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_5.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_5.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/reference/json-reference_5.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +[ 1 ] diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/trycatch/trycatch4.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/trycatch/trycatch4.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/trycatch/trycatch4.xml.res 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/trycatch/trycatch4.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -1 +1 @@ -Ha! It worked err:FORG0001 "xs:string": invalid value for cast/constructor: can not cast to "xs:integer" +Ha! It worked err:FORG0001 "a": value of type xs:string is not castable to type xs:integer diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/udf/udf-fib-rec2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/udf/udf-fib-rec2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/udf/udf-fib-rec2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/udf/udf-fib-rec2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +55 diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/uris/disable-http-3.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/uris/disable-http-3.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/uris/disable-http-3.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/uris/disable-http-3.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +<query>querystring</query> diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-context-item.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-context-item.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-context-item.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-context-item.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-variable.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-variable.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-variable.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/bind-variable.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-sequential.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-sequential.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-sequential.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-sequential.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-updating.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-updating.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-updating.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate-updating.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<parent><child>Content</child></parent> \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +2 \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/evaluate2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +2 \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/external-module.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/external-module.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/external-module.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/external-module.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +true \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/get-external-variables.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/get-external-variables.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/get-external-variables.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/get-external-variables.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +a \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-context-item.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-context-item.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-context-item.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-context-item.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +false \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-variable.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-variable.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-variable.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-bound-variable.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +true true false \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-sequential.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-sequential.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-sequential.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-sequential.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +true false \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-updating.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-updating.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-updating.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/is-updating.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +true false \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/multiple-queries.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/multiple-queries.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/multiple-queries.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/multiple-queries.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +2 3 \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +foo diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/uri-mapper2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<test:test xmlns:test="http://test"><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test> diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-module-resolver.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-module-resolver.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-module-resolver.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-module-resolver.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +foo diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<test:test xmlns:test="http://test"><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test> diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver2.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver2.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver2.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver2.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<test:test xmlns:test="http://test"><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test> diff -Nru zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver3.xml.res zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver3.xml.res --- zorba-2.7.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver3.xml.res 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/ExpQueryResults/zorba/xqxq/url-schema-resolver3.xml.res 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8"?> +<test:test xmlns:test="http://test"><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test> diff -Nru zorba-2.7.0-0/test/rbkt/Queries/CMakeLists.txt zorba-2.8.0-0/test/rbkt/Queries/CMakeLists.txt --- zorba-2.7.0-0/test/rbkt/Queries/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -230,7 +230,6 @@ #### IF (FOUND_XQTS AND NOT ZORBA_TEST_W3C_TO_SUBMIT_RESULTS) - #EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/PathExpr/Steps/Steps-leading-lone-slash-8a 3408285) EXPECTED_FAILURE(test/rbkt/w3c_testsuite/XQuery/Functions/QNameFunc/NamespaceURIForPrefixFunc/K2-NamespaceURIForPrefixFunc-2 872732) IF (NOT ZORBA_WITH_BIG_INTEGER) @@ -263,10 +262,6 @@ EXPECTED_FAILURE (test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes015 3355019) ENDIF (ZORBA_TEST_XQUERYX) - #this is marked as expected failure because the RQ uses XQTS_1_0_3. In that version the expected result is err:FODC0004 instead of err:FODC0002. - #W3C has changed the expected result for this test in the meantime: please see http://www.w3.org/Bugs/Public/show_bug.cgi?id=12542 - #EXPECTED_FAILURE (test/rbkt/w3c_testsuite/XQuery/Functions/NodeSeqFunc/SeqCollectionFunc/fn-collection-2 882002) - ENDIF (FOUND_XQTS AND NOT ZORBA_TEST_W3C_TO_SUBMIT_RESULTS) @@ -491,6 +486,13 @@ # hitting w3.org for the DTD, which is bad. SET_TESTS_PROPERTIES(test/rbkt/zorba/schemas/local-xhtml PROPERTIES TIMEOUT 5) +# Bug 867363. These should fail or pass quickly because HTTP download +# is disabled. +SET_TESTS_PROPERTIES(test/rbkt/zorba/uris/disable-http + PROPERTIES TIMEOUT 5) +SET_TESTS_PROPERTIES(test/rbkt/zorba/uris/disable-http-2 + PROPERTIES TIMEOUT 5) + # -------------------------------------------------------------------------- # the list of tests that are failing but can be accepted by the commit queue @@ -552,8 +554,6 @@ ENDIF(ZORBA_NO_ICU) -EXPECTED_FAILURE(test/rbkt/zorba/reference/reference_5 868640) - # external variable default expected failures EXPECTED_FAILURE(test/rbkt/zorba/ext_var/w3c/extvardef-014 923672) # not possible to set context item for rbkt tests EXPECTED_FAILURE(test/rbkt/zorba/ext_var/w3c/extvardef-015 923686) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/w3c_known_failures_XQueryX.txt zorba-2.8.0-0/test/rbkt/Queries/w3c_known_failures_XQueryX.txt --- zorba-2.7.0-0/test/rbkt/Queries/w3c_known_failures_XQueryX.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/w3c_known_failures_XQueryX.txt 2013-01-16 18:28:18.000000000 +0000 @@ -1,88 +1,85 @@ -test/rbkt/w3c_testsuite/XQueryX/SchemaValidation/ValidateExpression/validateexpr-28 -test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFLWORExpr/ST-PITest-02 -test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFLWORExpr/ST-PITest-01 -test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFLWORExpr/ST-WhereExpr001 +test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFunctions/ST-Data001 test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes012 test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes011 +test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes015 test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes013 test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes014 -test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STPathExpr/STSteps/STAxes/ST-Axes015 -test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFunctions/ST-Data001 -test/rbkt/w3c_testsuite/XQueryX/Basics/EQNames/eqname-013 -test/rbkt/w3c_testsuite/XQueryX/PathExpr/Steps/Steps-leading-lone-slash-8a -test/rbkt/w3c_testsuite/XQueryX/SchemaImport/SchemaImportProlog/modules-schema-context -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-021 +test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFLWORExpr/ST-WhereExpr001 +test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFLWORExpr/ST-PITest-01 +test/rbkt/w3c_testsuite/XQueryX/StaticTyping/STFLWORExpr/ST-PITest-02 +test/rbkt/w3c_testsuite/XQueryX/SchemaValidation/ValidateExpression/validateexpr-28 +test/rbkt/w3c_testsuite/XQueryX/Expressions/Construct/DirectConElem/DirectConElemContent/Constr-cont-nsmode-7 +test/rbkt/w3c_testsuite/XQueryX/Expressions/Construct/DirectConElem/DirectConElemContent/Constr-cont-nsmode-8 +test/rbkt/w3c_testsuite/XQueryX/Expressions/Construct/DirectConElem/DirectConElemContent/Constr-cont-nsmode-10 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-009 test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-008 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-049 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-024 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-913 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-021 test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-046 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-030 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-047 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-914 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-038 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-039 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-037 test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-007 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-913 test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-015 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-009 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-036 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-028 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-904 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-024 test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-017 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-029 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-914 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-049 test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-018 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-047 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-028 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-036 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-038 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-029 test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-031 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-039 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-037 -test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-904 -test/rbkt/w3c_testsuite/XQueryX/Expressions/Construct/DirectConElem/DirectConElemContent/Constr-cont-nsmode-8 -test/rbkt/w3c_testsuite/XQueryX/Expressions/Construct/DirectConElem/DirectConElemContent/Constr-cont-nsmode-7 -test/rbkt/w3c_testsuite/XQueryX/Expressions/Construct/DirectConElem/DirectConElemContent/Constr-cont-nsmode-10 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-005 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-006 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-903 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-003 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-007 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-001 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-901 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-002 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-004 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-902 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-003 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-002 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-903 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-901 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-902 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-004 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-005 +test/rbkt/w3c_testsuite/XQueryX/Expressions/HigherOrder/hof-030 +test/rbkt/w3c_testsuite/XQueryX/exprSeqTypes/PrologExpr/VariableProlog/ExternalVariablesWith/K2-ExternalVariablesWith-22 +test/rbkt/w3c_testsuite/XQueryX/Construct/DirectConElem/DirectConElemWhitespace/K2-DirectConElemWhitespace-25 +test/rbkt/w3c_testsuite/XQueryX/Construct/DirectConElem/DirectConElemContent/K2-DirectConElemContent-27 +test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/K2-MatchesFunc-5 +test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/K2-MatchesFunc-6 +test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch08 +test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch09 +test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch10 +test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch11 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-004 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-009 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-008 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-001 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-003 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-002 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-004 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-009 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-003 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldLeft/fold-left-005 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-005 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-002 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-004 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-001 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-003 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-901 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-002 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-001 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/FoldRight/fold-right-005 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-008 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-005 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-006 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-007 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-001 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-003 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-901 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-002 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-007 test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-902 -test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-001 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/MapPairs/map-pairs-005 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-902 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-001 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-002 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-003 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-005 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-006 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-004 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-007 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-901 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Map/map-903 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-902 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-003 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-903 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-004 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-901 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-002 +test/rbkt/w3c_testsuite/XQueryX/Functions/HigherOrder/Filter/filter-005 test/rbkt/w3c_testsuite/XQueryX/FunctX/functx-fn-tokenize/functx-fn-tokenize-7 test/rbkt/w3c_testsuite/XQueryX/FunctX/functx-fn-tokenize/functx-fn-tokenize-all -test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/K2-MatchesFunc-5 -test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch08 -test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch09 -test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/K2-MatchesFunc-6 -test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch11 -test/rbkt/w3c_testsuite/XQueryX/Functions/AllStringFunc/MatchStringFunc/MatchesFunc/caselessmatch10 -test/rbkt/w3c_testsuite/XQueryX/exprSeqTypes/PrologExpr/VariableProlog/ExternalVariablesWith/K2-ExternalVariablesWith-22 -test/rbkt/w3c_testsuite/XQueryX/Construct/DirectConElem/DirectConElemContent/K2-DirectConElemContent-27 -test/rbkt/w3c_testsuite/XQueryX/Construct/DirectConElem/DirectConElemWhitespace/K2-DirectConElemWhitespace-25 - +test/rbkt/w3c_testsuite/XQueryX/Basics/EQNames/eqname-013 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-040.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-040.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-040.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-040.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ +declare namespace o = "http://www.zorba-xquery.com/options/features"; +declare namespace err = "http://www.w3.org/2005/xqt-errors"; +declare option o:enable "hof"; + +try { function () { fn:error() } () } catch err:FOER0000 { 0 } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-041.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-041.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-041.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/HigherOrder/hof-041.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ +declare namespace o = "http://www.zorba-xquery.com/options/features"; +declare namespace err = "http://www.w3.org/2005/xqt-errors"; +declare option o:enable "hof"; + +try { function() { 1 div 0 } () } catch err:FOAR0001 { 0 } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/block/local_var3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/block/local_var3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/block/local_var3.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/block/local_var3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -11,7 +11,7 @@ for $i in (1, 2) return { - variable $dummy := {$x := $i + $y; }; + variable $dummy := { $x := $i + $y; () }; $x } }; @@ -20,7 +20,7 @@ for $i in (10, 20, 30) return { - variable $dummy := { $result := local:f($i); }; + variable $dummy := { $result := local:f($i); () }; $result } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/casting/notation.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/casting/notation.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/casting/notation.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/casting/notation.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.w3.org/2005/xqt-errors:XPTY0117 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/casting/notation.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/casting/notation.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/casting/notation.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/casting/notation.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,9 @@ +declare namespace op = 'http://www.zorba-xquery.com/options/features'; +declare namespace f = 'http://www.zorba-xquery.com/features'; +declare option op:enable 'f:hof'; + +declare function local:clarkname($q as xs:NOTATION) as xs:string { + $q +}; + +local:clarkname(xs:untypedAtomic("xs:integer")) Binary files /tmp/CpnDwFWrQs/zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/.DS_Store and /tmp/_l1HPYldi4/zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/.DS_Store differ diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/collection_001.xqdata zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/collection_001.xqdata --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/collection_001.xqdata 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/collection_001.xqdata 2013-01-16 18:28:18.000000000 +0000 @@ -6,6 +6,10 @@ declare collection ns:collection1 as node()*; +declare collection ns:collection-objects as object()*; + +declare collection ns:collection-arrays as array()*; + declare %ann:ordered collection ns:collection2; declare %ann:const collection ns:collection_const as node()*; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_index.xqdata zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_index.xqdata --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_index.xqdata 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_index.xqdata 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,11 @@ +module namespace ns = "http://www.example.com/example"; + +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +declare namespace ann = "http://www.zorba-xquery.com/annotations"; + +declare collection ns:collection as node()*; + +declare %ann:automatic %ann:value-equality index ns:index +on nodes dml:collection(xs:QName("ns:collection")) +by xs:integer(@id) as xs:integer; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_type.xqdata zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_type.xqdata --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_type.xqdata 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/collection_with_type.xqdata 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,7 @@ +module namespace ns = "http://www.example.com/example"; + +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +declare namespace ann = "http://www.zorba-xquery.com/annotations"; + +declare collection ns:collection as element(foo)*; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0017 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_001.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +dml:edit(<a/>, <b/>); + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0017 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_002.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,11 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), <a/>); + +dml:edit(<b/>, dml:collection(xs:QName("ns:collection"))); + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_003.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_003.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_003.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_003.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), (<a/>, <b/>, <c/>)); + +dml:edit(dml:collection(xs:QName("ns:collection"))[2], <d/>); + +dml:collection(xs:QName("ns:collection")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0017 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_004.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,8 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection2")); + +dml:delete-nodes(<a/>); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_005.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_005.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_005.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_005.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,17 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; +import module namespace ref = "http://www.zorba-xquery.com/modules/node-reference"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), (<a/>, <b/>, <c/>)); + +variable $old := ref:node-reference(dml:collection(xs:QName("ns:collection"))[2]); + +dml:edit(dml:collection(xs:QName("ns:collection"))[2], <d/>); + +variable $new := ref:node-reference(dml:collection(xs:QName("ns:collection"))[2]); + +$old eq $new diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_006.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_006.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_006.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_006.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,17 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; +import module namespace ref = "http://www.zorba-xquery.com/modules/node-reference"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), (<a/>, <b/>, <c/>)); + +variable $old := dml:collection(xs:QName("ns:collection"))[2]; + +dml:edit(dml:collection(xs:QName("ns:collection"))[2], <d/>); + +variable $new := dml:collection(xs:QName("ns:collection"))[2]; + +$old is $new diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_007.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_007.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_007.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_007.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,25 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; +import module namespace index_ddl = "http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; +import module namespace index_dml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml"; +import module namespace ref = "http://www.zorba-xquery.com/modules/node-reference"; + +import module namespace ns = "http://www.example.com/example" at "collection_with_index.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +index_ddl:create(xs:QName("ns:index")); + +dml:insert(xs:QName("ns:collection"), (<a id="1"/>, <b id="2"/>, <c id="3"/>)); + +variable $old := dml:collection(xs:QName("ns:collection"))[2]; + +dml:edit(dml:collection(xs:QName("ns:collection"))[2], <d id="4"/>); + +variable $new := dml:collection(xs:QName("ns:collection"))[2]; + +index_dml:probe-index-point-value(xs:QName("ns:index"), 1), +index_dml:probe-index-point-value(xs:QName("ns:index"), 2), +index_dml:probe-index-point-value(xs:QName("ns:index"), 3), +index_dml:probe-index-point-value(xs:QName("ns:index"), 4) + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0040 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_008.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,14 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; +import module namespace index_ddl = "http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; +import module namespace index_dml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml"; +import module namespace ref = "http://www.zorba-xquery.com/modules/node-reference"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), <a/>); + +dml:edit(dml:collection(xs:QName("ns:collection")), { "foo" : "bar" }); + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0040 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_009.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,14 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; +import module namespace index_ddl = "http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; +import module namespace index_dml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml"; +import module namespace ref = "http://www.zorba-xquery.com/modules/node-reference"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), <a/>); + +dml:edit(dml:collection(xs:QName("ns:collection")), document { <a/> } ); + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_010.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_010.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_010.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_010.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,17 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; +import module namespace index_ddl = "http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; +import module namespace index_dml = "http://www.zorba-xquery.com/modules/store/static/indexes/dml"; +import module namespace ref = "http://www.zorba-xquery.com/modules/node-reference"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), <a/>); + +variable $old := <b/>; + +dml:edit(dml:collection(xs:QName("ns:collection")), $old); + +$old diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_011.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_011.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_011.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_011.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection-objects")); + +dml:insert(xs:QName("ns:collection-objects"), { "foo" : "bar" }); + +dml:edit(dml:collection(xs:QName("ns:collection-objects")), { "bar" : "foo" }); + +dml:collection(xs:QName("ns:collection-objects")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_012.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_012.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_012.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_012.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), document { <a b="c"><!-- d --><?e f?>g</a> } ); + +dml:edit(dml:collection(xs:QName("ns:collection")), document { <b c="d"><!-- e --><?f g?>h</b> }); + +dml:collection(xs:QName("ns:collection")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_013.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_013.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_013.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_013.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml"; + +ddl:create(xs:QName("dml:collection")); + +dml:insert-first(xs:QName("dml:collection"), document { <a b="c"><!-- d --><?e f?>g</a> } ); + +dml:edit(dml:collection(xs:QName("dml:collection")), document { <b c="d"><!-- e --><?f g?>h</b> }); + +dml:collection(xs:QName("dml:collection")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_014.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_014.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_014.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_014.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "collection_with_type.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), <foo>1</foo> ); + +dml:edit(dml:collection(xs:QName("ns:collection")), <foo attr="value">test</foo>); + +dml:collection(xs:QName("ns:collection")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDTY0001 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_015.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "collection_with_type.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), <foo>1</foo> ); + +dml:edit(dml:collection(xs:QName("ns:collection")), <bar attr="value">test</bar>); + +dml:collection(xs:QName("ns:collection")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0039 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_016.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection-objects")); + +dml:insert(xs:QName("ns:collection-objects"), { "foo" : { "bar" : 1 } }); + +dml:edit(dml:collection(xs:QName("ns:collection-objects"))("foo"), { "bar" : 2 }); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0039 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_017.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "collection_with_type.xqdata"; + +ddl:create(xs:QName("ns:collection")); + +dml:insert(xs:QName("ns:collection"), <foo><bar></bar></foo> ); + +dml:edit(dml:collection(xs:QName("ns:collection"))/bar, <bar attr="value">test</bar>); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_018.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection-objects")); + +dml:insert(xs:QName("ns:collection-objects"), { "foo" : "bar", "bar" : [ 1, 2, 3, { "foo" : "bar" } ] }); + +dml:edit(dml:collection(xs:QName("ns:collection-objects")), { "bar" : "foo", "foo" : [ { "foo" : "bar" } ] }); + +dml:collection(xs:QName("ns:collection-objects")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_019.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,12 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection-arrays")); + +dml:insert(xs:QName("ns:collection-arrays"), [ { "foo" : "bar" }, 1, 2, 3 ]); + +dml:edit(dml:collection(xs:QName("ns:collection-arrays")), [ 1, 2, 3, [ { "foo" : "bar" } ] ]); + +dml:collection(xs:QName("ns:collection-arrays")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0037 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_append_only.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection_append_only")); + +dml:insert-last(xs:QName("ns:collection_append_only"), <a/>); + +dml:edit(dml:collection(xs:QName("ns:collection_append_only")[1]), <b/>); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0004 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_const.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection_const")); + +dml:insert-nodes(xs:QName("ns:collection_const"), <a/>); + +dml:edit(xs:QName("ns:collection_const")[1], <b/>); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDDY0038 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/edit/edit_collection_queue.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace ns = "http://www.example.com/example" at "../collection_001.xqdata"; + +ddl:create(xs:QName("ns:collection_queue")); + +dml:insert-last(xs:QName("ns:collection_queue"), <a/>); + +dml:edit(dml:collection(xs:QName("ns:collection_queue")[1]), <b/>); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/paging_1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/paging_1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/collections/paging_1.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/collections/paging_1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -4,6 +4,7 @@ import module namespace ref = "http://www.zorba-xquery.com/modules/node-reference"; declare namespace ann = "http://www.zorba-xquery.com/annotations"; +declare namespace zerr = "http://www.zorba-xquery.com/errors"; declare function local:order($items) { @@ -18,6 +19,18 @@ dml:insert-nodes(xs:QName("ns:test2"), <a/>); dml:insert-nodes(xs:QName("ns:test2"), <b/>); dml:insert-nodes(xs:QName("ns:test2"), (<c/>, <d/>, <e/>)); + + try { + dml:collection(xs:QName("ns:test2"), + xs:anyURI("urn:uuid:00000000-0000-0000-0000-000000000000"), + 0); + fn:error(); (: has to fail :) + } + catch zerr:ZSTR0066 + { + (: all ok :) + } + ( local:order(dml:collection(xs:QName("ns:test2"), 3)), <delim/>, local:order(dml:collection(xs:QName("ns:test2"), -1)), <delim/>, diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-date-la-uD-1.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-la-uD-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "Fri 12/28/12", "%a %D", "en-US" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDTP0005 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-ld-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "1", "%d" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-date-lj-uY-1.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-lj-uY-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "363 2012", "%j %Y" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-1.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "Friday 12/28/12", "%A %D", "en-US" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-date-uA-uD-2.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uA-uD-2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "Freitag 12/28/12", "%A %D", "de-DE" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "1/2/68", "%D" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uD-2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "1/2/69", "%D" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uF-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uF-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uF-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-date-uF-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-date( "1912-12-28", "%F" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +let $buf := "Friday, December 28, 2012, 08:00:00 PST" +return dt:parse-dateTime( $buf, "%A, %B %d, %Y, %T %Z", "en-US" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uAB-ld-uYTZ-2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +let $buf := "Freitag, Dezember 28, 2012, 08:00:00 PST" +return dt:parse-dateTime( $buf, "%A, %B %d, %Y, %T %Z", "de-DE" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-dateTime-uFTZ-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-dateTime( "1912-12-28 05:00:00 PST", "%F %T %Z" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-1.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "11:12:13 AM", "%r", "en-US" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/datetime/datetime-parse-time-lr-2.xml.res +Error: http://www.zorba-xquery.com/errors:ZOSE0007 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-lr-2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "11:12:13 AM", "%r", "fr-FR" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "23", "%H" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDTP0003 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uH-2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "24", "%H" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uIMS-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uIMS-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uIMS-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uIMS-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "12:34:56", "%I:%M:%S" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDTP0005 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uM-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "59", "%M" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uR-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uR-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uR-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uR-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "23:45", "%R" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDTP0005 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uS-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "59", "%S" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uT-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uT-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uT-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/datetime/datetime-parse-time-uT-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace dt = "http://www.zorba-xquery.com/modules/datetime"; + +dt:parse-time( "23:45:01", "%T" ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/eval/eval13.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/eval/eval13.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/eval/eval13.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/eval/eval13.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; - - -declare function local:dummy($n as node()) -{ -}; - - -declare function local:foo($n as node()) as node()* -{ - local:dummy($n), - $n/ancestor::node() -}; - - -declare function local:constr($n as node()) as node()* -{ - local:dummy($n), - <root>{$n}</root> -}; - - -declare variable $doc := -<a> - <b> - <c/> - </b> -</a> -; - - -local:constr($doc) -, -refl:eval("local:foo(local:constr($doc)//c)") diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/auctions1u.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/index/auctions1u.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/auctions1u.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/auctions1u.xq 2013-01-16 18:28:18.000000000 +0000 @@ -26,6 +26,8 @@ index_dml:refresh-index($emp-id); (: don't refresh the emp-city index manually because it's done automatically :) + + () } , " @@ -44,6 +46,7 @@ , { dml:insert-nodes($auctions:auctions, doc("auctions2.xml")); + () } , " diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/auctions2u.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/index/auctions2u.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/auctions2u.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/auctions2u.xq 2013-01-16 18:28:18.000000000 +0000 @@ -162,7 +162,7 @@ }} catch * { - <exception>{$err:code} : {$err:description}</exception> + <exception>{$err:code} : { $err:description }</exception> } , for $x in auctions:probe-point-watch($auctions:PersonWatches, diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/keys_mod.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/index/keys_mod.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/keys_mod.xqlib 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/keys_mod.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -16,7 +16,8 @@ declare %ann:automatic %ann:value-range index keys-lib:FooIdx3 on nodes dml:collection(xs:QName("keys-lib:foo")) - by xs:string(./@id) as xs:string, (if (./@name) then xs:string(./@name) else ()) as xs:string?; + by xs:string(./@id) as xs:string, + (if (./@name) then xs:string(./@name) else ()) as xs:string?; declare %ann:automatic %ann:general-equality index keys-lib:FooIdx-general on nodes dml:collection(xs:QName("keys-lib:foo")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,51 @@ +import module namespace d = "www.data.com" at "multi_key_01.xqlib"; + +import module namespace ddl = +"http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + +import module namespace dml = +"http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace iddl = +"http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; + +import module namespace idml = +"http://www.zorba-xquery.com/modules/store/static/indexes/dml"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + + +declare variable $doc11 := +<doc key1="foo1" key2="boo1"/>; + +declare variable $doc21 := +<doc key1="foo2" key2="boo1"/>; + +declare variable $doc12 := +<doc key1="foo1" key2="boo2"/>; + +declare variable $doc22 := +<doc key1="foo2" key2="boo2"/>; + + +ddl:create($d:documents); + +dml:insert($d:documents, ($doc11, $doc21, $doc12, $doc22)); + +iddl:create($d:idx); + +idml:probe-index-range-value( + $d:idx, + "foo1", (), true(), false(), false(), false(), + (), (), false(), false(), false(), false()) +, +" +" +, +idml:probe-index-range-value( + $d:idx, + (), "foo2", false(), true(), false(), false(), + (), (), false(), false(), false(), false()) +, +" +" diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xqlib 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_01.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,30 @@ +module namespace data = "www.data.com"; + +import module namespace ddl = +"http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + +import module namespace dml = +"http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace iddl = +"http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; + +import module namespace idml = +"http://www.zorba-xquery.com/modules/store/static/indexes/dml"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + +declare construction strip; + + +declare collection data:documents as node()*; + +declare variable $data:documents as xs:QName := xs:QName('data:documents'); + + +declare %private %an:automatic %an:unique %an:value-range index data:idx +on nodes dml:collection(xs:QName('data:documents')) +by string(./@key1) as xs:string, + string(./@key2) as xs:string; + +declare variable $data:idx as xs:QName := xs:QName('data:idx'); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,45 @@ +import module namespace d = "www.data.com" at "multi_key_02.xqlib"; + +import module namespace ddl = +"http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + +import module namespace dml = +"http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace iddl = +"http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; + +import module namespace idml = +"http://www.zorba-xquery.com/modules/store/static/indexes/dml"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + + +declare variable $doc11 := +<doc key1="10" key2="5" key3="3"/>; + +declare variable $doc12 := +<doc key1="10" key2="6" key3="5"/>; + +declare variable $doc21 := +<doc key1="20" key2="5" key3="4"/>; + +declare variable $doc22 := +<doc key1="20" key2="5" key3="30"/>; + + +ddl:create($d:documents); + +dml:insert($d:documents, ($doc11, $doc21, $doc12, $doc22)); + +iddl:create($d:idx); + +idml:probe-index-range-value( + $d:idx, + 10, (), true(), false(), false(), false(), + (), (), false(), false(), false(), false(), + 20, (), true(), false(), false(), false()) +, +" +" + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xqlib 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/multi_key_02.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,31 @@ +module namespace data = "www.data.com"; + +import module namespace ddl = +"http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + +import module namespace dml = +"http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +import module namespace iddl = +"http://www.zorba-xquery.com/modules/store/static/indexes/ddl"; + +import module namespace idml = +"http://www.zorba-xquery.com/modules/store/static/indexes/dml"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + +declare construction strip; + + +declare collection data:documents as node()*; + +declare variable $data:documents as xs:QName := xs:QName('data:documents'); + + +declare %private %an:automatic %an:unique %an:value-range index data:idx +on nodes dml:collection(xs:QName('data:documents')) +by xs:integer(./@key1) as xs:integer, + xs:integer(./@key2) as xs:integer, + xs:integer(./@key3) as xs:integer; + +declare variable $data:idx as xs:QName := xs:QName('data:idx'); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/paging.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/index/paging.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/paging.xqlib 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/paging.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -18,6 +18,7 @@ declare %an:nonunique %an:value-range %an:automatic index data:idx-age-range-val on nodes dml:collection(xs:QName("data:people")) by xs:integer(./age/text()) as xs:integer; + declare variable $data:idx-age-range-val := xs:QName("data:idx-age-range-val"); declare %an:sequential function data:init() diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/index/undo1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/index/undo1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/index/undo1.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/index/undo1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -57,7 +57,7 @@ } catch * { - <exception>{$err:code} : {$err:description}</exception> + <exception>{ $err:code } : { $err:description }</exception> } , diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -6,4 +6,5 @@ <json-format value="JsonML-array"/> </options> return json:parse( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -11,4 +11,5 @@ <json-format value="JsonML-array"/> </options> return json:parse( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -15,4 +15,5 @@ <json-format value="JsonML-array"/> </options> return json:parse( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq 2013-01-16 18:28:18.000000000 +0000 @@ -1,27 +1,30 @@ import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; -let $json := '["ul", - ["li", - { "style" : "color:red" }, - "First Item" - ], - ["li", - { - "title" : "Some hover text.", - "style" : "color:green" - }, - "Second Item" - ], - ["li", - ["span", - { "class" : "code-example-third" }, - "Third" +let $json := ' + [ "ul", + [ "li", + { "style" : "color:red" }, + "First Item" ], - " Item" - ] -]' + [ "li", + { + "title" : "Some hover text.", + "style" : "color:green" + }, + "Second Item" + ], + [ "li", + [ "span", + { "class" : "code-example-third" }, + "Third" + ], + " Item" + ] + ]' let $options := <options xmlns="http://www.zorba-xquery.com/modules/converters/json-options"> <json-format value="JsonML-array"/> </options> return json:parse( $json, $options ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq 2013-01-16 18:28:18.000000000 +0000 @@ -64,3 +64,5 @@ <json-format value="JsonML-array"/> </options> return json:parse( $json, $options ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq 2013-01-16 18:28:18.000000000 +0000 @@ -7,4 +7,5 @@ <json-format value="JsonML-array"/> </options> return json:parse( <a/>, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq 2013-01-16 18:28:18.000000000 +0000 @@ -20,4 +20,5 @@ <json-format value="JsonML-array"/> </options> return json:parse( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -7,4 +7,5 @@ <json-format value="JsonML-array"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -10,4 +10,5 @@ <json-format value="JsonML-array"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -7,4 +7,5 @@ <json-format value="JsonML-array"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq 2013-01-16 18:28:18.000000000 +0000 @@ -17,4 +17,5 @@ <whitespace value="indent"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq 2013-01-16 18:28:18.000000000 +0000 @@ -16,4 +16,5 @@ <json-format value="JsonML-array"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq 2013-01-16 18:28:18.000000000 +0000 @@ -17,4 +17,5 @@ <whitespace value="some"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-null-handling.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-null-handling.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-null-handling.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-null-handling.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -(: json:parse testing null handling :) - -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; - -json:parse('{ "web-app": null }') diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-numbers-and-decimals.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-numbers-and-decimals.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-numbers-and-decimals.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-numbers-and-decimals.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -(: json:parse testing numbers and decimals :) - -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; - -json:parse('{ "special-numbers": { - "decimal": 2.89, - "e": 2E+6, - "negative": -1.89 - } - }') diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := '[ true ]' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := '[ false ]' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := '[ null ]' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := '[ 1 ]' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := '[ 1, 2 ]' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq 2013-01-16 18:28:18.000000000 +0000 @@ -3,3 +3,5 @@ import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; json:parse( '[ [ 11, 12 ], [ 21, 22 ] ]' ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,6 @@ import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; -json:parse(<a/>) +json:parse( <a/> ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq 2013-01-16 18:28:18.000000000 +0000 @@ -17,4 +17,5 @@ } ' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-numbers.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,11 @@ +(: json:parse testing numbers :) + +import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; + +json:parse( '{ + "decimal": 2.89, + "e": 2E+6, + "negative": -1.89 +}' ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := '{ "a" : 1 }' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := '{ "a" : 1, "b" : 2 }' return json:parse( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-object-05.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,7 @@ +(: json:parse testing null as a key value :) + +import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; + +json:parse( '{ "a" : null }' ) + +(: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,6 @@ <pair name="html" type="string"><b>bold</b></pair> </json>; -json:parse(json:serialize($json-element)) +json:parse( json:serialize( $json-element ) ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-uncommon-chars.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,7 @@ +(: json:parse with uncommon characters :) + +import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; + +json:parse( '{ "web-app" : "!_\"-\\?*.$+" }' ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-parse-utf8-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ +(: try parsing a Unicode UTF-8 value :) + +import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; + +json:parse( '{ "mdash": "–" }' ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item type="boolean">true</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item type="boolean">false</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item type="null"/> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item type="number">1</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq 2013-01-16 18:28:18.000000000 +0000 @@ -6,4 +6,5 @@ <item type="number">2</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <foo type="boolean">true</foo> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item type="boolean">foo</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item>false</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item type="bool">false</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ hello </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <item type="boolean"><foo/></item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq 2013-01-16 18:28:18.000000000 +0000 @@ -8,4 +8,5 @@ <item type="boolean">true</item> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,4 +2,5 @@ let $json := <!--comment--> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq 2013-01-16 18:28:18.000000000 +0000 @@ -21,4 +21,5 @@ <whitespace value="indent"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <pair name="a" type="nothing">a</pair> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq 2013-01-16 18:28:18.000000000 +0000 @@ -16,4 +16,5 @@ </pair> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <pair name="a" type="number">1</pair> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -6,4 +6,5 @@ <pair name="b" type="number">2</pair> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -4,9 +4,10 @@ let $json := <json type="object"> - <!--comment--> + <!--comment--> <pair name="a" type="number">1</pair> - <!--comment--> + <!--comment--> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq 2013-01-16 18:28:18.000000000 +0000 @@ -3,3 +3,5 @@ declare variable $json-value := '{ "key" : "value" }'; json:serialize( json:parse( $json-value ) ) + +(: vim:se et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq 2013-01-16 18:28:18.000000000 +0000 @@ -21,4 +21,5 @@ <whitespace value="some"/> </options> return json:serialize( $json, $options ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,4 +5,5 @@ <pair name="a">a</pair> </json> return json:serialize( $json ) + (: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-uncommon-chars.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-uncommon-chars.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-uncommon-chars.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-uncommon-chars.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -(: json:parse with uncommon characters :) - -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; - -json:parse('{ "web-app": "!_\"-\\?*.$+" }') diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-utf-8.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-utf-8.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/json/json-snelson-utf-8.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/json/json-snelson-utf-8.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,5 +0,0 @@ -(: try parsing a Unicode UTF-8 value :) - -import module namespace json = "http://www.zorba-xquery.com/modules/converters/json"; - -json:parse('{"mdash": "–"}') diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/coll_dyn_02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -9,7 +9,7 @@ declare variable $coll1 := xs:QName("collection1"); -ddl:create($coll1, (<a/>, { "p1":1, "p2":2 }, {}, [1, 2, 3])); +ddl:create($coll1, (<a/>, { "p1":1, "p2":2 }, {||}, [1, 2, 3])); dml:collection($coll1) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/input1.json zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/input1.json --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/input1.json 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/input1.json 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +{ "foo" : "bar" } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/input2.json zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/input2.json --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/input2.json 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/input2.json 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +{ "foo" : "bar" } { "bar" : "foo" } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/input3.json zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/input3.json --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/input3.json 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/input3.json 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +{ "foo" : "bar" } { "bar" : "foo" diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +jn:json-doc("input1.json") \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +[ jn:json-doc("input1.json")("foo") ] \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://jsoniq.org/errors:JNDY0021 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +jn:json-doc("input2.json") \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_4.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_4.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_4.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_4.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +jn:json-doc(()) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://jsoniq.org/errors:JNDY0021 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/json_doc_5.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +jn:json-doc("input3.json") \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-09.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-09.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-09.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-09.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ +let $json := '[ 1, 2 ]' +let $options := { "jsoniq-strip-top-level-array" : true } +return jn:parse-json( $json, $options ) + +(: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-10.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-10.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-10.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/jsoniq/parse_json-10.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,8 @@ +let $json := '[ 1, 2 ][ 3, 4 ]' +let $options := { + "jsoniq-multiple-top-level-items" : true, + "jsoniq-strip-top-level-array" : true +} +return jn:parse-json( $json, $options ) + +(: vim:set et sw=2 ts=2: :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/modules/mainModule16.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/modules/mainModule16.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/modules/mainModule16.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/modules/mainModule16.xq 2013-01-16 18:28:18.000000000 +0000 @@ -5,6 +5,8 @@ (: Purpose: Error XQST0036 :) (:*******************************************************:) +xquery version "1.0"; + import module namespace math = "http://example.org/math-functions" at "libraryModule12.xqlib"; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/baseuri.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/baseuri.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/baseuri.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/baseuri.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,11 @@ + +declare namespace opt = "http://www.zorba-xquery.com/options/optimizer"; + +declare base-uri "http://x.com/root"; + +declare option opt:enable "for-serialization-only"; + + +let $t0 := <t/> +let $t := <a><b xml:base="b"><c><d xml:base="http://y.com/">{$t0}</d></c></b></a> +for $n in ($t, $t//*) return base-uri ($n) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/eval12.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/eval12.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/eval12.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/eval12.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,39 @@ + +declare namespace opt = "http://www.zorba-xquery.com/options/optimizer"; + +import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; + +declare option opt:enable "for-serialization-only"; + + +declare function local:dummy($n as node()) +{ +}; + + +declare function local:foo($n as node()) as node()* +{ + local:dummy($n), + $n/ancestor::node() +}; + + +declare function local:constr($n as node()) as node()* +{ + local:dummy($n), + <root>{$n}</root> +}; + + +declare variable $doc := +<a> + <b> + <c/> + </b> +</a> +; + + +local:constr($doc) +, +refl:eval("local:foo(local:constr($doc)//c)") diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/eval15.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/eval15.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/eval15.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/eval15.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,43 @@ +import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + + +declare variable $local:account := (); + + +declare function local:get-by-id($id as xs:string) +{ + () +}; + + +declare %an:sequential function local:validate() as xs:boolean +{ + variable $uid := "user"; + + if (true()) + then + let $account := local:get-by-id($uid) + return + if (true()) + then + if (true()) + then + { + $local:account := $account; + true() + } + else () + else () + else () +}; + + +declare function local:index() +{ + () +}; + + +refl:eval("local:index()") diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,19 @@ + + +declare namespace opt = "http://www.zorba-xquery.com/options/optimizer"; + +import module namespace node = "http://www.zorba-xquery.com/modules/node"; + +declare option opt:enable "for-serialization-only"; + + +declare variable $doc := <a xmlns:p1="www.foo1.com"><b><c/></b></a>; + + +let $node := <node xmlns:p2="www.foo2.com">{$doc/b}</node> +let $new-node := node:copy($node/b) +return $new-node//c +, +" +" + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-02.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,22 @@ + + +declare namespace opt = "http://www.zorba-xquery.com/options/optimizer"; + +import module namespace node = "http://www.zorba-xquery.com/modules/node"; + +declare copy-namespaces no-preserve, inherit; + + +declare option opt:enable "for-serialization-only"; + + +declare variable $doc := <a xmlns:p1="www.foo1.com"><b><c/></b></a>; + + +let $node := <node xmlns:p2="www.foo2.com">{$doc/b}</node> +let $new-node := node:copy($node/b) +return $new-node//c +, +" +" + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-03.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/node-copy-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,20 @@ +declare namespace opt = "http://www.zorba-xquery.com/options/optimizer"; + +import module namespace node = "http://www.zorba-xquery.com/modules/node"; + +declare copy-namespaces preserve, no-inherit; + + +declare option opt:enable "for-serialization-only"; + + +declare variable $doc := <a xmlns:p1="www.foo1.com"><b><c/></b></a>; + + +let $node := <node xmlns:p2="www.foo2.com">{$doc/b}</node> +let $new-node := node:copy($node/b) +return $new-node//c +, +" +" + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/q21.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/q21.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/q21.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/q21.xq 2013-01-16 18:28:18.000000000 +0000 @@ -1,19 +1,17 @@ -import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; declare namespace ann = "http://www.zorba-xquery.com/annotations"; -declare variable $serialization-params as element():= -<serialization-parameters/>; +declare variable $glob as element():= <glob/>; -declare %ann:sequential function -local:set-serialization-parameters($params as element()) as empty-sequence() +declare %ann:sequential function +local:set-global-var($param as element()) as empty-sequence() { - $serialization-params := $params; + $glob := $param; }; -declare %ann:sequential function local:set-redirect($url as xs:string) as xs:integer +declare %ann:sequential function local:dummy($url as xs:string) as xs:integer { 1 }; @@ -21,8 +19,8 @@ declare %ann:sequential function local:save() { - variable $tmp := $serialization-params/..; - local:set-redirect("/wiki"); + variable $tmp := $glob/..; + local:dummy("/wiki"); }; @@ -30,57 +28,3 @@ - -(: - -module namespace resp = "http://www.28msec.com/modules/response"; - -declare namespace ann = "http://www.zorba-xquery.com/annotations"; - -declare variable -$resp:serialization-params as element(serialization-parameters) := -resp:serializer-defaults-xml(); - - -declare function -resp:serializer-defaults-xml() as element(serialization-parameters) -{ - <serialization-parameters/> -}; - - -declare %ann:sequential function -resp:set-serialization-parameters($params as element(serialization-parameters)) as -empty-sequence() -{ - $resp:serialization-params := $params; -}; - - -declare %ann:sequential function resp:set-redirect($url as xs:string) as xs:integer -{ - 1 -}; - - ----------------------------------------- - - -import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; - -import module namespace res = "http://www.28msec.com/modules/response" at "q21.xqlib"; - -declare namespace ann = "http://www.zorba-xquery.com/annotations"; - - -declare %ann:sequential function local:save() -{ - variable $tmp := refl:eval-s('"blub"'); - res:set-redirect("/wiki"); -}; - - -local:save() - - -:) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/recursive_01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/recursive_01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/recursive_01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/recursive_01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,35 @@ +declare namespace ann = "http://www.zorba-xquery.com/annotations"; + + +declare namespace opt = "http://www.zorba-xquery.com/options/optimizer"; + +declare option opt:enable "for-serialization-only"; + + +declare function local:collapseNodes($x as node()*) as node()* +{ + for $y in $x + let $n := node-name($y) + group by $n + order by string($n) + return local:collapseNodesSameName(element {$n} {$y}) +}; + + +declare function local:collapseNodesSameName($x as node()) as node()+ +{ + variable $f := $x/*[1]; + variable $c := $x/*/*; + variable $cc := local:collapseNodes($c); + + element { node-name($x/*/..) } { $cc } +}; + + +declare variable $input as element()* := <book>{doc('books.xml')/*/*}</book>; + +local:collapseNodesSameName($input) +, +" + +" diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/test6.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/test6.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/no-copy/test6.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/no-copy/test6.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,24 @@ +declare namespace opt = "http://www.zorba-xquery.com/options/optimizer"; + +declare construction strip; + +import schema namespace s="http://www.zorba-xquery.org/simple" at "simple.xsd"; + +declare option opt:enable "for-serialization-only"; + +declare variable $doc := <s:person><s:name>foo</s:name><s:age>25</s:age></s:person>; + +let $vdoc := validate { $doc } +let $copy := <root>{$vdoc}</root> +return fn:data($copy/s:person) +, +" + +" +, +let $vdoc := validate { $doc } +let $copy := <root>{$vdoc}</root> +return fn:data($copy) + + + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/nodes/path.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/nodes/path.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/nodes/path.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/nodes/path.xq 2013-01-16 18:28:18.000000000 +0000 @@ -7,3 +7,11 @@ $f := $a//@ns:f return ( path($doc), path($b), path($d), path($f) ) + +(: +let + $a := <a><b/><b><c/></b><ns:e/></a>, + $b := $a/b[c] +return + ( path($b) ) +:) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/INF-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/INF-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/INF-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/INF-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +( + xs:float("-INF"), + xs:float("INF"), + xs:double("-INF"), + xs:double("INF") +) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/NaN.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/NaN.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/NaN.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/NaN.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ +( + xs:float("NaN"), + xs:double("NaN") +) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/format-number1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/format-number1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/format-number1.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/format-number1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -1,3 +1 @@ fn:format-number(1, ""), fn:format-number(12, "0") - - diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/format-number2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/format-number2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/format-number2.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/format-number2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -1,3 +1 @@ fn:format-number((), "0") - - diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/infinity0.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/infinity0.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/infinity0.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/infinity0.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -( - xs:float("1000000000000000000000000000000000000000000000000000000"), - xs:float("-100000000000000000000000000000000000000000000000000000"), - xs:float("NaN"), - xs:float("-INF"), - xs:float("INF"), - xs:double("1E200"), - xs:double("1E1000"), - xs:double("-1E1000"), - xs:double("NaN"), - xs:double("INF"), - xs:double("-INF") -) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/numerics/overflow-1.xml.res +Error: http://www.w3.org/2005/xqt-errors:FOAR0002 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +xs:float("1000000000000000000000000000000000000000000000000000000") diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/numerics/overflow-2.xml.res +Error: http://www.w3.org/2005/xqt-errors:FOAR0002 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +xs:float("-100000000000000000000000000000000000000000000000000000") diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/numerics/overflow-3.xml.res +Error: http://www.w3.org/2005/xqt-errors:FOAR0002 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +xs:double("1E1000") diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Result: $RBKT_SRC_DIR/ExpQueryResults/zorba/numerics/overflow-4.xml.res +Error: http://www.w3.org/2005/xqt-errors:FOAR0002 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/numerics/overflow-4.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +xs:double("-1E1000") diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/optim/no_folding_01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/optim/no_folding_01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/optim/no_folding_01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/optim/no_folding_01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,22 @@ + + +declare variable $g := 1; + + +declare function local:boo() +{ + local:foo(0) +}; + + +declare function local:foo($x) as xs:integer +{ + if ($x > 0) + then + local:boo() + else + $g +}; + + +local:boo() diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,22 @@ +import module namespace coll = +"http://www.28msec.com/rbkt/collections" at "pos_pred14.xqlib"; + +import module namespace ddl = +"http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + +import module namespace dml = +"http://www.zorba-xquery.com/modules/store/static/collections/dml"; + +ddl:create($coll:data); + +dml:insert-nodes($coll:data, <a>b</a> ); + +let $entries := dml:collection($coll:data) +let $num_entries := fn:count($entries) +return + if($num_entries = 0) + then + <empty/> + else + for $entry in $entries[position() gt -4] + return $entry diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xqlib 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/optim/pos_pred14.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ + +module namespace coll = "http://www.28msec.com/rbkt/collections"; + +declare variable $coll:data := xs:QName("coll:data"); + +declare collection coll:data as node()*; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,28 @@ +(: + Test for improved error messages logic: + the error message contains the "missing comma?" hint +:) + +import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; +declare namespace err="http://www.w3.org/2005/xqt-errors"; + +try +{ + +refl:eval( +'for $test in (1 to 10) +return if(true()) then { + true(); + 1 +} else { + +} + +true()' +) + +} +catch err:XPST0003 +{ + $err:description eq 'invalid expression: syntax error, unexpected expression (missing comma "," between expressions?)' +} diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-02.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,67 @@ +(: + Test for improved error messages logic: + the error message should not contain the "missing comma?" hint +:) + +import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; +declare namespace err="http://www.w3.org/2005/xqt-errors"; + +try +{ + +refl:eval( +'declare namespace an = "http://www.zorba-xquery.com/annotations"; + + declare %an:sequential function local:image( + $id as xs:string, $width as xs:int*, + $height as xs:int*, $ratio as xs:decimal*, $format as xs:string) as xs:base64Binary + { + variable $obj := null; + + if (fn:empty($obj)) then + () + else + { + variable $svg := $obj("svg"); + if (fn:not(jn:is-null($obj("size")("width")))) then + { + variable $svg-width := $obj("size")("width"); + variable $svg-height := $obj("size")("height"); + + if ($width) then + { + $svg-height := xs:int(($svg-height div $svg-width) * $width); + $svg-width := $width; + } + else if ($height) then + { + $svg-width := xs:int(($svg-width div $svg-height) * $height); + $svg-height := $height; + } + else if ($ratio) then + { + $svg-width := xs:int($svg-width * $ratio); + $svg-height := xs:int($svg-height * $ratio); + } + else + {} + + $svg := <a>{$svg}</a>/*; + + replace value of node $svg/@height width xs:string($svg-height) || "px"; + } + else + { + } + } + + }; + +()' +) + +} +catch err:XPST0003 +{ + $err:description eq 'invalid expression: syntax error, unexpected qualified name "width", expecting "with"' +} diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-03.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,27 @@ +(: + Test for improved error messages logic: + the error message should not contain the "missing comma?" hint +:) + +import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; +declare namespace err="http://www.w3.org/2005/xqt-errors"; + +try +{ + +refl:eval( +'variable $x := <a b="c"/>; + +declare function local:test($a) +{ + $a +}; + +local:test($x)' +) + +} +catch err:XPST0003 +{ + $err:description eq 'invalid expression: syntax error, unexpected "function", expecting "end of file" or "," or "}"' +} diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.spec 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.spec 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -Error: http://www.w3.org/2005/xqt-errors:XPST0003 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-comma.xq 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -for $test in (1 to 10) -return if(true()) then { - true(); - 1 -} else { - -} - -true() \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-semicolon-05.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-semicolon-05.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-semicolon-05.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/missing-semicolon-05.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,34 @@ +(: + Test for improved error messages logic: + the error message contains the "missing semicolon?" hint +:) + +import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; +declare namespace err="http://www.w3.org/2005/xqt-errors"; + +try +{ + +refl:eval( +'declare namespace an = "http://www.zorba-xquery.com/annotations"; + +declare %an:sequential function local:func($a, $b) { + if ($a) then { + (); + } else { + if ($b) then { + (); + local:func(false(), false()) (: forgot semicolon :) + local:func(true(), false()); + } else { + (); + } + } +};' +) + +} +catch err:XPST0003 +{ + $err:description eq 'invalid expression: syntax error, unexpected statement (missing semicolon ";" between statements?)' +} diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/unexpected-qname-03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/unexpected-qname-03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/unexpected-qname-03.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/parser/syntax-errors/unexpected-qname-03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,20 @@ +(: + Syntax error with an improved error message: + unexpected qualified name %actual_qname% +:) + +import module namespace refl = "http://www.zorba-xquery.com/modules/reflection"; +declare namespace err="http://www.w3.org/2005/xqt-errors"; + +let $query := +'local:f bad()' + +return +try +{ + refl:eval($query) +} +catch err:XPST0003 +{ + $err:description eq 'invalid expression: syntax error, unexpected qualified name "bad", expecting "end of file" or "," or "}"' +} diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/paths/following_01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/paths/following_01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/paths/following_01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/paths/following_01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ + +(<a><b>X<e>Y</e></b>Z</a>//text())[1]/following::text() diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/paths/preceding_pred_01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/paths/preceding_pred_01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/paths/preceding_pred_01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/paths/preceding_pred_01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ + +<a><b>B</b><c/></a>/c/preceding::node()[1] + + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZAPI0080 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,14 @@ +import module namespace id = "http://www.zorba-xquery.com/modules/reference"; + +variable $node := { "foo" : "bar" }; + +variable $before-currentid:=id:reference($node); +variable $got:=id:reference($node); +variable $after:=id:reference($node); + +<result> +<before>{fn:string-length($before-currentid)}</before> +<after>{fn:string-length($got)}</after> +<stable>{$got eq $after}</stable> +</result> + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace id = "http://www.zorba-xquery.com/modules/reference"; + +id:dereference(xs:anyURI("this:is-not-a-reference")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_3.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,15 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml"; + +import module namespace ref = "http://www.zorba-xquery.com/modules/reference"; + +declare namespace ann = "http://www.zorba-xquery.com/annotations"; + +declare %ann:sequential function local:test() +{ + ddl:create(xs:QName("local:coll")); + dml:insert-last(xs:QName("local:coll"), { "foo" : "bar" }); + ref:dereference(ref:reference(dml:collection(xs:QName("local:coll")))) +}; + +local:test() diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_4.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_4.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_4.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_4.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,21 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml"; +import module namespace ns = "http://example.org/datamodule/" at "collections.xqdata"; + +import module namespace ref = "http://www.zorba-xquery.com/modules/reference"; + +declare namespace ann = "http://www.zorba-xquery.com/annotations"; + +declare %ann:sequential function local:test() +{ + ddl:create(xs:QName("ns:coll")); + dml:insert-last(xs:QName("ns:coll"), { "foo" : "bar" }); + variable $node := dml:collection(xs:QName("ns:coll")); + variable $has1 := ref:has-reference($node); + variable $ref := ref:reference($node); + variable $has2 := ref:has-reference($node); + ($has1, $has2) +}; + +local:test() + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_5.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_5.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/json-reference_5.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/json-reference_5.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,16 @@ +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +import module namespace dml = "http://www.zorba-xquery.com/modules/store/dynamic/collections/dml"; + +import module namespace ref = "http://www.zorba-xquery.com/modules/reference"; + +declare namespace ann = "http://www.zorba-xquery.com/annotations"; + +declare %ann:sequential function local:test() +{ + ddl:create(xs:QName("local:coll")); + dml:insert-last(xs:QName("local:coll"), [ 1 ]); + ref:dereference(ref:reference(dml:collection(xs:QName("local:coll")))) +}; + +local:test() + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/reference_5.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/reference_5.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/reference/reference_5.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/reference/reference_5.xq 2013-01-16 18:28:18.000000000 +0000 @@ -8,22 +8,35 @@ <result> -<temporary-variable-in-scope>{let $temp:=<root>temp</root> return id:node-by-reference(id:node-reference($temp))}</temporary-variable-in-scope> -<temporary-variable-in-scope>{ -let $temp:=<root>temp</root> -return -let $ref:=id:node-reference($temp) -return -id:node-by-reference($ref) -}</temporary-variable-in-scope> -<temporary-variable-in-scope>{ -for $i in (1 to 3) -let $temp:=<root>temp</root> -let $ref:=id:node-reference($temp) -return -id:node-by-reference($ref) -}</temporary-variable-in-scope> -<temporary-variable-in-scope>{let $temp:=<root>temp</root> return id:node-by-reference(id:node-reference($temp))}</temporary-variable-in-scope> +<temporary-variable-in-scope> +{ + let $temp:=<root>temp</root> return id:node-by-reference(id:node-reference($temp)) +} +</temporary-variable-in-scope> + +<temporary-variable-in-scope> +{ + let $temp:=<root>temp</root> + return + let $ref:=id:node-reference($temp) + return id:node-by-reference($ref) +} +</temporary-variable-in-scope> + +<temporary-variable-in-scope> +{ + for $i in (1 to 3) + let $temp := <root>temp</root> + let $ref := id:node-reference($temp) + return id:node-by-reference($ref) +} +</temporary-variable-in-scope> + +<temporary-variable-in-scope> +{ + let $temp:=<root>temp</root> return id:node-by-reference(id:node-reference($temp)) +} +</temporary-variable-in-scope> </result> diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/scripting/flwor10.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/scripting/flwor10.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/scripting/flwor10.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/scripting/flwor10.xq 2013-01-16 18:28:18.000000000 +0000 @@ -3,5 +3,5 @@ variable $x := 0; for $i in (1, 2, 3) -let $y := { $x := $x + $i; } +let $y := { $x := $x + $i; () } return $x diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/scripting/flwor11.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/scripting/flwor11.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/scripting/flwor11.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/scripting/flwor11.xq 2013-01-16 18:28:18.000000000 +0000 @@ -2,6 +2,6 @@ variable $x := 0; -let $y := { $x := $x + 1; } +let $y := { $x := $x + 1; () } for $i in (1, 2, 3) return $x + $i diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/udf/udf-fib-rec2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/udf/udf-fib-rec2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/udf/udf-fib-rec2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/udf/udf-fib-rec2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,8 @@ +declare function local:fib($n as xs:integer) as xs:integer +{ + if ($n eq 0) then 0 + else if ($n eq 1) then 1 + else local:fib($n - 1) + local:fib($n - 2) +}; + +local:fib(10) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Options: {http://www.zorba-xquery.com/options/features}disable=http-uri-resolution +Error: http://www.w3.org/2005/xqt-errors:XQST0059 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ +import module namespace slow = "http://www.zorba-xquery.com/test/uris/slow" + at "slow.xqlib"; + +slow:ok() diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Options: {http://www.zorba-xquery.com/options/features}disable=http-uri-resolution diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +(: Ensure that disabling HTTP URI resolution doesn't defeat fn:doc(). :) +fn:doc("http://zorbatest.lambda.nu:8080/cgi-bin/test-xml?querystring")/body/query diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZXQP0061 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http-5.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,8 @@ +(: Cannot specify this option inside query, unfortunately, since options :) +(: must come after imports. :) +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare option op:disable "http-uri-resolution"; + +1 + + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Options: {http://www.zorba-xquery.com/options/features}disable=http-uri-resolution +Error: http://www.w3.org/2005/xqt-errors:XQST0059 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/disable-http.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/disable-http.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ +(: For various reasons, importing a bad schema via HTTP can take :) +(: minutes to complete. This test should time out unless the :) +(: http-uri-resolution feature is disabled. :) +import schema "http://www.w3.org/"; +1 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/slow.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/slow.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/uris/slow.xqlib 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/uris/slow.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,11 @@ +(: For various reasons, importing a bad schema via HTTP can take :) +(: minutes to complete. A test importing this module should time out :) +(: unless the http-uri-resolution feature is disabled. :) +module namespace slow = "http://www.zorba-xquery.com/test/uris/slow"; + +import schema "http://www.w3.org/"; + +declare function slow:ok() as xs:string +{ + "OK" +}; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/windowing/q4.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/windowing/q4.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/windowing/q4.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/windowing/q4.xq 2013-01-16 18:28:18.000000000 +0000 @@ -4,8 +4,8 @@ for sliding window $w in $timesequence/stream/event start $s_curr at $s_pos previous $s_prev - when ($s_curr/@time ne $s_prev/@time) or (empty($s_prev)) + when ($s_curr/@time ne $s_prev/@time) or (empty($s_prev)) only end next $e_next - when $e_next/@time - $s_curr/@time gt $MAX_DIFF + when $e_next/@time - $s_curr/@time gt $MAX_DIFF return avg( $w/@temp ) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xmark/q19.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xmark/q19.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xmark/q19.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xmark/q19.xq 2013-01-16 18:28:18.000000000 +0000 @@ -1,7 +1,9 @@ declare variable $input-context external; -let $auction := doc($input-context) return -for $b in $auction/site/regions//item -let $k := $b/name/text() -stable order by zero-or-one($b/location) ascending empty greatest -return <item name="{$k}">{$b/location/text()}</item> + +let $auction := doc($input-context) +return + for $b in $auction/site/regions//item + let $k := $b/name/text() + stable order by zero-or-one($b/location) ascending empty greatest + return <item name="{$k}">{$b/location/text()}</item> diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic1.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -22,8 +22,13 @@ { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} + { + { $i/name }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } }, { <newline> a diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic2.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -22,8 +22,13 @@ { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} + { + { $i/name }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } }, { <newline> a diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic3.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -11,25 +11,35 @@ { <newline> </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return $i/name -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { $i/name }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { dml:collection($xqddf-test:white-collection)/name } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic4.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic4.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic4.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/dic4.xq 2013-01-16 18:28:18.000000000 +0000 @@ -10,29 +10,40 @@ { <newline> </newline> -}, - +} +, { -for $i in fn:doc("auction.xml")//item -return $i/name -}, + for $i in fn:doc("auction.xml")//item + return $i/name +} +, { <newline> a </newline> -}, +} +, { -for $i in fn:doc("auction.xml")//item -return - {{$i/name}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + for $i in fn:doc("auction.xml")//item + return + { + { $i/name }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { -dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]); -}, + dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]); + () +} +, { -dml:collection($xqddf-test:white-collection)/name + dml:collection($xqddf-test:white-collection)/name } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic1.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -10,25 +10,35 @@ { <newline> </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return fn:string(($i/description/parlist/listitem/text)[1]) -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{fn:string(($i/description/parlist/listitem/text)[1])}, - { dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { fn:string(($i/description/parlist/listitem/text)[1]) }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { dml:collection($xqddf-test:white-collection)/description/parlist/listitem/text } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic2.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -10,25 +10,35 @@ { <newline> </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return $i/name -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { $i/name }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { dml:collection($xqddf-test:white-collection)/name } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic3.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -11,33 +11,45 @@ { <newline> </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return fn:string(($i/description/parlist/listitem/text)[1]) -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return $i/name -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { $i/name }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { dml:collection($xqddf-test:white-collection)/description/parlist/listitem/text } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic4.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic4.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic4.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/eic4.xq 2013-01-16 18:28:18.000000000 +0000 @@ -10,28 +10,40 @@ { <newline> </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return fn:string(($i/description/parlist/listitem/text)[1]) -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{fn:string(($i/description/parlist/listitem/text)[1])}, - { dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { fn:string(($i/description/parlist/listitem/text)[1]) }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]); -}, +() +} +, { <newline> a </newline> -}, +} +, { dml:collection($xqddf-test:white-collection)/description/parlist/listitem/text } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/i6.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/i6.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/i6.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/i6.xq 2013-01-16 18:28:18.000000000 +0000 @@ -12,31 +12,37 @@ for $i in fn:doc("auction.xml")//item return - dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi)); + dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); index_dml:refresh-index($xqddf-test:index2); + (:xqddf:collection($xqddf-test:white-collection);:) + { <newline> </newline> -}, - +} +, { index_dml:probe-index-point-value($xqddf-test:index1, "United States")[@id="item0"]/name -}, - +} +, { index_dml:probe-index-range-value($xqddf-test:index2, 1, 3, fn:true(), fn:true(), fn:true(), fn:false())[@id="item2"] -}, +} +, { rename node dml:collection($xqddf-test:white-collection)[@id="item0"]/location as "location2"; -}, +() +} +, { <newline> a </newline> -}, - +} +, { index_dml:probe-index-point-value($xqddf-test:index1, "United States")[@id="item1"]/name } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric1.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -20,18 +20,29 @@ { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { $i/name }, + { dml:insert-nodes($xqddf-test:blue-collection, + (copy $copyi := $i modify () return $copyi)); + () + }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { dml:collection($xqddf-test:white-collection)/name } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric2.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -11,30 +11,46 @@ { <newline> </newline> -}, - +} +, { -for $i in fn:doc("auction.xml")//item -return $i/name; -}, + for $i in fn:doc("auction.xml")//item + return $i/name; + () +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { $i/name }, + { dml:insert-nodes($xqddf-test:blue-collection, + (copy $copyi := $i modify () return $copyi)); + () + }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { dml:delete-nodes(dml:collection($xqddf-test:blue-collection)[1]); -}, +() +} +, { dml:collection($xqddf-test:white-collection)/name; +() } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric3.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -20,6 +20,7 @@ { for $i in fn:doc("auction.xml")//item return $i/name; + () }, @@ -32,14 +33,17 @@ { for $i in fn:doc("auction.xml")//item return - - { - { $i/name }, - { dml:insert-nodes($xqddf-test:blue-collection, - (copy $copyi := $i modify () return $copyi)); }, - { dml:insert-nodes($xqddf-test:white-collection, - (copy $copyi := $i modify () return $copyi)); } + { + { $i/name }, + { dml:insert-nodes($xqddf-test:blue-collection, + (copy $copyi := $i modify () return $copyi)); + () + }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () } + } }, @@ -52,9 +56,11 @@ { replace value of node dml:collection($xqddf-test:blue-collection)[1]/name with "replaced name"; + () }, { dml:collection($xqddf-test:white-collection)/name; + () } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric4.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric4.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric4.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric4.xq 2013-01-16 18:28:18.000000000 +0000 @@ -14,8 +14,8 @@ }, { -for $i in fn:doc("auction.xml")//item -return $i/name + for $i in fn:doc("auction.xml")//item + return $i/name }, { @@ -26,9 +26,17 @@ { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} + { + { $i/name }, + { dml:insert-nodes($xqddf-test:blue-collection, + (copy $copyi := $i modify () return $copyi)); + () + }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } }, { @@ -41,6 +49,7 @@ replace value of node dml:collection($xqddf-test:blue-collection)[1]/name with "gaze wages proving english "; +() }, { diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric5.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric5.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric5.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric5.xq 2013-01-16 18:28:18.000000000 +0000 @@ -11,30 +11,44 @@ { <newline> </newline> -}, - +} +, { for $i in fn:doc("auction.xml")//item return $i/name -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { $i/name }, + { dml:insert-nodes($xqddf-test:blue-collection, + (copy $copyi := $i modify () return $copyi)); + () + }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, { <newline> a </newline> -}, +} +, { dml:delete-nodes(dml:collection($xqddf-test:white-collection)[1]); -}, +() +} +, { dml:collection($xqddf-test:white-collection)/name } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/ric6.xq 2013-01-16 18:28:18.000000000 +0000 @@ -16,27 +16,48 @@ { for $i in fn:doc("auction.xml")//item return $i/name -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} -}, + { + { $i/name } + , + { dml:insert-nodes($xqddf-test:blue-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + , + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } +} +, +{ +try { -try{ - (dml:insert-nodes($xqddf-test:blue-collection, (fn:doc("auction.xml")//item)[@id="item0"]), - dml:delete-nodes(dml:collection($xqddf-test:blue-collection)[@id="item0"])); + { + (dml:insert-nodes($xqddf-test:blue-collection, + (fn:doc("auction.xml")//item)[@id="item0"]), + + dml:delete-nodes(dml:collection($xqddf-test:blue-collection)[@id="item0"])); + () + } } -catch * { " -cannot delete first item in blue collection"; +catch * +{ " +cannot delete first item in blue collection" } -}, +} +, { <newline> a </newline> diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo1.xq 2013-01-16 18:28:18.000000000 +0000 @@ -16,17 +16,27 @@ { for $i in fn:doc("auction.xml")//item return $i/name -}, +} +, { <newline> a </newline> -}, +} +, { for $i in fn:doc("auction.xml")//item return - {{$i/name}, - {dml:insert-nodes($xqddf-test:blue-collection, (copy $copyi := $i modify () return $copyi));}, - {dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi));}} + { + { $i/name }, + { dml:insert-nodes($xqddf-test:blue-collection, + (copy $copyi := $i modify () return $copyi)); + () + }, + { dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); + () + } + } }, { try @@ -40,20 +50,24 @@ catch * { " cannot delete first item in blue collection" } -}, +} +, { <newline> a </newline> -}, +} +, { for $x in dml:collection($xqddf-test:white-collection) order by number(substring-after($x/@id, "item")) return $x/name -}, +} +, { <newline> a </newline> -}, +} +, { for $x in dml:collection($xqddf-test:blue-collection) order by number(substring-after($x/@id, "item")) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo2.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/daniel/undo2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -9,43 +9,49 @@ { <newline> </newline> -}, - +} +, { for $i in fn:doc("auction.xml")//item return - dml:insert-nodes($xqddf-test:white-collection, (copy $copyi := $i modify () return $copyi)); + dml:insert-nodes($xqddf-test:white-collection, + (copy $copyi := $i modify () return $copyi)); index_ddl:create($xqddf-test:index1); -}, +() +} +, { dml:insert-nodes($xqddf-test:white-collection, <item><location>Earth3</location></item>); -}, - +() +} +, { index_dml:probe-index-point-value($xqddf-test:index1, "Earth3")[1] -}, - +} +, { try { { - dml:insert-nodes($xqddf-test:white-collection, <item><location>Earth</location></item>); + dml:insert-nodes($xqddf-test:white-collection, + <item><location>Earth</location></item>); dml:insert-nodes($xqddf-test:white-collection, ""); () } } catch * { " cannot insert empty item in white collection"} -}, - +} +, { <newline> a </newline> -}, - +} +, { index_dml:probe-index-point-value($xqddf-test:index1, "Earth")[1]; +() } diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_01.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_01.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_01.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_01.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDST0027 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +import module namespace error = "http://www.example.com/error" at "error_01.xqlib"; + +declare namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + + +ddl:create($error:collection); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xqlib 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_01.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,17 @@ + +module namespace error = "http://www.example.com/error"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + + +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + + +declare collection error:collection as node()*; + +declare variable $error:coll := xs:QName("error:collection"); + + +declare %an:automatic %an:value-equality index error:index +on nodes dml:collection(xs:QName("error:collection")) +by string(@id); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_02.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_02.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_02.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_02.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDST0027 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +import module namespace error = "http://www.example.com/error" at "error_02.xqlib"; + +declare namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + + +ddl:create($error:collection); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xqlib 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_02.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,16 @@ +module namespace error = "http://www.example.com/error"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + + +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + + +declare collection error:collection as node()*; + +declare variable $error:coll := xs:QName("error:collection"); + + +declare %an:automatic %an:value-range index error:index +on nodes dml:collection(xs:QName("error:collection")) +by xs:hexBinary(@id) as xs:hexBinary; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_03.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_03.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_03.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_03.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/errors:ZDST0027 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +import module namespace error = "http://www.example.com/error" at "error_03.xqlib"; + +declare namespace ddl = "http://www.zorba-xquery.com/modules/store/static/collections/ddl"; + + +ddl:create($error:collection); diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xqlib zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xqlib --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xqlib 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqddf/error_03.xqlib 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,16 @@ +module namespace error = "http://www.example.com/error"; + +declare namespace an = "http://www.zorba-xquery.com/annotations"; + + +import module namespace dml = "http://www.zorba-xquery.com/modules/store/static/collections/dml"; + + +declare collection error:collection as node()*; + +declare variable $error:coll := xs:QName("error:collection"); + + +declare %an:automatic %an:value-equality index error:index +on nodes dml:collection(xs:QName("error:collection")) +by @id as xs:untypedAtomic; diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq 2013-01-16 18:28:18.000000000 +0000 @@ -18,6 +18,7 @@ :) declare variable $ZorbaManifestPath as xs:string external; + declare %private %ann:nondeterministic function local:load-manifest() { try @@ -30,6 +31,7 @@ } }; + (:~ : This function generates the XQDoc XML for all correctly configured in Zorba : (in other words all modules present in ZorbaManifest.xml) and checks if the modules are correctly documented. @@ -70,16 +72,21 @@ local:test-functions($xqdoc), local:test-variables($xqdoc) ),"") - } catch * { - fn:concat("ERROR: ", $err:code, " Message: ", $err:description, " + } + catch * + { + fn:concat("ERROR: ", $err:code, + " Message: ", $err:description, + " Line: ", $err:line-number, " processing module: ", $moduleURI) } - }; + }; - fn:string-join($res,"") - } + fn:string-join($res,"") + } }; + declare function local:test-module($xqdoc as element(xqdoc:xqdoc)) as xs:string? { let $module := $xqdoc/xqdoc:module/xqdoc:comment @@ -119,9 +126,11 @@ ),"") }; + declare function local:test-functions( $xqdoc as element(xqdoc:xqdoc) -)as xs:string? { +)as xs:string? +{ let $module := $xqdoc/xqdoc:module return string-join(for $function in $xqdoc/xqdoc:functions/xqdoc:function @@ -129,6 +138,7 @@ return local:test-function($module, $function),"") }; + declare function local:test-function( $module as element(xqdoc:module), $function as element(xqdoc:function) @@ -182,9 +192,11 @@ ),"") }; + declare function local:test-variables( $xqdoc as element(xqdoc:xqdoc) -) as xs:string? { +) as xs:string? +{ let $module := $xqdoc/xqdoc:module let $moduleUri := $module/xqdoc:uri return @@ -192,10 +204,12 @@ return local:test-variable($module, $variable),"") }; + declare function local:test-variable( $module as element(xqdoc:module), $variable as element(xqdoc:variable) -) as xs:string? { +) as xs:string? +{ let $hasDescr := exists($variable/xqdoc:comment/xqdoc:description) return (: Test for variable description :) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/bind-context-item.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/bind-context-item.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/bind-context-item.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/bind-context-item.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module("insert node <child>Content</child> into /parent"); +variable $xml := doc("context-item.xml"); +xqxq:bind-context-item($query-key, $xml); +xqxq:is-bound-context-item($query-key) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/bind-variable.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/bind-variable.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/bind-variable.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/bind-variable.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; +variable $query-key := xqxq:prepare-main-module('declare variable $a external; $a'); +xqxq:bind-variable($query-key,xs:QName('a'),"foo"); +xqxq:is-bound-variable($query-key, xs:QName('a')) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/context-item.xml zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/context-item.xml --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/context-item.xml 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/context-item.xml 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +<parent></parent> \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/delete.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/delete.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/delete.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/delete.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/xqxq:NoQueryMatch \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/delete.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/delete.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/delete.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/delete.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module("1+1"); +xqxq:delete-query($query-key); +xqxq:evaluate($query-key) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,2 @@ +Error: http://www.w3.org/2005/xqt-errors:XQST0033 + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/error-in-query.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,21 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +declare namespace op = 'http://www.zorba-xquery.com/options/features'; +declare namespace f = 'http://www.zorba-xquery.com/features'; +declare option op:enable 'f:hof'; + +declare function local:url-resolver($namespace as xs:string, $entity as xs:string) { +switch($entity) +case 'schema' + return switch($namespace) + case 'http://www.w3.org/XQueryTest' return doc('/tmp/atomic.xsd') + default return () +default return () +}; + +variable $queryID := xqxq:prepare-main-module( + "declare namespace foo='http://test'; + declare namespace foo='http://test'; + 1", + local:url-resolver#2, ()); +xqxq:evaluate($queryID) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,17 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module(' +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +declare namespace an = "http://www.zorba-xquery.com/annotations"; +declare %an:sequential function local:foo() { + ddl:create(xs:QName("hola"),(<a/>,<b/>)); + + exit returning true(); +}; + +local:foo() +'); +variable $xml := doc("context-item.xml"); +xqxq:bind-context-item($query-key, $xml); +xqxq:evaluate-sequential($query-key) + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/xqxq:QueryIsUpdating \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-sequential2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module("insert node <child>Content</child> into /parent"); +variable $xml := doc("context-item.xml"); +xqxq:bind-context-item($query-key, $xml); +xqxq:evaluate-sequential($query-key) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,7 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module("insert node <child>Content</child> into /parent"); +variable $xml := doc("context-item.xml"); +xqxq:bind-context-item($query-key, $xml); +xqxq:evaluate-updating($query-key); +$xml \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/xqxq:QueryIsSequential \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate-updating2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,15 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module(' +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +declare namespace an = "http://www.zorba-xquery.com/annotations"; +declare %an:sequential function local:foo() { + ddl:create(xs:QName("hola"),(<a/>,<b/>)); + + exit returning (); +}; + +local:foo() +'); +xqxq:evaluate-updating($query-key); + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,5 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module("1+1"); +variable $a := xqxq:evaluate($query-key); +$a diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,6 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module("declare variable $a external; $a+1"); +xqxq:bind-variable($query-key, xs:QName("a"), 1); +variable $b := xqxq:evaluate($query-key); +$b diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/xqxq:QueryIsSequential \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/evaluate3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,15 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module(' +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +declare namespace an = "http://www.zorba-xquery.com/annotations"; +declare %an:sequential function local:foo() { + ddl:create(xs:QName("hola"),(<a/>,<b/>)); + + exit returning (); +}; + +local:foo() +'); +variable $a := xqxq:evaluate($query-key); +$a diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/external-module.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/external-module.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/external-module.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/external-module.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,8 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module(' + import module namespace r = "http://www.zorba-xquery.com/modules/random"; + + count((for $i in 1 to 10 return r:random(10), r:random())) eq 101 + '); +xqxq:evaluate($query-key) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/get-external-variables.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/get-external-variables.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/get-external-variables.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/get-external-variables.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; +variable $query-key2 := xqxq:prepare-main-module('declare variable $c external; $c'); +variable $query-key := xqxq:prepare-main-module('declare variable $a external;declare variable $d := "hi"; $a'); +xqxq:external-variables($query-key) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-context-item.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-context-item.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-context-item.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-context-item.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,4 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key := xqxq:prepare-main-module("insert node <child/> into /parent"); +xqxq:is-bound-context-item($query-key) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,10 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; +variable $query-key := xqxq:prepare-main-module(' + declare variable $a external; + declare variable $b external := 2; + declare variable $c external; + $a'); +xqxq:bind-variable($query-key, xs:QName('a'), "foo"); +xqxq:is-bound-variable($query-key, xs:QName('a')), +xqxq:is-bound-variable($query-key, xs:QName('b')), +xqxq:is-bound-variable($query-key, xs:QName('c')) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.zorba-xquery.com/modules/xqxq:UndeclaredVariable \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-bound-variable2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,7 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; +variable $query-key := xqxq:prepare-main-module(' + declare variable $a external; + declare variable $b external := 2; + declare variable $c external; + $a'); +xqxq:is-bound-variable($query-key, xs:QName('x')) \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-sequential.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-sequential.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-sequential.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-sequential.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,18 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key1 := xqxq:prepare-main-module(' +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +declare namespace an = "http://www.zorba-xquery.com/annotations"; +declare %an:sequential function local:foo() { + ddl:create(xs:QName("hola"),(<a/>,<b/>)); + + exit returning (); +}; + +local:foo() +'); +variable $query-key2 := xqxq:prepare-main-module("insert node <child/> into /parent"); +variable $is-sequential := xqxq:is-sequential($query-key1); +variable $is-not-sequential := xqxq:is-sequential($query-key2); +$is-sequential, $is-not-sequential + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-updating.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-updating.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/is-updating.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/is-updating.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,20 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key1 := xqxq:prepare-main-module(' +import module namespace ddl = "http://www.zorba-xquery.com/modules/store/dynamic/collections/ddl"; +declare namespace an = "http://www.zorba-xquery.com/annotations"; +declare %an:sequential function local:foo() { + ddl:create(xs:QName("hola"),(<a/>,<b/>)); + + exit returning (); +}; + +local:foo() +'); +variable $query-key2 := xqxq:prepare-main-module("insert node <child/> into /parent"); +variable $is-updating := xqxq:is-updating($query-key2); +variable $is-not-updating := xqxq:is-updating($query-key1); +xqxq:delete-query($query-key1); +xqxq:delete-query($query-key2); +$is-updating, $is-not-updating + diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/multiple-queries.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/multiple-queries.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/multiple-queries.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/multiple-queries.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,9 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +variable $query-key1 := xqxq:prepare-main-module("1+1"); +variable $query-key2 := xqxq:prepare-main-module("1+2"); +variable $a := xqxq:evaluate($query-key1); +variable $b := xqxq:evaluate($query-key2); +xqxq:delete-query($query-key1); +xqxq:delete-query($query-key2); +$a, $b diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.spec zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.spec --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.spec 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.spec 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +Error: http://www.w3.org/2005/xqt-errors:XPST0003 diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/prepare-library-module.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,3 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +xqxq:prepare-library-module('module namespace foo = "foo:bar"; declare function foo:bar() { 1 }') diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/test.xml zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/test.xml --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/test.xml 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/test.xml 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1 @@ +<test:test xmlns:test="http://test"><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test> \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/test.xsd zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/test.xsd --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/test.xsd 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/test.xsd 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + targetNamespace="http://test" + xmlns="http://test" + elementFormDefault="qualified"> + <xs:element name="test"> + <xs:complexType> + <xs:sequence> + <xs:element name="subtest" type="xs:string"/> + <xs:element name="subtest2" type="xs:string"/> + </xs:sequence> + </xs:complexType> + </xs:element> +</xs:schema> \ No newline at end of file diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,27 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; +declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper'; +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare namespace f = "http://www.zorba-xquery.com/features"; +declare option op:enable "f:hof"; + +declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) { + if($namespace = 'http://foo') + then "module namespace test = 'http://test'; declare function test:foo(){'foo'};" + else () +}; + +declare function mapper:uri-mapper($namespace as xs:string, $entity as xs:string) +{ + if($namespace = 'http://test') + then 'http://foo' + else () +}; + +variable $queryID := xqxq:prepare-main-module +( + "import module namespace test = 'http://test'; test:foo()", + resolver:url-resolver#2, mapper:uri-mapper#2 +); +xqxq:evaluate($queryID) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/uri-mapper2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,22 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; +declare namespace mapper = 'http://www.zorba-xquery.com/modules/xqxq/uri-mapper'; +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare namespace f = "http://www.zorba-xquery.com/features"; +declare option op:enable "f:hof"; + +declare function mapper:uri-mapper($namespace as xs:string, $entity as xs:string) +{ + if ($namespace = 'http://test' and $entity = 'schema') + then resolve-uri('test.xsd') + else () +}; + +variable $queryID := xqxq:prepare-main-module +( + "import schema namespace test = 'http://test'; validate{<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}", + (), + mapper:uri-mapper#2 +); +xqxq:evaluate($queryID) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-module-resolver.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-module-resolver.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-module-resolver.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-module-resolver.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,17 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare namespace f = "http://www.zorba-xquery.com/features"; +declare option op:enable "f:hof"; + +declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) { + if($namespace = 'http://test.xq') + then "module namespace test = 'http://test'; declare function test:foo(){'foo'};" + else () +}; + +variable $queryID := xqxq:prepare-main-module( + "import module namespace test = 'http://test'; test:foo()", + resolver:url-resolver#2, ()); +xqxq:evaluate($queryID) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,20 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; + +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare namespace f = "http://www.zorba-xquery.com/features"; +declare option op:enable "f:hof"; + +declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) { + if($namespace = 'http://test' and $entity = 'schema') + then + doc('test.xsd') + else + () +}; + +variable $queryID := xqxq:prepare-main-module( + "import schema namespace test = 'http://test'; validate {<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}", + resolver:url-resolver#2, ()); +xqxq:evaluate($queryID) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver2.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver2.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver2.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver2.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,29 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +import module namespace ddl = + "http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/ddl"; +import module namespace dml = + "http://www.zorba-xquery.com/modules/store/dynamic/collections/w3c/dml"; + +declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare namespace f = "http://www.zorba-xquery.com/features"; +declare option op:enable "f:hof"; + +declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) { + if ($entity = 'schema') + then + dml:collection("http://www.zorba-xquery.com/modules/xqxq")//xs:schema[@targetNamespace=$namespace] + else + () +}; + +declare variable $coll := "http://www.zorba-xquery.com/modules/xqxq"; +declare variable $schema := doc("test.xsd"); +ddl:create($coll); + +dml:apply-insert-nodes-first($coll, $schema); +variable $query-key := xqxq:prepare-main-module( + "import schema namespace test = 'http://test'; validate {<test:test><test:subtest>a</test:subtest><test:subtest2>a</test:subtest2></test:test>}", + resolver:url-resolver#2, ()); +xqxq:evaluate($query-key) diff -Nru zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver3.xq zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver3.xq --- zorba-2.7.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver3.xq 1970-01-01 00:00:00.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Queries/zorba/xqxq/url-schema-resolver3.xq 2013-01-16 18:28:18.000000000 +0000 @@ -0,0 +1,29 @@ +import module namespace xqxq = 'http://www.zorba-xquery.com/modules/xqxq'; + +declare namespace resolver = 'http://www.zorba-xquery.com/modules/xqxq/url-resolver'; + +declare namespace op = "http://www.zorba-xquery.com/options/features"; +declare namespace f = "http://www.zorba-xquery.com/features"; +declare option op:enable "f:hof"; + +declare function resolver:url-resolver($namespace as xs:string, $entity as xs:string) { + if($namespace = 'http://test' and $entity = 'schema') + then + doc('test.xsd') + else + () +}; + +variable $contextQueryID := xqxq:prepare-main-module( + "import schema namespace test = 'http://test'; + declare variable $cwd as xs:anyURI external; + validate { doc(resolve-uri('test.xml', $cwd)) }", + resolver:url-resolver#2, ()); +xqxq:bind-variable($contextQueryID, fn:QName("", "cwd"), resolve-uri(".")); +variable $contextItem := xqxq:evaluate($contextQueryID); + +variable $queryID := xqxq:prepare-main-module( + "import schema namespace test = 'http://test'; //*:test", + resolver:url-resolver#2, ()); +xqxq:bind-context-item($queryID, $contextItem); +xqxq:evaluate($queryID) diff -Nru zorba-2.7.0-0/test/rbkt/Scripts/w3c/Readme.txt zorba-2.8.0-0/test/rbkt/Scripts/w3c/Readme.txt --- zorba-2.7.0-0/test/rbkt/Scripts/w3c/Readme.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/Scripts/w3c/Readme.txt 2013-01-16 18:28:18.000000000 +0000 @@ -19,7 +19,7 @@ ZORBA_XQUERYX=ON ZORBA_TEST_XQUERYX=ON ZORBA_TEST_W3C_TO_SUBMIT_RESULTS=ON - All these options are set to OFF by default. + ZORBA_WITH_JSON=OFF 1. Import XQTS/XQFTTS. diff -Nru zorba-2.7.0-0/test/rbkt/modules/java/CMakeLists.txt zorba-2.8.0-0/test/rbkt/modules/java/CMakeLists.txt --- zorba-2.7.0-0/test/rbkt/modules/java/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/modules/java/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -19,7 +19,7 @@ COMPARE_VERSION_STRINGS (${CMAKE_VERSION} "2.8.6" RESULT) IF (${RESULT} GREATER -1) FIND_PACKAGE (Java COMPONENTS Development) - IF (Java_Development_FOUND) + IF (Java_JAVAC_EXECUTABLE) INCLUDE (UseJava) # Declare two "different" jars, for testing @@ -31,6 +31,8 @@ GET_PROPERTY (JavaTest2_JAR_FILE TARGET JavaTest2 PROPERTY JAR_FILE) DECLARE_ZORBA_JAR(FILE ${JavaTest_JAR_FILE} TARGET JavaTest TEST_ONLY) DECLARE_ZORBA_JAR(FILE ${JavaTest2_JAR_FILE} TARGET JavaTest2 TEST_ONLY) + SET_TARGET_PROPERTIES (JavaTest PROPERTIES FOLDER "Tests") + SET_TARGET_PROPERTIES (JavaTest2 PROPERTIES FOLDER "Tests") - ENDIF (Java_Development_FOUND) + ENDIF (Java_JAVAC_EXECUTABLE) ENDIF (${RESULT} GREATER -1) diff -Nru zorba-2.7.0-0/test/rbkt/testdriver_mt.cpp zorba-2.8.0-0/test/rbkt/testdriver_mt.cpp --- zorba-2.7.0-0/test/rbkt/testdriver_mt.cpp 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/rbkt/testdriver_mt.cpp 2013-01-16 18:28:18.000000000 +0000 @@ -953,9 +953,9 @@ exit(2); } #if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2 - queries.theQueriesDir = path.native_directory_string(); + queries.theQueriesDir = path.file_string(); #else - queries.theQueriesDir = path.parent_path().generic_string(); + queries.theQueriesDir = path.generic_string(); #endif #if !defined(BOOST_FILESYSTEM_VERSION) || BOOST_FILESYSTEM_VERSION == 2 diff -Nru zorba-2.7.0-0/test/unit/CMakeLists.txt zorba-2.8.0-0/test/unit/CMakeLists.txt --- zorba-2.7.0-0/test/unit/CMakeLists.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/unit/CMakeLists.txt 2013-01-16 18:28:18.000000000 +0000 @@ -137,21 +137,33 @@ ZORBA_GENERATE_EXE(LibUnitTest lib_unit_test.cpp "" "" "") # ADD NEW UNIT TESTS HERE +ZORBA_ADD_TEST("test/libunit/base64" LibUnitTest base64) +ZORBA_ADD_TEST("test/libunit/base64_streambuf" LibUnitTest base64_streambuf) IF (NOT WIN32) # disabled because of bug lp:867271 ZORBA_ADD_TEST("test/libunit/string" LibUnitTest string) ENDIF (NOT WIN32) ZORBA_ADD_TEST("test/libunit/uri" LibUnitTest uri) EXPECTED_FAILURE(test/libunit/uri 3118348) +IF (NOT ZORBA_NO_ICU) + ZORBA_ADD_TEST("test/libunit/icu_streambuf" LibUnitTest icu_streambuf) +ENDIF (NOT ZORBA_NO_ICU) ZORBA_ADD_TEST("test/libunit/json_parser" LibUnitTest json_parser) +ZORBA_ADD_TEST("test/libunit/time_parse" LibUnitTest time_parse) #ZORBA_ADD_TEST("test/libunit/memory_manager" LibUnitTest memory_manager) -IF (NOT ZORBA_HAVE_UNIQUE_PTR) - ZORBA_ADD_TEST("test/libunit/unique_ptr" LibUnitTest unique_ptr) -ENDIF (NOT ZORBA_HAVE_UNIQUE_PTR) IF (NOT ZORBA_NO_FULL_TEXT) ZORBA_ADD_TEST("test/libunit/stemmer" LibUnitTest stemmer) ZORBA_ADD_TEST("test/libunit/thesaurus" LibUnitTest thesaurus) ZORBA_ADD_TEST("test/libunit/tokenizer" LibUnitTest tokenizer) ENDIF (NOT ZORBA_NO_FULL_TEXT) +IF (NOT ZORBA_HAVE_UNIQUE_PTR) + ZORBA_ADD_TEST("test/libunit/unique_ptr" LibUnitTest unique_ptr) +ENDIF (NOT ZORBA_HAVE_UNIQUE_PTR) +IF (NOT ZORBA_HAVE_UNORDERED_MAP) + ZORBA_ADD_TEST("test/libunit/unordered_map" LibUnitTest unordered_map) +ENDIF (NOT ZORBA_HAVE_UNORDERED_MAP) +IF (NOT ZORBA_HAVE_UNORDERED_SET) + ZORBA_ADD_TEST("test/libunit/unordered_set" LibUnitTest unordered_set) +ENDIF (NOT ZORBA_HAVE_UNORDERED_SET) # vim:set et sw=2 ts=2: diff -Nru zorba-2.7.0-0/test/update/Scripts/Readme.txt zorba-2.8.0-0/test/update/Scripts/Readme.txt --- zorba-2.7.0-0/test/update/Scripts/Readme.txt 2012-10-03 22:34:48.000000000 +0000 +++ zorba-2.8.0-0/test/update/Scripts/Readme.txt 2013-01-16 18:28:18.000000000 +0000 @@ -19,7 +19,7 @@ ZORBA_XQUERYX=ON ZORBA_TEST_XQUERYX=ON ZORBA_TEST_W3C_TO_SUBMIT_RESULTS=ON - All these options are set to OFF by default. + ZORBA_WITH_JSON=OFF 1. Import XQUTS.