Merge lp:~zorba-coders/zorba/module-schema-tools into lp:~zorba-coders/zorba/zorba-experimental

Proposed by Cezar Andrei
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/module-schema-tools
Merge into: lp:~zorba-coders/zorba/zorba-experimental
Diff against target: 235657 lines (+114049/-64299)
1567 files modified
CMakeConfiguration.txt (+0/-4)
CMakeLists.txt (+37/-15)
CPackSourceConfig.cmake.in (+1/-1)
ChangeLog (+133/-13)
NOTICE.txt (+1/-1)
bin/CMakeLists.txt (+58/-19)
bin/debug_client/debug_command.cpp (+0/-99)
bin/debug_client/event_handler_init.cpp.in (+0/-41)
bin/debug_client/lock_free_queue.cpp (+0/-16)
bin/debug_client/message-handler.xq (+0/-165)
bin/debugger/command.h (+164/-211)
bin/debugger/command_arg.h (+237/-0)
bin/debugger/command_line_handler.cpp (+364/-204)
bin/debugger/command_line_handler.h (+116/-58)
bin/debugger/command_prompt.cpp (+287/-0)
bin/debugger/command_prompt.h (+72/-0)
bin/debugger/config.h.cmake (+24/-0)
bin/debugger/event_handler.cpp (+81/-76)
bin/debugger/event_handler.h (+25/-12)
bin/debugger/lock_free_queue.h (+10/-2)
bin/debugger/main.cpp (+340/-18)
bin/debugger/process_listener.cpp (+105/-0)
bin/debugger/process_listener.h (+75/-0)
bin/debugger/tuple.h (+6/-0)
bin/debugger/xqdb_client.cpp (+63/-0)
bin/debugger/xqdb_client.h (+51/-0)
bin/path_util.cpp (+77/-45)
bin/path_util.h (+15/-24)
bin/zorbacmd.cpp (+137/-55)
bin/zorbacmdproperties.cpp (+19/-5)
bin/zorbacmdproperties.h (+10/-1)
bin/zorbacmdproperties.txt (+6/-1)
bin/zorbacmdproperties_base.h (+41/-3)
cmake_modules/FindLibedit.cmake (+46/-0)
cmake_modules/FindPHP5.cmake (+5/-0)
cmake_modules/Windows/ProxyFindModule.cmake (+37/-0)
cmake_modules/ZorbaModule.cmake (+281/-101)
config/CMakeLists.txt (+5/-5)
config/ZorbaConfig.cmake.in (+7/-4)
doc/c/manual/indexpage.dox (+1/-1)
doc/cxx/examples/errors.cpp (+4/-4)
doc/cxx/examples/simple.cpp (+17/-10)
doc/java/examples/CMakeLists.txt (+1/-0)
doc/php/CMakeLists.txt (+1/-1)
doc/php/examples/CMakeLists.txt (+12/-4)
doc/php/examples/php.ini.in (+1/-0)
doc/php/examples/simple.php.in (+2/-2)
doc/php/examples/test.php.in (+120/-0)
doc/php/examples/zorba_api.php (+1/-1)
doc/zorba/build.dox (+5/-4)
doc/zorba/build_noncore.dox (+1/-1)
doc/zorba/build_options.dox (+35/-0)
doc/zorba/commandline.dox (+13/-14)
doc/zorba/conformance.dox (+4/-4)
doc/zorba/conformanceXQFTTS.dox (+74/-74)
doc/zorba/data_lifecycle.dox (+2/-2)
doc/zorba/external_functions.dox (+4/-4)
doc/zorba/ft_intro.dox (+0/-2)
doc/zorba/ft_thesaurus.dox (+34/-33)
doc/zorba/impl_dep_features.dox (+2/-2)
doc/zorba/indexpage.dox.in (+61/-140)
doc/zorba/installation.dox (+3/-4)
doc/zorba/link_crawler2.dox (+238/-0)
doc/zorba/modules_authoring.dox (+2/-3)
doc/zorba/modules_authoring_2.dox (+7/-3)
doc/zorba/modules_building_in.dox (+2/-2)
doc/zorba/options.dox (+233/-54)
doc/zorba/php_ubuntu.dox (+2/-4)
doc/zorba/php_windows.dox (+0/-2)
doc/zorba/schema_lifecycle.dox (+1/-1)
doc/zorba/uriresolvers.dox (+120/-38)
doc/zorba/web_crawler.dox (+141/-46)
doc/zorba/xqddf.dox (+224/-214)
doc/zorba/xqdoc/templates/main.html (+36/-24)
include/zorba/config.h.cmake (+15/-10)
include/zorba/debugger_client.h (+14/-2)
include/zorba/diagnostic.h (+4/-1)
include/zorba/dynamic_context.h (+14/-1)
include/zorba/identtypes.h (+16/-2)
include/zorba/internal/proxy.h (+48/-0)
include/zorba/internal/type_traits.h (+3/-1)
include/zorba/internal/unique_ptr.h (+2/-2)
include/zorba/internal/ztd.h (+2/-1)
include/zorba/item.h (+52/-3)
include/zorba/item_factory.h (+80/-2)
include/zorba/item_sequence.h (+10/-3)
include/zorba/iterator.h (+2/-0)
include/zorba/options.h (+19/-4)
include/zorba/pregenerated/diagnostic_list.h (+56/-4)
include/zorba/properties_base.h (+37/-1)
include/zorba/static_collection_manager.h (+66/-3)
include/zorba/static_context.h (+640/-529)
include/zorba/static_context_consts.h (+2/-1)
include/zorba/thesaurus.h (+24/-28)
include/zorba/transcode_stream.h (+213/-0)
include/zorba/typeident.h (+34/-1)
include/zorba/uri_resolvers.h (+18/-3)
include/zorba/util/file.h (+2/-0)
include/zorba/xquery.h (+19/-1)
include/zorba/zorba.h (+13/-2)
modules/DownloadModules.cmake (+59/-28)
modules/ExternalModules.conf (+24/-17)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+19/-1)
modules/com/zorba-xquery/www/modules/converters/base64.xq (+6/-3)
modules/com/zorba-xquery/www/modules/converters/json-options.xsd (+60/-0)
modules/com/zorba-xquery/www/modules/converters/json.xq (+260/-0)
modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq (+291/-0)
modules/com/zorba-xquery/www/modules/http-client.xq (+2/-2)
modules/com/zorba-xquery/www/modules/http-client.xq.src/curl_stream_buffer.cpp (+337/-338)
modules/com/zorba-xquery/www/modules/http-client.xq.src/curl_stream_buffer.h (+164/-143)
modules/com/zorba-xquery/www/modules/http-client.xq.src/http_client.cpp (+5/-2)
modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_handler.cpp (+4/-4)
modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.cpp (+71/-21)
modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_parser.h (+10/-6)
modules/com/zorba-xquery/www/modules/node-position.xq (+524/-0)
modules/com/zorba-xquery/www/modules/node-reference.xq (+25/-15)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+105/-9)
modules/com/zorba-xquery/www/modules/pregenerated/warnings.xq (+20/-1)
modules/com/zorba-xquery/www/modules/store/static/indexes/dml.xq (+187/-60)
modules/com/zorba-xquery/www/modules/string.xq (+21/-1)
modules/com/zorba-xquery/www/modules/uri.xq (+108/-0)
modules/com/zorba-xquery/www/modules/xqdoc2xhtml/index.xq (+22/-15)
modules/org/expath/ns/file.xq (+28/-13)
modules/org/expath/ns/file.xq.src/file.cpp (+33/-23)
modules/org/expath/ns/file.xq.src/file_function.cpp (+20/-9)
modules/org/expath/ns/file.xq.src/file_function.h (+5/-9)
modules/org/expath/ns/file.xq.src/file_module.cpp (+2/-5)
modules/org/expath/ns/file.xq.src/file_module.h (+13/-6)
schemas/CMakeLists.txt (+24/-0)
schemas/xhtml/xhtml-lat1.ent (+196/-0)
schemas/xhtml/xhtml-special.ent (+80/-0)
schemas/xhtml/xhtml-symbol.ent (+237/-0)
schemas/xhtml/xhtml1-frameset.dtd (+1235/-0)
schemas/xhtml/xhtml1-strict.dtd (+978/-0)
schemas/xhtml/xhtml1-transitional.dtd (+1201/-0)
schemas/xslt-xquery-serialization.xsd (+1/-1)
scripts/gen_all_props (+0/-31)
scripts/gen_po_props (+0/-248)
scripts/link_crawler.xq (+0/-232)
scripts/sanity_checks/README.txt (+2/-2)
scripts/sanity_checks/conformance_xqftts.xqi (+4/-5)
scripts/sanity_checks/conformance_xqts.xqi (+3/-3)
src/annotations/annotations.cpp (+324/-292)
src/annotations/annotations.h (+100/-59)
src/api/CMakeLists.txt (+2/-0)
src/api/annotationimpl.cpp (+1/-1)
src/api/collectionimpl.cpp (+4/-9)
src/api/dynamiccontextimpl.cpp (+33/-0)
src/api/dynamiccontextimpl.h (+7/-0)
src/api/functionimpl.cpp (+1/-1)
src/api/identtypesimpl.cpp (+61/-0)
src/api/item.cpp (+56/-1)
src/api/itemfactoryimpl.cpp (+87/-11)
src/api/itemfactoryimpl.h (+32/-3)
src/api/options.cpp (+27/-12)
src/api/serialization/serializer.cpp (+209/-91)
src/api/serialization/serializer.h (+4/-4)
src/api/staticcollectionmanagerimpl.cpp (+287/-0)
src/api/staticcollectionmanagerimpl.h (+37/-0)
src/api/staticcontextimpl.cpp (+258/-75)
src/api/staticcontextimpl.h (+36/-23)
src/api/thesaurus.cpp (+0/-4)
src/api/transcode_streambuf.cpp (+103/-0)
src/api/typeidentimpl.cpp (+146/-12)
src/api/uri_resolver_wrappers.cpp (+66/-30)
src/api/uri_resolver_wrappers.h (+6/-6)
src/api/uriresolverimpl.cpp (+5/-0)
src/api/uriresolverimpl.h (+2/-0)
src/api/xmldatamanagerimpl.cpp (+5/-6)
src/api/xqueryimpl.cpp (+120/-5)
src/api/xqueryimpl.h (+6/-0)
src/api/zorbaimpl.cpp (+11/-1)
src/api/zorbaimpl.h (+2/-0)
src/common/shared_types.h (+10/-4)
src/compiler/CMakeLists.txt (+0/-1)
src/compiler/api/compiler_api.cpp (+19/-13)
src/compiler/api/compiler_api.h (+3/-2)
src/compiler/api/compilercb.cpp (+21/-0)
src/compiler/api/compilercb.h (+17/-4)
src/compiler/codegen/plan_visitor.cpp (+121/-85)
src/compiler/expression/abstract_expr_visitor.h (+1/-0)
src/compiler/expression/expr.cpp (+49/-56)
src/compiler/expression/expr.h (+97/-55)
src/compiler/expression/expr_annotations.cpp (+0/-58)
src/compiler/expression/expr_base.cpp (+129/-29)
src/compiler/expression/expr_base.h (+79/-29)
src/compiler/expression/expr_classes.h (+1/-0)
src/compiler/expression/expr_iter.cpp (+11/-2)
src/compiler/expression/expr_put.cpp (+91/-38)
src/compiler/expression/expr_type.cpp (+46/-61)
src/compiler/expression/expr_visitor.h (+1/-0)
src/compiler/expression/flwor_expr.cpp (+48/-17)
src/compiler/expression/flwor_expr.h (+41/-18)
src/compiler/expression/fo_expr.cpp (+23/-26)
src/compiler/expression/fo_expr.h (+5/-5)
src/compiler/expression/ft_expr.cpp (+9/-0)
src/compiler/expression/ft_expr.h (+4/-3)
src/compiler/expression/ftnode.cpp (+209/-6)
src/compiler/expression/ftnode.h (+77/-26)
src/compiler/expression/path_expr.h (+5/-5)
src/compiler/expression/script_exprs.cpp (+163/-17)
src/compiler/expression/script_exprs.h (+101/-12)
src/compiler/expression/update_exprs.cpp (+60/-73)
src/compiler/expression/update_exprs.h (+51/-50)
src/compiler/expression/var_expr.cpp (+56/-1)
src/compiler/expression/var_expr.h (+110/-32)
src/compiler/parser/parse_constants.h (+1/-0)
src/compiler/parser/xquery_parser.cpp (+8853/-8696)
src/compiler/parser/xquery_parser.hpp (+242/-282)
src/compiler/parser/xquery_parser.y (+16/-3)
src/compiler/parser/xquery_scanner.cpp (+3049/-3059)
src/compiler/parser/xquery_scanner.l (+1/-0)
src/compiler/parsetree/parsenode_print_dot_visitor.cpp (+12/-0)
src/compiler/parsetree/parsenode_print_dot_visitor.h (+2/-0)
src/compiler/parsetree/parsenode_print_xml_visitor.cpp (+1/-0)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+94/-5)
src/compiler/parsetree/parsenode_print_xquery_visitor.cpp (+10/-0)
src/compiler/parsetree/parsenode_visitor.h (+1/-0)
src/compiler/parsetree/parsenodes.cpp (+7/-0)
src/compiler/parsetree/parsenodes.h (+21/-0)
src/compiler/rewriter/framework/rewriter_context.h (+59/-31)
src/compiler/rewriter/rewriters/default_optimizer.cpp (+10/-0)
src/compiler/rewriter/rules/flwor_rules.cpp (+28/-25)
src/compiler/rewriter/rules/fold_rules.cpp (+43/-52)
src/compiler/rewriter/rules/hoist_rules.cpp (+2/-1)
src/compiler/rewriter/rules/index_join_rule.cpp (+0/-3)
src/compiler/rewriter/rules/nodeid_rules.cpp (+815/-26)
src/compiler/rewriter/rules/path_rules.cpp (+4/-4)
src/compiler/rewriter/rules/rule_base.h (+1/-0)
src/compiler/rewriter/rules/ruleset.h (+52/-6)
src/compiler/rewriter/rules/type_rules.cpp (+51/-40)
src/compiler/rewriter/tools/dataflow_annotations.cpp (+561/-5)
src/compiler/rewriter/tools/dataflow_annotations.h (+48/-1)
src/compiler/rewriter/tools/expr_tools.cpp (+548/-39)
src/compiler/rewriter/tools/expr_tools.h (+0/-27)
src/compiler/rewriter/tools/udf_graph.cpp (+6/-4)
src/compiler/semantic_annotations/CMakeLists.txt (+0/-15)
src/compiler/semantic_annotations/annotation_holder.cpp (+0/-57)
src/compiler/semantic_annotations/annotation_holder.h (+0/-59)
src/compiler/semantic_annotations/annotation_keys.h (+0/-45)
src/compiler/semantic_annotations/annotations.h (+0/-63)
src/compiler/translator/translator.cpp (+442/-324)
src/compiler/xqddf/value_index.cpp (+35/-22)
src/compiler/xqddf/value_index.h (+53/-27)
src/compiler/xqueryx/xqueryx_to_xquery.cpp (+4/-1)
src/compiler/xqueryx/xqueryx_xslt.cpp (+578/-86)
src/compiler/xqueryx/xqueryx_xslt.h (+2/-1)
src/context/default_uri_mappers.cpp (+29/-9)
src/context/default_uri_mappers.h (+6/-6)
src/context/default_url_resolvers.cpp (+9/-3)
src/context/default_url_resolvers.h (+19/-5)
src/context/dynamic_context.cpp (+117/-47)
src/context/dynamic_context.h (+47/-29)
src/context/dynamic_loader.cpp (+49/-26)
src/context/dynamic_loader.h (+6/-7)
src/context/namespace_context.cpp (+4/-2)
src/context/namespace_context.h (+5/-1)
src/context/root_static_context.cpp (+78/-37)
src/context/root_static_context.h (+5/-3)
src/context/root_static_context_init.cpp.in (+9/-2)
src/context/static_context.cpp (+506/-397)
src/context/static_context.h (+123/-125)
src/context/static_context_consts.h (+2/-34)
src/context/thesaurus_wrappers.cpp (+0/-21)
src/context/thesaurus_wrappers.h (+0/-10)
src/context/uri_resolver.cpp (+32/-12)
src/context/uri_resolver.h (+34/-8)
src/debugger/debugger_client.cpp (+0/-2)
src/debugger/debugger_clientimpl.cpp (+549/-453)
src/debugger/debugger_clientimpl.h (+17/-10)
src/debugger/debugger_common.h (+3/-10)
src/debugger/debugger_commons.cpp (+128/-25)
src/debugger/debugger_commons.h (+11/-15)
src/debugger/debugger_communicator.cpp (+12/-9)
src/debugger/debugger_communicator.h (+4/-4)
src/debugger/debugger_protocol.cpp (+40/-16)
src/debugger/debugger_protocol.h (+3/-0)
src/debugger/debugger_runtime.cpp (+330/-104)
src/debugger/debugger_runtime.h (+37/-20)
src/debugger/debugger_server.cpp (+292/-90)
src/debugger/debugger_server.h (+24/-1)
src/debugger/socket_streambuf.cpp (+68/-55)
src/debugger/socket_streambuf.h (+20/-9)
src/diagnostics/diagnostic.cpp (+3/-0)
src/diagnostics/diagnostic_en.xml (+202/-50)
src/diagnostics/dict_XX_cpp.xq (+1/-0)
src/diagnostics/pregenerated/diagnostic_list.cpp (+84/-6)
src/diagnostics/pregenerated/dict_en.cpp (+48/-9)
src/diagnostics/qname.cpp (+6/-0)
src/functions/CMakeLists.txt (+1/-0)
src/functions/external_function.cpp (+86/-6)
src/functions/external_function.h (+6/-2)
src/functions/func_accessors_impl.cpp (+82/-62)
src/functions/func_accessors_impl.h (+5/-0)
src/functions/func_apply.cpp (+2/-2)
src/functions/func_arithmetic.cpp (+23/-20)
src/functions/func_booleans_impl.cpp (+68/-48)
src/functions/func_collections_impl.cpp (+63/-21)
src/functions/func_durations_dates_times_impl.cpp (+8/-8)
src/functions/func_enclosed.cpp (+14/-11)
src/functions/func_errors_and_diagnostics_impl.cpp (+12/-3)
src/functions/func_eval.cpp (+8/-8)
src/functions/func_hoist.cpp (+40/-34)
src/functions/func_index_ddl.cpp (+11/-11)
src/functions/func_index_ddl.h (+11/-11)
src/functions/func_node_sort_distinct.cpp (+49/-14)
src/functions/func_node_sort_distinct.h (+8/-6)
src/functions/func_numerics_impl.cpp (+157/-157)
src/functions/func_reflection.cpp (+11/-8)
src/functions/func_sequences_impl.cpp (+313/-193)
src/functions/func_sequences_impl.h (+97/-56)
src/functions/func_serialize_impl.cpp (+39/-0)
src/functions/func_strings_impl.cpp (+21/-2)
src/functions/func_var_decl.cpp (+7/-65)
src/functions/function.cpp (+57/-18)
src/functions/function.h (+16/-15)
src/functions/function_consts.h (+5/-6)
src/functions/function_impl.h (+10/-10)
src/functions/library.cpp (+6/-0)
src/functions/pregenerated/func_accessors.cpp (+8/-28)
src/functions/pregenerated/func_accessors.h (+70/-58)
src/functions/pregenerated/func_any_uri.cpp (+1/-1)
src/functions/pregenerated/func_any_uri.h (+4/-2)
src/functions/pregenerated/func_base64.cpp (+2/-2)
src/functions/pregenerated/func_base64.h (+8/-4)
src/functions/pregenerated/func_booleans.cpp (+3/-3)
src/functions/pregenerated/func_booleans.h (+21/-9)
src/functions/pregenerated/func_collections.cpp (+12/-12)
src/functions/pregenerated/func_collections.h (+171/-65)
src/functions/pregenerated/func_context.cpp (+8/-8)
src/functions/pregenerated/func_context.h (+32/-16)
src/functions/pregenerated/func_documents.cpp (+5/-5)
src/functions/pregenerated/func_documents.h (+22/-10)
src/functions/pregenerated/func_durations_dates_times.cpp (+21/-21)
src/functions/pregenerated/func_durations_dates_times.h (+84/-42)
src/functions/pregenerated/func_errors_and_diagnostics.cpp (+1/-1)
src/functions/pregenerated/func_errors_and_diagnostics.h (+21/-11)
src/functions/pregenerated/func_fetch.cpp (+2/-2)
src/functions/pregenerated/func_fetch.h (+8/-4)
src/functions/pregenerated/func_fnput.cpp (+1/-1)
src/functions/pregenerated/func_fnput.h (+6/-2)
src/functions/pregenerated/func_function_item_iter.cpp (+3/-3)
src/functions/pregenerated/func_function_item_iter.h (+12/-6)
src/functions/pregenerated/func_ic_ddl.cpp (+3/-3)
src/functions/pregenerated/func_ic_ddl.h (+12/-6)
src/functions/pregenerated/func_json.cpp (+87/-0)
src/functions/pregenerated/func_json.h (+79/-0)
src/functions/pregenerated/func_maps.cpp (+8/-8)
src/functions/pregenerated/func_maps.h (+32/-16)
src/functions/pregenerated/func_maths.cpp (+26/-26)
src/functions/pregenerated/func_maths.h (+104/-52)
src/functions/pregenerated/func_node_position.cpp (+584/-0)
src/functions/pregenerated/func_node_position.h (+409/-0)
src/functions/pregenerated/func_nodes.cpp (+20/-20)
src/functions/pregenerated/func_nodes.h (+128/-54)
src/functions/pregenerated/func_numerics.cpp (+8/-8)
src/functions/pregenerated/func_numerics.h (+35/-21)
src/functions/pregenerated/func_other_diagnostics.cpp (+2/-2)
src/functions/pregenerated/func_other_diagnostics.h (+8/-4)
src/functions/pregenerated/func_parse_fragment.cpp (+1/-1)
src/functions/pregenerated/func_parse_fragment.h (+4/-2)
src/functions/pregenerated/func_parsing_and_serializing.cpp (+2/-2)
src/functions/pregenerated/func_parsing_and_serializing.h (+10/-4)
src/functions/pregenerated/func_qnames.cpp (+8/-8)
src/functions/pregenerated/func_qnames.h (+41/-19)
src/functions/pregenerated/func_random.cpp (+3/-3)
src/functions/pregenerated/func_random.h (+12/-6)
src/functions/pregenerated/func_schema.cpp (+4/-4)
src/functions/pregenerated/func_schema.h (+27/-11)
src/functions/pregenerated/func_sctx.cpp (+25/-25)
src/functions/pregenerated/func_sctx.h (+100/-50)
src/functions/pregenerated/func_sequences.cpp (+22/-31)
src/functions/pregenerated/func_sequences.h (+255/-185)
src/functions/pregenerated/func_strings.cpp (+88/-28)
src/functions/pregenerated/func_strings.h (+154/-63)
src/functions/pregenerated/func_uris.cpp (+65/-0)
src/functions/pregenerated/func_uris.h (+64/-0)
src/functions/pregenerated/func_xqdoc.cpp (+2/-2)
src/functions/pregenerated/func_xqdoc.h (+8/-4)
src/functions/pregenerated/function_enum.h (+30/-1)
src/functions/signature.cpp (+92/-62)
src/functions/signature.h (+9/-1)
src/functions/udf.cpp (+245/-48)
src/functions/udf.h (+100/-35)
src/precompiled/stdafx.h (+3/-1)
src/runtime/CMakeLists.txt (+3/-0)
src/runtime/accessors/accessors_impl.cpp (+22/-22)
src/runtime/base/binarybase.h (+19/-9)
src/runtime/base/narybase.h (+16/-11)
src/runtime/base/plan_iterator.h (+60/-60)
src/runtime/base/unarybase.h (+15/-10)
src/runtime/base64/base64_impl.cpp (+53/-21)
src/runtime/booleans/BooleanImpl.cpp (+202/-220)
src/runtime/booleans/BooleanImpl.h (+1/-1)
src/runtime/collections/collections_base.h (+16/-16)
src/runtime/collections/collections_impl.cpp (+268/-115)
src/runtime/collections/collections_impl.h (+78/-0)
src/runtime/collections/pregenerated/collections.h (+2/-0)
src/runtime/core/arithmetic_impl.cpp (+50/-52)
src/runtime/core/arithmetic_impl.h (+18/-15)
src/runtime/core/constructors.cpp (+93/-99)
src/runtime/core/constructors.h (+15/-44)
src/runtime/core/flwor_iterator.cpp (+44/-47)
src/runtime/core/flwor_iterator.h (+1/-0)
src/runtime/core/fncall_iterator.cpp (+226/-65)
src/runtime/core/fncall_iterator.h (+80/-32)
src/runtime/core/gflwor/common.cpp (+45/-27)
src/runtime/core/gflwor/common.h (+4/-2)
src/runtime/core/gflwor/count_iterator.cpp (+1/-1)
src/runtime/core/gflwor/for_iterator.cpp (+1/-1)
src/runtime/core/gflwor/groupby_iterator.cpp (+9/-14)
src/runtime/core/gflwor/orderby_iterator.cpp (+10/-10)
src/runtime/core/gflwor/window_iterator.cpp (+3/-5)
src/runtime/core/path_iterators.h (+1/-1)
src/runtime/core/sequencetypes.cpp (+204/-156)
src/runtime/core/trycatch.cpp (+1/-1)
src/runtime/core/var_iterators.cpp (+178/-124)
src/runtime/core/var_iterators.h (+47/-29)
src/runtime/errors_and_diagnostics/errors_and_diagnostics_impl.cpp (+6/-7)
src/runtime/errors_and_diagnostics/other_diagnostics_impl.cpp (+13/-7)
src/runtime/eval/eval.cpp (+71/-35)
src/runtime/eval/eval.h (+18/-9)
src/runtime/fetch/fetch_impl.cpp (+11/-9)
src/runtime/full_text/apply.cpp (+20/-12)
src/runtime/full_text/ft_match.cpp (+2/-3)
src/runtime/full_text/ft_stop_words_set.cpp (+4/-4)
src/runtime/full_text/icu_tokenizer.cpp (+51/-24)
src/runtime/full_text/icu_tokenizer.h (+2/-2)
src/runtime/full_text/thesauri/wn_synset.cpp (+4/-2)
src/runtime/full_text/thesaurus.cpp (+22/-27)
src/runtime/full_text/thesaurus.h (+2/-27)
src/runtime/function_item/dynamic_fncall_iterator.cpp (+26/-6)
src/runtime/indexing/index_ddl.cpp (+52/-15)
src/runtime/indexing/index_ddl.h (+37/-30)
src/runtime/introspection/sctx_impl.cpp (+1/-1)
src/runtime/json/common.cpp (+62/-0)
src/runtime/json/common.h (+120/-0)
src/runtime/json/json_impl.cpp (+217/-0)
src/runtime/json/jsonml_array.cpp (+285/-0)
src/runtime/json/jsonml_array.h (+41/-0)
src/runtime/json/pregenerated/json.cpp (+94/-0)
src/runtime/json/pregenerated/json.h (+114/-0)
src/runtime/json/snelson.cpp (+515/-0)
src/runtime/json/snelson.h (+41/-0)
src/runtime/misc/materialize.cpp (+1/-1)
src/runtime/nodes/node_position_impl.cpp (+756/-0)
src/runtime/nodes/nodes_impl.cpp (+80/-35)
src/runtime/nodes/pregenerated/node_position.cpp (+710/-0)
src/runtime/nodes/pregenerated/node_position.h (+858/-0)
src/runtime/nodes/pregenerated/nodes.h (+6/-6)
src/runtime/numerics/NumericsImpl.cpp (+101/-114)
src/runtime/numerics/NumericsImpl.h (+2/-2)
src/runtime/numerics/numerics_impl.cpp (+30/-58)
src/runtime/parsing_and_serializing/parsing_and_serializing_impl.cpp (+13/-6)
src/runtime/parsing_and_serializing/pregenerated/parsing_and_serializing.h (+2/-0)
src/runtime/qnames/qnames_impl.cpp (+41/-48)
src/runtime/schema/schema_impl.cpp (+17/-14)
src/runtime/scripting/scripting.cpp (+7/-8)
src/runtime/sequences/pregenerated/sequences.h (+23/-23)
src/runtime/sequences/sequences_impl.cpp (+42/-24)
src/runtime/spec/accessors/accessors.xml (+48/-14)
src/runtime/spec/booleans/booleans.xml (+28/-15)
src/runtime/spec/codegen-cpp.xq (+1/-1)
src/runtime/spec/codegen-h.xq (+36/-12)
src/runtime/spec/collections/collections.xml (+31/-8)
src/runtime/spec/errors_and_diagnostics/errors_and_diagnostics.xml (+3/-0)
src/runtime/spec/fnput/fnput.xml (+2/-1)
src/runtime/spec/json/json.xml (+52/-0)
src/runtime/spec/mappings.xml (+13/-1)
src/runtime/spec/nodes/node_position.xml (+439/-0)
src/runtime/spec/nodes/nodes.xml (+358/-270)
src/runtime/spec/parsing_and_serializing/parsing_and_serializing.xml (+5/-0)
src/runtime/spec/plan_iter_visitor_h.xq (+4/-4)
src/runtime/spec/printer_visitor_cpp.xq (+2/-2)
src/runtime/spec/printer_visitor_h.xq (+1/-1)
src/runtime/spec/qnames/qnames.xml (+17/-0)
src/runtime/spec/schema/schema.xml (+19/-0)
src/runtime/spec/sequences/sequences.xml (+129/-112)
src/runtime/spec/store/documents.xml (+1/-0)
src/runtime/spec/strings/strings.xml (+61/-7)
src/runtime/spec/uris/uris.xml (+40/-0)
src/runtime/store/maps_impl.cpp (+16/-3)
src/runtime/strings/pregenerated/strings.cpp (+70/-0)
src/runtime/strings/pregenerated/strings.h (+89/-0)
src/runtime/strings/strings_impl.cpp (+429/-102)
src/runtime/update/update.cpp (+2/-1)
src/runtime/uris/pregenerated/uris.cpp (+66/-0)
src/runtime/uris/pregenerated/uris.h (+80/-0)
src/runtime/uris/uris_impl.cpp (+105/-0)
src/runtime/visitors/planiter_visitor_impl_code.h (+53/-52)
src/runtime/visitors/planiter_visitor_impl_include.h (+7/-6)
src/runtime/visitors/pregenerated/planiter_visitor.h (+146/-1)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+409/-0)
src/runtime/visitors/pregenerated/printer_visitor.h (+87/-0)
src/runtime/visitors/printer_visitor_impl.cpp (+246/-182)
src/runtime/visitors/printer_visitor_impl.h (+58/-51)
src/runtime/xqdoc/xqdoc_impl.cpp (+4/-4)
src/store/api/annotation.h (+17/-15)
src/store/api/index.h (+60/-22)
src/store/api/item.h (+115/-29)
src/store/api/item_factory.h (+31/-147)
src/store/api/iterator.h (+2/-0)
src/store/api/pul.h (+3/-0)
src/store/api/shared_types.h (+3/-0)
src/store/api/store.h (+47/-27)
src/store/api/temp_seq.h (+51/-47)
src/store/api/update_consts.h (+4/-1)
src/store/api/xs_type_codes.h (+94/-0)
src/store/naive/CMakeLists.txt (+2/-1)
src/store/naive/atomic_items.cpp (+1382/-318)
src/store/naive/atomic_items.h (+637/-210)
src/store/naive/collection.cpp (+108/-0)
src/store/naive/collection.h (+115/-0)
src/store/naive/collection_set.h (+28/-52)
src/store/naive/dataguide.cpp (+1/-1)
src/store/naive/inmemorystore.cpp (+2/-2)
src/store/naive/inmemorystorec.cpp (+1/-1)
src/store/naive/item.cpp (+224/-30)
src/store/naive/item_iterator.cpp (+1/-1)
src/store/naive/item_vector.cpp (+4/-2)
src/store/naive/loader.h (+1/-1)
src/store/naive/loader_dtd.cpp (+103/-67)
src/store/naive/loader_fast.cpp (+42/-47)
src/store/naive/node_factory.cpp (+6/-6)
src/store/naive/node_factory.h (+4/-4)
src/store/naive/node_items.cpp (+676/-297)
src/store/naive/node_items.h (+274/-133)
src/store/naive/node_iterators.cpp (+38/-12)
src/store/naive/node_iterators.h (+65/-11)
src/store/naive/node_updates.cpp (+41/-23)
src/store/naive/nsbindings.cpp (+4/-4)
src/store/naive/nsbindings.h (+3/-2)
src/store/naive/ordpath.cpp (+96/-2)
src/store/naive/ordpath.h (+11/-4)
src/store/naive/properties.cpp (+1/-1)
src/store/naive/properties.h (+1/-1)
src/store/naive/pul_primitive_factory.cpp (+14/-4)
src/store/naive/pul_primitive_factory.h (+10/-1)
src/store/naive/pul_primitives.cpp (+205/-68)
src/store/naive/pul_primitives.h (+96/-27)
src/store/naive/qname_pool.cpp (+73/-88)
src/store/naive/qname_pool.h (+18/-18)
src/store/naive/shared_types.h (+6/-4)
src/store/naive/simple_collection.cpp (+11/-79)
src/store/naive/simple_collection.h (+10/-16)
src/store/naive/simple_collection_set.cpp (+34/-27)
src/store/naive/simple_collection_set.h (+117/-0)
src/store/naive/simple_index.cpp (+323/-306)
src/store/naive/simple_index.h (+163/-204)
src/store/naive/simple_index_general.cpp (+1564/-2176)
src/store/naive/simple_index_general.h (+315/-176)
src/store/naive/simple_index_value.cpp (+221/-53)
src/store/naive/simple_index_value.h (+91/-40)
src/store/naive/simple_item_factory.cpp (+134/-25)
src/store/naive/simple_item_factory.h (+37/-3)
src/store/naive/simple_iterator_factory.cpp (+6/-6)
src/store/naive/simple_lazy_temp_seq.cpp (+169/-97)
src/store/naive/simple_lazy_temp_seq.h (+31/-144)
src/store/naive/simple_pul.cpp (+223/-177)
src/store/naive/simple_pul.h (+18/-4)
src/store/naive/simple_store.cpp (+360/-561)
src/store/naive/simple_store.h (+135/-89)
src/store/naive/simple_temp_seq.cpp (+185/-229)
src/store/naive/simple_temp_seq.h (+49/-51)
src/store/naive/store_defs.h (+1/-79)
src/store/naive/store_properties.h (+0/-7)
src/store/naive/string_pool.cpp (+1/-1)
src/store/naive/text_node_content.h (+1/-1)
src/system/globalenv.cpp (+73/-25)
src/system/globalenv.h (+41/-22)
src/system/properties.h (+21/-0)
src/system/zorba_properties.h (+28/-9)
src/system/zorba_properties.txt (+5/-2)
src/types/casting.cpp (+740/-275)
src/types/casting.h (+39/-17)
src/types/root_typemanager.cpp (+11/-11)
src/types/root_typemanager.h (+6/-9)
src/types/schema/EventSchemaValidator.cpp (+2/-2)
src/types/schema/SchemaValidatorFilter.cpp (+4/-2)
src/types/schema/XercSchemaValidator.cpp (+2/-2)
src/types/schema/XercesParseUtils.cpp (+2/-2)
src/types/schema/revalidateUtils.cpp (+3/-3)
src/types/schema/schema.cpp (+7/-7)
src/types/schema/schema.h (+2/-2)
src/types/schema/validate.cpp (+24/-18)
src/types/typeconstants.h (+1/-51)
src/types/typeimpl.cpp (+1/-1)
src/types/typeimpl.h (+7/-7)
src/types/typemanager.h (+6/-3)
src/types/typemanagerimpl.cpp (+36/-13)
src/types/typemanagerimpl.h (+1/-1)
src/types/typeops.cpp (+104/-39)
src/types/typeops.h (+25/-9)
src/unit_tests/CMakeLists.txt (+18/-6)
src/unit_tests/json_parser.cpp (+637/-0)
src/unit_tests/stemmer.cpp (+9/-1)
src/unit_tests/string.cpp (+11/-1)
src/unit_tests/string_instantiate.cpp (+9/-1)
src/unit_tests/test_debugger_protocol.cpp (+0/-414)
src/unit_tests/test_icu_streambuf.cpp (+152/-0)
src/unit_tests/thesaurus.cpp (+18/-14)
src/unit_tests/tokenizer.cpp (+9/-1)
src/unit_tests/unique_ptr.cpp (+8/-1)
src/unit_tests/unit_test_list.h (+12/-1)
src/unit_tests/unit_tests.cpp (+13/-1)
src/util/CMakeLists.txt (+8/-1)
src/util/ascii_util.h (+1/-6)
src/util/file.cpp (+12/-0)
src/util/fs_util.cpp (+24/-0)
src/util/fs_util.h (+28/-0)
src/util/http_util.cpp (+9/-4)
src/util/http_util.h (+0/-2)
src/util/icu_streambuf.cpp (+307/-0)
src/util/icu_streambuf.h (+140/-0)
src/util/json_parser.cpp (+663/-0)
src/util/json_parser.h (+570/-0)
src/util/mem_streambuf.cpp (+120/-0)
src/util/mem_streambuf.h (+108/-0)
src/util/omanip.h (+205/-57)
src/util/oseparator.h (+17/-5)
src/util/passthru_streambuf.cpp (+105/-0)
src/util/passthru_streambuf.h (+76/-0)
src/util/regex.cpp (+53/-17)
src/util/regex.h (+2/-2)
src/util/regex_ascii.h (+0/-2)
src/util/stl_util.h (+81/-21)
src/util/string/ptr_rep.tcc (+1/-0)
src/util/string_util.cpp (+13/-5)
src/util/string_util.h (+12/-5)
src/util/transcode_streambuf.h (+47/-0)
src/util/unicode_util.h (+4/-9)
src/util/uri_util.cpp (+2/-2)
src/util/utf8_util.cpp (+17/-0)
src/util/utf8_util.h (+0/-5)
src/util/utf8_util_base.h (+27/-12)
src/util/uuid/uuid.cpp (+27/-4)
src/util/uuid/uuid.h (+3/-0)
src/util/win32/dirent.h (+372/-0)
src/util/xml_util.h (+0/-1)
src/zorbamisc/ns_consts.h (+1/-5)
src/zorbaserialization/archiver.cpp (+4/-1)
src/zorbaserialization/archiver.h (+1/-1)
src/zorbaserialization/zorba_class_serializer.cpp (+38/-5)
src/zorbaserialization/zorba_class_serializer.h (+14/-7)
src/zorbaserialization/zorba_class_versions.cpp (+5/-5)
src/zorbatypes/URI.cpp (+18/-5)
src/zorbatypes/binary.cpp (+10/-0)
src/zorbatypes/decimal.cpp (+80/-47)
src/zorbatypes/decimal.h (+68/-48)
src/zorbatypes/floatimpl.cpp (+20/-1)
src/zorbatypes/floatimpl.h (+19/-4)
src/zorbatypes/integer.cpp (+144/-96)
src/zorbatypes/integer.h (+369/-308)
src/zorbatypes/numconversions.cpp (+8/-1)
src/zorbatypes/numconversions.h (+4/-0)
src/zorbatypes/rchandle.h (+9/-2)
src/zorbatypes/rclist.h (+37/-0)
src/zorbatypes/schema_types.h (+5/-1)
src/zorbatypes/zorbatypes_decl.h (+13/-1)
src/zorbautils/hashmap.h (+36/-9)
src/zorbautils/hashmap_itemh.h (+112/-0)
src/zorbautils/hashmap_zstring.h (+8/-8)
src/zorbautils/hashmap_zstring_nonserializable.h (+76/-0)
swig/CMakeLists.txt (+2/-7)
swig/ItemFactory.h (+69/-0)
swig/ItemFactory.i (+192/-0)
swig/StaticContext.h (+69/-0)
swig/StaticContext.i (+43/-107)
swig/XQuery.i (+89/-8)
swig/Zorba.i (+28/-1)
swig/java/CMakeLists.txt (+6/-1)
swig/php/CMakeLists.txt (+17/-27)
swig/php/XQueryProcessor.php (+397/-0)
swig/php/generate_proxy.php.in (+0/-209)
swig/php/test.xq (+1/-0)
swig/php/zorba_api.i (+7/-1)
swig/php/zorba_api_wrapper.php (+1215/-0)
swig/python/CMakeLists.txt (+2/-0)
swig/ruby/CMakeLists.txt (+10/-0)
swig/various.i (+184/-0)
swig/zorba_api.i (+12/-2)
test/apitest.cpp (+21/-6)
test/http-test-data/docroot/http-test-data/http2.xml (+4/-0)
test/rbkt/ExpCompilerResults/IterPlan/iterscript.cmake (+14/-10)
test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_dynamic_zorba_collection.iter (+25/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_static_zorba_collection.iter (+61/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/collections/count_w3c_collection.iter (+35/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/error/trace1.iter (+8/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx5.iter (+1/-1)
test/rbkt/ExpCompilerResults/IterPlan/zorba/misc/hoist4.iter (+7/-7)
test/rbkt/ExpCompilerResults/IterPlan/zorba/misc/inline_var1.iter (+2/-2)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-c.iter (+375/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide-nc.iter (+375/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide2-c.iter (+139/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dataguide2-nc.iter (+139/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/dblp-q0.iter (+182/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9065.iter (+62/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9198.iter (+75/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9199.iter (+75/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9212.iter (+83/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9389.iter (+70/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9390.iter (+70/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-9392.iter (+71/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-gary1.iter (+227/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx1.iter (+105/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-idx4.iter (+168/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/hashjoin-q8.iter (+102/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/path17.iter (+70/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q1.iter (+49/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q10.iter (+246/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q11.iter (+103/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q12.iter (+115/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q13.iter (+45/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q14.iter (+39/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q15.iter (+50/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q16.iter (+65/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q17.iter (+47/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q18.iter (+38/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q19.iter (+56/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q2.iter (+43/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q20.iter (+192/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q3.iter (+139/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q4.iter (+126/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q5.iter (+41/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q6.iter (+29/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q7.iter (+39/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q8.iter (+107/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/q9.iter (+169/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/no-copy/udfs1.iter (+58/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/paths/pred_order.iter (+2/-2)
test/rbkt/ExpCompilerResults/IterPlan/zorba/string/SubstringFunc/SubstringFunc2.iter (+10/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/string/SubstringFunc/SubstringFunc3.iter (+14/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf-fib-rec.iter (+42/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/udf/udf1.iter (+5/-5)
test/rbkt/ExpCompilerResults/IterPlan/zorba/xray/ppm_10.iter (+18/-23)
test/rbkt/ExpQueryResults/zorba/base64/binary_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/base64/file_read_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/base64/file_read_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/collections/count_dynamic_zorba_collection.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/collections/count_static_zorba_collection.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/collections/count_w3c_collection.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/collections/delete_double.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/collections/dynamic3.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/collections/dynamic4.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/collections/dynamic5.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/K-ConcatFunc-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/K-ConcatFunc-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/K-ConcatFunc-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/K-ConcatFunc-6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/K-ConcatFunc-7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/K-ConcatFunc-8.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/K-ConcatFunc-9.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-12.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-13.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-14.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-15.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-16.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-17.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-8.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concat-9.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdbl2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdbl2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdbl2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdbl2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdbl2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdec2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdec2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdec2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdec2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatdec2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatflt2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatflt2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatflt2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatflt2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatflt2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatint2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatint2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatint2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatint2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatint2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatintg2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatintg2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatintg2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatintg2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatintg2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatlng2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatlng2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatlng2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatlng2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatlng2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnint2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnint2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnint2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnint2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnint2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnni2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnni2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnni2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnni2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnni2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnpi2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnpi2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnpi2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnpi2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatnpi2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatpint2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatpint2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatpint2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatpint2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatpint2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatsht2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatsht2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatsht2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatsht2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatsht2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatulng2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatulng2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatulng2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatulng2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatulng2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatusht2args-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatusht2args-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatusht2args-3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatusht2args-4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/concat_operator/fn-concatusht2args-5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/debugger/dmh/break_response.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/debugger/dmh/break_response_no_info.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/error/trace1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/eval/eval10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/eval/eval11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/eval/eval12.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/eval/eval13.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/eval/eval9.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/eval/invoke1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-009.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-010.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-010a.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-012.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-013.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-014.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-014.xml.spec (+2/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-015.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-016.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-017.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-019.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-020.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-021.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-022.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-023.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/ext_var/w3c/extvardef-025.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/fetch/fetch_random_file.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/file/cp1252.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/file/streamability2.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/fulltext/ft-expr-clone-1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/fulltext/ft-same-sentence-false-2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/groupby/posvar.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/index/auctions1.xml.res (+3/-3)
test/rbkt/ExpQueryResults/zorba/index/numbers.xml.res (+21/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-parse-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-parse-02.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-parse-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-parse-04.xml.res (+7/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-parse-05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-parse-wikipedia.xml.res (+10/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-serialize-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-serialize-02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-serialize-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xml.res (+11/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-serialize-none-wikipedia.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-jsonml_array-serialize-some-wikipedia.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-null-handling.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-numbers-and-decimals.xml.res (+7/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-01.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-02.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-03.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-04.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-05.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-06.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-07.xml.res (+10/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-array-08.xml.res (+6/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-example.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-01.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-02.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-03.xml.res (+8/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-object-04.xml.res (+6/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-parse-serialize.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-array-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-array-02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-array-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-array-04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-array-05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-array-12.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-indent-example.xml.res (+11/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-none-example.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-object-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-object-02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-object-03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-parse.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-serialize-some-example.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-uncommon-chars.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-snelson-utf-8.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/misc/baseuri.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/dataguide-c.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/dataguide-nc.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/dataguide2-c.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/dataguide2-nc.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/dblp-q0.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-9198.xml.res (+19/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-9199.xml.res (+19/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-9212.xml.res (+49/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-9389.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-9390.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-9392.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-gary1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-idx1.xml.res (+254/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-idx4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/hashjoin-q8.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/parser_test.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/path17.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q12.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q13.xml.res (+18/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q14.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q17.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q18.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q19.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q20.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q8.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/q9.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/no-copy/udfs1.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_1.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_1_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_2.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_2_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_3.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_3_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_4.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_4_parsed.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/nodes/position_err.xml.res (+6/-0)
test/rbkt/ExpQueryResults/zorba/parsing_and_serializing/parse-xml-fragment-18.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/paths/ref1.xml.res (+387/-0)
test/rbkt/ExpQueryResults/zorba/reference/reference_1.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/reference/reference_2.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/reference/reference_3.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/reference/reference_4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/reference/reference_5.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/reference/reference_coll_1.xml.res (+2/-1)
test/rbkt/ExpQueryResults/zorba/reference/reference_coll_2.xml.res (+2/-1)
test/rbkt/ExpQueryResults/zorba/reference/reference_coll_3.xml.res (+2/-1)
test/rbkt/ExpQueryResults/zorba/schemas/val-inplace3.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/schemas/val-inplace4.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/schemas/val-xsiType-noSchemaImport.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/spec/xquery_1_1.xml.res (+0/-4)
test/rbkt/ExpQueryResults/zorba/spec/xquery_3_0.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/string/Regex/regex_a4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/tokenize01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/tokenize02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/tokenize03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/string/tokenize04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/udf/udf-fib-rec-BIG_INTEGER.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/udf/udf-fib-rec.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/updates/no_hoist.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/updates/recursive.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/updates/undo10.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/updates/undo11.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/updates/undo8.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/updates/undo9.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/uris/decode_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/uris/decode_03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/uris/decode_04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding06.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding07.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding09.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding11.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding12.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding13.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/sliding14.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling04.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling05.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling07.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling08.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling09.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling10.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling24.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling26.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling27.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling28.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling29.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling30.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling32.xml.res (+12/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling33.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling34.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling35.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling36.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling38.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling39.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling40.xml.res (+24/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling41.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling45.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling46.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling47.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/tumbling48.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/windowing/windowing12.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/xqdoc/basic.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/content.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/local.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/testSchemaTypes.xml.res (+1/-1)
test/rbkt/ExpQueryResults/zorba/xqdoc/unorderedAnnotations.xml.res (+1/-1)
test/rbkt/Queries/CMakeLists.txt (+304/-32)
test/rbkt/Queries/w3c_known_failures.txt (+51/-82)
test/rbkt/Queries/w3c_known_failures_XQueryX.txt (+88/-0)
test/rbkt/Queries/zorba/annotations/annot-unknown-02.spec (+1/-1)
test/rbkt/Queries/zorba/annotations/annot-unknown-02.xq (+10/-6)
test/rbkt/Queries/zorba/annotations/annot-unknown-04.spec (+1/-1)
test/rbkt/Queries/zorba/annotations/annot-unknown-04.xq (+9/-6)
test/rbkt/Queries/zorba/base64/binary_1.xq (+1/-0)
test/rbkt/Queries/zorba/base64/decoded-text (+1/-0)
test/rbkt/Queries/zorba/base64/encoded (+1/-0)
test/rbkt/Queries/zorba/base64/encoded-text (+1/-0)
test/rbkt/Queries/zorba/base64/file_read_1.xq (+10/-0)
test/rbkt/Queries/zorba/base64/file_read_2.xq (+11/-0)
test/rbkt/Queries/zorba/collections/count_dynamic_zorba_collection.xq (+10/-0)
test/rbkt/Queries/zorba/collections/count_static_zorba_collection.xq (+14/-0)
test/rbkt/Queries/zorba/collections/count_w3c_collection.xq (+8/-0)
test/rbkt/Queries/zorba/collections/delete_double.xq (+10/-0)
test/rbkt/Queries/zorba/collections/dynamic3.xq (+7/-0)
test/rbkt/Queries/zorba/collections/dynamic4.xq (+7/-0)
test/rbkt/Queries/zorba/collections/dynamic5.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K-ConcatFunc-3.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K-ConcatFunc-4.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K-ConcatFunc-5.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K-ConcatFunc-6.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K-ConcatFunc-7.xq (+8/-0)
test/rbkt/Queries/zorba/concat_operator/K-ConcatFunc-8.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K-ConcatFunc-9.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K2-ConcatFunc-1.spec (+1/-0)
test/rbkt/Queries/zorba/concat_operator/K2-ConcatFunc-1.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K2-ConcatFunc-2.spec (+1/-0)
test/rbkt/Queries/zorba/concat_operator/K2-ConcatFunc-2.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/K2-ConcatFunc-3.spec (+1/-0)
test/rbkt/Queries/zorba/concat_operator/K2-ConcatFunc-3.xq (+7/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-1.xq (+5/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-10.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-11.xq (+3/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-12.xq (+3/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-14.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-15.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-16.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-17.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-2.xq (+5/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-3.xq (+5/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-4.xq (+5/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-5.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-6.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-7.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-8.xq (+5/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concat-9.xq (+4/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdbl2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdbl2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdbl2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdbl2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdbl2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdec2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdec2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdec2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdec2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatdec2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatflt2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatflt2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatflt2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatflt2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatflt2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatint2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatint2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatint2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatint2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatint2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatintg2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatintg2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatintg2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatintg2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatintg2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatlng2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatlng2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatlng2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatlng2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatlng2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnint2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnint2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnint2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnint2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnint2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnni2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnni2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnni2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnni2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnni2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnpi2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnpi2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnpi2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnpi2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatnpi2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatpint2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatpint2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatpint2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatpint2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatpint2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatsht2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatsht2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatsht2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatsht2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatsht2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatulng2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatulng2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatulng2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatulng2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatulng2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatusht2args-1.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatusht2args-2.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatusht2args-3.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatusht2args-4.xq (+11/-0)
test/rbkt/Queries/zorba/concat_operator/fn-concatusht2args-5.xq (+11/-0)
test/rbkt/Queries/zorba/debugger/dmh/break_response.xq (+5/-0)
test/rbkt/Queries/zorba/debugger/dmh/break_response_no_info.xq (+7/-0)
test/rbkt/Queries/zorba/error/trace1.xq (+6/-0)
test/rbkt/Queries/zorba/eval/eval10.xq (+28/-0)
test/rbkt/Queries/zorba/eval/eval11.xq (+34/-0)
test/rbkt/Queries/zorba/eval/eval12.xq (+34/-0)
test/rbkt/Queries/zorba/eval/eval13.xq (+34/-0)
test/rbkt/Queries/zorba/eval/eval9.xq (+6/-0)
test/rbkt/Queries/zorba/eval/invoke1.xq (+5/-0)
test/rbkt/Queries/zorba/eval/invoke1_1.xqlib (+10/-0)
test/rbkt/Queries/zorba/eval/invoke1_2.xqlib (+3/-0)
test/rbkt/Queries/zorba/ext_var/w3c/SchemaImport/hats.xsd (+68/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-008.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-008.xq (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-009.xq (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-010.xq (+4/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-010a.xq (+4/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-011.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-011.xq (+3/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-011a.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-011a.xq (+9/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-012.xq (+4/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-013.spec (+3/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-013.xq (+6/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-014.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-014.xq (+3/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-015.xq (+4/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-016.xq (+4/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-017.xq (+2/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-018.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-018.xq (+2/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-019.xq (+3/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-020.xq (+5/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-021.xq (+3/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-022.xq (+5/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-023.xq (+8/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-024.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-024.xq (+8/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-025.xq (+8/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-026.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-026.xq (+8/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-027.spec (+1/-0)
test/rbkt/Queries/zorba/ext_var/w3c/extvardef-027.xq (+7/-0)
test/rbkt/Queries/zorba/fetch/fetch_bogus2.xq (+1/-1)
test/rbkt/Queries/zorba/fetch/fetch_random_file.xq (+4/-0)
test/rbkt/Queries/zorba/file/cp1252.txt (+1/-0)
test/rbkt/Queries/zorba/file/cp1252.xq (+3/-0)
test/rbkt/Queries/zorba/file/files_pattern_rec1.xq (+7/-1)
test/rbkt/Queries/zorba/file/files_pattern_rec2.xq (+7/-1)
test/rbkt/Queries/zorba/file/invalid_encoding.spec (+1/-0)
test/rbkt/Queries/zorba/file/invalid_encoding.xq (+3/-0)
test/rbkt/Queries/zorba/file/streamability2.spec (+0/-1)
test/rbkt/Queries/zorba/fulltext/ft-expr-clone-1.xq (+10/-0)
test/rbkt/Queries/zorba/fulltext/ft-same-sentence-false-2.xq (+2/-0)
test/rbkt/Queries/zorba/fulltext/ft-same-sentence-true-2.xq (+1/-1)
test/rbkt/Queries/zorba/fulltext/ft-same-sentence-true-3.xq (+1/-1)
test/rbkt/Queries/zorba/fulltext/ft-same-sentence-true-4.xq (+1/-1)
test/rbkt/Queries/zorba/groupby/posvar.xq (+17/-0)
test/rbkt/Queries/zorba/http-client/send-request/http2-read-svg.xq (+2/-2)
test/rbkt/Queries/zorba/index/auctions1.xml (+1/-0)
test/rbkt/Queries/zorba/index/auctions1.xq (+1/-1)
test/rbkt/Queries/zorba/index/numbers.xml (+10/-0)
test/rbkt/Queries/zorba/index/numbers.xq (+75/-0)
test/rbkt/Queries/zorba/index/numbers.xqlib (+28/-0)
test/rbkt/Queries/zorba/json/json-invalid-option-parameter.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-invalid-option-parameter.xq (+10/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-01.xq (+9/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-02.xq (+14/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-03.xq (+18/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-04.xq (+27/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-05.xq (+66/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-06.xq (+10/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-parse-wikipedia.xq (+23/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-01.xq (+10/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-02.xq (+13/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-03.xq (+10/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-indent-wikipedia.xq (+20/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-none-wikipedia.xq (+19/-0)
test/rbkt/Queries/zorba/json/json-jsonml_array-serialize-some-wikipedia.xq (+20/-0)
test/rbkt/Queries/zorba/json/json-snelson-invalid-json.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-invalid-json.xq (+9/-0)
test/rbkt/Queries/zorba/json/json-snelson-null-handling.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-numbers-and-decimals.xq (+10/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-01.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-02.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-03.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-04.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-05.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-06.xq (+7/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-07.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-array-08.xq (+7/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-empty.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-empty.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-example.xq (+20/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-object-01.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-object-02.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-object-03.xq (+7/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-object-04.xq (+12/-0)
test/rbkt/Queries/zorba/json/json-snelson-parse-serialize.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-01.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-02.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-03.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-04.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-05.xq (+9/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-06.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-07.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-08.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-09.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-10.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-11.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-array-12.xq (+11/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-comment-node.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-indent-example.xq (+24/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-invalid-value-for-attribute.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-none-example.xq (+19/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-object-01.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-object-02.xq (+9/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-object-03.xq (+12/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-parse.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-some-example.xq (+24/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.spec (+1/-0)
test/rbkt/Queries/zorba/json/json-snelson-serialize-type-value-missing.xq (+8/-0)
test/rbkt/Queries/zorba/json/json-snelson-uncommon-chars.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-snelson-utf-8.xq (+5/-0)
test/rbkt/Queries/zorba/misc/baseuri.xml (+1/-0)
test/rbkt/Queries/zorba/misc/baseuri.xq (+2/-0)
test/rbkt/Queries/zorba/modules/libraryModule15.xqlib (+8/-3)
test/rbkt/Queries/zorba/no-copy/auction.xml (+2182/-0)
test/rbkt/Queries/zorba/no-copy/books.xml (+25/-0)
test/rbkt/Queries/zorba/no-copy/dataguide-c.xq (+87/-0)
test/rbkt/Queries/zorba/no-copy/dataguide-nc.xq (+91/-0)
test/rbkt/Queries/zorba/no-copy/dataguide2-c.xq (+33/-0)
test/rbkt/Queries/zorba/no-copy/dataguide2-nc.xq (+38/-0)
test/rbkt/Queries/zorba/no-copy/dblp-q0.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/dblp-q0.xq (+32/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-9065.xq (+9/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-9198.xq (+13/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-9199.xq (+11/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-9212.xq (+15/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-9389.xq (+13/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-9390.xq (+15/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-9392.xq (+14/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-gary1.xq (+42/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-idx1.xq (+12/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-idx4.xq (+33/-0)
test/rbkt/Queries/zorba/no-copy/hashjoin-q8.xq (+17/-0)
test/rbkt/Queries/zorba/no-copy/parser_test.xq (+3/-0)
test/rbkt/Queries/zorba/no-copy/path17.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/path17.xq (+12/-0)
test/rbkt/Queries/zorba/no-copy/q1.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q1.xq (+9/-0)
test/rbkt/Queries/zorba/no-copy/q10.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q10.xq (+36/-0)
test/rbkt/Queries/zorba/no-copy/q11.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q11.xq (+13/-0)
test/rbkt/Queries/zorba/no-copy/q12.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q12.xq (+16/-0)
test/rbkt/Queries/zorba/no-copy/q13.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q13.xq (+9/-0)
test/rbkt/Queries/zorba/no-copy/q14.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q14.xq (+11/-0)
test/rbkt/Queries/zorba/no-copy/q15.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q15.xq (+10/-0)
test/rbkt/Queries/zorba/no-copy/q16.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q16.xq (+17/-0)
test/rbkt/Queries/zorba/no-copy/q17.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q17.xq (+10/-0)
test/rbkt/Queries/zorba/no-copy/q18.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q18.xq (+17/-0)
test/rbkt/Queries/zorba/no-copy/q19.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q19.xq (+13/-0)
test/rbkt/Queries/zorba/no-copy/q2.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q2.xq (+10/-0)
test/rbkt/Queries/zorba/no-copy/q20.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q20.xq (+34/-0)
test/rbkt/Queries/zorba/no-copy/q3.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q3.xq (+14/-0)
test/rbkt/Queries/zorba/no-copy/q4.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q4.xq (+14/-0)
test/rbkt/Queries/zorba/no-copy/q5.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q5.xq (+13/-0)
test/rbkt/Queries/zorba/no-copy/q6.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q6.xq (+10/-0)
test/rbkt/Queries/zorba/no-copy/q7.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q7.xq (+11/-0)
test/rbkt/Queries/zorba/no-copy/q8.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q8.xq (+14/-0)
test/rbkt/Queries/zorba/no-copy/q9.spec (+3/-0)
test/rbkt/Queries/zorba/no-copy/q9.xq (+20/-0)
test/rbkt/Queries/zorba/no-copy/simple_parser.xqlib (+2207/-0)
test/rbkt/Queries/zorba/no-copy/test1.xq (+17/-0)
test/rbkt/Queries/zorba/no-copy/udfs1.xq (+31/-0)
test/rbkt/Queries/zorba/no-copy/udfs2.xq (+31/-0)
test/rbkt/Queries/zorba/nodes/position.xml (+15/-0)
test/rbkt/Queries/zorba/nodes/position_1.xq (+97/-0)
test/rbkt/Queries/zorba/nodes/position_1_parsed.xq (+98/-0)
test/rbkt/Queries/zorba/nodes/position_2.xq (+157/-0)
test/rbkt/Queries/zorba/nodes/position_2_parsed.xq (+156/-0)
test/rbkt/Queries/zorba/nodes/position_3.xq (+32/-0)
test/rbkt/Queries/zorba/nodes/position_3_parsed.xq (+34/-0)
test/rbkt/Queries/zorba/nodes/position_4.xq (+84/-0)
test/rbkt/Queries/zorba/nodes/position_4_parsed.xq (+81/-0)
test/rbkt/Queries/zorba/nodes/position_err.xq (+60/-0)
test/rbkt/Queries/zorba/parsing_and_serializing/parse-xml-fragment-18.xq (+10/-0)
test/rbkt/Queries/zorba/paths/ref1.spec (+0/-1)
test/rbkt/Queries/zorba/reference/error.spec (+0/-4)
test/rbkt/Queries/zorba/reference/error.xq (+0/-6)
test/rbkt/Queries/zorba/reference/reference.xqlib (+3/-0)
test/rbkt/Queries/zorba/reference/reference_1.xq (+13/-0)
test/rbkt/Queries/zorba/reference/reference_2.xq (+14/-0)
test/rbkt/Queries/zorba/reference/reference_3.xq (+33/-0)
test/rbkt/Queries/zorba/reference/reference_4.spec (+1/-0)
test/rbkt/Queries/zorba/reference/reference_4.xq (+3/-0)
test/rbkt/Queries/zorba/reference/reference_5.xq (+29/-0)
test/rbkt/Queries/zorba/reference/reference_doc_example_01.spec (+0/-4)
test/rbkt/Queries/zorba/reference/reference_doc_example_01.xq (+0/-7)
test/rbkt/Queries/zorba/reference/reference_doc_example_02.spec (+0/-4)
test/rbkt/Queries/zorba/reference/reference_doc_example_02.xq (+0/-8)
test/rbkt/Queries/zorba/schemas/local-xhtml.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/local-xhtml.xq (+6/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.spec (+1/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.xq (+23/-0)
test/rbkt/Queries/zorba/schemas/val-inplace-err2.xsd (+18/-0)
test/rbkt/Queries/zorba/schemas/val-inplace3.xq (+22/-0)
test/rbkt/Queries/zorba/schemas/val-inplace3.xsd (+13/-0)
test/rbkt/Queries/zorba/schemas/val-inplace4.xq (+40/-0)
test/rbkt/Queries/zorba/schemas/val-inplace4.xsd (+26/-0)
test/rbkt/Queries/zorba/schemas/val-xsiType-noSchemaImport.xq (+11/-0)
test/rbkt/Queries/zorba/schemas/validate_xqdoc_01.xq (+4/-0)
test/rbkt/Queries/zorba/schemas/validate_xqdoc_02.xq (+4/-0)
test/rbkt/Queries/zorba/spec/XQuery_3.0.html (+28771/-30944)
test/rbkt/Queries/zorba/spec/xquery_1_1.spec (+0/-5)
test/rbkt/Queries/zorba/spec/xquery_1_1.xq (+0/-69)
test/rbkt/Queries/zorba/spec/xquery_3_0.spec (+5/-0)
test/rbkt/Queries/zorba/spec/xquery_3_0.xq (+69/-0)
test/rbkt/Queries/zorba/spec/xquery_spec.xqi (+4/-13)
test/rbkt/Queries/zorba/store/documents.xq (+1/-0)
test/rbkt/Queries/zorba/store/example_3.xq (+4/-4)
test/rbkt/Queries/zorba/string/Regex/regex_a4.xq (+1/-0)
test/rbkt/Queries/zorba/string/token01.txt (+1/-0)
test/rbkt/Queries/zorba/string/token02.txt (+1/-0)
test/rbkt/Queries/zorba/string/token03.txt (+1/-0)
test/rbkt/Queries/zorba/string/token04.txt (+1/-0)
test/rbkt/Queries/zorba/string/tokenize01.xq (+5/-0)
test/rbkt/Queries/zorba/string/tokenize02.xq (+5/-0)
test/rbkt/Queries/zorba/string/tokenize03.xq (+5/-0)
test/rbkt/Queries/zorba/string/tokenize04.xq (+5/-0)
test/rbkt/Queries/zorba/udf/udf-fib-rec.spec (+1/-0)
test/rbkt/Queries/zorba/udf/udf-fib-rec.xq (+8/-0)
test/rbkt/Queries/zorba/updates/no_hoist.xq (+8/-0)
test/rbkt/Queries/zorba/updates/recursive.xq (+11/-0)
test/rbkt/Queries/zorba/updates/subst.xsd (+23/-0)
test/rbkt/Queries/zorba/updates/undo10.xq (+34/-0)
test/rbkt/Queries/zorba/updates/undo11.xq (+54/-0)
test/rbkt/Queries/zorba/updates/undo8.xq (+54/-0)
test/rbkt/Queries/zorba/updates/undo9.xq (+54/-0)
test/rbkt/Queries/zorba/updates/utils.xqlib (+30/-0)
test/rbkt/Queries/zorba/uris/decode_01.xq (+3/-0)
test/rbkt/Queries/zorba/uris/decode_02.spec (+1/-0)
test/rbkt/Queries/zorba/uris/decode_02.xq (+3/-0)
test/rbkt/Queries/zorba/uris/decode_03.xq (+4/-0)
test/rbkt/Queries/zorba/uris/decode_04.xq (+3/-0)
test/rbkt/Queries/zorba/versioning/import-chain1.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import-chain2.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import1.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import2.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import3.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import4.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import5.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import6.xq (+1/-1)
test/rbkt/Queries/zorba/versioning/import7.xq (+1/-1)
test/rbkt/Queries/zorba/windowing/sliding01.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/sliding02.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/sliding03.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/sliding04.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/sliding05.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/sliding06.xq (+6/-0)
test/rbkt/Queries/zorba/windowing/sliding07.xq (+10/-0)
test/rbkt/Queries/zorba/windowing/sliding08.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/sliding08.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/sliding09.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/sliding10.xq (+18/-0)
test/rbkt/Queries/zorba/windowing/sliding11.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/sliding12.xq (+7/-0)
test/rbkt/Queries/zorba/windowing/sliding13.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/sliding14.xq (+12/-0)
test/rbkt/Queries/zorba/windowing/tumbling01.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling02.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/tumbling04.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling05.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/tumbling06.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling07.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling08.xq (+6/-0)
test/rbkt/Queries/zorba/windowing/tumbling09.xq (+6/-0)
test/rbkt/Queries/zorba/windowing/tumbling10.xq (+10/-0)
test/rbkt/Queries/zorba/windowing/tumbling11.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling11.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling14.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling14.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling15.spec (+2/-0)
test/rbkt/Queries/zorba/windowing/tumbling15.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling16.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling16.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling17.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling17.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling18.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling18.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling19.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling19.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling20.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling20.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling21.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling21.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling22.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling22.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling24.xq (+6/-0)
test/rbkt/Queries/zorba/windowing/tumbling25.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/tumbling26.xq (+3/-0)
test/rbkt/Queries/zorba/windowing/tumbling27.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling28.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling29.xq (+17/-0)
test/rbkt/Queries/zorba/windowing/tumbling31.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling31.xq (+3/-0)
test/rbkt/Queries/zorba/windowing/tumbling32.xq (+19/-0)
test/rbkt/Queries/zorba/windowing/tumbling33.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/tumbling34.xq (+6/-0)
test/rbkt/Queries/zorba/windowing/tumbling35.xq (+8/-0)
test/rbkt/Queries/zorba/windowing/tumbling36.xq (+5/-0)
test/rbkt/Queries/zorba/windowing/tumbling37.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling37.xq (+8/-0)
test/rbkt/Queries/zorba/windowing/tumbling38.xq (+8/-0)
test/rbkt/Queries/zorba/windowing/tumbling39.xq (+12/-0)
test/rbkt/Queries/zorba/windowing/tumbling40.xq (+27/-0)
test/rbkt/Queries/zorba/windowing/tumbling41.xq (+9/-0)
test/rbkt/Queries/zorba/windowing/tumbling42.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling42.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling43.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling43.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling44.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/tumbling44.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling45.xq (+4/-0)
test/rbkt/Queries/zorba/windowing/tumbling46.xq (+17/-0)
test/rbkt/Queries/zorba/windowing/tumbling47.xq (+20/-0)
test/rbkt/Queries/zorba/windowing/tumbling48.xq (+18/-0)
test/rbkt/Queries/zorba/windowing/tumbling49.xq (+12/-0)
test/rbkt/Queries/zorba/windowing/windowing12.xq (+9/-0)
test/rbkt/Queries/zorba/windowing/windowing13.spec (+1/-0)
test/rbkt/Queries/zorba/windowing/windowing13.xq (+4/-0)
test/rbkt/Queries/zorba/xmark/q10.xq (+8/-4)
test/rbkt/Queries/zorba/xqddf/test-node-reference.xq (+2/-0)
test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.spec (+1/-3)
test/rbkt/Queries/zorba/xqdoc/moduleDocumentation.xq (+58/-63)
test/rbkt/Scripts/w3c/Readme.txt (+17/-7)
test/rbkt/Scripts/w3c/Submit_xqts.cmake (+23/-9)
test/rbkt/Scripts/w3c/generate-submission-xqftts.xq (+4/-4)
test/rbkt/Scripts/w3c/generate-submission-xqts.xq (+4/-9)
test/rbkt/Scripts/w3c/import_w3c_full_text_testsuite.sh (+1/-1)
test/rbkt/Scripts/w3c/import_w3c_testsuite.sh (+1/-1)
test/rbkt/itertest.xq.in (+58/-44)
test/rbkt/modules/CMakeLists.txt (+9/-3)
test/rbkt/modules/bad-ver.xq (+1/-1)
test/rbkt/modules/java/CMakeLists.txt (+39/-0)
test/rbkt/modules/java/Test.java (+7/-0)
test/rbkt/modules/module-A.xq (+1/-1)
test/rbkt/modules/module-B.xq (+1/-1)
test/rbkt/modules/random-file.txt (+1/-0)
test/rbkt/modules/ver.xq (+1/-1)
test/rbkt/modules/ver2.xq (+1/-1)
test/rbkt/specification.h (+1/-1)
test/rbkt/testdriver.cpp (+1/-0)
test/rbkt/testdriver_common.cpp (+17/-4)
test/rbkt/testdriver_mt.cpp (+32/-5)
test/unit/CMakeLists.txt (+40/-10)
test/unit/context_item.cpp (+158/-0)
test/unit/context_item1.xq (+4/-0)
test/unit/context_item2.xq (+6/-0)
test/unit/cxx_api_ch1.xq (+26/-0)
test/unit/cxx_api_ch2.xq (+17/-0)
test/unit/cxx_api_ch3.xq (+20/-0)
test/unit/cxx_api_ch4.xq (+19/-0)
test/unit/cxx_api_changes.cpp (+345/-0)
test/unit/datetime.cpp (+2/-0)
test/unit/ext_main2.xq (+21/-0)
test/unit/ext_main3.xq (+21/-0)
test/unit/ext_mod.xq (+4/-0)
test/unit/ext_mod2.xq (+19/-0)
test/unit/external_function.cpp (+169/-15)
test/unit/guestbook.xq (+9/-0)
test/unit/guestbook_main.xq (+1/-1)
test/unit/main_invoke.xq (+9/-0)
test/unit/mini_audit.xq (+13/-0)
test/unit/mini_http.xq (+40/-0)
test/unit/module2.xq (+6/-0)
test/unit/module4.xq (+6/-0)
test/unit/module5.xq (+20/-0)
test/unit/module6.xq (+38/-0)
test/unit/plan_serializer.cpp (+61/-14)
test/unit/schema1.xsd (+21/-0)
test/unit/static_context.cpp (+75/-0)
test/unit/staticcollectionmanager.cpp (+229/-2)
test/unit/testGetExtVarA.xq (+13/-0)
test/unit/testGetExtVarB.xq (+6/-0)
test/update/CMakeLists.txt (+1/-1)
test/update/Queries/zorba/store/sc3_ex3.xq (+1/-1)
test/update/Scripts/Readme.txt (+8/-5)
test/update/Scripts/XQUTS.xml (+1/-1)
test/update/Scripts/generate-submission-xquts.xq (+11/-4)
test/update/Scripts/import_w3c_update_testsuite.sh (+1/-1)
test/update/Scripts/zorba-xquts-submission.xml (+858/-0)
test/update/Scripts/zorba-xqutsx-submission.xml (+858/-0)
test/zperf/src/start.xq (+154/-100)
To merge this branch: bzr merge lp:~zorba-coders/zorba/module-schema-tools
Reviewer Review Type Date Requested Status
Cezar Andrei Approve
Review via email: mp+97092@code.launchpad.net

This proposal supersedes a proposal from 2012-02-27.

This proposal has been superseded by a proposal from 2012-03-14.

Commit message

Testing schema-tools which includes xmlbeans. Take 4. Updated documentation.

Description of the change

Testing schema-tools which includes xmlbeans. Take 3.

To post a comment you must log in.
Revision history for this message
Cezar Andrei (cezar-andrei) wrote : Posted in a previous version of this proposal

go

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Cezar Andrei (cezar-andrei) : Posted in a previous version of this proposal
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Cezar Andrei (cezar-andrei) wrote : Posted in a previous version of this proposal

g

review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal
Revision history for this message
Cezar Andrei (cezar-andrei) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
10630. By Cezar Andrei <email address hidden>

Enable schema-tools module for merging into experimental.

10631. By Cezar Andrei <email address hidden>

Merge from trunk.

10632. By Cezar Andrei <email address hidden>

Refactor DymanicLoader::loadModule.
Remove commented macro.

10633. By Cezar Andrei <email address hidden>

Revert store_properties.h to trunk version.

10634. By Cezar Andrei <email address hidden>

Added dirent.h entry in NOTICE.xml.

10635. By Cezar Andrei <email address hidden>

Update NOTICE.txt

10636. By Cezar Andrei <email address hidden>

Remove java version output and comment.

10637. By Cezar Andrei <email address hidden>

Ficx spelling.

10638. By Cezar Andrei <email address hidden>

Rename getProperties to getPropertiesGlobal.

10639. By Cezar Andrei <email address hidden>

Remove schema-tools module from ExternalModules.conf

10640. By Cezar Andrei <email address hidden>

Fix ExternalModule.conf to the latest in trunk.

10641. By Cezar Andrei <email address hidden>

Fix wrong merge of options.

10642. By Cezar Andrei <email address hidden>

Merge from trunk.

10643. By Cezar Andrei <email address hidden>

Removed the top comment about this file beeing generated.
Fix some indentation.

10644. By Cezar Andrei <email address hidden>

Fix indentation src/system/zorba_properties.h.

10645. By Cezar Andrei <email address hidden>

Include schema-tools as external module for experimental.

10646. By Cezar Andrei <email address hidden>

Comment out reference to schema-tools module.
Removed swig IStream class and references.

10647. By Chris Hillery

Merge from trunk.

10648. By Chris Hillery

Significantly enhance modules/CMakeLists.txt to automatically figure
out in what order to add non-core module projects to Zorba. This was
necessary to extend the functionality of the automatically-created
moduleConfig.cmake files used in inter-module dependencies. These
files can now reference a "use file" to enable information such as
include directories to be shared to dependent modules.

10649. By Chris Hillery

Tweak DAG-formation algorithm to skip dependencies that aren't on other
module projects.

10650. By Chris Hillery

Move auto-creation of module package Config.cmake file to
DONE_DECLARING_ZORBA_URIS(), and extended it to support _INCLUDE_DIRS
and _LIBRARIES. The latter is automatically populated with all dynamic
libs created by DECLARE_ZORBA_MODULE().

10651. By Chris Hillery

Fix build dependencies for .jar files and inter-dependent modules.

10652. By Chris Hillery

Work around CMake bug with LIST(REMOVE_DUPLICATES).

10653. By Chris Hillery

Add util-jvm module.

10654. By Cezar Andrei <email address hidden>

Merge from trunk.

10655. By Cezar Andrei <email address hidden>

Add entries in ChangeLog.

10656. By Chris Hillery

Removing orphaned JVM classpath fields from static_context.

10657. By Chris Hillery

Merge from trunk.

10658. By Chris Hillery

Yet another crack at making the build dependencies for modules and zorba
completely consistent and correct.

10659. By Chris Hillery

Merge from trunk; remove erroneous swig merge.

10660. By Chris Hillery

Merge from trunk.

10661. By Chris Hillery

Merge from trunk.

10662. By Chris Hillery

Merge from trunk.

10663. By Chris Hillery

Unwanted file.

Unmerged revisions

10663. By Chris Hillery

Unwanted file.

10662. By Chris Hillery

Merge from trunk.

10661. By Chris Hillery

Merge from trunk.

10660. By Chris Hillery

Merge from trunk.

10659. By Chris Hillery

Merge from trunk; remove erroneous swig merge.

10658. By Chris Hillery

Yet another crack at making the build dependencies for modules and zorba
completely consistent and correct.

10657. By Chris Hillery

Merge from trunk.

10656. By Chris Hillery

Removing orphaned JVM classpath fields from static_context.

10655. By Cezar Andrei <email address hidden>

Add entries in ChangeLog.

10654. By Cezar Andrei <email address hidden>

Merge from trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeConfiguration.txt'
2--- CMakeConfiguration.txt 2011-09-16 19:55:59 +0000
3+++ CMakeConfiguration.txt 2012-03-14 02:09:24 +0000
4@@ -70,10 +70,6 @@
5 SET(ZORBA_FOR_ONE_THREAD_ONLY OFF CACHE BOOL "compile zorba for single threaded use")
6 MESSAGE(STATUS "ZORBA_FOR_ONE_THREAD_ONLY: " ${ZORBA_FOR_ONE_THREAD_ONLY})
7
8-# by default the zorba command line client is deactivated until it gets to a more stable and userfriendly state
9-SET(ZORBA_WITH_DEBUGGER_CLIENT OFF CACHE BOOL "build and install zorbas command line debugger client")
10-MESSAGE(STATUS "ZORBA_WITH_DEBUGGER_CLIENT: " ${ZORBA_WITH_DEBUGGER_CLIENT})
11-
12 IF (DEFINED UNIX)
13 IF (NOT DEFINED ZORBA_HAVE_PTHREAD_H AND NOT DEFINED ZORBA_FOR_ONE_THREAD_ONLY)
14 MESSAGE(FATAL_ERROR "pthread is not available")
15
16=== modified file 'CMakeLists.txt'
17--- CMakeLists.txt 2011-09-08 15:09:20 +0000
18+++ CMakeLists.txt 2012-03-14 02:09:24 +0000
19@@ -130,18 +130,17 @@
20 ################################################################################
21 # Various cmake macros
22
23-IF(WIN32)
24+SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules ${CMAKE_MODULE_PATH})
25+IF (WIN32)
26 # On Windows we use proxy modules that try to guess first the location
27 # of the required third party libraries. This will search in order in:
28 # 1. the path pointed by ZORBA_THIRD_PARTY_REQUIREMENTS
29 # 2. the Program Files directory available on the users computer
30 # 3. the PATH environment variable
31 # The logic is implemented by the macros in the ProxyFindModule.cmake module.
32- LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules/Windows")
33- INCLUDE(ProxyFindModule)
34-ENDIF(WIN32)
35-LIST (APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake_modules")
36-
37+ SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/Windows ${CMAKE_MODULE_PATH})
38+ INCLUDE (ProxyFindModule)
39+ENDIF (WIN32)
40
41 ################################################################################
42 # This section is used for batch script generation. Each executable
43@@ -418,13 +417,35 @@
44
45 # zorba versioning
46 SET(ZORBA_MAJOR_NUMBER "2")
47-SET(ZORBA_MINOR_NUMBER "0")
48-SET(ZORBA_PATCH_NUMBER "1")
49+SET(ZORBA_MINOR_NUMBER "1")
50+SET(ZORBA_PATCH_NUMBER "0")
51 SET(ZORBA_VERSION ${ZORBA_MAJOR_NUMBER}.${ZORBA_MINOR_NUMBER}.${ZORBA_PATCH_NUMBER})
52 MESSAGE(STATUS "Zorba version number: ${ZORBA_VERSION}")
53-SET(ZORBA_MODULES_INSTALL_DIR "share/zorba-${ZORBA_VERSION}/modules"
54- CACHE STRING "Path (relative to installdir) to modules" FORCE)
55-MARK_AS_ADVANCED(ZORBA_MODULES_INSTALL_DIR)
56+
57+SET(ZORBA_LIB_DIRNAME "lib" CACHE STRING
58+ "directory name for libs (may want to set to 'lib64' on 64-bit Linux platforms)")
59+
60+# Directories for modules and schemas. "Core" are those which are
61+# shipped with Zorba and must be present for correct Zorba
62+# functionality. "Non-core" are developed independently of Zorba and
63+# have different version lifecycles.
64+#
65+# URI dir is for things resolved by URI - specifically modules (.xq
66+# files) and schemas (.xsd files) - which are platform-
67+# independent. Lib dir is for platform-specific files, specifically
68+# shared libraries for module external functions.
69+SET(ZORBA_NONCORE_URI_DIR "share/zorba/uris"
70+ CACHE STRING "Path (relative to installdir) to non-core modules/schemas")
71+MARK_AS_ADVANCED(ZORBA_NONCORE_URI_DIR)
72+SET(ZORBA_CORE_URI_DIR "${ZORBA_NONCORE_URI_DIR}/core/${ZORBA_VERSION}"
73+ CACHE STRING "Path (relative to installdir) to core modules/schemas")
74+MARK_AS_ADVANCED(ZORBA_CORE_URI_DIR)
75+SET(ZORBA_NONCORE_LIB_DIR "${ZORBA_LIB_DIRNAME}/zorba"
76+ CACHE STRING "Path (relative to installdir) to non-core libraries")
77+MARK_AS_ADVANCED(ZORBA_NONCORE_LIB_DIR)
78+SET(ZORBA_CORE_LIB_DIR "${ZORBA_NONCORE_LIB_DIR}/core/${ZORBA_VERSION}"
79+ CACHE STRING "Path (relative to installdir) to core libraries")
80+MARK_AS_ADVANCED(ZORBA_CORE_LIB_DIR)
81
82 # add compiler variables
83 ADD_DEFINITIONS(${DEFINITIONS})
84@@ -461,7 +482,7 @@
85 SET(ZORBA_CMAKE_DIR "cmake" CACHE STRING
86 "Relative path to CMake files in Zorba installation")
87 ELSE (WIN32)
88- SET(ZORBA_CMAKE_DIR "share/zorba-${ZORBA_VERSION}/cmake" CACHE STRING
89+ SET(ZORBA_CMAKE_DIR "share/cmake/zorba-${ZORBA_VERSION}" CACHE STRING
90 "Relative path to CMake files in Zorba installation")
91 ENDIF (WIN32)
92
93@@ -477,14 +498,15 @@
94 # Subdirectory ordering: We need to include "test" before "config" so
95 # ZorbaConfig knows about testdriver. We need to include "config"
96 # before "modules" so external modules will be able to find
97-# ZorbaConfig.cmake.
98+# ZorbaConfig.cmake. We need to include "modules" before "include" so
99+# config.h can know eg. whether we found CURL.
100
101 ADD_SUBDIRECTORY(test)
102 ADD_SUBDIRECTORY(config)
103-ADD_SUBDIRECTORY(include)
104 ADD_SUBDIRECTORY(doc)
105 ADD_SUBDIRECTORY(schemas)
106 ADD_SUBDIRECTORY(modules)
107+ADD_SUBDIRECTORY(include)
108
109 ADD_DEFINITIONS(-Dzorba_EXPORTS)
110 ADD_SUBDIRECTORY(src)
111@@ -535,4 +557,4 @@
112 # This dependency is zorba-only related, which is why it's added here
113 # and not within zorba-modules, which is for general use in other
114 # non-zorba modules.
115-ADD_DEPENDENCIES(check_uris gen_diag_modules)
116+ADD_DEPENDENCIES(check_core_uris gen_diag_modules)
117
118=== modified file 'CPackSourceConfig.cmake.in'
119--- CPackSourceConfig.cmake.in 2009-10-30 16:24:51 +0000
120+++ CPackSourceConfig.cmake.in 2012-03-14 02:09:24 +0000
121@@ -19,7 +19,7 @@
122
123 SET(CPACK_CMAKE_GENERATOR "Unix Makefiles")
124 SET(CPACK_GENERATOR "TGZ;TZ")
125-SET(CPACK_IGNORE_FILES "test/coverity/;dist/;_CPack_Packages/;build/;build./;CVS/;/\\.svn/;\\.swp$;\\.#;/#")
126+SET(CPACK_IGNORE_FILES "test/coverity/;dist/;_CPack_Packages/;build/;build./;CVS/;/\\.svn/;\\.swp$;\\.#;/#;\\.bzr/")
127 SET(CPACK_INSTALLED_DIRECTORIES "@CMAKE_SOURCE_DIR@;/")
128 SET(CPACK_INSTALL_CMAKE_PROJECTS "")
129 SET(CPACK_MODULE_PATH "")
130
131=== modified file 'ChangeLog'
132--- ChangeLog 2011-10-05 22:39:18 +0000
133+++ ChangeLog 2012-03-14 02:09:24 +0000
134@@ -1,13 +1,92 @@
135 Zorba - The XQuery Processor
136
137-version 2.x
138-
139- * Custom Full-text thesaurus.
140- * Fixed bug #3401971 (node-by-reference on dynamic collections)
141+version 2.2
142+
143+ * Add --compile-plan (-c) and --execute-plan (-e) options to zorba command line.
144+ * Add XQuery 3.0 concat operator (http://www.w3.org/TR/xquery-30/#id-string-concat-expr)
145+ * Fixed bug 923015 (clone() not implemented for full-text expressions)
146+ * No-copy optimization: avoids copying nodes during node-constructor expressions.
147+ * Added external function annotations %ann:propagates-input-nodes and
148+ %ann:must-copy-input-nodes to be used by the no-copy optimization.
149+ * Caching of results for recursive functions with atomic parameter and return types.
150+ * Added %ann:cache and %ann:no-cache to enable or disable caching of results of functions with atomic parameter and return types.
151+ * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)
152+ * Fixed bug 867509 (Can not handle largest xs:unsignedLong values)
153+ * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
154+ * New URI module providing percent-decoding functions.
155+ * Optimization: change the implementation of the free-vars annotation and got rid
156+ of the annotations map in expressions.
157+ * Fixed bug 909126 (bug in cloning of var_expr)
158+ * Fixed bug in destruction of exit_catcher_expr
159+ * Fixed bug #867024 (error messages)
160+ * Types-related optimizations for runtime operators (comparisons, FnBoolean, Or, And,
161+ Compare, instance-of, cast, castable, treat, promote).
162+ * Fixed bug #911585 (management of variables during eval)
163+ * Fixed bug #866423 (fn:empty and fn:exists iterators must reset their input in
164+ case of early-out)
165+ * More efficient implementation for base64Binary items
166+ * Added index management function to the C++ api's StaticCollectionManager.
167+ * Fixed bug #872288 (reset recursive flag during node rename)
168+ * Fixed bug #905041 (allow for the default element and function namespaces to be
169+ set multiple times via the c++ api).
170+ * Fixed bug #907872 (segfault when returning an input ItemSequence from an external function).
171+ * Fixed bug #905050 (setting and getting the context item type via the c++ api).
172+ * Added createDayTimeDuration, createYearMonthDuration, createDocumentNode, createCommentNode, createPiNode to api's ItemFactory.
173+ * Fixed bug in codegen: do not create a materialize clause if one exists already
174+ * Added split function to the string module that allows for streamable tokenization but doesn't have regular expression
175+ support.
176+ * Fixed bug involving positional var and groupby
177+ * Optimization: preallocate and reuse temp sequence iterator for LetVarITerator
178+ and CtxVarIterator.
179+ * Optimization: enhanced push-down of positional predicate into LetVarITerator
180+ and CtxVarIterator.
181+ * Fixed bug #867266 (do not hoist updating expressions)
182+ * Fixed bug #867022 (added location and params to some XPTY0004 errors)
183+ * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
184+ * Add new XQuery interface for the PHP bindings.
185+ * Added two API methods StaticContext::getFunctions to introspect the functions of a static context
186+ * Added API method Item::getNamespaceBindings().
187+ * Added a transcoding streambuffer to the API which allows transcoding arbitrary encodings
188+ from and to UTF-8
189+ * file:read-text is able to handle arbitrary encodings (fixes bug #867159)
190+ * http:send-request is able to handle arbitrary encodings
191+ * Fixed bug #917981 (disallow declaring same module twice).
192+ * Added API method StaticContext::getNamespaceBindings() (see bug #905035)
193+ * Deprecated StaticContext:getNamespaceURIByPrefix()
194+ * Fixed bug #943788 (streamable string is not seekable)
195+ * Fixed bug 921624 (slow queries with bogus example.com schema URIs)
196+ * Fixed bug #918211 (xqueryx fulltext w3c conformance generation)
197+ * Fixed bug #918157 (Add XQFTTS to validation queue)
198+ * Fixed bug with unversioned modules with C++ external functions
199+ * Fixed bug #878508 (JSON Module not escaping escape characters)
200+ * Fixed bug #912579 (validate-in-place on non-root elements)
201+ * Fixed bug #891209 (validation with xsi:type returns untyped)
202+
203+version 2.1
204+
205+New Features:
206+ * New node-position module. This module allows to obtain a representation of a node position, which
207+ can be used to assess structural relationships with other nodes.
208+ * New node-reference module. References can be obtained for any node, and
209+ different nodes cannot have the same identifier.
210+ * Custom Full-text thesaurus using Zorba URI resolver mechanism.
211+ * Modified C++ API to add isSequential, getExternalVariables, isBoundContextItem and
212+ isBoundExternalVariable Functions
213+ * Collection allows to retrieve information about the type
214+ and the annotations of a static collection.
215+ * Implemented the probe-index-range-value for general indexes
216+ * Added ExternalFunctionParameter class to be registered in the DynamicContext
217+ * New module for compiling and executing XQueries from XQuery (xqxq)
218+ * External functions are allowed to be updating (i.e. return a pending update list)
219+
220+Optimization:
221 * Optimization for positioned sequence access (e.g. $x[$x[1]] where $x is a
222 sequence of integers)
223- * documentation improvements
224- * installer improvements
225+ * Optimization for count(collection()) expressions
226+ * Optimization of the fn:substring function in the case when its $start and $length arguments
227+ are integers
228+
229+Bug Fixes/Other Changes:
230 * Fixed bug #3403291 (build for Fedora 15)
231 * Fixed bug #3397293 (Incorrect XQueryX error message)
232 * Fixed bug #3398637 (Nested element constructors cause loss of namespace bindings)
233@@ -15,20 +94,19 @@
234 * Fixed bug #3404689 (assignment problem in flwor)
235 * Fix for bug #3404450 (testdriver_mt problem: caching and validation of docs)
236 * Fixed installation bug to not install the .so for test modules
237- * Fix for running ctest on Windows
238 * Fixed bug #3390410 (Adding a node to a collection causes out of bound in vector)
239 * Fixed bug #3406200 (node types were not being moved to new tree during node detach)
240 * Fixed bug #3406191 (Namespace bindings lost after update due to bug in node detach)
241 * Fixed bug #3290122 (ZDST0003 needs collection name)
242- * Collection allows to retrieve information about the type
243- and the annotations of a static collection.
244 * Fixed bug #3406272 (merging of adjacent text nodes must be done after all
245 updates have been applied).
246+ * Don't raise warnings for unknown annotations.
247 * Fixed bug #3409344 (during detach, if the node being detached is the root of
248 its tree, it should be detached from the tree as well; otherwise memory
249 corruption will occur)
250- * Fixed bug # (Should not destroy the parent of a node that is being detached
251- before the detach is done).
252+ * Fixed bug # (Should not destroy the parent of a node that is being detached
253+ before the detach is done).
254+ * Added const qualifier to StaticContext::getAuditEvent()
255 * Fixed bug #3408181 (available-collection() returns undeclared collections)
256 * Fixed bug #859465 (Fatal error if a PUL contains two deactivate IC primitives)
257 * Fixed bug #859467 (Fatal error if a PUL contains two activate Foreign Key primitives)
258@@ -36,11 +114,53 @@
259 * Fixed bug #859522 (Fatal error if a PUL contains two delete document primitives)
260 * Fixed bug #859968 (Using put on an attribute produces an invalid XDM instance and may cause segmentation faults)
261 * Fixed bug #855314 (should not fold a constant expr that returns an error item)
262- * Added ExternalFunctionParameter class to be registered in the DynamicContext
263+ * Fixed bug when parsing a document with a base-uri attribute.
264 * Fixed bug #863320 (Sentence is incorrectly incremented when token characters end without sentence terminator)
265 * Fixed bug #863730 (static delete-node* functions don't raise ZDDY0012)
266- * Implemented the probe-index-range-value for general indexes
267+ * Removed ZSTR0005 and ZSTR0006 error codes
268+ * Fixed bug #868258 (Assertion failure with two delete collection)
269+ * Fixed bug #871623 and #871629 (assertion failures with insertions in dynamic collections)
270+ * Fixed bug #867262 (allow reuse of iterator over ExtFuncArgItemSequence)
271+ * Fixed bug #869024 (segmentation fault with node-reference)
272+ * Fixed bug #869025 (segmentation fault with node-reference)
273+ * New node-reference module. References can be obtained for any node, and
274+ different nodes cannot have the same identifier.
275+ * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)
276+ * Added undo for node revalidation
277+ * Optimization for count(collection()) expressions
278+ * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
279+ * Fixed bug #872799 (validate-in-place can set incorrect types)
280+ * Fixed bug #855715 (Invalid escaped characters in regex not caught)
281+ * Fixed bug #868325 (fn:analyze-string fails with some recursive subgroups)
282+ * Fixed bug #872697 (segmentation fault with validation of NMTOKENS)
283+ * General index cannot be declared as unique if the type of its key is
284+ xs:anyAtomicType or xs:untypedAtomic.
285+ * Added undo for node revalidation
286+ * Optimization for count(collection()) expressions
287+ * Fixed bug #867133 (SWIG PHP build failure on Mac OSX)
288+ * Fixed bug #872796 (validate-in-place can interfere with other update primitives)
289+ * Fixed bug #872799 (validate-in-place can set incorrect types)
290+ * Fixed bug #872850 (Serialization of Tumbling Window For fails)
291+ * Fixed bug #855715 (Invalid escaped characters in regex not caught)
292+ * Fixed bug #862089 (Split binary/xq install directories for modules) by
293+ splitting "module path" into separate URI and Library paths
294+ * Fixed bug #872502 (validation of the JSON module xqdoc fails)
295+ * Fixed bug #897619 (testdriver_mt can not run the XQueryX tests)
296+ * Fixed bug #867107 (xqdoc dependency to zorba is wrong)
297+ * Fixed bug #897616 (Fix the generation of the XQFTTS report results for
298+ W3C)
299+
300+version 2.0.3
301 * Fixed bug #867662 ("nullptr" warning)
302+ * documentation improvements
303+
304+version 2.0.2
305+ * Fixed bug #3401971 (node-by-reference on dynamic collections)
306+ * documentation improvements
307+ * installer improvements
308+ * Fixed bug #3403291 (build for Fedora 15)
309+ * Don't install the .so for test modules
310+ * Fix for running ctest on Windows
311
312 version 2.0.1
313
314
315=== modified file 'NOTICE.txt'
316--- NOTICE.txt 2011-09-01 01:58:54 +0000
317+++ NOTICE.txt 2012-03-14 02:09:24 +0000
318@@ -1,5 +1,5 @@
319 -----------
320-Zorba 2.0.1
321+Zorba 2.1.0
322 -----------
323
324 (Note: This file is generated automatically from NOTICE.xml.
325
326=== modified file 'bin/CMakeLists.txt'
327--- bin/CMakeLists.txt 2011-08-05 02:21:55 +0000
328+++ bin/CMakeLists.txt 2012-03-14 02:09:24 +0000
329@@ -15,33 +15,38 @@
330 INCLUDE_DIRECTORIES(AFTER ${CMAKE_SOURCE_DIR}/src/)
331 INCLUDE_DIRECTORIES(AFTER ${CMAKE_CURRENT_SOURCE_DIR})
332
333-IF(ZORBA_WITH_DEBUGGER_CLIENT)
334- CONFIGURE_FILE (debug_client/event_handler_init.cpp.in debug_client/event_handler_init.cpp)
335-
336- SET(DEBUG_CLIENT_SRCS
337- debug_client/tuple.h
338- debug_client/main.cpp
339- debug_client/debug_command.h
340- debug_client/debug_command.cpp
341- debug_client/command_line_handler.h
342- debug_client/command_line_handler.cpp
343- debug_client/lock_free_queue.h
344- debug_client/event_handler.h
345- debug_client/event_handler.cpp
346- ${CMAKE_CURRENT_BINARY_DIR}/debug_client/event_handler_init.cpp
347+IF (ZORBA_WITH_DEBUGGER)
348+ IF (NOT WIN32)
349+ FIND_PACKAGE (Libedit)
350+ IF (LIBEDIT_FOUND)
351+ INCLUDE_DIRECTORIES (${LIBEDIT_INCLUDE_DIRS})
352+ SET (LIBEDIT_LIBS ${LIBEDIT_LIBRARIES})
353+ SET (ZORBA_HAVE_LIBEDIT_H ${LIBEDIT_FOUND})
354+ ENDIF (LIBEDIT_FOUND)
355+ ENDIF (NOT WIN32)
356+
357+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h)
358+ MESSAGE(STATUS "configured ${CMAKE_CURRENT_SOURCE_DIR}/debugger/config.h.cmake --> ${CMAKE_CURRENT_BINARY_DIR}/debugger/config.h")
359+ INCLUDE_DIRECTORIES (BEFORE ${CMAKE_CURRENT_BINARY_DIR}/debugger)
360+
361+ SET (DEBUG_CLIENT_SRCS
362+ debugger/main.cpp
363+ debugger/xqdb_client.cpp
364+ debugger/process_listener.cpp
365+ debugger/command_prompt.cpp
366+ debugger/command_line_handler.cpp
367+ debugger/event_handler.cpp
368 )
369
370- CONFIGURE_FILE (debug_client/message-handler.xq message-handler.xq)
371-
372- ZORBA_GENERATE_EXE("debuggercmd" "${DEBUG_CLIENT_SRCS}" "" "debugger" "bin")
373-ENDIF(ZORBA_WITH_DEBUGGER_CLIENT)
374+ ZORBA_GENERATE_EXE ("xqdb" "${DEBUG_CLIENT_SRCS}" "${LIBEDIT_LIBS}" "xqdb" "bin")
375+ENDIF (ZORBA_WITH_DEBUGGER)
376
377 SET(SRCS
378 zorbacmd.cpp
379 zorbacmdproperties.cpp
380 error_printer.cpp
381 util.cpp
382- module_path.cpp
383+ path_util.cpp
384 )
385
386 INCLUDE("${CMAKE_SOURCE_DIR}/cmake_modules/ZorbaGenerateExe.cmake")
387@@ -84,3 +89,37 @@
388 # test the --option option to set an option in the static context
389 ZORBA_ADD_TEST(bin/zorba_option zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/test/option.xq" -f --option "{http://www.zorba-xquery.com}option=value")
390 ZORBA_SET_TEST_PROPERTY(bin/zorba_option PASS_REGULAR_EXPRESSION "value")
391+
392+# test the --uri-path, --lib-path, and --module-path args.
393+# Use the versioning tests as they utilize test modules already.
394+SET (_testdir
395+ "${CMAKE_CURRENT_SOURCE_DIR}/../test/rbkt/Queries/zorba/versioning")
396+SET (_uridir "${CMAKE_BINARY_DIR}/TEST_URI_PATH")
397+SET (_libdir "${CMAKE_BINARY_DIR}/TEST_LIB_PATH")
398+ZORBA_ADD_TEST(bin/zorba_uri_path_1 zorbacmd -f -q "${_testdir}/import1.xq"
399+ --uri-path "${_uridir}")
400+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_1
401+ PASS_REGULAR_EXPRESSION "hello, v2")
402+
403+ZORBA_ADD_TEST(bin/zorba_uri_path_2 zorbacmd -f -q "${_testdir}/external1.xq"
404+ --uri-path "${_uridir}")
405+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_2
406+ PASS_REGULAR_EXPRESSION "ZXQP0008")
407+
408+ZORBA_ADD_TEST(bin/zorba_uri_path_3 zorbacmd -f -q "${_testdir}/external1.xq"
409+ --uri-path "${_uridir}" --lib-path "${_libdir}")
410+ZORBA_SET_TEST_PROPERTY(bin/zorba_uri_path_3
411+ PASS_REGULAR_EXPRESSION "hello, v2")
412+
413+IF(WIN32)
414+ SET(PATH_SEP ";")
415+ELSE(WIN32)
416+ SET(PATH_SEP ":")
417+ENDIF(WIN32)
418+ZORBA_ADD_TEST(bin/zorba_module_path_1 zorbacmd -f -q "${_testdir}/external1.xq"
419+ --module-path "${_libdir}${PATH_SEP}${_uridir}")
420+ZORBA_SET_TEST_PROPERTY(bin/zorba_module_path_1
421+ PASS_REGULAR_EXPRESSION "hello, v2")
422+
423+# test compilation of the perf script
424+ZORBA_ADD_TEST(bin/zorba_compilechk4 zorbacmd -q "${CMAKE_CURRENT_SOURCE_DIR}/../test/zperf/src/start.xq" -f --compile-only)
425
426=== removed file 'bin/debug_client/debug_command.cpp'
427--- bin/debug_client/debug_command.cpp 2011-07-01 01:53:24 +0000
428+++ bin/debug_client/debug_command.cpp 1970-01-01 00:00:00 +0000
429@@ -1,99 +0,0 @@
430-/*
431- * Copyright 2006-2008 The FLWOR Foundation.
432- *
433- * Licensed under the Apache License, Version 2.0 (the "License");
434- * you may not use this file except in compliance with the License.
435- * You may obtain a copy of the License at
436- *
437- * http://www.apache.org/licenses/LICENSE-2.0
438- *
439- * Unless required by applicable law or agreed to in writing, software
440- * distributed under the License is distributed on an "AS IS" BASIS,
441- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
442- * See the License for the specific language governing permissions and
443- * limitations under the License.
444- */
445-#include <iostream>
446-#include "debug_client/debug_command.h"
447-
448-namespace zorba { namespace debugclient {
449-
450-
451- void CommandLine::execute()
452- {
453- for (;;) {
454- std::cout << "zdb>> ";
455- std::string command;
456- std::getline(std::cin, command);
457- std::vector<std::string> args;
458- args << command;
459- std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.find(args[0]);
460- if (lIter == theCommands.end()) {
461- std::cout << args[0] << ": Command not found" << std::endl;
462- continue;
463- }
464- if (!lIter->second->execute(args))
465- continue;
466- return;
467- }
468- }
469-
470-
471- CommandLine::~CommandLine()
472- {
473- for (std::map<std::string, UntypedCommand*>::iterator i = theCommands.begin();
474- i != theCommands.end(); ++i)
475- {
476- delete i->second;
477- }
478- }
479-
480- CommandLine& CommandLine::operator<<(UntypedCommand *aCommand)
481- {
482- theCommands.insert(std::make_pair(aCommand->get_name(), aCommand));
483- return *this;
484- }
485-}}
486-
487-namespace std {
488- vector<string>& operator<< (vector<string>& vec, const string& str)
489- {
490- string::size_type before = 0;
491- string::size_type pos = str.find(" ", 0);
492- while (pos != str.npos) {
493- std::string lSub = str.substr(before, pos - before);
494- if (lSub[0] == '"') {
495- std::string::size_type lBeforeCopy = before;
496- do {
497- lBeforeCopy = str.find("\"", lBeforeCopy + 1);
498- } while (pos != str.npos && str.size() > pos + 1 && str[pos + 1] == '\\');
499- pos = lBeforeCopy;
500- lSub = str.substr(before + 1, pos - before - 1);
501- }
502- vec.push_back(lSub);
503- before = pos + 1;
504- pos = str.find(" ", before);
505- }
506- std::string lSub = str.substr(before);
507- if (lSub[0] == '"') {
508- pos = str.find("\"", before + 1);
509- lSub = str.substr(before + 1, pos - before - 1);
510- }
511- vec.push_back(lSub);
512- return vec;
513- }
514-
515- set<string>& operator<< (set<string>& vec, const string& str)
516- {
517- string::size_type before = 0;
518- string::size_type pos = str.find(" ", 0);
519- while (pos != str.npos) {
520- vec.insert(str.substr(before, pos));
521- before = pos + 1;
522- pos = str.find(" ", before);
523- }
524- vec.insert(str.substr(before));
525- return vec;
526- }
527-
528-}
529
530=== removed file 'bin/debug_client/event_handler_init.cpp.in'
531--- bin/debug_client/event_handler_init.cpp.in 2011-07-01 01:53:24 +0000
532+++ bin/debug_client/event_handler_init.cpp.in 1970-01-01 00:00:00 +0000
533@@ -1,41 +0,0 @@
534-/*
535- * Copyright 2006-2008 The FLWOR Foundation.
536- *
537- * Licensed under the Apache License, Version 2.0 (the "License");
538- * you may not use this file except in compliance with the License.
539- * You may obtain a copy of the License at
540- *
541- * http://www.apache.org/licenses/LICENSE-2.0
542- *
543- * Unless required by applicable law or agreed to in writing, software
544- * distributed under the License is distributed on an "AS IS" BASIS,
545- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
546- * See the License for the specific language governing permissions and
547- * limitations under the License.
548- */
549-#include <fstream>
550-#include "debug_client/event_handler.h"
551-
552-namespace zorba { namespace debugclient {
553-
554- std::istream* EventHandler::getCurrentDirectory() {
555- const char* build_dir = "@CMAKE_BINARY_DIR@/bin/message-handler.xq";
556- const char* install_dir =
557-#ifndef WIN32
558- "@CMAKE_INSTALL_PREFIX@/bin/";
559-#else
560- "C:/Program Files/Zorba XQuery Processor @ZORBA_MAJOR_NUMBER@.@ZORBA_MINOR_NUMBER@.@ZORBA_PATCH_NUMBER@/bin/";
561-#endif
562- std::auto_ptr<std::ifstream> stream(new std::ifstream(build_dir));
563- if (stream->good()) {
564- return stream.release();
565- }
566- stream.reset(new std::ifstream(install_dir));
567- if (stream->good()) {
568- return stream.release();
569- }
570- return 0;
571- }
572-
573-}} // end of namespace zorba::debugclient
574-
575
576=== removed file 'bin/debug_client/lock_free_queue.cpp'
577--- bin/debug_client/lock_free_queue.cpp 2011-07-01 01:53:24 +0000
578+++ bin/debug_client/lock_free_queue.cpp 1970-01-01 00:00:00 +0000
579@@ -1,16 +0,0 @@
580-/*
581- * Copyright 2006-2008 The FLWOR Foundation.
582- *
583- * Licensed under the Apache License, Version 2.0 (the "License");
584- * you may not use this file except in compliance with the License.
585- * You may obtain a copy of the License at
586- *
587- * http://www.apache.org/licenses/LICENSE-2.0
588- *
589- * Unless required by applicable law or agreed to in writing, software
590- * distributed under the License is distributed on an "AS IS" BASIS,
591- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
592- * See the License for the specific language governing permissions and
593- * limitations under the License.
594- */
595-#include "lock_free_queue.h"
596
597=== removed file 'bin/debug_client/message-handler.xq'
598--- bin/debug_client/message-handler.xq 2011-08-26 23:36:24 +0000
599+++ bin/debug_client/message-handler.xq 1970-01-01 00:00:00 +0000
600@@ -1,165 +0,0 @@
601-(:
602- : Copyright 2006-2009 The FLWOR Foundation.
603- :
604- : Licensed under the Apache License, Version 2.0 (the "License");
605- : you may not use this file except in compliance with the License.
606- : You may obtain a copy of the License at
607- :
608- : http://www.apache.org/licenses/LICENSE-2.0
609- :
610- : Unless required by applicable law or agreed to in writing, software
611- : distributed under the License is distributed on an "AS IS" BASIS,
612- : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
613- : See the License for the specific language governing permissions and
614- : limitations under the License.
615-:)
616-
617-import module namespace refl = 'http://www.zorba-xquery.com/modules/reflection';
618-import module namespace sctx = "http://www.zorba-xquery.com/modules/introspection/sctx";
619-import module namespace base64 = "http://www.zorba-xquery.com/modules/converters/base64";
620-
621-
622-declare variable $local:localns as xs:string := 'http://www.w3.org/2005/xquery-local-functions';
623-
624-
625-declare variable $local:endl as xs:string := '
626-';
627-
628-declare function local:has-to-stop($resp as element())
629-{
630- fn:not(($resp/@command/data(.) eq "stop" and $resp/@reason/data(.) eq "ok")
631- or ($resp/@status/data(.) eq "stopped")
632- or ($resp/@status/data(.) eq "stopping"))
633-};
634-
635-declare function local:status($resp as element())
636-{
637- fn:concat(
638- "Status: ", $resp/@status/data(.), $local:endl,
639- "Reason: ", $resp/@reason/data(.), $local:endl,
640- let $msg := $resp/text()
641- return
642- if (fn:empty($msg) or $msg eq "") then
643- ""
644- else
645- fn:concat($msg, $local:endl)
646- )
647-};
648-
649-
650-declare function local:run($resp as element()) {
651- if ($resp/@status/data(.) eq "starting") then
652- "Starting query"
653- else
654- local:status($resp)
655-};
656-
657-declare function local:stop($resp as element())
658-{
659- local:status($resp)
660-};
661-
662-declare function local:breakpoint_set($resp as element())
663-{
664- if ($resp/error) then
665- fn:concat("Error when setting a breakpoint: ", if ($resp/error/message) then $resp/error/message/text() else concat(" errcode: ", data($resp/error/@code)))
666- else
667- fn:concat("set breakpoint with id ", data($resp/@id), " and state ", data($resp/@state))
668-};
669-
670-declare function local:breakpoint_list($resp as element())
671-{
672- string-join(
673- for $b in $resp/breakpoint
674- return concat("Breakpoint ", data($b/@id), " at ", data($b/@filename), ":", data($b/@lineno), " ", data($b/@state)),
675- $local:endl
676- )
677-};
678-
679-declare function local:breakpoint_remove($resp as element())
680-{
681- "Breakpoint removed"
682-};
683-
684-declare function local:stack_depth($resp as element())
685-{
686- concat("Depth: ", data($resp/@depth))
687-};
688-
689-declare function local:stack_get($resp as element())
690-{
691- string-join(
692- for $s in $resp/stack
693- return concat("Level ", data($s/@level), " at ", data($s/@filename), ":", data($s/@lineno)),
694- $local:endl
695- )
696-};
697-
698-
699-declare function local:context_names($resp as element())
700-{
701- string-join(
702- for $c in $resp/context
703- return concat("Context: ", data($c/@name), " id: ", data($c/@id)),
704- $local:endl
705- )
706-};
707-
708-declare function local:context_get($resp as element())
709-{
710- string-join(
711- for $p in $resp/property
712- return concat(data($p/@fullname), ": [", data($p/@type), "]",
713- if ($p/text() ne "") then concat(": ", base64:decode($p/text())) else ""),
714- $local:endl
715- )
716-};
717-
718-declare function local:eval($resp as element())
719-{
720- if (data($resp/@success) eq "1") then
721- local:context_get($resp)
722- else
723- concat("Eval failed", ":", $resp/error/message/text())
724-};
725-
726-declare function local:process-response($resp as element())
727-{
728- if (data($resp/@command) eq "") then
729- (fn:true(), $resp/@transaction_id/data(.), local:status($resp))
730- else
731- let $fun-cont-name := fn:QName($local:localns, concat("local:", $resp/@command/data(.), "-cont"))
732- let $fun-msg-name := fn:QName($local:localns, concat("local:", $resp/@command/data(.)))
733- return (
734- if (sctx:function-arguments-count($fun-cont-name) = 1) then
735- refl:invoke($fun-cont-name, $resp)
736- else
737- local:has-to-stop($resp),
738- $resp/@transaction_id/data(.),
739- if (sctx:function-arguments-count($fun-msg-name) = 1) then
740- refl:invoke($fun-msg-name, $resp)
741- else
742- "Recieved a message - command not implemented"
743- )
744-};
745-
746-declare function local:process-init($init as element())
747-{
748- fn:true(),
749- 0,
750- fn:concat(fn:string-join(
751- ('Established connection with', $init/@language/data(.), 'client', $init/@appid/data(.)), ' '), '
752-')
753-};
754-
755-declare function local:main($response as element()) {
756- let $process-fun as xs:QName := fn:QName($local:localns, concat("local:process-", node-name($response)))
757- return
758- if (sctx:function-arguments-count($process-fun) = 1) then
759- refl:invoke($process-fun, $response)
760- else (
761- true(),
762- ($response/@transaction_id, 0)[1]/data(.),
763- "ERROR: Recieved unknown node from client"
764- )
765-};
766
767=== renamed directory 'bin/debug_client' => 'bin/debugger'
768=== renamed file 'bin/debug_client/debug_command.h' => 'bin/debugger/command.h'
769--- bin/debug_client/debug_command.h 2011-07-04 08:05:46 +0000
770+++ bin/debugger/command.h 2012-03-14 02:09:24 +0000
771@@ -14,7 +14,9 @@
772 * limitations under the License.
773 */
774 #pragma once
775-#include <zorba/config.h>
776+#ifndef ZORBA_DEBUGGER_COMMAND_H
777+#define ZORBA_DEBUGGER_COMMAND_H
778+
779 #include <string>
780 #include <vector>
781 #include <iostream>
782@@ -23,151 +25,18 @@
783 #include <sstream>
784 #include <memory>
785 #include <typeinfo>
786-#include "debug_client/tuple.h"
787-
788-namespace zorba { namespace debugclient {
789+
790+#include <zorba/config.h>
791+
792+#include "command_arg.h"
793+#include "tuple.h"
794+
795+
796+namespace zorba { namespace debugger {
797
798 class DebugClientParseException : public std::exception {
799 };
800
801- template<typename Tuple>
802- class CommandArg;
803-
804- template<typename Tuple>
805- class CommandArgInstance {
806- public:
807- virtual int get_index() const = 0;
808- virtual const CommandArg<Tuple>* get_arg() const = 0;
809- virtual void insertValue(Tuple& t) = 0;
810- virtual bool isSet(Tuple& t) const = 0;
811- };
812-
813- template<typename T, int Idx, typename Tuple>
814- class TypedCommandArgInstance : public CommandArgInstance<Tuple>
815- {
816- public:
817- TypedCommandArgInstance(T aValue, const CommandArg<Tuple>* aArg)
818- : theValue(aValue), theArg(aArg) {}
819- virtual int get_index() const { return Idx; }
820- virtual const CommandArg<Tuple>* get_arg() const { return theArg; }
821- virtual void insertValue(Tuple& t)
822- {
823- ZORBA_TR1_NS::get<Idx>(t).first = true;
824- ZORBA_TR1_NS::get<Idx>(t).second = theValue;
825- }
826- virtual bool isSet(Tuple& t) const
827- {
828- return ZORBA_TR1_NS::get<Idx>(t).first;
829- }
830- private:
831- T theValue;
832- const CommandArg<Tuple>* theArg;
833- };
834-
835- template<typename Tuple>
836- class CommandArgType {
837- public:
838- virtual CommandArgInstance<Tuple>* parse(const std::string& str,
839- const CommandArg<Tuple>* arg) = 0;
840- virtual bool isVoid() const = 0;
841- virtual bool isSet(Tuple& t) const = 0;
842- virtual ~CommandArgType() {}
843- };
844-
845- template<typename T, int Idx, typename Tuple>
846- class TypedCommandArgType : public CommandArgType<Tuple> {
847- public:
848- typedef T Type;
849- public: // implementation
850- TypedCommandArgType(bool aIsVoid) : theIsVoid(aIsVoid) {}
851- TypedCommandArgType(const T& aValue,
852- bool aIsVoid)
853- : theDefault(aValue), theIsVoid(aIsVoid) {}
854- virtual CommandArgInstance<Tuple>* parse(const std::string& str,
855- const CommandArg<Tuple>* arg)
856- {
857- T aValue;
858- std::stringstream stream(str);
859- stream >> aValue;
860- if (stream.fail()) {
861- std::cerr << "Could not parse argument of type "
862- << typeid(T).name()
863- << std::endl;
864- return 0;
865- }
866- return new TypedCommandArgInstance<T, Idx, Tuple>(aValue, arg);
867- }
868- virtual bool isVoid() const { return theIsVoid; }
869- virtual bool isSet(Tuple& t) const
870- {
871- return ZORBA_TR1_NS::get<Idx>(t).first;
872- }
873- private:
874- TypedCommandArgType<T, Idx, Tuple>() {}
875- T theDefault;
876- bool theIsVoid;
877- };
878-
879- template<typename Tuple>
880- class CommandArg {
881- public:
882- CommandArg(unsigned aId,
883- CommandArgType<Tuple>* aType,
884- const std::set<std::string>& aFlags,
885- const std::string& aDescription,
886- bool aIsRequired)
887- : theId(aId),
888- theType(aType),
889- theFlags(aFlags),
890- theDescription(aDescription),
891- theIsRequired(aIsRequired)
892- {
893- }
894- ~CommandArg() { delete theType; }
895- unsigned get_id() const { return theId; }
896- bool canHandle(const std::string& arg) const
897- {
898- if (theFlags.find(arg) != theFlags.end()) {
899- return true;
900- }
901- return false;
902- }
903- CommandArgInstance<Tuple>* parse(const std::string& str) const
904- {
905- return theType->parse(str, this);
906- }
907- bool isVoid() const {
908- return theType->isVoid();
909- }
910- bool isRequired() const { return theIsRequired; }
911- std::string get_name() const {
912- return *(theFlags.begin());
913- }
914- bool isSet(Tuple& t) const
915- {
916- return theType->isSet(t);
917- }
918- private:
919- unsigned theId;
920- CommandArgType<Tuple>* theType;
921- std::set<std::string> theFlags;
922- std::string theDescription;
923- bool theIsRequired;
924- };
925-}} // end namespace zorba
926-
927-namespace std {
928-
929- /**
930- * This is a helper split function
931- */
932- vector<string>& operator<< (vector<string>& vec, const string& str);
933-
934- set<string>& operator<< (set<string>& vec, const string& str);
935-} //end namespace std
936-
937-namespace zorba { namespace debugclient {
938-
939 template<typename Func, typename Tuple, int CommandIdx>
940 class CommandInstance
941 {
942@@ -188,8 +57,10 @@
943
944 class UntypedCommand {
945 public:
946- virtual std::string get_name() const = 0;
947- virtual std::string get_description() const = 0;
948+ virtual std::string getName() const = 0;
949+ virtual std::set<std::string> getAliases() const = 0;
950+ virtual std::string getDescription() const = 0;
951+ virtual void printHelp() const = 0;
952 virtual bool execute(const std::vector<std::string>& args) = 0;
953 };
954
955@@ -197,77 +68,141 @@
956 class Command : public UntypedCommand {
957 public:
958 Command(const std::string& aName, Func& aFunction, const std::string& aDescription)
959- : theName(aName), theFunction(aFunction), theDescription(aDescription) {}
960+ : theName(aName), theFunction(aFunction), theDescription(aDescription)
961+ {}
962+
963+ Command(const std::string& aName, const std::set<std::string> aAliases, Func& aFunction, const std::string& aDescription)
964+ : theName(aName), theAliases(aAliases), theFunction(aFunction), theDescription(aDescription)
965+ {}
966+
967 ~Command();
968+
969 public:
970- Command& operator() (unsigned aId,
971- const std::string& aFlags,
972- CommandArgType<Tuple>* aType,
973- const std::string& aDescription = "",
974- bool isRequired = false);
975- virtual std::string get_name() const { return theName; }
976- virtual std::string get_description() const { return theDescription; }
977+
978+ void
979+ addArgument(
980+ unsigned aId,
981+ const std::string& aFlags,
982+ CommandArgType<Tuple>* aType,
983+ const std::string& aDescription = "",
984+ bool isRequired = false);
985+
986+ static void
987+ splitNames(
988+ const std::string& names,
989+ std::set<std::string>& set);
990+
991+ virtual std::string
992+ getName() const
993+ {
994+ return theName;
995+ }
996+
997+ virtual std::set<std::string> getAliases() const
998+ {
999+ return theAliases;
1000+ }
1001+
1002+ virtual std::string
1003+ getDescription() const
1004+ {
1005+ return theDescription;
1006+ }
1007+
1008+ virtual void
1009+ printHelp() const;
1010+
1011 virtual bool execute(const std::vector<std::string>& args)
1012 {
1013 CommandInstance<Func, Tuple, CommandIdx> instance(theFunction, theTuple);
1014- if (instance.parseArguments(args, theArgs))
1015+ if (instance.parseArguments(args, theArgs)) {
1016 instance.execute();
1017- else
1018- return false;
1019- return true;
1020+ return true;
1021+ }
1022+ return false;
1023 }
1024 private:
1025 std::string theName;
1026+ std::set<std::string> theAliases;
1027 Func& theFunction;
1028 Tuple theTuple;
1029 std::string theDescription;
1030- std::map<std::string, CommandArg<Tuple>* > theArgs;
1031- };
1032-
1033- class CommandLine {
1034- public:
1035- ~CommandLine();
1036- public:
1037- void execute();
1038- CommandLine& operator<< (UntypedCommand* aCommand);
1039- private:
1040- std::map<std::string, UntypedCommand*> theCommands;
1041- };
1042-
1043- template<typename Func, typename Tuple, int CommandIdx>
1044- Command<Func, Tuple, CommandIdx>::~Command()
1045- {
1046- typedef std::map<std::string, CommandArg<Tuple>* > ArgType;
1047- for (typename ArgType::iterator i = theArgs.begin(); i != theArgs.end(); ++i) {
1048- delete i->second;
1049- }
1050- }
1051-
1052-
1053- template<typename Func, typename Tuple, int CommandIdx>
1054- Command<Func, Tuple, CommandIdx>&
1055- Command<Func, Tuple, CommandIdx>::operator() (unsigned aId,
1056- const std::string& aFlags,
1057- CommandArgType<Tuple>* aType,
1058- const std::string& aDescription,
1059- bool isRequired)
1060- {
1061- std::set<std::string> args;
1062- args << aFlags;
1063- for (std::set<std::string>::iterator i = args.begin(); i != args.end(); ++i) {
1064- std::string toAdd = (i->size() == 1) ? "-" + *i : "--" + *i;
1065- theArgs.insert(std::make_pair(toAdd,
1066- new CommandArg<Tuple>(aId,
1067- aType,
1068- args,
1069- aDescription,
1070- isRequired)
1071- )
1072- );
1073- }
1074- return *this;
1075- }
1076-
1077+ std::map<std::string, CommandArg<Tuple>*> theArgs;
1078+ };
1079+
1080+/*****************************************************************************/
1081+/*****************************************************************************/
1082+
1083+template<typename Func, typename Tuple, int CommandIdx>
1084+Command<Func, Tuple, CommandIdx>::~Command()
1085+{
1086+ typedef std::map<std::string, CommandArg<Tuple>*> ArgType;
1087+ for (typename ArgType::iterator i = theArgs.begin(); i != theArgs.end(); ++i) {
1088+ delete i->second;
1089+ }
1090+}
1091+
1092+template<typename Func, typename Tuple, int CommandIdx>
1093+void
1094+Command<Func, Tuple, CommandIdx>::printHelp() const
1095+{
1096+ std::cout << "Purpose: " << getDescription() << std::endl;
1097+
1098+ typename std::map<std::string, CommandArg<Tuple>*>::const_iterator lIter = theArgs.begin();
1099+ if (lIter == theArgs.end()) {
1100+ std::cout << "This command has no arguments." << std::endl;
1101+ std::cout << std::endl;
1102+ return;
1103+ }
1104+
1105+ std::cout << "Arguments:" << std::endl << std::endl;
1106+ for (; lIter != theArgs.end(); ++lIter) {
1107+ std::cout << " " << lIter->first << "\t" << lIter->second->getDescription() << std::endl;
1108+ }
1109+ std::cout << std::endl;
1110+}
1111+
1112+template<typename Func, typename Tuple, int CommandIdx>
1113+void
1114+Command<Func, Tuple, CommandIdx>::splitNames(const std::string& aNames, std::set<std::string>& aSet)
1115+{
1116+ std::string::size_type before = 0;
1117+ std::string::size_type pos = aNames.find(" ", 0);
1118+ while (pos != aNames.npos) {
1119+ std::string lName = aNames.substr(before, pos);
1120+ if (lName != "") {
1121+ aSet.insert(lName);
1122+ }
1123+ before = pos + 1;
1124+ pos = aNames.find(" ", before);
1125+ }
1126+ std::string lName = aNames.substr(before);
1127+ if (lName != "") {
1128+ aSet.insert(lName);
1129+ }
1130+}
1131+
1132+template<typename Func, typename Tuple, int CommandIdx>
1133+void
1134+Command<Func, Tuple, CommandIdx>::addArgument(
1135+ unsigned aId,
1136+ const std::string& aFlags,
1137+ CommandArgType<Tuple>* aType,
1138+ const std::string& aDescription,
1139+ bool isRequired)
1140+{
1141+ std::set<std::string> lNames;
1142+ splitNames(aFlags, lNames);
1143+
1144+ for (std::set<std::string>::iterator i = lNames.begin(); i != lNames.end(); ++i) {
1145+ std::string toAdd = (i->size() == 1) ? "-" + *i : "--" + *i;
1146+ CommandArg<Tuple>* lArg = new CommandArg<Tuple>(aId, aType, lNames, aDescription, isRequired);
1147+ theArgs.insert(std::make_pair(toAdd, lArg));
1148+ }
1149+}
1150+
1151+/*****************************************************************************/
1152+
1153 template<typename Tuple, typename T, int Idx>
1154 CommandArgType<Tuple>* createArgType(Tuple t)
1155 {
1156@@ -290,6 +225,16 @@
1157 return new Command<Func, Tuple, CommandIdx>(aName, aFunction, aDescription);
1158 }
1159
1160+ template<int CommandIdx, typename Tuple, typename Func>
1161+ Command<Func, Tuple, CommandIdx>* createCommand(Tuple t,
1162+ const std::string& aName,
1163+ const std::set<std::string>& aAliases,
1164+ Func& aFunction,
1165+ const std::string& aDescription)
1166+ {
1167+ return new Command<Func, Tuple, CommandIdx>(aName, aAliases, aFunction, aDescription);
1168+ }
1169+
1170 template<typename Func, typename Tuple, int CommandIdx>
1171 bool CommandInstance<Func, Tuple, CommandIdx>::
1172 parseArguments(const std::vector<std::string>& args,
1173@@ -301,29 +246,34 @@
1174 for (ArgType::size_type i = 1; i < size; ++i) {
1175 typename CArgType::const_iterator pos = aCommandArgs.find(args[i]);
1176 if (pos == aCommandArgs.end()) {
1177- std::cerr << "Error: Unknown Argument " << args[i] << std::endl;
1178+ std::cerr << "Error: Unknown option " << args[i] << std::endl;
1179 parseError = true;
1180 return false;
1181 }
1182 const CommandArg<Tuple>& arg = *(pos->second);
1183- if (!arg.isVoid() && args[++i][0] == '-') {
1184- std::cerr << "Did not expect parameter for option " << args[i] << std::endl;
1185- return false;
1186- }
1187 std::auto_ptr<CommandArgInstance<Tuple> > instance;
1188 if (arg.isVoid()) {
1189 instance.reset(arg.parse("1"));
1190 } else {
1191+ ++i;
1192+ if (i >= size) {
1193+ std::cerr << "Error: Missing value for argument " << args[i - 1] << std::endl;
1194+ parseError = true;
1195+ allSet = false;
1196+ return false;
1197+ }
1198 instance.reset(arg.parse(args[i]));
1199 }
1200- instance->insertValue(theTuple);
1201+ if (instance.get()) {
1202+ instance->insertValue(theTuple);
1203+ }
1204 }
1205 bool allSet = true;
1206 for (typename CArgType::const_iterator i = aCommandArgs.begin();
1207 i != aCommandArgs.end(); ++i)
1208 {
1209 if (i->second->isRequired() && !i->second->isSet(theTuple)) {
1210- std::cerr << "Error: Argument " << i->second->get_name() << " not set" << std::endl;
1211+ std::cerr << "Error: Argument -" << i->second->getName() << " not set" << std::endl;
1212 allSet = false;
1213 }
1214 }
1215@@ -336,4 +286,7 @@
1216 theFunction.template handle<CommandIdx>(this->theTuple);
1217 }
1218
1219-}} // end of namespace zorba::debugclient
1220+} // namespace zorba
1221+} // namespace debugger
1222+
1223+#endif // ZORBA_DEBUGGER_COMMAND_H
1224
1225=== added file 'bin/debugger/command_arg.h'
1226--- bin/debugger/command_arg.h 1970-01-01 00:00:00 +0000
1227+++ bin/debugger/command_arg.h 2012-03-14 02:09:24 +0000
1228@@ -0,0 +1,237 @@
1229+/*
1230+ * Copyright 2006-2008 The FLWOR Foundation.
1231+ *
1232+ * Licensed under the Apache License, Version 2.0 (the "License");
1233+ * you may not use this file except in compliance with the License.
1234+ * You may obtain a copy of the License at
1235+ *
1236+ * http://www.apache.org/licenses/LICENSE-2.0
1237+ *
1238+ * Unless required by applicable law or agreed to in writing, software
1239+ * distributed under the License is distributed on an "AS IS" BASIS,
1240+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1241+ * See the License for the specific language governing permissions and
1242+ * limitations under the License.
1243+ */
1244+#pragma once
1245+#ifndef ZORBA_DEBUGGER_COMMAND_ARG_H
1246+#define ZORBA_DEBUGGER_COMMAND_ARG_H
1247+
1248+#include <string>
1249+#include <iostream>
1250+#include <set>
1251+#include <sstream>
1252+
1253+#include "tuple.h"
1254+
1255+
1256+namespace zorba { namespace debugger {
1257+
1258+template<typename Tuple>
1259+class CommandArg;
1260+
1261+template<typename Tuple>
1262+class CommandArgInstance {
1263+ public:
1264+ virtual int get_index() const = 0;
1265+ virtual const CommandArg<Tuple>* get_arg() const = 0;
1266+ virtual void insertValue(Tuple& t) = 0;
1267+ virtual bool isSet(Tuple& t) const = 0;
1268+};
1269+
1270+template<typename T, int Idx, typename Tuple>
1271+class TypedCommandArgInstance : public CommandArgInstance<Tuple>
1272+{
1273+ public:
1274+ TypedCommandArgInstance(T aValue, const CommandArg<Tuple>* aArg)
1275+ : theValue(aValue), theArg(aArg)
1276+ {
1277+ }
1278+
1279+ virtual int
1280+ get_index() const
1281+ {
1282+ return Idx;
1283+ }
1284+
1285+ virtual const CommandArg<Tuple>*
1286+ get_arg() const
1287+ {
1288+ return theArg;
1289+ }
1290+
1291+ virtual void
1292+ insertValue(Tuple& t)
1293+ {
1294+ ZORBA_TR1_NS::get<Idx>(t).first = true;
1295+ ZORBA_TR1_NS::get<Idx>(t).second = theValue;
1296+ }
1297+
1298+ virtual bool isSet(Tuple& t) const
1299+ {
1300+ return ZORBA_TR1_NS::get<Idx>(t).first;
1301+ }
1302+
1303+ private:
1304+
1305+ T theValue;
1306+ const CommandArg<Tuple>* theArg;
1307+};
1308+
1309+template<typename Tuple>
1310+class CommandArgType
1311+{
1312+ public:
1313+ virtual CommandArgInstance<Tuple>*
1314+ parse(
1315+ const std::string& str,
1316+ const CommandArg<Tuple>* arg) = 0;
1317+
1318+ virtual bool
1319+ isVoid() const = 0;
1320+
1321+ virtual bool
1322+ isSet(Tuple& t) const = 0;
1323+
1324+ virtual ~CommandArgType() {}
1325+};
1326+
1327+ template<typename T, int Idx, typename Tuple>
1328+ class TypedCommandArgType : public CommandArgType<Tuple> {
1329+ public:
1330+ typedef T Type;
1331+ public: // implementation
1332+ TypedCommandArgType(bool aIsVoid) : theIsVoid(aIsVoid) {}
1333+ TypedCommandArgType(const T& aValue,
1334+ bool aIsVoid)
1335+ : theDefault(aValue), theIsVoid(aIsVoid) {}
1336+ virtual CommandArgInstance<Tuple>* parse(const std::string& str,
1337+ const CommandArg<Tuple>* arg)
1338+ {
1339+ T aValue;
1340+
1341+ // special treatment for strings
1342+ // this is a double hack:
1343+ // - we check the type name if this starts with: class std::basic_string
1344+ // - we use void* in readEntireString to workaround the template type T
1345+ // which would otherwise complain during compilation if types and
1346+ // operators do not match
1347+ // TOSO: probably someone can find a more elegant solution
1348+ std::string lTypeName(typeid(T).name());
1349+ if (lTypeName.find("class std::basic_string") == 0) {
1350+ readEntireString(str, &aValue);
1351+ } else {
1352+ std::stringstream stream(str);
1353+ std::stringstream out;
1354+ stream >> aValue;
1355+ if (stream.fail()) {
1356+ std::cerr << "Error: Could not parse value \"" << str << "\" as type "
1357+ << typeid(T).name()
1358+ << std::endl;
1359+ return 0;
1360+ }
1361+ }
1362+
1363+ return new TypedCommandArgInstance<T, Idx, Tuple>(aValue, arg);
1364+ }
1365+ virtual bool isVoid() const { return theIsVoid; }
1366+ virtual bool isSet(Tuple& t) const
1367+ {
1368+ return ZORBA_TR1_NS::get<Idx>(t).first;
1369+ }
1370+ private:
1371+ void readEntireString(std::string aIn, void* aValue)
1372+ {
1373+ *((std::string*)aValue) = aIn;
1374+ }
1375+
1376+ TypedCommandArgType<T, Idx, Tuple>() {}
1377+ T theDefault;
1378+ bool theIsVoid;
1379+ };
1380+
1381+ template<typename Tuple>
1382+ class CommandArg {
1383+ public:
1384+ CommandArg(unsigned aId,
1385+ CommandArgType<Tuple>* aType,
1386+ const std::set<std::string>& aNames,
1387+ const std::string& aDescription,
1388+ bool aIsRequired)
1389+ : theId(aId),
1390+ theType(aType),
1391+ theNames(aNames),
1392+ theDescription(aDescription),
1393+ theIsRequired(aIsRequired)
1394+ {
1395+ }
1396+
1397+ ~CommandArg()
1398+ {
1399+ delete theType;
1400+ }
1401+
1402+ unsigned
1403+ get_id() const
1404+ {
1405+ return theId;
1406+ }
1407+
1408+ bool
1409+ canHandle(const std::string& arg) const
1410+ {
1411+ if (theNames.find(arg) != theNames.end()) {
1412+ return true;
1413+ }
1414+ return false;
1415+ }
1416+
1417+ CommandArgInstance<Tuple>*
1418+ parse(const std::string& str) const
1419+ {
1420+ return theType->parse(str, this);
1421+ }
1422+
1423+ bool
1424+ isVoid() const
1425+ {
1426+ return theType->isVoid();
1427+ }
1428+
1429+ bool
1430+ isRequired() const
1431+ {
1432+ return theIsRequired;
1433+ }
1434+
1435+ std::string
1436+ getName() const
1437+ {
1438+ return *(theNames.begin());
1439+ }
1440+
1441+ std::string
1442+ getDescription() const
1443+ {
1444+ return theDescription;
1445+ }
1446+
1447+ bool
1448+ isSet(Tuple& t) const
1449+ {
1450+ return theType->isSet(t);
1451+ }
1452+
1453+ private:
1454+
1455+ unsigned theId;
1456+ CommandArgType<Tuple>* theType;
1457+ std::set<std::string> theNames;
1458+ std::string theDescription;
1459+ bool theIsRequired;
1460+ };
1461+
1462+} // namespace zorba
1463+} // namespace debugger
1464+
1465+#endif // ZORBA_DEBUGGER_COMMAND_ARG_H
1466
1467=== modified file 'bin/debugger/command_line_handler.cpp'
1468--- bin/debug_client/command_line_handler.cpp 2011-07-01 01:53:24 +0000
1469+++ bin/debugger/command_line_handler.cpp 2012-03-14 02:09:24 +0000
1470@@ -1,4 +1,4 @@
1471-/*
1472+ /*
1473 * Copyright 2006-2008 The FLWOR Foundation.
1474 *
1475 * Licensed under the Apache License, Version 2.0 (the "License");
1476@@ -23,225 +23,385 @@
1477 # define msleep Sleep
1478 #endif
1479
1480-namespace zorba { namespace debugclient {
1481+#include "command_prompt.h"
1482+
1483+
1484+namespace zorba { namespace debugger {
1485
1486- using namespace ::std;
1487 using namespace ::ZORBA_TR1_NS;
1488
1489- CommandLineHandler::CommandLineHandler(unsigned short port,
1490- LockFreeConsumer<std::size_t>& aConsumer,
1491- LockFreeConsumer<bool>& aContinueQueue,
1492- EventHandler& aHandler,
1493- CommandLine& aCommandLine)
1494+CommandLineHandler::CommandLineHandler(
1495+ unsigned short port,
1496+ LockFreeConsumer<std::size_t>& aConsumer,
1497+ LockFreeConsumer<bool>& aContinueQueue,
1498+ EventHandler* aHandler,
1499+ CommandPrompt* aCommandPrompt)
1500 : theConsumer(aConsumer),
1501 theContinueQueue(aContinueQueue),
1502- theClient(DebuggerClient::createDebuggerClient(&aHandler, port, "localhost")),
1503- theCommandLine(aCommandLine),
1504- theQuit(false), theContinue(false), theWaitFor(0)
1505+ theClient(DebuggerClient::createDebuggerClient(aHandler, port, "localhost")),
1506+ theCommandLine(aCommandPrompt),
1507+ theQuit(false), theTerminated(true), theContinue(false), theWaitFor(0)
1508 {
1509 addCommands();
1510 }
1511
1512- CommandLineHandler::~CommandLineHandler()
1513- {
1514- }
1515+CommandLineHandler::~CommandLineHandler()
1516+{
1517+}
1518
1519- void CommandLineHandler::execute()
1520- {
1521- theClient->accept();
1522- std::set<std::size_t> lIdList;
1523- do {
1524+void
1525+CommandLineHandler::execute()
1526+{
1527+ theClient->accept();
1528+ std::set<std::size_t> lIdList;
1529+ do {
1530+ getNextId(lIdList);
1531+ while (lIdList.find(theWaitFor) == lIdList.end()) {
1532 getNextId(lIdList);
1533- while (!theQuit && lIdList.find(theWaitFor) == lIdList.end()) {
1534- getNextId(lIdList);
1535- msleep(20);
1536- }
1537- while (!theContinueQueue.consume(theQuit)) {
1538- msleep(20);
1539- }
1540- theQuit = !theQuit;
1541- if (!theQuit) {
1542- theCommandLine.execute();
1543- while (theContinue) {
1544- theContinue = false;
1545- theCommandLine.execute();
1546- }
1547- }
1548- } while (!theQuit);
1549- }
1550-
1551- void CommandLineHandler::getNextId(std::set<std::size_t>& aIdList)
1552- {
1553- std::size_t result;
1554- if (theConsumer.consume(result)) {
1555- aIdList.insert(result);
1556- }
1557- }
1558-
1559- template<>
1560- void CommandLineHandler::handle<Status>(ZORBA_TR1_NS::tuple<> &t)
1561- {
1562- theWaitFor = theClient->status();
1563- }
1564-
1565- template<>
1566- void CommandLineHandler::handle<Quit>(ZORBA_TR1_NS::tuple<> &t)
1567- {
1568+ msleep(20);
1569+ }
1570+ bool lCanQuit;
1571+ while (!theContinueQueue.consume(lCanQuit)) {
1572+ msleep(20);
1573+ }
1574+ if (lCanQuit) {
1575+ theTerminated = true;
1576+ }
1577+ theCommandLine->execute();
1578+ while (theContinue) {
1579+ theContinue = false;
1580+ theCommandLine->execute();
1581+ }
1582+ } while (!theQuit);
1583+}
1584+
1585+void
1586+CommandLineHandler::getNextId(std::set<std::size_t>& aIdList)
1587+{
1588+ std::size_t result;
1589+ if (theConsumer.consume(result)) {
1590+ aIdList.insert(result);
1591+ }
1592+}
1593+
1594+template<>
1595+void
1596+CommandLineHandler::handle<Status>(ZORBA_TR1_NS::tuple<> &t)
1597+{
1598+ theWaitFor = theClient->status();
1599+}
1600+
1601+template<>
1602+void
1603+CommandLineHandler::handle<Variables>(ZORBA_TR1_NS::tuple<> &t)
1604+{
1605+ theWaitFor = theClient->variables();
1606+}
1607+
1608+template<>
1609+void
1610+CommandLineHandler::handle<Quit>(ZORBA_TR1_NS::tuple<> &t)
1611+{
1612+ if (!theTerminated) {
1613 bool answered = false;
1614 while (!answered) {
1615 std::cout << "Do you really want to stop debugging and exit? (y/n) ";
1616- char answer;
1617- std::cin >> answer;
1618- std::cout << std::endl;
1619- if (answer == 'y') {
1620+ std::string lAnswer;
1621+ std::getline(std::cin, lAnswer);
1622+ if (lAnswer == "y" || lAnswer == "yes") {
1623 answered = true;
1624- } else if (answered == 'n') {
1625+ } else if (lAnswer == "n" || lAnswer == "no") {
1626 theContinue = true;
1627 return;
1628 }
1629 }
1630- theWaitFor = theClient->stop();
1631- theClient->quit();
1632- }
1633-
1634- template<>
1635- void CommandLineHandler::handle<Run>(ZORBA_TR1_NS::tuple<> &t)
1636- {
1637- theWaitFor = theClient->run();
1638- }
1639-
1640- template<>
1641- void CommandLineHandler::handle<BreakpointSet>(std::tr1::tuple<bstring, bstring, bint> &t)
1642- {
1643- DebuggerClient::BreakpointType lType = DebuggerClient::Line;
1644- bool lEnabled = true;
1645- if (get<0>(t).first) {
1646- if (get<0>(t).second == "disabled") {
1647- lEnabled = false;
1648- }
1649- }
1650- theWaitFor = theClient->breakpoint_set(lType,
1651- lEnabled,
1652- get<1>(t).second,
1653- get<2>(t).second);
1654- }
1655-
1656- template<>
1657- void CommandLineHandler::handle<BreakpointGet>(tuple<bint> &aTuple)
1658- {
1659- theWaitFor = theClient->breakpoint_get(get<0>(aTuple).second);
1660- }
1661-
1662- template<>
1663- void CommandLineHandler::handle<BreakpointDel>(tuple<bint> &aTuple)
1664- {
1665- theWaitFor = theClient->breakpoint_remove(get<0>(aTuple).second);
1666- }
1667-
1668- template<>
1669- void CommandLineHandler::handle<BreakpointList>(tuple<> &t)
1670- {
1671- theWaitFor = theClient->breakpoint_list();
1672- }
1673-
1674- template<>
1675- void CommandLineHandler::handle<StackDepth>(tuple<> &t)
1676- {
1677- theWaitFor = theClient->stack_depth();
1678- }
1679-
1680- template<>
1681- void CommandLineHandler::handle<StackGet>(tuple<bint> &aTuple)
1682- {
1683- if (get<0>(aTuple).first) {
1684- theWaitFor = theClient->stack_get(get<0>(aTuple).second);
1685- } else {
1686- theWaitFor = theClient->stack_get();
1687- }
1688- }
1689-
1690- template<>
1691- void CommandLineHandler::handle<ContextNames>(tuple<>& aTuple)
1692- {
1693- theWaitFor = theClient->context_names();
1694- }
1695-
1696- template<>
1697- void CommandLineHandler::handle<ContextGet>(tuple<bint> &aTuple)
1698- {
1699- if (get<0>(aTuple).first)
1700- theWaitFor = theClient->context_get(get<0>(aTuple).second);
1701- else
1702- theWaitFor = theClient->context_get();
1703- }
1704-
1705- template<>
1706- void CommandLineHandler::handle<Eval>(tuple<bstring>& aTuple)
1707- {
1708- theWaitFor = theClient->eval(get<0>(aTuple).second);
1709- }
1710-
1711- void CommandLineHandler::addCommands()
1712- {
1713- theCommandLine << createCommand<Status>(tuple<>(), "status", *this,
1714- "Gets the status of the server");
1715- theCommandLine << createCommand<Quit>(tuple<>(), "quit", *this,
1716- "Stops debugging and quits the client");
1717- theCommandLine << createCommand<Run>(tuple<>(), "run", *this, "Run the Query");
1718- {
1719- Command<CommandLineHandler, tuple<bstring, bstring, bint>, BreakpointSet>* lCommand =
1720- createCommand<BreakpointSet>(tuple<bstring, bstring, bint>(), "break", *this, "Set a breakpoint");
1721- (*lCommand)(0, "s", createArgType<tuple<bstring, bstring, bint>, std::string, 0>(tuple<bstring, bstring, bint>()),
1722- "breakpoint state (enabled or disabled - default: enabled)", false);
1723- (*lCommand)(1, "f", createArgType<tuple<bstring, bstring, bint>, std::string, 1>(tuple<bstring, bstring, bint>()),
1724- "The name of the file where to stop", true);
1725- (*lCommand)(2, "l", createArgType<tuple<bstring, bstring, bint>, int, 2>(tuple<bstring, bstring, bint>()),
1726- "The line number", true);
1727-
1728- theCommandLine << lCommand;
1729- }
1730- {
1731- Command<CommandLineHandler, tuple<bint>, BreakpointGet>* lCommand
1732- = createCommand<BreakpointGet>(tuple<bint>(), "binfo", *this,
1733- "Get information about a given breakpoint");
1734- (*lCommand)(0, "i", createArgType<tuple<bint>, int, 0>(tuple<bint>()),
1735- "The id of the breakpoint", true);
1736-
1737- theCommandLine << lCommand;
1738- }
1739- {
1740- Command<CommandLineHandler, tuple<bint>, BreakpointDel>* lCommand
1741- = createCommand<BreakpointDel>(tuple<bint>(), "bdel", *this, "Delete a breakpoint with a given id");
1742- (*lCommand)(0, "i", createArgType<tuple<bint>, int, 0>(tuple<bint>()), "The id of the breakpoint", true);
1743-
1744- theCommandLine << lCommand;
1745- }
1746- theCommandLine << createCommand<BreakpointList>(tuple<>(), "blist", *this, "List all set breakpoints");
1747- theCommandLine << createCommand<StackDepth>(tuple<>(), "sdepth", *this, "Get the depth of the stack");
1748- {
1749- Command<CommandLineHandler, tuple<bint>, StackGet>* lCommand
1750- = createCommand<StackGet>(tuple<bint>(), "sget", *this, "Get information about one or all stack frames");
1751- (*lCommand)(0, "d", createArgType<tuple<bint>, int, 0>(tuple<bint>()), "The stack entry two show (show all if not provided)", false);
1752- theCommandLine << lCommand;
1753- }
1754- theCommandLine << createCommand<ContextNames>(tuple<>(), "cnames", *this, "Get the names of the avilable contexts");
1755- {
1756- Command<CommandLineHandler, tuple<bint>, ContextGet>* lCommand
1757- = createCommand<ContextGet>(tuple<bint>(), "cget", *this, "Get a context");
1758-
1759- (*lCommand)(0, "c", createArgType<tuple<bint>, int, 0>(tuple<bint>()), "The id of the context", false);
1760-
1761- theCommandLine << lCommand;
1762- }
1763- {
1764- Command<CommandLineHandler, tuple<bstring>, Eval>* lCommand
1765- = createCommand<Eval>(tuple<bstring>(), "eval", *this, "Evaluate a function");
1766-
1767- (*lCommand)(0, "c", createArgType<tuple<bstring>, std::string, 0>(tuple<bstring>()), "The command to evaluate", true);
1768-
1769- theCommandLine << lCommand;
1770- }
1771- }
1772-
1773-}} // namespace zorba::debugclient
1774-
1775+ }
1776+ theWaitFor = theClient->stop(true);
1777+ theClient->quit();
1778+ theQuit = true;
1779+}
1780+
1781+template<>
1782+void
1783+CommandLineHandler::handle<Run>(ZORBA_TR1_NS::tuple<> &t)
1784+{
1785+ theTerminated = false;
1786+ theWaitFor = theClient->run();
1787+}
1788+
1789+template<>
1790+void
1791+CommandLineHandler::handle<Stop>(ZORBA_TR1_NS::tuple<> &t)
1792+{
1793+ theWaitFor = theClient->stop(false);
1794+}
1795+
1796+template<>
1797+void
1798+CommandLineHandler::handle<BreakpointSet>(std::tr1::tuple<bstring, bstring, bint> &aTuple)
1799+{
1800+ DebuggerClient::BreakpointType lType = DebuggerClient::Line;
1801+ bool lEnabled = true;
1802+ if (get<0>(aTuple).first) {
1803+ if (get<0>(aTuple).second == "disabled") {
1804+ lEnabled = false;
1805+ }
1806+ }
1807+ theWaitFor = theClient->breakpoint_set(lType,
1808+ lEnabled,
1809+ get<1>(aTuple).second,
1810+ get<2>(aTuple).second);
1811+}
1812+
1813+template<>
1814+void
1815+CommandLineHandler::handle<BreakpointGet>(tuple<bint> &aTuple)
1816+{
1817+ theWaitFor = theClient->breakpoint_get(get<0>(aTuple).second);
1818+}
1819+
1820+template<>
1821+void
1822+CommandLineHandler::handle<BreakpointRemove>(tuple<bint> &aTuple)
1823+{
1824+ theWaitFor = theClient->breakpoint_remove(get<0>(aTuple).second);
1825+}
1826+
1827+template<>
1828+void
1829+CommandLineHandler::handle<BreakpointList>(tuple<> &aTuple)
1830+{
1831+ theWaitFor = theClient->breakpoint_list();
1832+}
1833+
1834+template<>
1835+void
1836+CommandLineHandler::handle<StackDepth>(tuple<> &aTuple)
1837+{
1838+ theWaitFor = theClient->stack_depth();
1839+}
1840+
1841+template<>
1842+void
1843+CommandLineHandler::handle<StackGet>(tuple<bint> &aTuple)
1844+{
1845+ if (get<0>(aTuple).first) {
1846+ theWaitFor = theClient->stack_get(get<0>(aTuple).second);
1847+ } else {
1848+ theWaitFor = theClient->stack_get();
1849+ }
1850+}
1851+
1852+template<>
1853+void
1854+CommandLineHandler::handle<ContextNames>(tuple<>& aTuple)
1855+{
1856+ theWaitFor = theClient->context_names();
1857+}
1858+
1859+template<>
1860+void CommandLineHandler::handle<ContextGet>(tuple<bint, bint> &aTuple)
1861+{
1862+ int lDepth = -1;
1863+ int lContext = -1;
1864+
1865+ if (get<0>(aTuple).first) {
1866+ lDepth = get<0>(aTuple).second;
1867+ }
1868+ if (get<1>(aTuple).first) {
1869+ lContext = get<1>(aTuple).second;
1870+ }
1871+ theWaitFor = theClient->context_get(lDepth, lContext);
1872+}
1873+
1874+template<>
1875+void CommandLineHandler::handle<Source>(tuple<bint, bint, bstring> &aTuple)
1876+{
1877+ theWaitFor = theClient->source(
1878+ get<2>(aTuple).second,
1879+ get<0>(aTuple).second,
1880+ get<1>(aTuple).second);
1881+}
1882+
1883+template<>
1884+void CommandLineHandler::handle<Eval>(tuple<bstring>& aTuple)
1885+{
1886+ theWaitFor = theClient->eval(get<0>(aTuple).second);
1887+}
1888+
1889+template<>
1890+void
1891+CommandLineHandler::handle<StepIn>(ZORBA_TR1_NS::tuple<> &t)
1892+{
1893+ theTerminated = false;
1894+ theWaitFor = theClient->step_into();
1895+}
1896+
1897+template<>
1898+void
1899+CommandLineHandler::handle<StepOut>(ZORBA_TR1_NS::tuple<> &t)
1900+{
1901+ theWaitFor = theClient->step_out();
1902+}
1903+
1904+template<>
1905+void
1906+CommandLineHandler::handle<StepOver>(ZORBA_TR1_NS::tuple<> &t)
1907+{
1908+ theTerminated = false;
1909+ theWaitFor = theClient->step_over();
1910+}
1911+
1912+void
1913+CommandLineHandler::addCommands()
1914+{
1915+ typedef tuple<> TUPLE;
1916+ typedef tuple<bint> TUPLE_INT;
1917+ typedef tuple<bstring> TUPLE_STR;
1918+ typedef tuple<bint, bint> TUPLE_INT_INT;
1919+ typedef tuple<bstring, bstring, bint> TUPLE_STR_STR_INT;
1920+ typedef tuple<bint, bint, bstring> TUPLE_INT_INT_STR;
1921+
1922+ // DBGP: status
1923+ *theCommandLine << createCommand<Status>(TUPLE(), "status", *this, "Gets the status of the server");
1924+
1925+ // ALIAS: variables (context_get -c -1)
1926+ {
1927+ std::set<std::string> lAliases;
1928+ lAliases.insert("vars");
1929+ *theCommandLine << createCommand<Variables>(TUPLE(), "variables", lAliases, *this, "Gets the variables visible in the current scope");
1930+ }
1931+
1932+ // META: quit
1933+ *theCommandLine << createCommand<Quit>(TUPLE(), "quit", *this, "Stops debugging and quits the client");
1934+
1935+ // DBGP: run
1936+ *theCommandLine << createCommand<Run>(TUPLE(), "run", *this, "Run the query");
1937+
1938+ // DBGP: stop
1939+ *theCommandLine << createCommand<Stop>(TUPLE(), "stop", *this, "Stop the query");
1940+
1941+ // DBGP: breakpoint_set
1942+ {
1943+ std::set<std::string> lAliases;
1944+ lAliases.insert("break");
1945+ Command<CommandLineHandler, TUPLE_STR_STR_INT, BreakpointSet>* lCommand =
1946+ createCommand<BreakpointSet>(TUPLE_STR_STR_INT(), "bset", lAliases, *this, "Set a breakpoint");
1947+
1948+ lCommand->addArgument(0, "s", createArgType<TUPLE_STR_STR_INT, std::string, 0>(TUPLE_STR_STR_INT()), "breakpoint state (optional, 'enabled' or 'disabled', default: enabled)", false);
1949+ lCommand->addArgument(1, "f", createArgType<TUPLE_STR_STR_INT, std::string, 1>(TUPLE_STR_STR_INT()), "name of the file where to stop", true);
1950+ lCommand->addArgument(2, "l", createArgType<TUPLE_STR_STR_INT, int, 2>(TUPLE_STR_STR_INT()), "line number", true);
1951+
1952+ *theCommandLine << lCommand;
1953+ }
1954+
1955+ // DBGP: breakpoint_get
1956+ {
1957+ Command<CommandLineHandler, TUPLE_INT, BreakpointGet>* lCommand =
1958+ createCommand<BreakpointGet>(TUPLE_INT(), "bget", *this, "Get information about a given breakpoint");
1959+
1960+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "breakpoint ID", true);
1961+
1962+ *theCommandLine << lCommand;
1963+ }
1964+
1965+ // DBGP: breakpoint_remove
1966+ {
1967+ std::set<std::string> lAliases;
1968+ lAliases.insert("clear");
1969+ lAliases.insert("delete");
1970+ Command<CommandLineHandler, TUPLE_INT, BreakpointRemove>* lCommand =
1971+ createCommand<BreakpointRemove>(TUPLE_INT(), "bremove", lAliases, *this, "Delete a breakpoint");
1972+
1973+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "breakpoint ID", true);
1974+
1975+ *theCommandLine << lCommand;
1976+ }
1977+
1978+ // DBGP: breakpoint_list
1979+ *theCommandLine << createCommand<BreakpointList>(TUPLE(), "blist", *this, "List all set breakpoints");
1980+
1981+ // DBGP: stack_depth
1982+ *theCommandLine << createCommand<StackDepth>(TUPLE(), "sdepth", *this, "Get the depth of the stack");
1983+
1984+ // DBGP: stack_get
1985+ {
1986+ Command<CommandLineHandler, TUPLE_INT, StackGet>* lCommand =
1987+ createCommand<StackGet>(TUPLE_INT(), "sget", *this, "Get information about one or all stack frames");
1988+
1989+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT, int, 0>(TUPLE_INT()), "stack frame to show: 0 for current stack frame, N for the main module (optional, all frames are shown if not provided)", false);
1990+
1991+ *theCommandLine << lCommand;
1992+ }
1993+
1994+ // DBGP: context_names
1995+ *theCommandLine << createCommand<ContextNames>(tuple<>(), "cnames", *this, "Get the names of the avilable contexts");
1996+ // the DBGP -d arguments for this command is omitted since we always have/return: 0 - Local, 1 - Global
1997+
1998+ // DBGP: context_get
1999+ {
2000+ Command<CommandLineHandler, TUPLE_INT_INT, ContextGet>* lCommand =
2001+ createCommand<ContextGet>(TUPLE_INT_INT(), "cget", *this, "Get a context (list variables in this context)");
2002+
2003+ lCommand->addArgument(0, "d", createArgType<TUPLE_INT_INT, int, 0>(TUPLE_INT_INT()), "stack depth (optional, default: 0)", false);
2004+ lCommand->addArgument(0, "c", createArgType<TUPLE_INT_INT, int, 1>(TUPLE_INT_INT()), "context ID: 0 for Local, 1 for Global (optional, default: 0)", false);
2005+
2006+ *theCommandLine << lCommand;
2007+ }
2008+
2009+ // DBGP: source
2010+ {
2011+ std::set<std::string> lAliases;
2012+ lAliases.insert("list");
2013+ Command<CommandLineHandler, TUPLE_INT_INT_STR, Source>* lCommand =
2014+ createCommand<Source>(TUPLE_INT_INT_STR(), "source", lAliases, *this, "List source code");
2015+
2016+ lCommand->addArgument(0, "b", createArgType<TUPLE_INT_INT_STR, int, 0>(TUPLE_INT_INT_STR()), "begin line (optional, default: first line)", false);
2017+ lCommand->addArgument(1, "e", createArgType<TUPLE_INT_INT_STR, int, 1>(TUPLE_INT_INT_STR()), "end line (optional, default: last line)", false);
2018+ lCommand->addArgument(2, "f", createArgType<TUPLE_INT_INT_STR, std::string, 2>(TUPLE_INT_INT_STR()), "file URI (optional, default: the file in the top-most stack frame during execution, main module otherwise)", false);
2019+
2020+ *theCommandLine << lCommand;
2021+ }
2022+
2023+ // DBGP: eval
2024+ {
2025+ std::set<std::string> lAliases;
2026+ lAliases.insert("print");
2027+ Command<CommandLineHandler, TUPLE_STR, Eval>* lCommand =
2028+ createCommand<Eval>(TUPLE_STR(), "eval", lAliases, *this, "Evaluate an expression");
2029+
2030+ // TODO: this argument should not be here at all. Eval has the form: eval -i transaction_id -- {DATA}
2031+ // Eval should be called with a command like: eval 1 + 3
2032+ // - no need for an argument name
2033+ // - everything following the fist contiguous set of whitespaces are sent as string
2034+ lCommand->addArgument(0, "c", createArgType<TUPLE_STR, std::string, 0>(TUPLE_STR()), "expression to evaluate", true);
2035+
2036+ *theCommandLine << lCommand;
2037+ }
2038+
2039+ // DBGP: step_in
2040+ {
2041+ std::set<std::string> lAliases;
2042+ lAliases.insert("step");
2043+ lAliases.insert("s");
2044+ *theCommandLine << createCommand<StepIn>(TUPLE(), "in", lAliases, *this, "Step in");
2045+ }
2046+
2047+ // DBGP: step_out
2048+ {
2049+ std::set<std::string> lAliases;
2050+ lAliases.insert("finish");
2051+ *theCommandLine << createCommand<StepOut>(TUPLE(), "out", lAliases, *this, "Step out");
2052+ }
2053+
2054+ // DBGP: step_over
2055+ {
2056+ std::set<std::string> lAliases;
2057+ lAliases.insert("next");
2058+ lAliases.insert("n");
2059+ *theCommandLine << createCommand<StepOver>(TUPLE(), "over", lAliases, *this, "Step over");
2060+ }
2061+}
2062+
2063+} // namespace zorba
2064+} // namespace debugger
2065
2066=== modified file 'bin/debugger/command_line_handler.h'
2067--- bin/debug_client/command_line_handler.h 2011-07-01 01:53:24 +0000
2068+++ bin/debugger/command_line_handler.h 2012-03-14 02:09:24 +0000
2069@@ -14,46 +14,71 @@
2070 * limitations under the License.
2071 */
2072 #pragma once
2073+#ifndef ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
2074+#define ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
2075
2076 #include <set>
2077 #include <cassert>
2078+
2079 #include <zorba/debugger_client.h>
2080-#include "debug_command.h"
2081+
2082+#include "command.h"
2083 #include "event_handler.h"
2084
2085-namespace zorba { namespace debugclient {
2086-
2087+
2088+namespace zorba { namespace debugger {
2089+
2090+ class CommandPrompt;
2091+
2092 enum Commands {
2093 Status,
2094+ Variables,
2095+ Quit,
2096 Run,
2097+ Stop,
2098 BreakpointSet,
2099 BreakpointGet,
2100- BreakpointDel,
2101+ BreakpointRemove,
2102 BreakpointList,
2103 StackDepth,
2104 StackGet,
2105 ContextNames,
2106 ContextGet,
2107+ Source,
2108 Eval,
2109- Quit
2110+ StepIn,
2111+ StepOut,
2112+ StepOver
2113 };
2114
2115- class CommandLineHandler {
2116+class CommandLineHandler
2117+{
2118 private:
2119+
2120 typedef std::pair<bool, std::string> bstring;
2121 typedef std::pair<bool, int> bint;
2122+
2123 public:
2124- CommandLineHandler(unsigned short port,
2125- LockFreeConsumer<std::size_t>& aConsumer,
2126- LockFreeConsumer<bool>& aContinueQueue,
2127- EventHandler& aHandler,
2128- CommandLine& aCommandLine);
2129+
2130+ CommandLineHandler(
2131+ unsigned short port,
2132+ LockFreeConsumer<std::size_t>& aConsumer,
2133+ LockFreeConsumer<bool>& aContinueQueue,
2134+ EventHandler* aHandler,
2135+ CommandPrompt* aCommandPrompt);
2136+
2137 ~CommandLineHandler();
2138+
2139 public:
2140 void execute();
2141+
2142 public: // Handlers
2143+
2144 template<int>
2145- void handle(ZORBA_TR1_NS::tuple<>& aTuple) { assert(false); }
2146+ void handle(ZORBA_TR1_NS::tuple<>& aTuple)
2147+ {
2148+ assert(false);
2149+ }
2150
2151 template<int>
2152 void handle(ZORBA_TR1_NS::tuple<bstring, bstring, bint>& t)
2153@@ -62,63 +87,96 @@
2154 }
2155
2156 template<int>
2157+ void handle(ZORBA_TR1_NS::tuple<bint, bint, bstring>& t)
2158+ {
2159+ assert(false);
2160+ }
2161+
2162+ template<int>
2163 void handle(ZORBA_TR1_NS::tuple<bint>& aTuple)
2164 {
2165 assert(false);
2166 }
2167
2168 template<int>
2169+ void handle(ZORBA_TR1_NS::tuple<bint, bint>& aTuple)
2170+ {
2171+ assert(false);
2172+ }
2173+
2174+ template<int>
2175 void handle(ZORBA_TR1_NS::tuple<bstring>& aTuple)
2176 {
2177 assert(false);
2178 }
2179+
2180 private:
2181- LockFreeConsumer<std::size_t>& theConsumer;
2182- LockFreeConsumer<bool>& theContinueQueue;
2183- DebuggerClient* theClient;
2184- CommandLine& theCommandLine;
2185- bool theQuit;
2186- bool theContinue;
2187- std::size_t theWaitFor;
2188+ LockFreeConsumer<std::size_t>& theConsumer;
2189+ LockFreeConsumer<bool>& theContinueQueue;
2190+ DebuggerClient* theClient;
2191+ CommandPrompt* theCommandLine;
2192+ bool theQuit;
2193+ bool theTerminated;
2194+ bool theContinue;
2195+ std::size_t theWaitFor;
2196+
2197 private:
2198 void getNextId(std::set<std::size_t>& aIdList);
2199 void addCommands();
2200- };
2201-
2202- template<>
2203- void CommandLineHandler::handle<Status> (ZORBA_TR1_NS::tuple<>& t);
2204-
2205- template<>
2206- void CommandLineHandler::handle<Quit> (ZORBA_TR1_NS::tuple<>& t);
2207-
2208- template<>
2209- void CommandLineHandler::handle<Run> (ZORBA_TR1_NS::tuple<> &t);
2210-
2211- template<>
2212- void CommandLineHandler::handle<StackDepth> (ZORBA_TR1_NS::tuple<>& t);
2213-
2214- template<>
2215- void CommandLineHandler::handle<BreakpointList> (ZORBA_TR1_NS::tuple<>& aTuple);
2216-
2217- template<>
2218- void CommandLineHandler::handle<BreakpointSet> (ZORBA_TR1_NS::tuple<bstring, bstring, bint> &t);
2219-
2220- template<>
2221- void CommandLineHandler::handle<BreakpointGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
2222-
2223- template<>
2224- void CommandLineHandler::handle<BreakpointDel>(ZORBA_TR1_NS::tuple<bint> &aTuple);
2225-
2226- template<>
2227- void CommandLineHandler::handle<StackGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
2228-
2229- template<>
2230- void CommandLineHandler::handle<ContextNames>(ZORBA_TR1_NS::tuple<> &aTuple);
2231-
2232- template<>
2233- void CommandLineHandler::handle<ContextGet>(ZORBA_TR1_NS::tuple<bint> &aTuple);
2234-
2235- template<>
2236- void CommandLineHandler::handle<Eval>(ZORBA_TR1_NS::tuple<bstring>& aTuple);
2237-
2238-}} // close namespaces zorba::debugclient
2239+};
2240+
2241+template<>
2242+void CommandLineHandler::handle<Status> (ZORBA_TR1_NS::tuple<>& t);
2243+
2244+template<>
2245+void CommandLineHandler::handle<Quit> (ZORBA_TR1_NS::tuple<>& t);
2246+
2247+template<>
2248+void CommandLineHandler::handle<Run> (ZORBA_TR1_NS::tuple<> &t);
2249+
2250+template<>
2251+void CommandLineHandler::handle<Stop> (ZORBA_TR1_NS::tuple<> &t);
2252+
2253+template<>
2254+void CommandLineHandler::handle<StackDepth> (ZORBA_TR1_NS::tuple<>& t);
2255+
2256+template<>
2257+void CommandLineHandler::handle<BreakpointList> (ZORBA_TR1_NS::tuple<>& aTuple);
2258+
2259+template<>
2260+void CommandLineHandler::handle<BreakpointSet> (ZORBA_TR1_NS::tuple<bstring, bstring, bint> &t);
2261+
2262+template<>
2263+void CommandLineHandler::handle<BreakpointGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
2264+
2265+template<>
2266+void CommandLineHandler::handle<BreakpointRemove>(ZORBA_TR1_NS::tuple<bint> &aTuple);
2267+
2268+template<>
2269+void CommandLineHandler::handle<StackGet> (ZORBA_TR1_NS::tuple<bint>& aTuple);
2270+
2271+template<>
2272+void CommandLineHandler::handle<ContextNames>(ZORBA_TR1_NS::tuple<> &aTuple);
2273+
2274+template<>
2275+void CommandLineHandler::handle<ContextGet>(ZORBA_TR1_NS::tuple<bint, bint> &aTuple);
2276+
2277+template<>
2278+void CommandLineHandler::handle<Source>(ZORBA_TR1_NS::tuple<bint, bint, bstring> &aTuple);
2279+
2280+template<>
2281+void CommandLineHandler::handle<Eval>(ZORBA_TR1_NS::tuple<bstring>& aTuple);
2282+
2283+template<>
2284+void CommandLineHandler::handle<StepIn> (ZORBA_TR1_NS::tuple<> &t);
2285+
2286+template<>
2287+void CommandLineHandler::handle<StepOut> (ZORBA_TR1_NS::tuple<> &t);
2288+
2289+template<>
2290+void CommandLineHandler::handle<StepOver> (ZORBA_TR1_NS::tuple<> &t);
2291+
2292+} // namespace zorba
2293+} // namespace debugger
2294+
2295+#endif // ZORBA_DEBUGGER_COMMAND_LINE_HANDLER_H
2296
2297=== added file 'bin/debugger/command_prompt.cpp'
2298--- bin/debugger/command_prompt.cpp 1970-01-01 00:00:00 +0000
2299+++ bin/debugger/command_prompt.cpp 2012-03-14 02:09:24 +0000
2300@@ -0,0 +1,287 @@
2301+/*
2302+ * Copyright 2006-2008 The FLWOR Foundation.
2303+ *
2304+ * Licensed under the Apache License, Version 2.0 (the "License");
2305+ * you may not use this file except in compliance with the License.
2306+ * You may obtain a copy of the License at
2307+ *
2308+ * http://www.apache.org/licenses/LICENSE-2.0
2309+ *
2310+ * Unless required by applicable law or agreed to in writing, software
2311+ * distributed under the License is distributed on an "AS IS" BASIS,
2312+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2313+ * See the License for the specific language governing permissions and
2314+ * limitations under the License.
2315+ */
2316+#include "command_prompt.h"
2317+
2318+#include <string>
2319+#include <vector>
2320+#include <map>
2321+#include <iostream>
2322+
2323+#include "command.h"
2324+
2325+
2326+namespace zorba { namespace debugger {
2327+
2328+#ifdef ZORBA_HAVE_LIBEDIT_H
2329+const char*
2330+prompt(EditLine* aEl) {
2331+ return "(xqdb) ";
2332+}
2333+#endif
2334+
2335+CommandPrompt::CommandPrompt()
2336+{
2337+#ifdef ZORBA_HAVE_LIBEDIT_H
2338+ theEditLine = el_init("xqdb", stdin, stdout, stderr);
2339+ theHistory = history_init();
2340+ HistEvent lHistoryEvent;
2341+ history(theHistory, &lHistoryEvent, H_SETSIZE, 100);
2342+
2343+ el_set(theEditLine, EL_PROMPT, prompt);
2344+
2345+ el_set(theEditLine, EL_HIST, history, theHistory);
2346+ el_set(theEditLine, EL_EDITOR, "emacs");
2347+#endif
2348+}
2349+
2350+CommandPrompt::~CommandPrompt()
2351+{
2352+#ifdef ZORBA_HAVE_LIBEDIT_H
2353+ history_end(theHistory);
2354+ el_end(theEditLine);
2355+#endif
2356+
2357+ std::map<std::string, UntypedCommand*>::iterator lIter;
2358+ for (lIter = theCommands.begin(); lIter != theCommands.end(); ++lIter) {
2359+ delete lIter->second;
2360+ }
2361+}
2362+
2363+void
2364+CommandPrompt::printHelp(UntypedCommand* aCommand)
2365+{
2366+ // if no command is provided, print all the available commands
2367+ if (!aCommand) {
2368+ std::cout << "Available commands:" << std::endl;
2369+
2370+ // print the names of all commands
2371+ std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.begin();
2372+ while (lIter != theCommands.end()) {
2373+ std::cout << " " << (*lIter).first;
2374+ std::set<std::string> lAliases = (*lIter).second->getAliases();
2375+ std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
2376+ while (lAliasIter != lAliases.end()) {
2377+ std::cout << ", " << *lAliasIter;
2378+ lAliasIter++;
2379+ }
2380+ std::cout << std::endl;
2381+ lIter++;
2382+ }
2383+
2384+ // some hints for detailed help
2385+ std::cout << std::endl;
2386+ std::cout << "Type help <command> to get more information about one command." << std::endl;
2387+ std::cout << std::endl;
2388+ } else {
2389+ // ok, so we have a command; then print the help
2390+ aCommand->printHelp();
2391+ }
2392+}
2393+
2394+void
2395+CommandPrompt::execute()
2396+{
2397+ bool lWithOutput = true;
2398+
2399+ for (;;) {
2400+#ifdef ZORBA_HAVE_LIBEDIT_H
2401+ const char* lBuf;
2402+ int lCharsRead = -1;
2403+ lBuf = el_gets(theEditLine, &lCharsRead);
2404+ std::string lCommandLine(lBuf, lCharsRead - 1);
2405+#else
2406+ if (lWithOutput) {
2407+ std::cout << "(xqdb) ";
2408+ }
2409+ lWithOutput = true;
2410+ std::string lCommandLine;
2411+ std::getline(std::cin, lCommandLine);
2412+ if (std::cin.fail()) {
2413+ lWithOutput = false;
2414+ std::cin.clear();
2415+ continue;
2416+ }
2417+#endif
2418+
2419+ std::vector<std::string> lArgs;
2420+
2421+ // split the command into arguments
2422+ parseLine(lCommandLine, lArgs);
2423+ std::string::size_type lSize = lArgs.size();
2424+
2425+ // empty command? do nothing!
2426+ if (lSize == 0) {
2427+ lArgs = theLastArgs;
2428+ if (lArgs.size() == 0) {
2429+ continue;
2430+ }
2431+ }
2432+#ifdef ZORBA_HAVE_LIBEDIT_H
2433+ else {
2434+ HistEvent lHistoryEvent;
2435+ history(theHistory, &lHistoryEvent, H_ENTER, lCommandLine.c_str());
2436+ }
2437+#endif
2438+ theLastArgs = lArgs;
2439+
2440+ UntypedCommand* lCommand = NULL;
2441+
2442+ // help is not a command but a hook here
2443+ if (lArgs.at(0) == "h" || lArgs.at(0) == "help") {
2444+ std::string lCmd = "";
2445+
2446+ // if the user needs the help for a specific command
2447+ if (lSize > 1) {
2448+ // do nothing if we don't have a command starting with this prefix?
2449+ // findCommand will print the appropriate errors
2450+ if (!findCommand(lArgs[1], lCommand)) {
2451+ continue;
2452+ }
2453+ }
2454+ printHelp(lCommand);
2455+ continue;
2456+ }
2457+ if (findCommand(lArgs[0], lCommand) && lCommand->execute(lArgs)) {
2458+ return;
2459+ }
2460+ continue;
2461+ }
2462+}
2463+
2464+CommandPrompt&
2465+CommandPrompt::operator<<(UntypedCommand *aCommand)
2466+{
2467+ theCommands.insert(std::make_pair(aCommand->getName(), aCommand));
2468+ return *this;
2469+}
2470+
2471+bool
2472+CommandPrompt::findCommand(const std::string& aPrefix, UntypedCommand*& aCommand)
2473+{
2474+ std::vector<UntypedCommand*> lFoundCommands;
2475+
2476+ std::map<std::string, UntypedCommand*>::iterator lIter = theCommands.begin();
2477+ while (lIter != theCommands.end()) {
2478+ // if a command name is equal with the prefix, this is the command we want
2479+ if ((*lIter).first == aPrefix) {
2480+ aCommand = (*lIter).second;
2481+ return true;
2482+ }
2483+
2484+ bool lIsCandidate = false;
2485+
2486+ // add this command to candidate commands if the prefix matches
2487+ if ((*lIter).first.find(aPrefix) == 0) {
2488+ lFoundCommands.push_back((*lIter).second);
2489+ lIsCandidate = true;
2490+ }
2491+
2492+ // now process the aliases
2493+ std::set<std::string> lAliases = (*lIter).second->getAliases();
2494+ std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
2495+ while (lAliasIter != lAliases.end()) {
2496+ // if a command alias is equal with the prefix, this is the command we want
2497+ if (*lAliasIter == aPrefix) {
2498+ aCommand = (*lIter).second;
2499+ return true;
2500+ }
2501+
2502+ // add this command to candidate commands if the prefix matches one alias
2503+ // and if the command is not already added
2504+ if (!lIsCandidate && (*lAliasIter).find(aPrefix) == 0) {
2505+ lFoundCommands.push_back((*lIter).second);
2506+ break;
2507+ }
2508+ lAliasIter++;
2509+ }
2510+
2511+ lIter++;
2512+ }
2513+
2514+ if (lFoundCommands.empty()) {
2515+ std::cout << "Command not found: " << aPrefix << std::endl;
2516+ return false;
2517+ }
2518+
2519+ if (lFoundCommands.size() > 1) {
2520+ std::cout << "Ambigous command: " << aPrefix << std::endl;
2521+ // show all possible commands that start with this prefix
2522+ for (std::string::size_type i = 0; i < lFoundCommands.size(); i++) {
2523+ UntypedCommand* lCommand = lFoundCommands.at(i);
2524+
2525+ // commands
2526+ if (lCommand->getName().find(aPrefix) == 0) {
2527+ std::cout << " " << lCommand->getName() << std::endl;
2528+ }
2529+
2530+ // and aliases
2531+ std::set<std::string> lAliases = lCommand->getAliases();
2532+ std::set<std::string>::const_iterator lAliasIter = lAliases.begin();
2533+ while (lAliasIter != lAliases.end()) {
2534+ if ((*lAliasIter).find(aPrefix) == 0) {
2535+ std::cout << " " << *lAliasIter << std::endl;
2536+ }
2537+ lAliasIter++;
2538+ }
2539+ }
2540+ return false;
2541+ }
2542+
2543+ aCommand = lFoundCommands[0];
2544+ return true;
2545+}
2546+
2547+void
2548+CommandPrompt::parseLine(const std::string& aLine, std::vector<std::string>& aVector)
2549+{
2550+ std::string::size_type lBefore = 0;
2551+ std::string::size_type lPos = aLine.find_first_of(" \t", 0);
2552+
2553+ while (lPos != aLine.npos) {
2554+ std::string lSub = aLine.substr(lBefore, lPos - lBefore);
2555+
2556+ // if two consecutive spaces, you get an empty string here
2557+ if (lSub != "") {
2558+ if (lSub[0] == '"') {
2559+ std::string::size_type lBeforeCopy = lBefore;
2560+ do {
2561+ lBeforeCopy = aLine.find("\"", lBeforeCopy + 1);
2562+ } while (lPos != aLine.npos && aLine.size() > lPos + 1 && aLine[lPos + 1] == '\\');
2563+ lPos = lBeforeCopy;
2564+ lSub = aLine.substr(lBefore + 1, lPos - lBefore - 1);
2565+ }
2566+ aVector.push_back(lSub);
2567+ }
2568+
2569+ lBefore = lPos + 1;
2570+ lPos = aLine.find_first_of(" \t", lBefore);
2571+ }
2572+ std::string lSub = aLine.substr(lBefore);
2573+
2574+ // catching the case when the command ends with a space
2575+ if (lSub == "") {
2576+ return;
2577+ }
2578+
2579+ if (lSub[0] == '"') {
2580+ lPos = aLine.find("\"", lBefore + 1);
2581+ lSub = aLine.substr(lBefore + 1, lPos - lBefore - 1);
2582+ }
2583+ aVector.push_back(lSub);
2584+}
2585+
2586+} // namespace zorba
2587+} // namespace debugger
2588
2589=== added file 'bin/debugger/command_prompt.h'
2590--- bin/debugger/command_prompt.h 1970-01-01 00:00:00 +0000
2591+++ bin/debugger/command_prompt.h 2012-03-14 02:09:24 +0000
2592@@ -0,0 +1,72 @@
2593+/*
2594+ * Copyright 2006-2008 The FLWOR Foundation.
2595+ *
2596+ * Licensed under the Apache License, Version 2.0 (the "License");
2597+ * you may not use this file except in compliance with the License.
2598+ * You may obtain a copy of the License at
2599+ *
2600+ * http://www.apache.org/licenses/LICENSE-2.0
2601+ *
2602+ * Unless required by applicable law or agreed to in writing, software
2603+ * distributed under the License is distributed on an "AS IS" BASIS,
2604+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2605+ * See the License for the specific language governing permissions and
2606+ * limitations under the License.
2607+ */
2608+#pragma once
2609+#ifndef ZORBA_DEBUGGER_COMMAND_PROMPT_H
2610+#define ZORBA_DEBUGGER_COMMAND_PROMPT_H
2611+
2612+#include <string>
2613+#include <map>
2614+#include <vector>
2615+
2616+#include "config.h"
2617+
2618+#ifdef ZORBA_HAVE_LIBEDIT_H
2619+# include <histedit.h>
2620+#endif
2621+
2622+
2623+namespace zorba { namespace debugger {
2624+
2625+class UntypedCommand;
2626+
2627+class CommandPrompt
2628+{
2629+ public:
2630+ CommandPrompt();
2631+ ~CommandPrompt();
2632+
2633+ public:
2634+
2635+ void execute();
2636+
2637+ CommandPrompt& operator<< (UntypedCommand* command);
2638+
2639+ private:
2640+
2641+ void
2642+ printHelp(UntypedCommand* command);
2643+
2644+ bool
2645+ findCommand(const std::string& prefix, UntypedCommand*& command);
2646+
2647+ void
2648+ parseLine(const std::string& line, std::vector<std::string>& vector);
2649+
2650+ private:
2651+ std::map<std::string, UntypedCommand*> theCommands;
2652+ std::vector<std::string> theLastArgs;
2653+
2654+#ifdef ZORBA_HAVE_LIBEDIT_H
2655+ EditLine* theEditLine;
2656+ History* theHistory;
2657+#endif
2658+};
2659+
2660+
2661+} // namespace zorba
2662+} // namespace debugger
2663+
2664+#endif // ZORBA_DEBUGGER_COMMAND_PROMPT_H
2665
2666=== added file 'bin/debugger/config.h.cmake'
2667--- bin/debugger/config.h.cmake 1970-01-01 00:00:00 +0000
2668+++ bin/debugger/config.h.cmake 2012-03-14 02:09:24 +0000
2669@@ -0,0 +1,24 @@
2670+/*
2671+ * Copyright 2006-2008 The FLWOR Foundation.
2672+ *
2673+ * Licensed under the Apache License, Version 2.0 (the "License");
2674+ * you may not use this file except in compliance with the License.
2675+ * You may obtain a copy of the License at
2676+ *
2677+ * http://www.apache.org/licenses/LICENSE-2.0
2678+ *
2679+ * Unless required by applicable law or agreed to in writing, software
2680+ * distributed under the License is distributed on an "AS IS" BASIS,
2681+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2682+ * See the License for the specific language governing permissions and
2683+ * limitations under the License.
2684+ */
2685+
2686+// This header is configured by Zorba's build process -- DO NOT EDIT!
2687+
2688+#ifndef ZORBA_DEBUGGER_CONFIG_H
2689+#define ZORBA_DEBUGGER_CONFIG_H
2690+
2691+#cmakedefine ZORBA_HAVE_LIBEDIT_H
2692+
2693+#endif /* ZORBA_DEBUGGER_CONFIG_H */
2694
2695=== modified file 'bin/debugger/event_handler.cpp'
2696--- bin/debug_client/event_handler.cpp 2011-07-01 01:53:24 +0000
2697+++ bin/debugger/event_handler.cpp 2012-03-14 02:09:24 +0000
2698@@ -13,88 +13,93 @@
2699 * See the License for the specific language governing permissions and
2700 * limitations under the License.
2701 */
2702+
2703+#include "event_handler.h"
2704+
2705+#include <sstream>
2706+
2707 #include <zorba/zorba.h>
2708 #include <zorba/store_manager.h>
2709 #include <zorba/iterator.h>
2710-#include <sstream>
2711-#include "debug_client/event_handler.h"
2712
2713-namespace zorba { namespace debugclient {
2714+namespace zorba { namespace debugger {
2715
2716- EventHandler::EventHandler(LockFreeProducer<std::size_t>& aQueue, LockFreeProducer<bool>& aContProducer)
2717+EventHandler::EventHandler(LockFreeProducer<std::size_t>& aQueue, LockFreeProducer<bool>& aContProducer)
2718 : theIdQueue(aQueue), theContinueProducer(aContProducer),
2719 theStore(StoreManager::getStore()),
2720 theZorbaInstance(Zorba::getInstance(theStore)),
2721 theStaticContext(theZorbaInstance->createStaticContext())
2722-
2723- {
2724- try {
2725- Zorba_CompilerHints_t lHints;
2726- lHints.opt_level = ZORBA_OPT_LEVEL_O1;
2727- std::auto_ptr<std::istream> stream(getCurrentDirectory());
2728- zorba::String query;
2729- char buffer[1024];
2730- std::string::size_type s;
2731- while ((s = stream->readsome(buffer, 1024))) {
2732- query.append(std::string(buffer, s));
2733- }
2734- theStaticContext->loadProlog(query, lHints);
2735- } catch (zorba::ZorbaException& e) {
2736- std::cerr << "Exception: I was not able to load the query file:" << std::endl;
2737- std::cerr << e.what() << std::endl;
2738- throw;
2739- }
2740- }
2741-
2742- EventHandler::~EventHandler()
2743- {
2744- theStaticContext = 0;
2745- theZorbaInstance->shutdown();
2746- StoreManager::shutdownStore(theStore);
2747- }
2748-
2749- void EventHandler::parseMessage(const std::string &aMessage)
2750- {
2751- try {
2752- zorba::String queryString = "local:main(";
2753- queryString += aMessage + ")";
2754- XQuery_t query = theZorbaInstance->compileQuery(queryString, theStaticContext);
2755- Iterator_t lIter = query->iterator();
2756- Item item;
2757- lIter->open();
2758- bool doContinue = false;
2759- lIter->next(item);
2760- {
2761- const std::string& continueString = item.getStringValue().str();
2762- if (continueString == "true") {
2763- doContinue = true;
2764- } else if (continueString == "false") {
2765- doContinue = false;
2766- } else {
2767- std::stringstream stream(continueString);
2768- stream >> doContinue;
2769- }
2770- }
2771- lIter->next(item);
2772- std::size_t lId;
2773- {
2774- std::stringstream stream(item.getStringValue().c_str());
2775- stream >> lId;
2776- }
2777- lIter->next(item);
2778- std::cout << item.getStringValue() << std::endl;
2779- theContinueProducer.produce(doContinue);
2780- theIdQueue.produce(lId);
2781- } catch (ZorbaException& e) {
2782- std::cerr << "FATAL: could not execute query: " << std::endl;
2783- std::cerr << e << std::endl;
2784- std::cerr << "This is a bug, please report to zorba-users@lists.sourceforge.net" << std::endl;
2785- theContinueProducer.produce(false);
2786- }
2787- }
2788-
2789- void EventHandler::error(unsigned int errcode, const std::string &msg)
2790- {
2791- std::cerr << "Error " << errcode << ": " << msg << std::endl;
2792- }
2793-}}
2794+{
2795+}
2796+
2797+EventHandler::~EventHandler()
2798+{
2799+ theStaticContext = 0;
2800+ theZorbaInstance->shutdown();
2801+ StoreManager::shutdownStore(theStore);
2802+}
2803+
2804+void
2805+EventHandler::init()
2806+{
2807+ try {
2808+ Zorba_CompilerHints_t lHints;
2809+ lHints.opt_level = ZORBA_OPT_LEVEL_O1;
2810+ zorba::String lProlog("import module namespace dmh = 'http://www.zorba-xquery.com/modules/debugger/dbgp-message-handler';");
2811+ theStaticContext->loadProlog(lProlog, lHints);
2812+ } catch (zorba::ZorbaException& e) {
2813+ std::cerr << "Exception: I was not able to load the query file:" << std::endl;
2814+ std::cerr << e.what() << std::endl;
2815+ throw;
2816+ }
2817+}
2818+
2819+void
2820+EventHandler::parseMessage(const std::string &aMessage)
2821+{
2822+ try {
2823+#ifndef NDEBUG
2824+ // uncomment this to see the raw messages received by the event handler
2825+ //std::cout << "Processing response: " << aMessage << std::endl;
2826+#endif
2827+ // the query to process the response
2828+ std::stringstream lQueryStream;
2829+ lQueryStream << "dmh:process(" << aMessage << ")";
2830+ XQuery_t lQuery = theZorbaInstance->compileQuery(lQueryStream.str(), theStaticContext);
2831+
2832+ // get the query result sequrence:
2833+ // 1. a message
2834+ Iterator_t lIter = lQuery->iterator();
2835+ Item lItem;
2836+ lIter->open();
2837+ lIter->next(lItem);
2838+ std::size_t lId;
2839+ std::stringstream lStream(lItem.getStringValue().c_str());
2840+ lStream >> lId;
2841+
2842+ // 2. an "idle" flag (to disable quit confirmation)
2843+ bool lCanQuit = false;
2844+ if (lIter->next(lItem)) {
2845+ String lMessage = lItem.getStringValue();
2846+ lCanQuit = lMessage == "idle";
2847+ std::cout << std::endl << lItem.getStringValue() << std::endl;
2848+ }
2849+ theContinueProducer.produce(lCanQuit);
2850+
2851+ // go and solve the event with this id
2852+ theIdQueue.produce(lId);
2853+ } catch (ZorbaException& e) {
2854+ std::cerr << "FATAL: could not execute query: " << std::endl;
2855+ std::cerr << e << std::endl;
2856+ std::cerr << "This is a bug, please report it at http://bugs.launchpad.net/zorba" << std::endl;
2857+ }
2858+}
2859+
2860+void
2861+EventHandler::error(unsigned int errcode, const std::string &msg)
2862+{
2863+ std::cerr << "Error " << errcode << ": " << msg << std::endl;
2864+}
2865+
2866+} // namespace zorba
2867+} // namespace debugger
2868
2869=== modified file 'bin/debugger/event_handler.h'
2870--- bin/debug_client/event_handler.h 2011-07-01 01:53:24 +0000
2871+++ bin/debugger/event_handler.h 2012-03-14 02:09:24 +0000
2872@@ -14,33 +14,46 @@
2873 * limitations under the License.
2874 */
2875 #pragma once
2876+#ifndef ZORBA_DEBUGGER_EVENT_HANDLER_H
2877+#define ZORBA_DEBUGGER_EVENT_HANDLER_H
2878+
2879 #include <string>
2880 #include <iostream>
2881+
2882 #include <zorba/debugger_event_handler.h>
2883 #include <zorba/static_context.h>
2884+
2885 #include "lock_free_queue.h"
2886
2887-namespace zorba {
2888- class Zorba;
2889-}
2890-
2891-namespace zorba { namespace debugclient {
2892-
2893- class EventHandler : public zorba::DebuggerEventHandler
2894- {
2895+
2896+namespace zorba { namespace debugger {
2897+
2898+class EventHandler : public zorba::DebuggerEventHandler
2899+{
2900 public:
2901- EventHandler(LockFreeProducer<std::size_t>& aQueue, LockFreeProducer<bool>& aContQueue);
2902+ EventHandler(
2903+ LockFreeProducer<std::size_t>& aQueue,
2904+ LockFreeProducer<bool>& aContQueue);
2905+
2906 ~EventHandler();
2907+
2908 public:
2909 virtual void parseMessage(const std::string& aMessage);
2910+
2911 virtual void error(unsigned int errcode, const std::string& msg);
2912+
2913+ virtual void init();
2914+
2915 private:
2916- static std::istream* getCurrentDirectory();
2917 LockFreeProducer<std::size_t>& theIdQueue;
2918 LockFreeProducer<bool>& theContinueProducer;
2919 void* theStore;
2920 Zorba* theZorbaInstance;
2921 StaticContext_t theStaticContext;
2922- };
2923+
2924+};
2925
2926-}} // end of namespace zorba::debugclient
2927+} // namespace zorba
2928+} // namespace debugger
2929+
2930+#endif // ZORBA_DEBUGGER_EVENT_HANDLER_H
2931
2932=== modified file 'bin/debugger/lock_free_queue.h'
2933--- bin/debug_client/lock_free_queue.h 2011-07-01 01:53:24 +0000
2934+++ bin/debugger/lock_free_queue.h 2012-03-14 02:09:24 +0000
2935@@ -14,10 +14,14 @@
2936 * limitations under the License.
2937 */
2938 #pragma once
2939+#ifndef ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
2940+#define ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
2941+
2942 #include <iostream>
2943 #include <list>
2944
2945-namespace zorba { namespace debugclient {
2946+
2947+namespace zorba { namespace debugger {
2948
2949 template<typename T>
2950 class LockFreeProducer
2951@@ -80,4 +84,8 @@
2952 }
2953 return false;
2954 }
2955-}} // namespace zorba::debugclient
2956+
2957+} // namespace zorba
2958+} // namespace debugger
2959+
2960+#endif // ZORBA_DEBUGGER_LOCK_FREE_QUEUE_H
2961
2962=== modified file 'bin/debugger/main.cpp'
2963--- bin/debug_client/main.cpp 2011-07-01 01:53:24 +0000
2964+++ bin/debugger/main.cpp 2012-03-14 02:09:24 +0000
2965@@ -13,12 +13,286 @@
2966 * See the License for the specific language governing permissions and
2967 * limitations under the License.
2968 */
2969+
2970+#ifdef WIN32
2971+# include <windows.h>
2972+# include <string.h>
2973+# include <strsafe.h>
2974+#endif
2975+
2976+#include <vector>
2977+
2978 #include <zorba/config.h>
2979-#include "debug_command.h"
2980-#include "command_line_handler.h"
2981+
2982+#include "xqdb_client.h"
2983+#include "process_listener.h"
2984+
2985
2986 using namespace zorba;
2987-using namespace zorba::debugclient;
2988+using namespace zorba::debugger;
2989+
2990+
2991+std::auto_ptr<XqdbClient> theClient;
2992+
2993+// this will make sure the xqdb process will not quit when Ctrl-C is pressed
2994+#ifdef WIN32
2995+BOOL WINAPI
2996+ctrlC_Handler(DWORD aCtrlType)
2997+{
2998+ if (CTRL_C_EVENT == aCtrlType) {
2999+ return true;
3000+ }
3001+ return false;
3002+}
3003+#else
3004+void
3005+ctrlC_Handler(int lParam)
3006+{
3007+ // an empty sugnal handler on Linux should do the job
3008+}
3009+#endif
3010+
3011+
3012+// this handler function is passed the the zorba process listener and will
3013+// the client if the zorba process terminates
3014+void
3015+onExitProcess(ExitCode aExitCode) {
3016+ std::cout << std::endl << "Terminating debugger client." << std::endl;
3017+
3018+#ifndef WIN32
3019+ XqdbClient* lClient = theClient.release();
3020+ if (lClient) {
3021+ delete lClient;
3022+ }
3023+#endif
3024+
3025+ exit(aExitCode);
3026+}
3027+
3028+
3029+int
3030+startZorba(std::string& aExec, std::vector<std::string>& aArgs, std::auto_ptr<ProcessListener>& aProcessListener)
3031+{
3032+#ifdef WIN32
3033+ // **************************
3034+ // start a process on Windows
3035+
3036+ DWORD iReturnVal = 0;
3037+
3038+ std::wstring lExec;
3039+ std::wstring lArgs;
3040+
3041+ lExec.assign(aExec.begin(), aExec.end());
3042+
3043+ // the executable must be the first in the list of arguments
3044+ lArgs.append(L"\"");
3045+ lArgs.append(lExec);
3046+ lArgs.append(L"\"");
3047+
3048+ for (std::vector<std::string>::size_type j = 0; j < aArgs.size(); j++) {
3049+ std::string lArg(aArgs.at(j));
3050+ std::wstring lArgW;
3051+ lArgW.assign(lArg.begin(), lArg.end());
3052+ lArgs.append(L" ");
3053+ lArgs.append(lArgW);
3054+ }
3055+
3056+ // CreateProcessW can modify Parameters thus we allocate needed memory
3057+ wchar_t * pwszParam = new wchar_t[lArgs.size() + 1];
3058+ if (pwszParam == 0) {
3059+ return 1;
3060+ }
3061+ const wchar_t* pchrTemp = lArgs.c_str();
3062+ wcscpy_s(pwszParam, lArgs.size() + 1, pchrTemp);
3063+
3064+ // CreateProcess API initialization
3065+ STARTUPINFOW siStartupInfo;
3066+ PROCESS_INFORMATION piProcessInfo;
3067+ memset(&siStartupInfo, 0, sizeof(siStartupInfo));
3068+ memset(&piProcessInfo, 0, sizeof(piProcessInfo));
3069+ siStartupInfo.cb = sizeof(siStartupInfo);
3070+
3071+ BOOL lResult = CreateProcessW(
3072+ const_cast<LPCWSTR>(lExec.c_str()),
3073+ pwszParam, 0, 0, false,
3074+ CREATE_DEFAULT_ERROR_MODE, 0, 0,
3075+ &siStartupInfo, &piProcessInfo);
3076+
3077+ if (lResult) {
3078+ // Watch the process
3079+ aProcessListener.reset(new ProcessListener(piProcessInfo.dwProcessId, &onExitProcess));
3080+ }
3081+ else {
3082+ // CreateProcess failed
3083+ iReturnVal = GetLastError();
3084+ LPVOID lpMsgBuf;
3085+ LPVOID lpDisplayBuf;
3086+
3087+ FormatMessage(
3088+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
3089+ NULL,
3090+ iReturnVal,
3091+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
3092+ (LPTSTR) &lpMsgBuf,
3093+ 0, NULL);
3094+
3095+ // Display the error message and exit the process
3096+
3097+ lpDisplayBuf = (LPVOID)LocalAlloc(
3098+ LMEM_ZEROINIT,
3099+ (lstrlen((LPCTSTR)lpMsgBuf) + 40) * sizeof(TCHAR));
3100+
3101+ StringCchPrintf(
3102+ (LPTSTR)lpDisplayBuf,
3103+ LocalSize(lpDisplayBuf) / sizeof(TCHAR),
3104+ TEXT("Error (%d) when starting zorba: %s"),
3105+ iReturnVal,
3106+ lpMsgBuf);
3107+
3108+ std::wstring lErrorW((wchar_t*)lpDisplayBuf);
3109+ std::string lError;
3110+ lError.assign(lErrorW.begin(), lErrorW.end());
3111+ std::cout << lError << std::endl;
3112+
3113+ LocalFree(lpMsgBuf);
3114+ LocalFree(lpDisplayBuf);
3115+ }
3116+
3117+ // Free memory
3118+ delete[]pwszParam;
3119+ pwszParam = 0;
3120+
3121+ // Release handles
3122+ CloseHandle(piProcessInfo.hProcess);
3123+ CloseHandle(piProcessInfo.hThread);
3124+
3125+ return iReturnVal;
3126+
3127+#else
3128+ // ************************
3129+ // start a process on Linux
3130+
3131+ pid_t pID = fork();
3132+ if (pID == 0) {
3133+ // Code only executed by child process
3134+ std::stringstream lCommand;
3135+ lCommand << aExec;
3136+ for (std::vector<std::string>::size_type j = 0; j < aArgs.size(); j++) {
3137+ lCommand << " " << aArgs.at(j);
3138+ }
3139+
3140+ int lRes = system(lCommand.str().c_str());
3141+ exit(lRes);
3142+ }
3143+ else {
3144+ // Code only executed by parent process
3145+ if (pID < 0) {
3146+ std::cerr << "Failed to fork Zorba" << std::endl;
3147+ return pID;
3148+ }
3149+
3150+ // Watch the process
3151+ aProcessListener.reset(new ProcessListener(pID, &onExitProcess));
3152+
3153+ return 0;
3154+ }
3155+#endif
3156+}
3157+
3158+void printUsage(std::string& aProgram)
3159+{
3160+ std::cerr << "Usage:" << std::endl
3161+ << " " << aProgram << " <zorba_arguments>" << std::endl
3162+ << " this will start a debugger command line and a zorba process with the given arguments" << std::endl;
3163+}
3164+
3165+bool
3166+processArguments(
3167+ int argc,
3168+ char* argv[],
3169+ std::string& aProgram,
3170+ bool& aStandalone,
3171+ std::string& aZorba,
3172+ unsigned int& aPort,
3173+ std::vector<std::string>& aZorbaArgs)
3174+{
3175+ aPort = 28028;
3176+
3177+ // find the path to Zorba and this executable name
3178+ aProgram = argv[0];
3179+
3180+#ifdef WIN32
3181+ char lSep = '\\';
3182+#else
3183+ char lSep = '/';
3184+#endif
3185+ std::string::size_type lPos = aProgram.find_last_of(lSep);
3186+
3187+ std::stringstream lZs;
3188+
3189+ if (lPos == aProgram.npos) {
3190+ lZs << "." << lSep;
3191+ } else {
3192+ lZs << aProgram.substr(0, lPos + 1);
3193+ aProgram = aProgram.substr(lPos + 1);
3194+ }
3195+ lZs << "zorba";
3196+#ifdef WIN32
3197+ lZs << ".exe";
3198+#endif
3199+ aZorba = lZs.str();
3200+
3201+
3202+ bool lHasFileArg = false;
3203+ bool lHasQueryArg = false;
3204+ bool lHasQueryVal = false;
3205+
3206+ // find if the user asked for help or specified a specific port
3207+ for (int i = 1; i < argc; i++) {
3208+ std::string lArg = argv[i];
3209+ if (lArg == "-h" || lArg == "--help") {
3210+ return false;
3211+ }
3212+ else if (lArg == "-p" || lArg == "--debug-port") {
3213+ // if there is one more argument
3214+ if (i < argc - 1) {
3215+ // get the port value
3216+ int lPort;
3217+ std::stringstream lStream(argv[i + 1]);
3218+ lStream >> lPort;
3219+ if (!lStream.fail()) {
3220+ aPort = lPort;
3221+ }
3222+ }
3223+ }
3224+ else if (lArg == "-f") {
3225+ lHasFileArg = true;
3226+ }
3227+ else if (lArg == "-q") {
3228+ lHasQueryArg = true;
3229+ if (++i < argc) {
3230+ lHasQueryVal = true;
3231+ }
3232+ }
3233+ }
3234+
3235+ if (!lHasFileArg || !lHasQueryArg || !lHasQueryVal) {
3236+ std::cout << "Not enough arguments to start Zorba." << std::endl;
3237+ std::cout << "Running the standalone XQuery debugger client on port: " << aPort << std::endl;
3238+ return true;
3239+ }
3240+
3241+ // zorba will need the -d flag
3242+ aZorbaArgs.push_back("-d");
3243+
3244+ // gather all arguments (excepting the program name)
3245+ for (int i = 1; i < argc; i++) {
3246+ aZorbaArgs.push_back(argv[i]);
3247+ }
3248+
3249+ aStandalone = false;
3250+ return true;
3251+}
3252
3253 #ifndef _WIN32_WCE
3254 int
3255@@ -28,24 +302,72 @@
3256 _tmain(int argc, _TCHAR* argv[])
3257 #endif
3258 {
3259- int port = 28028;
3260- if (argv[1]) {
3261- std::stringstream stream(argv[1]);
3262- stream >> port;
3263- if (stream.fail() || argv[2]) {
3264- std::cerr << "Unknown argument. USAGE: " << argv[0] << " [PORT]" << std::endl;
3265- return 2;
3266+#ifdef WIN32
3267+ SetConsoleCtrlHandler(ctrlC_Handler, TRUE);
3268+#else
3269+ signal(SIGINT, ctrlC_Handler);
3270+#endif
3271+
3272+ // **************************************************************************
3273+ // processing arguments
3274+
3275+ std::string lProgram, lZorbaExec;
3276+ unsigned int lPort = 28028;
3277+ std::vector<std::string> lZorbaArgs;
3278+
3279+ bool lStandalone = true;
3280+ if (!processArguments(argc, argv, lProgram, lStandalone, lZorbaExec, lPort, lZorbaArgs)) {
3281+ printUsage(lProgram);
3282+ return 1;
3283+ }
3284+
3285+#ifndef NDEBUG
3286+ // **************************************************************************
3287+ // debug reporting
3288+
3289+ if (!lStandalone) {
3290+ std::cout << "Communication port: " << lPort << std::endl;
3291+ std::cout << "Zorba executable: " << lZorbaExec << std::endl;
3292+ std::cout << "Zorba arguments: ";
3293+ for (std::vector<std::string>::size_type j = 0; j < lZorbaArgs.size(); j++) {
3294+ std::cout << lZorbaArgs.at(j) << " ";
3295 }
3296+ std::cout << std::endl;
3297 }
3298+#endif
3299+
3300 try {
3301- LockFreeQueue<std::size_t> lQueue;
3302- LockFreeQueue<bool> lContEvent;
3303- EventHandler lHandler(lQueue, lContEvent);
3304- CommandLine cli;
3305- CommandLineHandler handler(port, lQueue, lContEvent, lHandler, cli);
3306- handler.execute();
3307+ // **************************************************************************
3308+ // start a zorba
3309+
3310+ // This is a process listener used to watch the Zorba process termination.
3311+ std::auto_ptr<ProcessListener> lProcessListener;
3312+
3313+ if (!lStandalone) {
3314+ int lResult = startZorba(lZorbaExec, lZorbaArgs, lProcessListener);
3315+ if (lResult) {
3316+ return lResult;
3317+ }
3318+ } else {
3319+ std::cout << "Listening for an incomming Zorba connection on port " << lPort << "..." << std::endl;
3320+ }
3321+
3322+ // **************************************************************************
3323+ // start the debugger command line
3324+
3325+ theClient.reset(new XqdbClient(lPort));
3326+ theClient->start();
3327+
3328 } catch (...) {
3329- return 4;
3330- }
3331+ return -1;
3332+ }
3333+
3334+#ifndef WIN32
3335+ XqdbClient* lClient = theClient.release();
3336+ if (lClient) {
3337+ delete lClient;
3338+ }
3339+#endif
3340+
3341 return 0;
3342 }
3343
3344=== added file 'bin/debugger/process_listener.cpp'
3345--- bin/debugger/process_listener.cpp 1970-01-01 00:00:00 +0000
3346+++ bin/debugger/process_listener.cpp 2012-03-14 02:09:24 +0000
3347@@ -0,0 +1,105 @@
3348+/*
3349+ * Copyright 2006-2008 The FLWOR Foundation.
3350+ *
3351+ * Licensed under the Apache License, Version 2.0 (the "License");
3352+ * you may not use this file except in compliance with the License.
3353+ * You may obtain a copy of the License at
3354+ *
3355+ * http://www.apache.org/licenses/LICENSE-2.0
3356+ *
3357+ * Unless required by applicable law or agreed to in writing, software
3358+ * distributed under the License is distributed on an "AS IS" BASIS,
3359+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3360+ * See the License for the specific language governing permissions and
3361+ * limitations under the License.
3362+ */
3363+
3364+#include "process_listener.h"
3365+
3366+#include <iostream>
3367+
3368+#ifdef ZORBA_HAVE_PTHREAD_H
3369+# include <cassert>
3370+#endif
3371+
3372+
3373+namespace zorba { namespace debugger {
3374+
3375+ProcessListener::ProcessListener(ProcessId aProcessID, ExitCallbackType aCallback)
3376+ : theProcessID(aProcessID), theCallback(aCallback)
3377+{
3378+#ifdef WIN32
3379+ theThread = CreateThread(NULL, 0, &run, (void*) this, 0, &theThreadId);
3380+#else
3381+ if (pthread_create(&theThread, NULL, &run, (void*) this)) {
3382+ assert(false);
3383+ }
3384+#endif
3385+}
3386+
3387+ProcessListener::~ProcessListener()
3388+{
3389+}
3390+
3391+ProcessId
3392+ProcessListener::getProcessID()
3393+{
3394+ return theProcessID;
3395+}
3396+
3397+ExitCallbackType
3398+ProcessListener::getCallback()
3399+{
3400+ return theCallback;
3401+}
3402+
3403+
3404+ZORBA_THREAD_RETURN
3405+ProcessListener::run(void* params)
3406+{
3407+ ProcessListener* lThis = static_cast<ProcessListener*>(params);
3408+ ExitCode lExitCode = -1;
3409+ ProcessId lPid = lThis->getProcessID();
3410+
3411+#ifdef WIN32
3412+ HANDLE lProcessHandle = OpenProcess(SYNCHRONIZE, false, lPid);
3413+ if (lProcessHandle != NULL) {
3414+ // wait for the process to exit
3415+ DWORD lResult = WaitForSingleObject(lProcessHandle, INFINITE);
3416+
3417+ // find out the process exit code if possible
3418+ if (!GetExitCodeProcess(lProcessHandle, &lExitCode)) {
3419+ lExitCode = -1;
3420+ }
3421+ DWORD dw = GetLastError();
3422+
3423+ // wait a little for zorba to dump the garbage
3424+ Sleep(1000);
3425+ }
3426+#else
3427+ int lChildExitStatus;
3428+
3429+ // wait for the process to exit
3430+ waitpid(lPid, &lChildExitStatus, 0);
3431+
3432+ // find out the process exit code if possible
3433+ if (WIFEXITED(lChildExitStatus)) {
3434+ lExitCode = WEXITSTATUS(lChildExitStatus);
3435+ }
3436+
3437+ // wait a little for zorba to dump the garbage
3438+ sleep(1);
3439+#endif
3440+
3441+ // and call the callback when this happened
3442+ ExitCallbackType lCallback = lThis->getCallback();
3443+ lCallback(lExitCode);
3444+
3445+ for (int i = 0; i < 10; i++) {
3446+ std::cout << i << std::endl;
3447+ }
3448+ return NULL;
3449+}
3450+
3451+} // namespace zorba
3452+} // namespace debugger
3453
3454=== added file 'bin/debugger/process_listener.h'
3455--- bin/debugger/process_listener.h 1970-01-01 00:00:00 +0000
3456+++ bin/debugger/process_listener.h 2012-03-14 02:09:24 +0000
3457@@ -0,0 +1,75 @@
3458+/*
3459+ * Copyright 2006-2008 The FLWOR Foundation.
3460+ *
3461+ * Licensed under the Apache License, Version 2.0 (the "License");
3462+ * you may not use this file except in compliance with the License.
3463+ * You may obtain a copy of the License at
3464+ *
3465+ * http://www.apache.org/licenses/LICENSE-2.0
3466+ *
3467+ * Unless required by applicable law or agreed to in writing, software
3468+ * distributed under the License is distributed on an "AS IS" BASIS,
3469+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3470+ * See the License for the specific language governing permissions and
3471+ * limitations under the License.
3472+ */
3473+#pragma once
3474+#ifndef ZORBA_DEBUGGER_PROCESS_LISTENER_H
3475+#define ZORBA_DEBUGGER_PROCESS_LISTENER_H
3476+
3477+#include <zorba/config.h>
3478+
3479+#ifdef ZORBA_HAVE_PTHREAD_H
3480+# include <pthread.h>
3481+# include <sys/wait.h>
3482+ typedef pthread_t ThreadId;
3483+ typedef pid_t ProcessId;
3484+ typedef int ExitCode;
3485+# define ZORBA_THREAD_RETURN void *
3486+#else
3487+# include <windows.h>
3488+ typedef DWORD ThreadId;
3489+ typedef DWORD ProcessId;
3490+ typedef DWORD ExitCode;
3491+# define ZORBA_THREAD_RETURN DWORD WINAPI
3492+#endif
3493+
3494+typedef void (*ExitCallbackType)(ExitCode);
3495+
3496+
3497+namespace zorba { namespace debugger {
3498+
3499+class ProcessListener
3500+{
3501+ public:
3502+ ProcessListener(ProcessId processID, ExitCallbackType callback);
3503+
3504+ ~ProcessListener();
3505+
3506+ ProcessId
3507+ getProcessID();
3508+
3509+ ExitCallbackType
3510+ getCallback();
3511+
3512+ private:
3513+
3514+ static ZORBA_THREAD_RETURN run(void* params);
3515+
3516+ private:
3517+
3518+#ifdef ZORBA_HAVE_PTHREAD_H
3519+ pthread_t theThread;
3520+#else
3521+ ThreadId theThreadId;
3522+ HANDLE theThread;
3523+#endif
3524+
3525+ ProcessId theProcessID;
3526+ ExitCallbackType theCallback;
3527+};
3528+
3529+} // namespace zorba
3530+} // namespace debugger
3531+
3532+#endif // ZORBA_DEBUGGER_PROCESS_LISTENER_H
3533
3534=== modified file 'bin/debugger/tuple.h'
3535--- bin/debug_client/tuple.h 2011-07-04 08:05:46 +0000
3536+++ bin/debugger/tuple.h 2012-03-14 02:09:24 +0000
3537@@ -14,9 +14,15 @@
3538 * limitations under the License.
3539 */
3540 #pragma once
3541+#ifndef ZORBA_DEBUGGER_TUPLE_H
3542+#define ZORBA_DEBUGGER_TUPLE_H
3543+
3544 #include <zorba/config.h>
3545+
3546 #if ZORBA_TR1_IN_TR1_SUBDIRECTORY
3547 # include <tr1/tuple>
3548 #else
3549 # include <tuple>
3550 #endif
3551+
3552+#endif // ZORBA_DEBUGGER_TUPLE_H
3553
3554=== added file 'bin/debugger/xqdb_client.cpp'
3555--- bin/debugger/xqdb_client.cpp 1970-01-01 00:00:00 +0000
3556+++ bin/debugger/xqdb_client.cpp 2012-03-14 02:09:24 +0000
3557@@ -0,0 +1,63 @@
3558+/*
3559+ * Copyright 2006-2008 The FLWOR Foundation.
3560+ *
3561+ * Licensed under the Apache License, Version 2.0 (the "License");
3562+ * you may not use this file except in compliance with the License.
3563+ * You may obtain a copy of the License at
3564+ *
3565+ * http://www.apache.org/licenses/LICENSE-2.0
3566+ *
3567+ * Unless required by applicable law or agreed to in writing, software
3568+ * distributed under the License is distributed on an "AS IS" BASIS,
3569+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3570+ * See the License for the specific language governing permissions and
3571+ * limitations under the License.
3572+ */
3573+
3574+#include "xqdb_client.h"
3575+
3576+#include <iostream>
3577+
3578+#ifdef ZORBA_HAVE_PTHREAD_H
3579+# include <cassert>
3580+#endif
3581+
3582+
3583+namespace zorba { namespace debugger {
3584+
3585+XqdbClient::XqdbClient(unsigned int aPort)
3586+{
3587+ theIdQueue = new LockFreeQueue<std::size_t>();
3588+ theQuitQueue = new LockFreeQueue<bool>();
3589+ theEventHandler = new EventHandler(*theIdQueue, *theQuitQueue);
3590+ theEventHandler->init();
3591+
3592+ theCommandPrompt = new CommandPrompt();
3593+ theCommandLineHandler = new CommandLineHandler(aPort, *theIdQueue, *theQuitQueue, theEventHandler, theCommandPrompt);
3594+}
3595+
3596+XqdbClient::~XqdbClient()
3597+{
3598+ if (theCommandLineHandler) {
3599+ delete theCommandLineHandler;
3600+ }
3601+ if (theCommandPrompt) {
3602+ delete theCommandPrompt;
3603+ }
3604+ if (theEventHandler) {
3605+ delete theEventHandler;
3606+ }
3607+
3608+ delete theIdQueue;
3609+ delete theQuitQueue;
3610+}
3611+
3612+void
3613+XqdbClient::start()
3614+{
3615+ theCommandLineHandler->execute();
3616+}
3617+
3618+
3619+} // namespace zorba
3620+} // namespace debugger
3621
3622=== added file 'bin/debugger/xqdb_client.h'
3623--- bin/debugger/xqdb_client.h 1970-01-01 00:00:00 +0000
3624+++ bin/debugger/xqdb_client.h 2012-03-14 02:09:24 +0000
3625@@ -0,0 +1,51 @@
3626+/*
3627+ * Copyright 2006-2008 The FLWOR Foundation.
3628+ *
3629+ * Licensed under the Apache License, Version 2.0 (the "License");
3630+ * you may not use this file except in compliance with the License.
3631+ * You may obtain a copy of the License at
3632+ *
3633+ * http://www.apache.org/licenses/LICENSE-2.0
3634+ *
3635+ * Unless required by applicable law or agreed to in writing, software
3636+ * distributed under the License is distributed on an "AS IS" BASIS,
3637+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3638+ * See the License for the specific language governing permissions and
3639+ * limitations under the License.
3640+ */
3641+#pragma once
3642+#ifndef ZORBA_DEBUGGER_XQDB_CLIENT_H
3643+#define ZORBA_DEBUGGER_XQDB_CLIENT_H
3644+
3645+#include "command_prompt.h"
3646+#include "command_line_handler.h"
3647+
3648+
3649+namespace zorba { namespace debugger {
3650+
3651+class XqdbClient {
3652+
3653+ public:
3654+
3655+ XqdbClient(unsigned int aPort);
3656+
3657+ ~XqdbClient();
3658+
3659+ void
3660+ start();
3661+
3662+ private:
3663+
3664+ LockFreeQueue<std::size_t>* theIdQueue;
3665+ LockFreeQueue<bool>* theQuitQueue;
3666+
3667+ EventHandler* theEventHandler;
3668+ CommandPrompt* theCommandPrompt;
3669+ CommandLineHandler* theCommandLineHandler;
3670+};
3671+
3672+
3673+} // namespace zorba
3674+} // namespace debugger
3675+
3676+#endif // ZORBA_DEBUGGER_XQDB_CLIENT_H
3677
3678=== renamed file 'bin/module_path.cpp' => 'bin/path_util.cpp'
3679--- bin/module_path.cpp 2011-05-25 16:40:26 +0000
3680+++ bin/path_util.cpp 2012-03-14 02:09:24 +0000
3681@@ -14,85 +14,117 @@
3682 * limitations under the License.
3683 */
3684
3685-#include "module_path.h"
3686+#include "path_util.h"
3687
3688 #include <stdlib.h>
3689-#include "zorba/zorba_string.h"
3690+//#include "zorba/zorba_string.h"
3691 #include "zorba/util/path.h"
3692
3693 #include "util.h"
3694 #include "zorbacmdproperties.h"
3695+#include <zorba/static_context.h>
3696
3697 namespace zorba {
3698
3699-std::string
3700-ModulePath::getEnvironmentModulePath()
3701+namespace PathUtil {
3702+
3703+static std::string
3704+getPathFromEnvironment(std::string const& aEnvVar)
3705 {
3706- std::string lEnvName("ZORBA_MODULE_PATH");
3707 #ifdef WIN32
3708 char* lBuffer;
3709 size_t lLen=0;
3710- errno_t lErr = getenv_s(&lLen, NULL, 0, lEnvName.c_str());
3711+ errno_t lErr = getenv_s(&lLen, NULL, 0, aEnvVar.c_str());
3712 if (lErr || !lLen) return "";
3713 lBuffer = (char*)malloc(lLen * sizeof(char));
3714 if (!lBuffer) return "";
3715- getenv_s(&lLen, lBuffer, lLen, lEnvName.c_str());
3716+ getenv_s(&lLen, lBuffer, lLen, aEnvVar.c_str());
3717 std::string lRes(lBuffer);
3718 free(lBuffer);
3719 return lRes;
3720 #else
3721- const char* lEnvValue = getenv(lEnvName.c_str());
3722- return lEnvValue!=0?lEnvValue:"";
3723+ const char* lEnvValue = getenv(aEnvVar.c_str());
3724+ return lEnvValue != 0 ? lEnvValue : "";
3725 #endif
3726 }
3727
3728-void
3729-ModulePath::convertVector(
3730- const std::vector<std::string>& aSource,
3731- std::vector<String>& aDest)
3732-{
3733- for (std::vector<std::string>::const_iterator lIter = aSource.begin();
3734- lIter != aSource.end(); ++lIter) {
3735- aDest.push_back(*lIter);
3736- }
3737-}
3738
3739 void
3740-ModulePath::tokenizeModulePath(
3741- const std::string& aModulePath,
3742- std::vector<std::string>& aResult)
3743+tokenizePath(
3744+ const std::string& aPathStr,
3745+ std::vector<String>& aResult)
3746 {
3747+ std::vector<std::string> lPath;
3748 #ifdef WIN32
3749- Util::tokenize(aModulePath, ";", aResult);
3750+ Util::tokenize(aPathStr, ";", lPath);
3751 #else
3752- Util::tokenize(aModulePath, ":", aResult);
3753+ Util::tokenize(aPathStr, ":", lPath);
3754 #endif
3755-}
3756+ for (std::vector<std::string>::iterator lIter = lPath.begin();
3757+ lIter != lPath.end(); ++lIter) {
3758+ aResult.push_back(*lIter);
3759+ }
3760+}
3761+
3762+
3763+String
3764+concatenatePaths( const std::vector<String>& aPathList)
3765+{
3766+ String delimiter(filesystem_path::get_path_separator());
3767+
3768+ String lResult;
3769+ for (std::vector<String>::const_iterator lIter = aPathList.begin();
3770+ lIter != aPathList.end(); ++lIter)
3771+ {
3772+ lResult += delimiter + *lIter;
3773+ }
3774+
3775+ return lResult;
3776+}
3777+
3778
3779 void
3780-ModulePath::getModulePaths(
3781+setPathsOnContext(
3782 const ZorbaCMDProperties& aProperties,
3783- std::vector<String>& aModulePaths)
3784+ StaticContext_t& aStaticCtx)
3785 {
3786- std::vector<std::string> lModulePaths; // result vector
3787- std::string lModulePath; // temporary variable for collections paths
3788-
3789- // 1. add the module paths from the command line properties
3790- aProperties.getModulePaths(lModulePath);
3791-
3792- tokenizeModulePath(lModulePath, lModulePaths);
3793-
3794- // 2. add the module paths from the environment
3795- lModulePath = ModulePath::getEnvironmentModulePath();
3796-
3797- tokenizeModulePath(lModulePath, lModulePaths);
3798-
3799- // 3. add the current working directory as module path
3800+ std::vector<String> lPath;
3801+ std::string lPathStr, lEnvStr;
3802+
3803+ // Compute the current working directory to append to all paths.
3804 filesystem_path lCWD;
3805- lModulePaths.push_back(lCWD.get_path());
3806-
3807- // convert std::string to zorba::String
3808- convertVector(lModulePaths, aModulePaths);
3809+
3810+ // setModulePaths() *overwrites* the URI path and lib path, so there's no
3811+ // sense in calling both. So if either --module-path or ZORBA_MODULE_PATH
3812+ // exists, just use those.
3813+ aProperties.getModulePath(lPathStr);
3814+ lEnvStr = getPathFromEnvironment("ZORBA_MODULE_PATH");
3815+ if (lPathStr.length() > 0 || lEnvStr.length() > 0) {
3816+ tokenizePath(lPathStr, lPath);
3817+ tokenizePath(lEnvStr, lPath);
3818+ lPath.push_back(lCWD.get_path());
3819+ aStaticCtx->setModulePaths(lPath);
3820+ }
3821+ else {
3822+ // Compute and set URI path
3823+ aProperties.getURIPath(lPathStr);
3824+ tokenizePath(lPathStr, lPath);
3825+ lEnvStr = getPathFromEnvironment("ZORBA_URI_PATH");
3826+ tokenizePath(lEnvStr, lPath);
3827+ lPath.push_back(lCWD.get_path());
3828+ aStaticCtx->setURIPath(lPath);
3829+ lPath.clear();
3830+
3831+ // Compute and set lib path
3832+ aProperties.getLibPath(lPathStr);
3833+ tokenizePath(lPathStr, lPath);
3834+ lPath.push_back(lCWD.get_path());
3835+ lEnvStr = getPathFromEnvironment("ZORBA_LIB_PATH");
3836+ tokenizePath(lEnvStr, lPath);
3837+ aStaticCtx->setLibPath(lPath);
3838+ }
3839 }
3840
3841+} /* namespace ModulePath */
3842+
3843 } /* namespace zorba */
3844
3845=== renamed file 'bin/module_path.h' => 'bin/path_util.h'
3846--- bin/module_path.h 2010-02-12 08:57:04 +0000
3847+++ bin/path_util.h 2012-03-14 02:09:24 +0000
3848@@ -18,6 +18,7 @@
3849
3850 #include <vector>
3851 #include <string>
3852+#include <zorba/api_shared_types.h>
3853
3854 class ZorbaCMDProperties;
3855
3856@@ -25,30 +26,20 @@
3857
3858 class String;
3859
3860- class ModulePath {
3861- protected:
3862- static std::string
3863- getEnvironmentModulePath();
3864-
3865- static void
3866- convertVector(const std::vector<std::string>& aSource,
3867- std::vector<String>& aDest);
3868-
3869- static void
3870- tokenizeModulePath(const std::string& aModulePath,
3871- std::vector<std::string>& aResult);
3872-
3873- static void
3874- getInstalledModulePath(const std::string& aModulePath,
3875- std::vector<std::string>& aResult);
3876-
3877- public:
3878- static void
3879- getModulePaths(const ZorbaCMDProperties& aProperties,
3880- std::vector<String>& aModulePaths);
3881-
3882-
3883- };
3884+ namespace PathUtil {
3885+
3886+ void
3887+ setPathsOnContext(const ZorbaCMDProperties& aProperties,
3888+ zorba::StaticContext_t& aStaticCtx);
3889+
3890+ void
3891+ tokenizePath(const std::string& aPathStr, std::vector<String>& aResult);
3892+
3893+
3894+ String
3895+ concatenatePaths( const std::vector<String>& aPathList);
3896+
3897+ }
3898 } /* namespace zorba */
3899
3900 #endif
3901
3902=== modified file 'bin/zorbacmd.cpp'
3903--- bin/zorbacmd.cpp 2011-07-11 11:12:23 +0000
3904+++ bin/zorbacmd.cpp 2012-03-14 02:09:24 +0000
3905@@ -38,12 +38,13 @@
3906 #include <zorba/iterator.h>
3907 #include <zorba/xquery_functions.h>
3908 #include <zorba/uri_resolvers.h>
3909+#include <zorba/serialization_callback.h>
3910
3911 #include <zorba/store_manager.h>
3912
3913 #include "error_printer.h"
3914 #include "util.h"
3915-#include "module_path.h"
3916+#include "path_util.h"
3917
3918 // For setting the base URI from the current directory
3919 #include <zorba/util/path.h>
3920@@ -70,8 +71,26 @@
3921
3922 #ifndef ZORBA_NO_FULL_TEXT
3923 OneToOneURIMapper theStopWordsMapper(EntityData::STOP_WORDS);
3924-OneToOneURIMapper theThesaurusMapper(EntityData::THESAURUS, URIMapper::COMPONENT);
3925+OneToOneURIMapper theThesaurusMapper(EntityData::THESAURUS);
3926 #endif
3927+class URIMapperSerializationCallback : public SerializationCallback
3928+{
3929+ private:
3930+ std::vector<URIMapper*> theURIMappers;
3931+
3932+ public:
3933+ void addURIMapper(URIMapper* lURIMapper)
3934+ {
3935+ theURIMappers.push_back(lURIMapper);
3936+ }
3937+
3938+ virtual URIMapper*
3939+ getURIMapper(size_t i) const
3940+ {
3941+ return theURIMappers[i];
3942+ }
3943+};
3944+URIMapperSerializationCallback theSerializationCallback;
3945
3946 bool
3947 populateStaticContext(
3948@@ -85,10 +104,8 @@
3949 // 2. environment ZORBA_MODULE_PATH
3950 // 3. current working directory
3951 {
3952- std::vector<String> lModulePaths;
3953- ModulePath::getModulePaths(aProperties, lModulePaths);
3954-
3955- aStaticContext->setModulePaths(lModulePaths);
3956+ std::vector<String> lModulePath;
3957+ PathUtil::setPathsOnContext(aProperties, aStaticContext);
3958 }
3959
3960 if (aProperties.boundarySpace().size() != 0 )
3961@@ -151,7 +168,11 @@
3962 for (; lIter != end; ++lIter) {
3963 theStopWordsMapper.addMapping(lIter->uri, lIter->value);
3964 }
3965- aStaticContext->registerURIMapper(&theStopWordsMapper);
3966+ if(aProperties.executePlan()) {
3967+ theSerializationCallback.addURIMapper(&theStopWordsMapper);
3968+ } else {
3969+ aStaticContext->registerURIMapper(&theStopWordsMapper);
3970+ }
3971 }
3972 {
3973 ZorbaCMDProperties::FullText_t::const_iterator lIter = aProperties.thesaurusBegin();
3974@@ -159,7 +180,11 @@
3975 for (; lIter != end; ++lIter) {
3976 theThesaurusMapper.addMapping(lIter->uri, lIter->value);
3977 }
3978- aStaticContext->registerURIMapper(&theThesaurusMapper);
3979+ if(aProperties.executePlan()) {
3980+ theSerializationCallback.addURIMapper(&theStopWordsMapper);
3981+ } else {
3982+ aStaticContext->registerURIMapper(&theThesaurusMapper);
3983+ }
3984 }
3985 #endif
3986 return true;
3987@@ -505,16 +530,30 @@
3988 unsigned long lNumExecutions = properties.multiple();
3989 bool lIndent = properties.indent();
3990 bool doTiming = properties.timing();
3991-
3992+ bool compilePlan = properties.compilePlan();
3993+ bool executePlan = properties.executePlan();
3994+ std::ostringstream lOut;
3995 Zorba_CompilerHints lHints;
3996
3997 // default is O1 in the Zorba_CompilerHints constructor
3998- if (properties.optimizationLevel() == "O0") {
3999+ if (properties.optimizationLevel() == "O0")
4000+ {
4001 lHints.opt_level = ZORBA_OPT_LEVEL_O0;
4002- } else if (properties.optimizationLevel() == "O2") {
4003+ }
4004+ else if (properties.optimizationLevel() == "O2")
4005+ {
4006 lHints.opt_level = ZORBA_OPT_LEVEL_O2;
4007 }
4008
4009+ lHints.for_serialization_only = true;
4010+
4011+#if ZORBACMD_LOAD_SYSTEM_PROPERTIES
4012+ if (Properties::instance()->serializeOnlyQuery() == 0)
4013+ {
4014+ lHints.for_serialization_only = false;
4015+ }
4016+#endif
4017+
4018 // default is false
4019 if (properties.libModule())
4020 {
4021@@ -558,7 +597,11 @@
4022 query->registerDiagnosticHandler(&diagnosticHandler);
4023 query->setFileName(qfilepath);
4024
4025- query->compile(qfile, staticContext, lHints);
4026+ if(executePlan) {
4027+ query->loadExecutionPlan(qfile, &theSerializationCallback);
4028+ } else {
4029+ query->compile(qfile, staticContext, lHints);
4030+ }
4031
4032 if (doTiming)
4033 {
4034@@ -577,8 +620,6 @@
4035 return 12;
4036 }
4037
4038- // if (diagnosticHandler.
4039-
4040 //
4041 // Create and populate the dynamic context
4042 //
4043@@ -623,7 +664,11 @@
4044 }
4045 else
4046 {
4047- query->execute(outputStream, &lSerOptions);
4048+ if (compilePlan) {
4049+ query->saveExecutionPlan(outputStream, ZORBA_USE_BINARY_ARCHIVE, SAVE_UNUSED_FUNCTIONS);
4050+ } else {
4051+ query->execute(outputStream, &lSerOptions);
4052+ }
4053 if (properties.trailingNl()) {
4054 outputStream << std::endl;
4055 }
4056@@ -661,19 +706,22 @@
4057 XmlDataManager* store = zorbaInstance->getXmlDataManager();
4058
4059 timing.startTimer(TimingInfo::UNLOAD_TIMER, i);
4060+
4061 DocumentManager* lMgr = store->getDocumentManager();
4062 ItemSequence_t lSeq = lMgr->availableDocuments();
4063 Iterator_t lIter = lSeq->getIterator();
4064 lIter->open();
4065 Item lURI;
4066- while (lIter->next(lURI)) {
4067+ while (lIter->next(lURI))
4068+ {
4069 lMgr->remove(lURI.getStringValue());
4070 }
4071+
4072 timing.stopTimer(TimingInfo::UNLOAD_TIMER, i);
4073
4074 timing.stopTimer(TimingInfo::TOTAL_TIMER, i);
4075 }
4076- }
4077+ } // for each execution
4078
4079 return 0;
4080 }
4081@@ -704,7 +752,7 @@
4082 return 1;
4083 }
4084
4085- TimingInfo timing(lProperties.multiple());
4086+ TimingInfo engineTiming(lProperties.multiple());
4087
4088 bool doTiming = lProperties.timing();
4089 bool debug = false;
4090@@ -738,17 +786,25 @@
4091 return 3;
4092 }
4093
4094+ // Add command line --classpath option in front of config/env CLASSPATH
4095+ Properties* globalProperties = Properties::instance();
4096+ std::string cmdJvmClassPath;
4097+ lProperties.getJVMClassPath(cmdJvmClassPath);
4098+ std::string configJvmClassPath;
4099+ globalProperties->getJVMClassPath(configJvmClassPath);
4100+ globalProperties->setJVMClassPath(cmdJvmClassPath +
4101+ filesystem_path::get_path_separator() + configJvmClassPath);
4102
4103 // Start the engine
4104
4105- timing.startTimer(TimingInfo::INIT_TIMER, 2);
4106+ engineTiming.startTimer(TimingInfo::INIT_TIMER, 2);
4107
4108 void* store = zorba::StoreManager::getStore();
4109
4110 zorba::Zorba* lZorbaInstance = zorba::Zorba::getInstance(store);
4111
4112 {
4113- timing.stopTimer(TimingInfo::INIT_TIMER, 2);
4114+ engineTiming.stopTimer(TimingInfo::INIT_TIMER, 2);
4115
4116 // For each query ...
4117
4118@@ -770,14 +826,14 @@
4119 if (asFile)
4120 {
4121 path.resolve_relative ();
4122- qfile.reset (new std::ifstream (path.c_str ()));
4123+ qfile.reset(new std::ifstream (path.c_str ()));
4124 }
4125 else
4126 {
4127- qfile.reset (new std::istringstream(fURI));
4128+ qfile.reset(new std::istringstream(fURI));
4129 }
4130
4131- if ( asFile && (!qfile->good() || qfile->eof()) )
4132+ if (asFile && (!qfile->good() || qfile->eof()))
4133 {
4134 std::cerr << "file {" << fname << "} not found or not readable." << std::endl;
4135 lProperties.printHelp(std::cout);
4136@@ -793,7 +849,8 @@
4137 //
4138 // Print the query if requested
4139 //
4140- if (lProperties.printQuery()) {
4141+ if (lProperties.printQuery())
4142+ {
4143 *lOutputStream << "\nQuery number " << queryNo << " :\n";
4144 std::copy (std::istreambuf_iterator<char> (*qfile),
4145 std::istreambuf_iterator<char> (),
4146@@ -836,8 +893,10 @@
4147 }
4148
4149 // Parse the query
4150- if (lProperties.parseOnly()) {
4151- try {
4152+ if (lProperties.parseOnly())
4153+ {
4154+ try
4155+ {
4156 zorba::XQuery_t lQuery = lZorbaInstance->createQuery();
4157 if (asFile) {
4158 lQuery->setFileName(path.get_path());
4159@@ -845,7 +904,8 @@
4160
4161 lQuery->parse (*qfile);
4162 }
4163- catch (zorba::ZorbaException const& ze) {
4164+ catch (zorba::ZorbaException const& ze)
4165+ {
4166 std::cerr << ze << std::endl;
4167 return 6;
4168 }
4169@@ -853,30 +913,44 @@
4170
4171 // Compile and run it if necessary.
4172 // Print timing information if requested.
4173- else if (!debug) {
4174- if (compileOnly) {
4175- try {
4176+ else if (!debug)
4177+ {
4178+ if (compileOnly)
4179+ {
4180+ try
4181+ {
4182 zorba::XQuery_t aQuery = lZorbaInstance->createQuery();
4183- if (asFile) {
4184+ if (asFile)
4185+ {
4186 aQuery->setFileName(path.get_path());
4187 }
4188+
4189 aQuery->parse(*qfile);
4190+
4191 qfile->clear();
4192 qfile->seekg(0); // go back to the beginning
4193- } catch (zorba::XQueryException const& qe) {
4194- ErrorPrinter::print(qe, std::cerr, lProperties.printErrorsAsXml(), lProperties.indent());
4195+ }
4196+ catch (zorba::XQueryException const& qe)
4197+ {
4198+ ErrorPrinter::print(qe,
4199+ std::cerr,
4200+ lProperties.printErrorsAsXml(),
4201+ lProperties.indent());
4202 return 6;
4203 }
4204 }
4205
4206+ TimingInfo queryTiming(lProperties.multiple());
4207+
4208 int status = compileAndExecute(lZorbaInstance,
4209 lProperties,
4210 lStaticContext,
4211 path.get_path(),
4212 *qfile,
4213 *lOutputStream,
4214- timing);
4215- if (status != 0) {
4216+ queryTiming);
4217+ if (status != 0)
4218+ {
4219 // reset the file handler (in case output option was provided)
4220 // in order to delete the created output file
4221 lFileStream.reset();
4222@@ -884,21 +958,25 @@
4223 return status;
4224 }
4225
4226- if (doTiming) {
4227- timing.print(std::cout);
4228+ if (doTiming)
4229+ {
4230+ queryTiming.print(std::cout);
4231 }
4232 }
4233
4234 #ifdef ZORBA_WITH_DEBUGGER
4235 // Debug the query. Do not allow "compileOnly" flags and inline queries
4236- else if (debug) {
4237- if (compileOnly) {
4238+ else if (debug)
4239+ {
4240+ if (compileOnly)
4241+ {
4242 std::cerr << "cannot debug a query if the compileOnly option is specified"
4243 << std::endl;
4244 return 7;
4245 }
4246
4247- if (!asFile) {
4248+ if (!asFile)
4249+ {
4250 std::cerr << "Cannot debug inline queries." << std::endl;
4251 return 8;
4252 }
4253@@ -908,7 +986,8 @@
4254
4255 zorba::XQuery_t lQuery;
4256
4257- try {
4258+ try
4259+ {
4260 lQuery = lZorbaInstance->createQuery();
4261 lQuery->setFileName(lFileName);
4262 lQuery->setDebugMode(true);
4263@@ -927,21 +1006,24 @@
4264 lHost = "127.0.0.1";
4265 }
4266
4267- if (lProperties.debug()) {
4268- Zorba_SerializerOptions lSerOptions =
4269- Zorba_SerializerOptions::SerializerOptionsFromStringParams(
4270- lProperties.getSerializerParameters());
4271- createSerializerOptions(lSerOptions, lProperties);
4272+ Zorba_SerializerOptions lSerOptions =
4273+ Zorba_SerializerOptions::SerializerOptionsFromStringParams(
4274+ lProperties.getSerializerParameters());
4275+ createSerializerOptions(lSerOptions, lProperties);
4276
4277- if (!lProperties.hasNoLogo() && !lProperties.debug()) {
4278- std::cout << "Zorba XQuery Debugger Server\n" << copyright_str << std::endl;
4279- }
4280- lQuery->debug(*lOutputStream, lSerOptions, lHost, lProperties.getDebugPort());
4281+ if (!lProperties.hasNoLogo())
4282+ {
4283+ std::cout << "Zorba XQuery Debugger Server\n" << copyright_str << std::endl;
4284 }
4285+
4286+ lQuery->debug(*lOutputStream, lSerOptions, lHost, lProperties.getDebugPort());
4287 }
4288 catch (zorba::XQueryException const& qe)
4289 {
4290- ErrorPrinter::print(qe, std::cerr, lProperties.printErrorsAsXml(), lProperties.indent());
4291+ ErrorPrinter::print(qe,
4292+ std::cerr,
4293+ lProperties.printErrorsAsXml(),
4294+ lProperties.indent());
4295 return 5;
4296 }
4297 catch (zorba::ZorbaException const& ze)
4298@@ -958,7 +1040,7 @@
4299
4300 if (doTiming)
4301 {
4302- timing.startTimer(TimingInfo::DEINIT_TIMER, 2);
4303+ engineTiming.startTimer(TimingInfo::DEINIT_TIMER, 2);
4304 }
4305
4306 lZorbaInstance->shutdown();
4307@@ -966,11 +1048,11 @@
4308
4309 if (doTiming)
4310 {
4311- timing.stopTimer(TimingInfo::DEINIT_TIMER, 2);
4312+ engineTiming.stopTimer(TimingInfo::DEINIT_TIMER, 2);
4313
4314 std::cout << std::endl << "Engine Shutdown Time : "
4315- << timing.elapsedDeinitWalltime
4316- << " (user: " << timing.elapsedDeinitCputime << ")"
4317+ << engineTiming.elapsedDeinitWalltime
4318+ << " (user: " << engineTiming.elapsedDeinitCputime << ")"
4319 << " milliseconds" << std::endl;
4320 }
4321 return 0;
4322
4323=== modified file 'bin/zorbacmdproperties.cpp'
4324--- bin/zorbacmdproperties.cpp 2011-07-21 19:21:25 +0000
4325+++ bin/zorbacmdproperties.cpp 2012-03-14 02:09:24 +0000
4326@@ -166,11 +166,25 @@
4327 }
4328
4329
4330-void ZorbaCMDProperties::getModulePaths(std::string& aPaths) const
4331-{
4332- aPaths = theModulePath;
4333-}
4334-
4335+void ZorbaCMDProperties::getModulePath(std::string& aPath) const
4336+{
4337+ aPath = theModulePath;
4338+}
4339+
4340+void ZorbaCMDProperties::getURIPath(std::string& aPath) const
4341+{
4342+ aPath = theUriPath;
4343+}
4344+
4345+void ZorbaCMDProperties::getLibPath(std::string& aPath) const
4346+{
4347+ aPath = theLibPath;
4348+}
4349+
4350+void ZorbaCMDProperties::getJVMClassPath(std::string& aPath) const
4351+{
4352+ aPath = theClasspath;
4353+}
4354
4355 std::vector<std::pair<std::string,std::string> > ZorbaCMDProperties::getSerializerParameters() const
4356 {
4357
4358=== modified file 'bin/zorbacmdproperties.h'
4359--- bin/zorbacmdproperties.h 2011-06-29 17:25:50 +0000
4360+++ bin/zorbacmdproperties.h 2012-03-14 02:09:24 +0000
4361@@ -84,8 +84,17 @@
4362 getSerializerParameters() const;
4363
4364 void
4365- getModulePaths(std::string&) const;
4366+ getModulePath(std::string&) const;
4367
4368+ void
4369+ getURIPath(std::string&) const;
4370+
4371+ void
4372+ getLibPath(std::string&) const;
4373+
4374+ void
4375+ getJVMClassPath(std::string&) const;
4376+
4377 bool isDebug(){ return theDebug; }
4378
4379 bool hasNoLogo(){ return theNoLogo; }
4380
4381=== modified file 'bin/zorbacmdproperties.txt'
4382--- bin/zorbacmdproperties.txt 2011-07-04 08:31:01 +0000
4383+++ bin/zorbacmdproperties.txt 2012-03-14 02:09:24 +0000
4384@@ -28,8 +28,13 @@
4385 ("debug-port,p", po::value<unsigned int>()->default_value (28028), "The port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028")
4386 ("no-logo", "Print no logo when starting.")
4387 ("timeout", po::value<long>()->default_value(-1), "Specify a timeout in seconds. After the specified time, the execution of the query will be aborted.")
4388-("module-path", po::value<std::string>(), "Module paths added to the built-in resolver, i.e. where module imports are looking for modules.")
4389+("uri-path", po::value<std::string>(), "URI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.")
4390+("lib-path", po::value<std::string>(), "Library path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.")
4391+("module-path", po::value<std::string>(), "Path (list of directories) to add to both the URI and Library paths.")
4392+("classpath", po::value<std::string>(), "JVM classpath to be used by modules using Java implementations")
4393 ("option", po::value<std::vector<std::string> >(), "Set an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value").
4394 ("trailing-nl", "Output a trailing newline after the result of the query.")
4395 ("stop-words", po::value<std::vector<std::string> >(), "Mapping specifying a stop-words URI to another.")
4396 ("thesaurus", po::value<std::vector<std::string> >(), "Mapping specifying a thesaurus URI to another.")
4397+("compile-plan,c", "Output the query plan as binary.")
4398+("execute-plan", "Take a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.")
4399
4400=== modified file 'bin/zorbacmdproperties_base.h'
4401--- bin/zorbacmdproperties_base.h 2011-07-04 08:31:01 +0000
4402+++ bin/zorbacmdproperties_base.h 2012-03-14 02:09:24 +0000
4403@@ -34,7 +34,7 @@
4404 class ZorbaCMDPropertiesBase : public ::zorba::PropertiesBase {
4405 protected:
4406 const char **get_all_options () const {
4407- static const char *result [] = { "--timing", "--output-file", "--serialization-parameter", "--serialize-html", "--serialize-text", "--indent", "--print-query", "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration", "--base-uri", "--boundary-space", "--default-collation", "--construction-mode", "--ordering-mode", "--multiple", "--query", "--as-files", "--external-variable", "--context-item", "--optimization-level", "--lib-module", "--parse-only", "--compile-only", "--no-serializer", "--debug", "--debug-host", "--debug-port", "--no-logo", "--timeout", "--module-path", "--option", "--trailing-nl", "--stop-words", "--thesaurus", NULL };
4408+ static const char *result [] = { "--timing", "--output-file", "--serialization-parameter", "--serialize-html", "--serialize-text", "--indent", "--print-query", "--print-errors-as-xml", "--byte-order-mark", "--omit-xml-declaration", "--base-uri", "--boundary-space", "--default-collation", "--construction-mode", "--ordering-mode", "--multiple", "--query", "--as-files", "--external-variable", "--context-item", "--optimization-level", "--lib-module", "--parse-only", "--compile-only", "--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", NULL };
4409 return result;
4410 }
4411 bool theTiming;
4412@@ -67,11 +67,16 @@
4413 unsigned int theDebugPort;
4414 bool theNoLogo;
4415 long theTimeout;
4416+ std::string theUriPath;
4417+ std::string theLibPath;
4418 std::string theModulePath;
4419+ std::string theClasspath;
4420 std::vector<std::string> theOption;
4421 bool theTrailingNl;
4422 std::vector<std::string> theStopWords;
4423 std::vector<std::string> theThesaurus;
4424+ bool theCompilePlan;
4425+ bool theExecutePlan;
4426
4427 void initialize () {
4428 theTiming = false;
4429@@ -95,6 +100,8 @@
4430 theNoLogo = false;
4431 theTimeout = -1;
4432 theTrailingNl = false;
4433+ theCompilePlan = false;
4434+ theExecutePlan = false;
4435 }
4436 public:
4437 const bool &timing () const { return theTiming; }
4438@@ -127,11 +134,16 @@
4439 const unsigned int &debugPort () const { return theDebugPort; }
4440 const bool &noLogo () const { return theNoLogo; }
4441 const long &timeout () const { return theTimeout; }
4442+ const std::string &uriPath () const { return theUriPath; }
4443+ const std::string &libPath () const { return theLibPath; }
4444 const std::string &modulePath () const { return theModulePath; }
4445+ const std::string &classpath () const { return theClasspath; }
4446 const std::vector<std::string> &option () const { return theOption; }
4447 const bool &trailingNl () const { return theTrailingNl; }
4448 const std::vector<std::string> &stopWords () const { return theStopWords; }
4449 const std::vector<std::string> &thesaurus () const { return theThesaurus; }
4450+ const bool &compilePlan () const { return theCompilePlan; }
4451+ const bool &executePlan () const { return theExecutePlan; }
4452
4453 std::string load_argv (int argc, const char **argv) {
4454 if (argv == NULL) return "";
4455@@ -262,11 +274,26 @@
4456 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
4457 if (*argv == NULL) { result = "No value given for --timeout option"; break; } init_val (*argv, theTimeout, d);
4458 }
4459+ else if (strcmp (*argv, "--uri-path") == 0) {
4460+ int d = 2;
4461+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
4462+ if (*argv == NULL) { result = "No value given for --uri-path option"; break; } init_val (*argv, theUriPath, d);
4463+ }
4464+ else if (strcmp (*argv, "--lib-path") == 0) {
4465+ int d = 2;
4466+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
4467+ if (*argv == NULL) { result = "No value given for --lib-path option"; break; } init_val (*argv, theLibPath, d);
4468+ }
4469 else if (strcmp (*argv, "--module-path") == 0) {
4470 int d = 2;
4471 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
4472 if (*argv == NULL) { result = "No value given for --module-path option"; break; } init_val (*argv, theModulePath, d);
4473 }
4474+ else if (strcmp (*argv, "--classpath") == 0) {
4475+ int d = 2;
4476+ if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
4477+ if (*argv == NULL) { result = "No value given for --classpath option"; break; } init_val (*argv, theClasspath, d);
4478+ }
4479 else if (strcmp (*argv, "--option") == 0) {
4480 int d = 2;
4481 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
4482@@ -285,6 +312,12 @@
4483 if ((*argv) [1] == '-' || (*argv) [2] == '\0') { d = 0; ++argv; }
4484 if (*argv == NULL) { result = "No value given for --thesaurus option"; break; } init_val (*argv, theThesaurus, d);
4485 }
4486+ else if (strcmp (*argv, "--compile-plan") == 0 || strncmp (*argv, "-c", 2) == 0) {
4487+ theCompilePlan = true;
4488+ }
4489+ else if (strcmp (*argv, "--execute-plan") == 0) {
4490+ theExecutePlan = true;
4491+ }
4492 else if (strcmp (*argv, "--") == 0) {
4493 copy_args (++argv);
4494 break;
4495@@ -327,15 +360,20 @@
4496 "--compile-only\nOnly compile (don't execute)\n\n"
4497 "--no-serializer\nDo not serialize (discard) result.\n\n"
4498 "--debug, -d\nLaunch the Zorba debugger server and connect to a DBGP-enabled debugger client.\n\n"
4499-"--debug-host, -p\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
4500+"--debug-host, -h\nThe host where the DBGP-enabled debugger client listens for connections. Defaults to: 127.0.0.1\n\n"
4501 "--debug-port, -p\nThe port on which the DBGP-enabled debugger client listens for connections. Defaults to: 28028\n\n"
4502 "--no-logo\nPrint no logo when starting.\n\n"
4503 "--timeout\nSpecify a timeout in seconds. After the specified time, the execution of the query will be aborted.\n\n"
4504-"--module-path\nModule paths added to the built-in resolver, i.e. where module imports are looking for modules.\n\n"
4505+"--uri-path\nURI path (list of directories) added to the built-in URI resolver, i.e. where to find modules/schemas to import.\n\n"
4506+"--lib-path\nLibrary path (list of directories) where Zorba will look for dynamic libraries (e.g., module external function implementations.\n\n"
4507+"--module-path\nPath (list of directories) to add to both the URI and Library paths.\n\n"
4508+"--classpath\nJVM classpath to be used by modules using Java implementations\n\n"
4509 "--option\nSet an XQuery option in the static context. The QName of the option is passed as a string in the notation by James Clark (i.e. {namespace}localname). For example, --option {http://www.zorba-xquery.com}option=value\n\n"
4510 "--trailing-nl\nOutput a trailing newline after the result of the query.\n\n"
4511 "--stop-words\nMapping specifying a stop-words URI to another.\n\n"
4512 "--thesaurus\nMapping specifying a thesaurus URI to another.\n\n"
4513+"--compile-plan, -c\nOutput the query plan as binary.\n\n"
4514+"--execute-plan\nTake a query plan as binary and execute it. Binary query plans can be generated using the --compile-plan option.\n\n"
4515 ;
4516 }
4517
4518
4519=== added file 'cmake_modules/FindLibedit.cmake'
4520--- cmake_modules/FindLibedit.cmake 1970-01-01 00:00:00 +0000
4521+++ cmake_modules/FindLibedit.cmake 2012-03-14 02:09:24 +0000
4522@@ -0,0 +1,46 @@
4523+# Copyright 2011 The FLWOR Foundation.
4524+#
4525+# Licensed under the Apache License, Version 2.0 (the "License");
4526+# you may not use this file except in compliance with the License.
4527+# You may obtain a copy of the License at
4528+#
4529+# http://www.apache.org/licenses/LICENSE-2.0
4530+#
4531+# Unless required by applicable law or agreed to in writing, software
4532+# distributed under the License is distributed on an "AS IS" BASIS,
4533+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4534+# See the License for the specific language governing permissions and
4535+# limitations under the License.
4536+#
4537+# - Try to find the libedit library
4538+#
4539+# Once done this will define
4540+#
4541+# LIBEDIT_FOUND - True if libedit library is found
4542+# LIBEDIT_INCLUDE_DIRS - Directory to include to get libedit headers
4543+# LIBEDIT_LIBRARIES - Libraries to link against for the libedit library
4544+#
4545+
4546+FIND_PATH (
4547+ LIBEDIT_INCLUDE
4548+ editline/readline.h
4549+ PATHS ${LIBEDIT_INCLUDE_DIR} /usr/include /usr/local/include
4550+)
4551+MESSAGE(STATUS ${LIBEDIT_INCLUDE})
4552+
4553+FIND_LIBRARY (
4554+ LIBEDIT_LIBRARY
4555+ NAMES edit
4556+ PATHS ${LIBEDIT_LIBRARY_DIR} /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
4557+)
4558+MESSAGE(STATUS ${LIBEDIT_LIBRARY})
4559+
4560+SET (LIBEDIT_INCLUDE_DIRS ${LIBEDIT_INCLUDE})
4561+SET (LIBEDIT_LIBRARIES ${LIBEDIT_LIBRARY})
4562+
4563+FIND_PACKAGE_HANDLE_STANDARD_ARGS (
4564+ Libedit
4565+ DEFAULT_MSG
4566+ LIBEDIT_INCLUDE LIBEDIT_LIBRARY
4567+)
4568+
4569
4570=== modified file 'cmake_modules/FindPHP5.cmake'
4571--- cmake_modules/FindPHP5.cmake 2011-08-19 00:03:31 +0000
4572+++ cmake_modules/FindPHP5.cmake 2012-03-14 02:09:24 +0000
4573@@ -97,6 +97,11 @@
4574 _zend_rsrc_list_get_rsrc_type
4575 _zend_wrong_param_count
4576 _zval_used_for_init
4577+ _zval_is_true
4578+ _zend_lookup_class
4579+ __object_init
4580+ __zend_hash_add_or_update
4581+ _php_strtolower
4582 )
4583 SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS
4584 "${CMAKE_SHARED_MODULE_CREATE_C_FLAGS},-U,${symbol}")
4585
4586=== modified file 'cmake_modules/Windows/ProxyFindModule.cmake'
4587--- cmake_modules/Windows/ProxyFindModule.cmake 2011-10-08 16:34:42 +0000
4588+++ cmake_modules/Windows/ProxyFindModule.cmake 2012-03-14 02:09:24 +0000
4589@@ -32,6 +32,15 @@
4590 ENDMACRO (PRINT_FIND_END_TITLE)
4591
4592
4593+MACRO (PRINT_FIND_END_TITLE_SYSTEM MODULE_NAME FOUND)
4594+ IF (${FOUND})
4595+ MESSAGE (STATUS "************* DONE (found) *************")
4596+ ELSE (${FOUND})
4597+ MESSAGE (STATUS "*********** DONE (not found) ***********")
4598+ ENDIF (${FOUND})
4599+ENDMACRO (PRINT_FIND_END_TITLE_SYSTEM)
4600+
4601+
4602 MACRO (INSTALL_DLL DLL_PATH)
4603 IF (${PROJECT_NAME} STREQUAL "zorba")
4604 # for zorba core requirements, install this DLL
4605@@ -213,6 +222,34 @@
4606 ENDMACRO (FIND_PACKAGE_WIN32)
4607
4608
4609+# This macro will just perform a normal library search without trying to guess
4610+# locations. This should be used for searching libraries that can be found on
4611+# Windows using other means like registry entries (ImageMagick) or special
4612+# environment variables (Java or JNI)
4613+MACRO (FIND_PACKAGE_WIN32_NO_PROXY MODULE_NAME FOUND_VAR)
4614+
4615+ PRINT_FIND_TITLE (${MODULE_NAME})
4616+
4617+ # remove the Windows module path (both from Zorba or the external modules)
4618+ # to avoid an infinite recursion
4619+ FOREACH (PATH ${CMAKE_MODULE_PATH})
4620+ IF ("${PATH}" MATCHES ".*/cmake_modules/Windows")
4621+ LIST (REMOVE_ITEM CMAKE_MODULE_PATH "${PATH}")
4622+ ENDIF ("${PATH}" MATCHES ".*/cmake_modules/Windows")
4623+ ENDFOREACH (PATH)
4624+
4625+ FIND_PACKAGE (${MODULE_NAME})
4626+
4627+ # restore the module path
4628+ SET (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_modules/Windows ${CMAKE_MODULE_PATH})
4629+ # restore the prefix path
4630+ SET (CMAKE_PREFIX_PATH ${OLD_CMAKE_PREFIX_PATH})
4631+
4632+ PRINT_FIND_END_TITLE_SYSTEM (${MODULE_NAME} ${FOUND_VAR})
4633+
4634+ENDMACRO (FIND_PACKAGE_WIN32_NO_PROXY)
4635+
4636+
4637 # This macro will search for a DLL in the given library location using extra
4638 # arguments as alternative names of the DLL. The first DLL found with that name
4639 # is considered. This is useful for some libraries that come with different DLL
4640
4641=== modified file 'cmake_modules/ZorbaModule.cmake'
4642--- cmake_modules/ZorbaModule.cmake 2011-10-09 01:15:10 +0000
4643+++ cmake_modules/ZorbaModule.cmake 2012-03-14 02:09:24 +0000
4644@@ -66,7 +66,8 @@
4645 #
4646 # Parameters:
4647 # URI - URI to mangle
4648-# EXT - extension to ensure URI ends with
4649+# EXT - extension to ensure URI ends with (may be empty; if set, must
4650+# include leading "."
4651 # DIR_VAR - variable to set with the directory part of the mangled path
4652 # FILE_VAR - variable to set with the file part of the mangled path
4653 MACRO (MANGLE_URI URI EXT DIR_VAR FILE_VAR)
4654@@ -89,13 +90,14 @@
4655
4656 # Convert final component into proper filename
4657 IF (NOT final_comp)
4658- SET (${FILE_VAR} "index.${EXT}")
4659+ SET (${FILE_VAR} "index${EXT}")
4660 ELSE (NOT final_comp)
4661- IF ("${final_comp}" MATCHES "\\.${EXT}$")
4662+ # \\ necessary to escape the leading . in EXT
4663+ IF ("${final_comp}" MATCHES "\\${EXT}$")
4664 SET (${FILE_VAR} "${final_comp}")
4665- ELSE ("${final_comp}" MATCHES "\\.${EXT}$")
4666- SET (${FILE_VAR} "${final_comp}.${EXT}")
4667- ENDIF ("${final_comp}" MATCHES "\\.${EXT}$")
4668+ ELSE ("${final_comp}" MATCHES "\\${EXT}$")
4669+ SET (${FILE_VAR} "${final_comp}${EXT}")
4670+ ENDIF ("${final_comp}" MATCHES "\\${EXT}$")
4671 ENDIF (NOT final_comp)
4672
4673 # Stick the reversed authority back on the front of the path: done!
4674@@ -138,8 +140,7 @@
4675 ENDIF (NOT IS_ABSOLUTE "${MODULE_FILE}")
4676 GET_FILENAME_COMPONENT (module_name "${MODULE_FILE}" NAME)
4677
4678-
4679- MANGLE_URI (${MODULE_URI} "xq" module_path module_filename)
4680+ MANGLE_URI (${MODULE_URI} ".xq" module_path module_filename)
4681
4682 # Compute a CMake-symbol-safe version of the target URI, for storing
4683 # things in CMake properties.
4684@@ -159,41 +160,51 @@
4685 MATH (EXPR num_zorba_modules "${num_zorba_modules} + 1")
4686 SET_PROPERTY (GLOBAL PROPERTY ZORBA_MODULE_COUNT ${num_zorba_modules})
4687
4688- # Compute the version numbers, if any provided.
4689- IF (MODULE_VERSION)
4690- STRING (REPLACE "." ";" version "${MODULE_VERSION}")
4691- LIST (LENGTH version version_len)
4692- IF (NOT (version_len EQUAL 2) OR (version_len EQUAL 3))
4693- MESSAGE (FATAL_ERROR
4694- "Version ${MODULE_VERSION} not of form 'major.minor[.patch]'")
4695- ENDIF (NOT (version_len EQUAL 2) OR (version_len EQUAL 3))
4696- LIST (GET version 0 major_ver)
4697- LIST (GET version 1 minor_ver)
4698- IF (version_len EQUAL 3)
4699- LIST (GET version 2 patch_ver)
4700- MATH (EXPR version_int
4701- "${major_ver} * 100000000 + ${minor_ver} * 100000 + ${patch_ver}")
4702- ELSE (version_len EQUAL 3)
4703- SET (patch_ver)
4704- MATH (EXPR version_int "${major_ver} * 100000000 + ${minor_ver} * 100000")
4705- ENDIF (version_len EQUAL 3)
4706-
4707- # We maintain a global CMake property named after the target URI
4708- # which remembers all versions of this URI which have been
4709- # declared. If a *lower* version has already been declared, the
4710- # output file rules will be messed up, so die.
4711- GET_PROPERTY (target_versions GLOBAL PROPERTY "${uri_sym}-versions")
4712- FOREACH (known_ver ${target_versions})
4713- IF (known_ver LESS version_int)
4714- MESSAGE (FATAL_ERROR
4715- "The module ${MODULE_URI} has already been declared with a "
4716- "lower version number than ${MODULE_VERSION}. "
4717- "Please call DECLARE_ZORBA_MODULE() for higher versions of the same "
4718- "module first.")
4719- ENDIF (known_ver LESS version_int)
4720- ENDFOREACH (known_ver)
4721- SET_PROPERTY (GLOBAL APPEND PROPERTY "${uri_sym}-versions" ${version_int})
4722- ENDIF (MODULE_VERSION)
4723+ # If no version specified, it is effectively treated as 0.0.0.
4724+ IF (NOT MODULE_VERSION)
4725+ SET (MODULE_VERSION "0.0.0")
4726+ ENDIF (NOT MODULE_VERSION)
4727+
4728+ # Compute a unique integer, version_int, based on the version
4729+ # number, so we can more easily compare with other versions later.
4730+ STRING (REPLACE "." ";" version "${MODULE_VERSION}")
4731+ LIST (LENGTH version version_len)
4732+ IF (NOT ( (version_len EQUAL 2) OR (version_len EQUAL 3) ) )
4733+ MESSAGE (FATAL_ERROR
4734+ "Version ${version_len} ${MODULE_VERSION} not of form 'major.minor[.patch]'")
4735+ ENDIF (NOT ( (version_len EQUAL 2) OR (version_len EQUAL 3) ) )
4736+ LIST (GET version 0 major_ver)
4737+ LIST (GET version 1 minor_ver)
4738+ IF (version_len EQUAL 3)
4739+ LIST (GET version 2 patch_ver)
4740+ MATH (EXPR version_int
4741+ "${major_ver} * 100000000 + ${minor_ver} * 100000 + ${patch_ver}")
4742+ ELSE (version_len EQUAL 3)
4743+ SET (patch_ver)
4744+ MATH (EXPR version_int "${major_ver} * 100000000 + ${minor_ver} * 100000")
4745+ ENDIF (version_len EQUAL 3)
4746+
4747+ # We maintain a global CMake property named after the target URI
4748+ # which remembers all versions of this URI which have been
4749+ # declared. If a *lower* version has already been declared, the
4750+ # output file rules will be messed up, so die. If the *same* version
4751+ # has already been declare, XQdoc will be messed up, so die.
4752+ GET_PROPERTY (target_versions GLOBAL PROPERTY "${uri_sym}-versions")
4753+ FOREACH (known_ver ${target_versions})
4754+ IF (known_ver LESS version_int)
4755+ MESSAGE (FATAL_ERROR
4756+ "The module ${MODULE_URI} has already been declared with a "
4757+ "lower version number than ${MODULE_VERSION}. "
4758+ "Please call DECLARE_ZORBA_MODULE() for higher versions of the same "
4759+ "module first.")
4760+ ElSEIF (known_ver EQUAL version_int)
4761+ MESSAGE (FATAL_ERROR
4762+ "The module ${MODULE_URI} has already been declared with the "
4763+ "version number ${MODULE_VERSION}. You cannot declare the same "
4764+ "module twice.")
4765+ ENDIF (known_ver LESS version_int)
4766+ ENDFOREACH (known_ver)
4767+ SET_PROPERTY (GLOBAL APPEND PROPERTY "${uri_sym}-versions" ${version_int})
4768
4769 # Add to module manifest (except test modules).
4770 IF (NOT MODULE_TEST_ONLY)
4771@@ -250,6 +261,11 @@
4772 SET(module_lib_target "modlib${num_zorba_modules}_${module_name}")
4773 ADD_LIBRARY(${module_lib_target} SHARED ${SRC_FILES})
4774 GET_FILENAME_COMPONENT(module_filewe "${module_filename}" NAME_WE)
4775+ IF (MODULE_VERSION)
4776+ # If there's a version, insert it into the module library name
4777+ SET (module_filewe "${module_filewe}_${MODULE_VERSION}")
4778+ ENDIF (MODULE_VERSION)
4779+
4780 # It seems like it would be nice to set the VERSION and/or
4781 # SOVERSION target properties here. However: On Windows, it
4782 # doesn't seem to do anything (the .rc file configured above
4783@@ -260,7 +276,7 @@
4784 # target property isn't desirable.
4785 # FOLDER is to group IDE projects into folders.
4786 SET_TARGET_PROPERTIES (${module_lib_target} PROPERTIES
4787- OUTPUT_NAME "${module_filewe}_${MODULE_VERSION}${SUFFIX}"
4788+ OUTPUT_NAME "${module_filewe}${SUFFIX}"
4789 ${target_type}_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${module_name}.src"
4790 FOLDER "Modules"
4791 )
4792@@ -272,12 +288,12 @@
4793 IF(NOT ${PROJECT_NAME} STREQUAL "zorba")
4794 STRING(REPLACE "-" "_" component_name ${PROJECT_NAME})
4795 INSTALL(TARGETS ${module_lib_target}
4796- ${target_type} DESTINATION ${ZORBA_MODULES_INSTALL_DIR}/${module_path}
4797+ ${target_type} DESTINATION ${ZORBA_NONCORE_LIB_DIR}/${module_path}
4798 COMPONENT ${component_name})
4799
4800 ELSE(NOT ${PROJECT_NAME} STREQUAL "zorba")
4801 INSTALL(TARGETS ${module_lib_target}
4802- ${target_type} DESTINATION ${ZORBA_MODULES_INSTALL_DIR}/${module_path})
4803+ ${target_type} DESTINATION ${ZORBA_CORE_LIB_DIR}/${module_path})
4804 ENDIF(NOT ${PROJECT_NAME} STREQUAL "zorba")
4805 ENDIF (NOT MODULE_TEST_ONLY)
4806
4807@@ -296,16 +312,16 @@
4808 ENDIF (patch_ver)
4809 ENDIF (MODULE_VERSION)
4810 FOREACH (version_infix "" ${version_infixes})
4811- ADD_COPY_RULE ("${SOURCE_FILE}" "${module_path}/${module_filename}"
4812- "${version_infix}" "" "${MODULE_TEST_ONLY}")
4813+ ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${module_path}/${module_filename}"
4814+ "${version_infix}" "" 1 "${MODULE_TEST_ONLY}")
4815 ENDFOREACH (version_infix)
4816
4817 # Also copy the dynamic library from the location it was built.
4818 IF (module_lib_target)
4819 GET_TARGET_PROPERTY (lib_location "${module_lib_target}" LOCATION)
4820 GET_FILENAME_COMPONENT (lib_filename "${lib_location}" NAME)
4821- ADD_COPY_RULE ("${lib_location}" "${module_path}/${lib_filename}"
4822- "" "${module_lib_target}" "${MODULE_TEST_ONLY}")
4823+ ADD_COPY_RULE ("LIB" "${lib_location}" "${module_path}/${lib_filename}"
4824+ "" "${module_lib_target}" 0 "${MODULE_TEST_ONLY}")
4825 ENDIF (module_lib_target)
4826
4827 # Last but not least, whip up a test case that ensures the module
4828@@ -350,34 +366,152 @@
4829 SET (SOURCE_FILE "${SCHEMA_FILE}")
4830 ENDIF (NOT IS_ABSOLUTE "${SCHEMA_FILE}")
4831 GET_FILENAME_COMPONENT (schema_name "${SCHEMA_FILE}" NAME)
4832- MANGLE_URI (${SCHEMA_URI} "xsd" schema_path schema_filename)
4833+ MANGLE_URI (${SCHEMA_URI} ".xsd" schema_path schema_filename)
4834
4835 # Add to schema manifest (except test schema).
4836 IF (NOT SCHEMA_TEST_ONLY)
4837 ADD_ZORBA_MANIFEST_ENTRY("schema" ${SCHEMA_URI} "")
4838 ENDIF (NOT SCHEMA_TEST_ONLY)
4839
4840- ADD_COPY_RULE ("${SOURCE_FILE}" "${schema_path}/${schema_filename}"
4841- "" "" "${SCHEMA_TEST_ONLY}")
4842+ ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${schema_path}/${schema_filename}"
4843+ "" "" 1 "${SCHEMA_TEST_ONLY}")
4844
4845 ENDMACRO (DECLARE_ZORBA_SCHEMA)
4846
4847+# Macro which declares a file to be loaded by URI. This sets up the
4848+# installation of the file into the URI_PATH folder so it will be
4849+# found at runtime.
4850+#
4851+# Args: URI - the URI of the file
4852+# FILE - path to file (if not absolute, will be resolved
4853+# relative to CMAKE_CURRENT_SOURCE_DIR)
4854+# TEST_ONLY - (optional) File is for testcases only and should not
4855+# be installed
4856+MACRO (DECLARE_ZORBA_URI_FILE)
4857+ # QQQ Refactor - this macro is basically identical to DECLARE_ZORBA_SCHEMA
4858+ PARSE_ARGUMENTS(URI_FILE "" "URI;FILE" "TEST_ONLY" ${ARGN})
4859+ IF (NOT URI_FILE_FILE)
4860+ MESSAGE (FATAL_ERROR "'FILE' argument is required for ZORBA_DECLARE_URI_FILE()")
4861+ ENDIF (NOT URI_FILE_FILE)
4862+ IF (NOT URI_FILE_URI)
4863+ MESSAGE (FATAL_ERROR "'URI' argument is required for ZORBA_DECLARE_URI_FILE()")
4864+ ENDIF (NOT URI_FILE_URI)
4865+ IF (NOT IS_ABSOLUTE "${URI_FILE_FILE}")
4866+ SET (SOURCE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/${URI_FILE_FILE}")
4867+ ELSE (NOT IS_ABSOLUTE "${URI_FILE_FILE}")
4868+ SET (SOURCE_FILE "${URI_FILE_FILE}")
4869+ ENDIF (NOT IS_ABSOLUTE "${URI_FILE_FILE}")
4870+ GET_FILENAME_COMPONENT (uri_file_name "${URI_FILE_FILE}" NAME)
4871+ # Don't enforce any extension on general files
4872+ MANGLE_URI (${URI_FILE_URI} "" uri_file_path uri_file_filename)
4873+
4874+ ADD_COPY_RULE ("URI" "${SOURCE_FILE}" "${uri_file_path}/${uri_file_filename}"
4875+ "" "" 1 "${URI_FILE_TEST_ONLY}")
4876+
4877+ENDMACRO (DECLARE_ZORBA_URI_FILE)
4878+
4879+# Inform Zorba of a .jar file that should be made available on the CLASSPATH
4880+# of the JVM, should the JVM be started. QQQ more doc needed
4881+#
4882+# Args: FILE - path to file (must be absolute)
4883+# EXTERNAL - (optional) FILE specifies a path that should be added
4884+# to CLASSPATH as-is
4885+# TEST_ONLY - (optional) Jar file is for testcases only and should not
4886+# be installed
4887+
4888+MACRO (DECLARE_ZORBA_JAR)
4889+ PARSE_ARGUMENTS (JAR "FILE" "" "TEST_ONLY;EXTERNAL" ${ARGN})
4890+ IF (NOT JAR_FILE)
4891+ MESSAGE (FATAL_ERROR "'FILE' argument is required for DECLARE_ZORBA_JAR")
4892+ ENDIF (NOT JAR_FILE)
4893+
4894+ # Initialize classpath file and set up copy rule (once per project)
4895+ SET (_CP_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-classpath.txt")
4896+ GET_PROPERTY (_known_project GLOBAL PROPERTY "${PROJECT_NAME}-jars")
4897+ IF (NOT _known_project)
4898+ FILE (REMOVE "${_CP_FILE}")
4899+ SET_PROPERTY (GLOBAL PROPERTY "${PROJECT_NAME}-jars" 1)
4900+ ADD_COPY_RULE ("LIB" "${_CP_FILE}" "jars/${PROJECT_NAME}-classpath.txt"
4901+ "" "" 1 "${JAR_TEST_ONLY}")
4902+ ENDIF (NOT _known_project)
4903+
4904+ # Iterate over all supplied jar files
4905+ FOREACH (_jar_file ${JAR_FILE})
4906+
4907+ IF (JAR_EXTERNAL)
4908+ # Put absolute path into classpath file
4909+ FILE (APPEND "${_CP_FILE}" "${_jar_file}\n")
4910+ ELSE (JAR_EXTERNAL)
4911+ # Copy jar to jars/ directory and add relative path to classpath file
4912+ GET_FILENAME_COMPONENT (_output_filename "${_jar_file}" NAME)
4913+ ADD_COPY_RULE ("LIB" "${_jar_file}" "jars/${_output_filename}" "" ""
4914+ 1 "${JAR_TEST_ONLY}")
4915+ FILE (APPEND "${_CP_FILE}" "${_output_filename}\n")
4916+ ENDIF (JAR_EXTERNAL)
4917+
4918+ ENDFOREACH (_jar_file)
4919+ENDMACRO (DECLARE_ZORBA_JAR)
4920+
4921+# Inform Zorba of a .jar file that should be made available on the CLASSPATH
4922+# of the JVM, should the JVM be started. QQQ more doc needed
4923+#
4924+# Args: FILE - path to file (must be absolute)
4925+# EXTERNAL - (optional) FILE specifies a path that should be added
4926+# to CLASSPATH as-is
4927+# TEST_ONLY - (optional) Jar file is for testcases only and should not
4928+# be installed
4929+
4930+#MACRO (DECLARE_ZORBA_JAR)
4931+# PARSE_ARGUMENTS (JAR "" "FILE" "TEST_ONLY;EXTERNAL" ${ARGN})
4932+# IF (NOT JAR_FILE)
4933+# MESSAGE (FATAL_ERROR "'JAR' argument is required for DECLARE_ZORBA_JAR")
4934+# ENDIF (NOT JAR_FILE)
4935+# IF (NOT IS_ABSOLUTE "${JAR_FILE}")
4936+# SET (JAR_FILE "${CMAKE_CURRENT_BINARY_DIR}/${JAR_FILE}")
4937+# ENDIF (NOT IS_ABSOLUTE "${JAR_FILE}")
4938+#
4939+# SET (_LIST_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-classpath.txt")
4940+# IF (JAR_EXTERNAL)
4941+# # Remember whether we've seen external jars for this project yet
4942+# GET_PROPERTY (_known_project GLOBAL PROPERTY "${PROJECT_NAME}-ext-jars")
4943+# IF (NOT _known_project)
4944+# FILE (REMOVE "${_LIST_FILE}")
4945+# SET_PROPERTY (GLOBAL PROPERTY "${PROJECT_NAME}-ext-jars" 1)
4946+# ADD_COPY_RULE ("LIB" "${_LIST_FILE}" "jars/${PROJECT_NAME}-classpath.txt"
4947+# "" "" 1 0)
4948+# ENDIF (NOT _known_project)
4949+# FILE (APPEND "${_LIST_FILE}" "${JAR_FILE}\n")
4950+# ELSE (JAR_EXTERNAL)
4951+# GET_FILENAME_COMPONENT (_output_filename "${JAR_FILE}" NAME)
4952+# ADD_COPY_RULE ("LIB" "${JAR_FILE}" "jars/${_output_filename}" "" ""
4953+# 1 "${JAR_TEST_ONLY}")
4954+# ENDIF (JAR_EXTERNAL)
4955+#ENDMACRO (DECLARE_ZORBA_JAR)
4956+
4957+
4958+
4959 # Utility macro for setting up a build rule to copy a file to a
4960-# particular (possible versioned) file in URI_PATH if such a file has
4961-# not already been output.
4962+# particular (possibly versioned) file in a shared directory if such a
4963+# file has not already been output.
4964+#
4965+# FILE_TYPE: Either "URI" or "LIB"; will be used to determine which shared
4966+# directory to place output in (URI_PATH or LIB_PATH).
4967 # INPUT_FILE: Absolute path to file to copy.
4968 # OUTPUT_FILE: Relative path to output file (relative to URI_PATH).
4969 # VERSION_ARG: Version; may be "" for non-versioned files.
4970 # DEPEND_TARGET: A CMake target name upon which the copy rule should depend;
4971 # may be "".
4972+# INSTALL: If 1, an INSTALL() directive will be executed to put the
4973+# file into the install image.
4974 # TEST_ONLY: If 1, file is for testcases only; will be copied into
4975-# TEST_URI_PATH and will not be installed
4976-MACRO (ADD_COPY_RULE INPUT_FILE OUTPUT_FILE VERSION_ARG DEPEND_TARGET TEST_ONLY)
4977+# TEST_URI_PATH/TEST_LIB_PATH and will not be installed.
4978+MACRO (ADD_COPY_RULE FILE_TYPE INPUT_FILE OUTPUT_FILE VERSION_ARG
4979+ DEPEND_TARGET INSTALL TEST_ONLY)
4980 # Choose output base directory
4981 IF (${TEST_ONLY} EQUAL 1)
4982- SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_URI_PATH")
4983+ SET (_output_basedir "${CMAKE_BINARY_DIR}/TEST_${FILE_TYPE}_PATH")
4984 ELSE (${TEST_ONLY} EQUAL 1)
4985- SET (_output_basedir "${CMAKE_BINARY_DIR}/URI_PATH")
4986+ SET (_output_basedir "${CMAKE_BINARY_DIR}/${FILE_TYPE}_PATH")
4987 ENDIF (${TEST_ONLY} EQUAL 1)
4988
4989 # Compute the modified output filename by inserting VERSION_ARG (if
4990@@ -404,46 +538,50 @@
4991 IF (file_found EQUAL -1)
4992 SET_PROPERTY (GLOBAL APPEND PROPERTY "${_dir_sym}-output-files"
4993 "${_output_file}")
4994- # Save the input file, output file, and any library dependency
4995- # target for this rule in a global property
4996+ # Detect whether this is a core URI or not
4997+ IF (PROJECT_NAME STREQUAL "zorba")
4998+ SET (_is_core 1)
4999+ ELSE (PROJECT_NAME STREQUAL "zorba")
5000+ SET (_is_core 0)
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to all changes: