Merge lp:~zorba-coders/zorba/jsoniq into lp:~zorba-coders/zorba/zorba-experimental

Proposed by Matthias Brantner
Status: Superseded
Proposed branch: lp:~zorba-coders/zorba/jsoniq
Merge into: lp:~zorba-coders/zorba/zorba-experimental
Diff against target: 139156 lines (+71782/-27545)
1007 files modified
CMakeConfiguration.txt (+3/-4)
CMakeLists.txt (+29/-7)
CPackSourceConfig.cmake.in (+1/-1)
ChangeLog (+86/-12)
NOTICE.txt (+0/-740)
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 (+60/-45)
bin/path_util.h (+9/-24)
bin/zorbacmd.cpp (+87/-50)
bin/zorbacmdproperties.cpp (+14/-5)
bin/zorbacmdproperties.h (+7/-1)
bin/zorbacmdproperties.txt (+3/-1)
bin/zorbacmdproperties_base.h (+19/-3)
cmake_modules/FindLibedit.cmake (+46/-0)
cmake_modules/FindPHP5.cmake (+5/-0)
cmake_modules/ZorbaModule.cmake (+57/-29)
config/CMakeLists.txt (+5/-5)
config/ZorbaConfig.cmake.in (+7/-4)
doc/cxx/examples/errors.cpp (+4/-4)
doc/cxx/examples/simple.cpp (+17/-10)
doc/php/CMakeLists.txt (+1/-1)
doc/php/examples/CMakeLists.txt (+14/-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/commandline.dox (+7/-1)
doc/zorba/external_functions.dox (+2/-2)
doc/zorba/ft_thesaurus.dox (+34/-33)
doc/zorba/impl_dep_features.dox (+2/-2)
doc/zorba/modules_authoring.dox (+2/-3)
doc/zorba/modules_authoring_2.dox (+4/-3)
doc/zorba/modules_building_in.dox (+1/-1)
doc/zorba/options.dox (+233/-54)
doc/zorba/uriresolvers.dox (+120/-38)
doc/zorba/xqddf.dox (+206/-153)
doc/zorba/xqdoc/templates/main.html (+36/-24)
include/zorba/config.h.cmake (+13/-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/-4)
include/zorba/internal/type_traits.h (+3/-1)
include/zorba/internal/unique_ptr.h (+2/-2)
include/zorba/item.h (+29/-3)
include/zorba/item_factory.h (+60/-1)
include/zorba/options.h (+23/-5)
include/zorba/pregenerated/diagnostic_list.h (+52/-4)
include/zorba/static_collection_manager.h (+66/-3)
include/zorba/static_context.h (+619/-529)
include/zorba/store_consts.h (+46/-8)
include/zorba/thesaurus.h (+24/-28)
include/zorba/typeident.h (+44/-34)
include/zorba/uri_resolvers.h (+18/-3)
include/zorba/xquery.h (+19/-1)
include/zorba/zorba.h (+1/-0)
modules/ExternalModules.conf (+14/-13)
modules/com/zorba-xquery/www/modules/CMakeLists.txt (+14/-1)
modules/com/zorba-xquery/www/modules/converters/json-options.xsd (+47/-0)
modules/com/zorba-xquery/www/modules/converters/json.xq (+231/-0)
modules/com/zorba-xquery/www/modules/debugger/dbgp-message-handler.xq (+277/-0)
modules/com/zorba-xquery/www/modules/http-client.xq.src/http_response_handler.cpp (+4/-4)
modules/com/zorba-xquery/www/modules/node-position.xq (+524/-0)
modules/com/zorba-xquery/www/modules/pregenerated/errors.xq (+98/-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/xqdoc2xhtml/index.xq (+20/-13)
modules/org/CMakeLists.txt (+2/-0)
modules/org/jsoniq/CMakeLists.txt (+15/-0)
modules/org/jsoniq/www/CMakeLists.txt (+19/-0)
modules/org/jsoniq/www/functions.xq (+172/-0)
src/annotations/annotations.cpp (+324/-292)
src/annotations/annotations.h (+101/-60)
src/api/annotationimpl.cpp (+1/-1)
src/api/collectionimpl.cpp (+4/-9)
src/api/dynamiccontextimpl.cpp (+35/-1)
src/api/dynamiccontextimpl.h (+7/-0)
src/api/functionimpl.cpp (+1/-1)
src/api/item.cpp (+26/-0)
src/api/itemfactoryimpl.cpp (+61/-4)
src/api/itemfactoryimpl.h (+25/-3)
src/api/options.cpp (+30/-12)
src/api/serialization/serializer.cpp (+276/-56)
src/api/serialization/serializer.h (+33/-5)
src/api/serializerimpl.cpp (+5/-0)
src/api/staticcollectionmanagerimpl.cpp (+287/-0)
src/api/staticcollectionmanagerimpl.h (+37/-0)
src/api/staticcontextimpl.cpp (+207/-80)
src/api/staticcontextimpl.h (+26/-23)
src/api/thesaurus.cpp (+0/-4)
src/api/typeidentimpl.cpp (+61/-7)
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 (+118/-4)
src/api/xqueryimpl.h (+6/-0)
src/api/zorbaimpl.cpp (+1/-1)
src/compiler/api/compiler_api.cpp (+19/-13)
src/compiler/api/compiler_api.h (+3/-2)
src/compiler/api/compilercb.cpp (+4/-0)
src/compiler/api/compilercb.h (+12/-2)
src/compiler/codegen/plan_visitor.cpp (+222/-85)
src/compiler/expression/CMakeLists.txt (+1/-0)
src/compiler/expression/abstract_expr_visitor.h (+10/-2)
src/compiler/expression/expr.cpp (+53/-58)
src/compiler/expression/expr.h (+103/-55)
src/compiler/expression/expr_annotations.cpp (+0/-129)
src/compiler/expression/expr_annotations.h (+0/-54)
src/compiler/expression/expr_base.cpp (+124/-26)
src/compiler/expression/expr_base.h (+72/-26)
src/compiler/expression/expr_classes.h (+7/-0)
src/compiler/expression/expr_iter.cpp (+51/-2)
src/compiler/expression/expr_put.cpp (+98/-40)
src/compiler/expression/expr_type.cpp (+81/-80)
src/compiler/expression/expr_visitor.h (+7/-0)
src/compiler/expression/flwor_expr.cpp (+42/-17)
src/compiler/expression/flwor_expr.h (+41/-18)
src/compiler/expression/fo_expr.cpp (+4/-17)
src/compiler/expression/fo_expr.h (+5/-5)
src/compiler/expression/ft_expr.h (+2/-1)
src/compiler/expression/json_exprs.cpp (+189/-0)
src/compiler/expression/json_exprs.h (+148/-0)
src/compiler/expression/path_expr.h (+5/-5)
src/compiler/expression/script_exprs.cpp (+163/-17)
src/compiler/expression/script_exprs.h (+101/-26)
src/compiler/expression/update_exprs.cpp (+60/-73)
src/compiler/expression/update_exprs.h (+51/-50)
src/compiler/expression/var_expr.cpp (+55/-1)
src/compiler/expression/var_expr.h (+110/-32)
src/compiler/parser/xquery_parser.cpp (+7930/-7283)
src/compiler/parser/xquery_parser.hpp (+28/-24)
src/compiler/parser/xquery_parser.y (+246/-50)
src/compiler/parser/xquery_scanner.cpp (+3211/-3127)
src/compiler/parser/xquery_scanner.l (+34/-12)
src/compiler/parsetree/parsenode_print_dot_visitor.h (+6/-0)
src/compiler/parsetree/parsenode_print_xml_visitor.cpp (+83/-27)
src/compiler/parsetree/parsenode_print_xqdoc_visitor.cpp (+9/-3)
src/compiler/parsetree/parsenode_print_xquery_visitor.cpp (+13/-6)
src/compiler/parsetree/parsenode_visitor.h (+7/-0)
src/compiler/parsetree/parsenodes.cpp (+107/-0)
src/compiler/parsetree/parsenodes.h (+103/-1)
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 (+4/-9)
src/compiler/rewriter/rules/fold_rules.cpp (+4/-9)
src/compiler/rewriter/rules/hoist_rules.cpp (+2/-4)
src/compiler/rewriter/rules/index_join_rule.cpp (+3/-3)
src/compiler/rewriter/rules/nodeid_rules.cpp (+870/-38)
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/-5)
src/compiler/rewriter/rules/type_rules.cpp (+53/-42)
src/compiler/rewriter/tools/dataflow_annotations.cpp (+557/-8)
src/compiler/rewriter/tools/dataflow_annotations.h (+37/-1)
src/compiler/rewriter/tools/expr_tools.cpp (+536/-6)
src/compiler/rewriter/tools/udf_graph.cpp (+6/-4)
src/compiler/translator/translator.cpp (+650/-294)
src/compiler/xqddf/value_index.cpp (+35/-22)
src/compiler/xqddf/value_index.h (+53/-27)
src/context/default_uri_mappers.cpp (+2/-2)
src/context/default_uri_mappers.h (+6/-6)
src/context/default_url_resolvers.cpp (+5/-5)
src/context/default_url_resolvers.h (+19/-5)
src/context/dynamic_context.cpp (+45/-22)
src/context/dynamic_context.h (+30/-19)
src/context/dynamic_loader.cpp (+8/-17)
src/context/dynamic_loader.h (+2/-3)
src/context/namespace_context.cpp (+4/-2)
src/context/namespace_context.h (+5/-1)
src/context/root_static_context.cpp (+86/-45)
src/context/root_static_context.h (+5/-3)
src/context/root_static_context_init.cpp.in (+9/-2)
src/context/static_context.cpp (+448/-393)
src/context/static_context.h (+106/-123)
src/context/static_context_consts.h (+1/-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 (+210/-42)
src/diagnostics/dict_XX_cpp.xq (+1/-0)
src/diagnostics/pregenerated/diagnostic_list.cpp (+78/-6)
src/diagnostics/pregenerated/dict_en.cpp (+46/-7)
src/diagnostics/qname.cpp (+6/-0)
src/functions/CMakeLists.txt (+7/-0)
src/functions/external_function.cpp (+85/-5)
src/functions/external_function.h (+5/-1)
src/functions/func_accessors_impl.cpp (+81/-61)
src/functions/func_accessors_impl.h (+5/-0)
src/functions/func_apply.cpp (+1/-1)
src/functions/func_arithmetic.cpp (+24/-21)
src/functions/func_booleans_impl.cpp (+60/-39)
src/functions/func_collections_impl.cpp (+44/-2)
src/functions/func_durations_dates_times_impl.cpp (+2/-2)
src/functions/func_enclosed.cpp (+63/-20)
src/functions/func_errors_and_diagnostics_impl.cpp (+11/-2)
src/functions/func_eval.cpp (+4/-4)
src/functions/func_hoist.cpp (+40/-34)
src/functions/func_index_ddl.cpp (+1/-1)
src/functions/func_index_ddl.h (+11/-11)
src/functions/func_jsoniq_functions_impl.cpp (+76/-0)
src/functions/func_node_sort_distinct.cpp (+48/-13)
src/functions/func_node_sort_distinct.h (+8/-6)
src/functions/func_numerics_impl.cpp (+152/-152)
src/functions/func_reflection.cpp (+7/-4)
src/functions/func_sequences_impl.cpp (+279/-210)
src/functions/func_sequences_impl.h (+97/-56)
src/functions/func_serialize_impl.cpp (+38/-0)
src/functions/func_strings_impl.cpp (+21/-2)
src/functions/func_var_decl.cpp (+6/-64)
src/functions/function.cpp (+60/-23)
src/functions/function.h (+15/-13)
src/functions/function_consts.h (+5/-6)
src/functions/library.cpp (+12/-0)
src/functions/pregenerated/func_accessors.cpp (+0/-20)
src/functions/pregenerated/func_accessors.h (+70/-58)
src/functions/pregenerated/func_any_uri.h (+4/-2)
src/functions/pregenerated/func_base64.h (+8/-4)
src/functions/pregenerated/func_booleans.h (+21/-9)
src/functions/pregenerated/func_collections.h (+171/-65)
src/functions/pregenerated/func_context.h (+32/-16)
src/functions/pregenerated/func_documents.h (+22/-10)
src/functions/pregenerated/func_durations_dates_times.h (+84/-42)
src/functions/pregenerated/func_errors_and_diagnostics.h (+21/-11)
src/functions/pregenerated/func_fetch.h (+8/-4)
src/functions/pregenerated/func_fnput.h (+6/-2)
src/functions/pregenerated/func_function_item_iter.h (+12/-6)
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_jsoniq_functions.cpp (+580/-0)
src/functions/pregenerated/func_jsoniq_functions.h (+475/-0)
src/functions/pregenerated/func_maps.h (+32/-16)
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.h (+128/-54)
src/functions/pregenerated/func_numerics.h (+35/-21)
src/functions/pregenerated/func_other_diagnostics.h (+8/-4)
src/functions/pregenerated/func_parse_fragment.h (+4/-2)
src/functions/pregenerated/func_parsing_and_serializing.h (+10/-4)
src/functions/pregenerated/func_qnames.h (+41/-19)
src/functions/pregenerated/func_random.h (+12/-6)
src/functions/pregenerated/func_schema.h (+27/-11)
src/functions/pregenerated/func_sctx.h (+100/-50)
src/functions/pregenerated/func_sequences.h (+255/-185)
src/functions/pregenerated/func_strings.cpp (+60/-0)
src/functions/pregenerated/func_strings.h (+154/-63)
src/functions/pregenerated/func_xqdoc.h (+8/-4)
src/functions/pregenerated/function_enum.h (+51/-1)
src/functions/signature.cpp (+92/-62)
src/functions/signature.h (+9/-1)
src/functions/udf.cpp (+218/-11)
src/functions/udf.h (+47/-4)
src/precompiled/stdafx.h (+1/-1)
src/runtime/CMakeLists.txt (+2/-0)
src/runtime/base/plan_iterator.h (+4/-0)
src/runtime/booleans/BooleanImpl.cpp (+176/-197)
src/runtime/booleans/BooleanImpl.h (+1/-1)
src/runtime/collections/collections_impl.cpp (+21/-21)
src/runtime/core/arithmetic_impl.cpp (+45/-45)
src/runtime/core/arithmetic_impl.h (+18/-15)
src/runtime/core/constructors.cpp (+90/-88)
src/runtime/core/constructors.h (+27/-44)
src/runtime/core/flwor_iterator.cpp (+27/-30)
src/runtime/core/flwor_iterator.h (+1/-0)
src/runtime/core/fncall_iterator.cpp (+171/-25)
src/runtime/core/fncall_iterator.h (+39/-6)
src/runtime/core/gflwor/common.cpp (+45/-27)
src/runtime/core/gflwor/common.h (+4/-2)
src/runtime/core/gflwor/groupby_iterator.cpp (+9/-14)
src/runtime/core/gflwor/window_iterator.cpp (+3/-5)
src/runtime/core/path_iterators.cpp (+39/-33)
src/runtime/core/path_iterators.h (+3/-3)
src/runtime/core/sequencetypes.cpp (+41/-58)
src/runtime/core/trycatch.cpp (+1/-1)
src/runtime/core/var_iterators.cpp (+67/-90)
src/runtime/core/var_iterators.h (+13/-13)
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 (+19/-12)
src/runtime/full_text/ft_stop_words_set.cpp (+4/-4)
src/runtime/full_text/icu_tokenizer.cpp (+44/-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/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/jansson_wrapper.cpp (+729/-0)
src/runtime/json/jansson_wrapper.h (+56/-0)
src/runtime/json/json_constructors.cpp (+270/-0)
src/runtime/json/json_constructors.h (+135/-0)
src/runtime/json/json_impl.cpp (+527/-0)
src/runtime/json/jsoniq_functions_impl.cpp (+688/-0)
src/runtime/json/pregenerated/json.cpp (+94/-0)
src/runtime/json/pregenerated/json.h (+114/-0)
src/runtime/json/pregenerated/jsoniq_functions.cpp (+613/-0)
src/runtime/json/pregenerated/jsoniq_functions.h (+827/-0)
src/runtime/misc/materialize.cpp (+1/-1)
src/runtime/nodes/node_position_impl.cpp (+756/-0)
src/runtime/nodes/pregenerated/node_position.cpp (+710/-0)
src/runtime/nodes/pregenerated/node_position.h (+858/-0)
src/runtime/numerics/NumericsImpl.cpp (+76/-76)
src/runtime/numerics/NumericsImpl.h (+2/-2)
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/scripting/scripting.cpp (+7/-8)
src/runtime/sequences/sequences_impl.cpp (+12/-12)
src/runtime/spec/accessors/accessors.xml (+48/-14)
src/runtime/spec/booleans/booleans.xml (+28/-15)
src/runtime/spec/codegen-cpp.xq (+8/-5)
src/runtime/spec/codegen-h.xq (+49/-12)
src/runtime/spec/collections/collections.xml (+22/-0)
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/json/jsoniq_functions.xml (+570/-0)
src/runtime/spec/mappings.xml (+18/-1)
src/runtime/spec/nodes/node_position.xml (+439/-0)
src/runtime/spec/nodes/nodes.xml (+320/-236)
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 (+17/-0)
src/runtime/spec/store/documents.xml (+1/-0)
src/runtime/spec/strings/strings.xml (+61/-7)
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 (+428/-101)
src/runtime/update/update.cpp (+2/-1)
src/runtime/visitors/planiter_visitor_impl_code.h (+58/-51)
src/runtime/visitors/planiter_visitor_impl_include.h (+12/-6)
src/runtime/visitors/pregenerated/planiter_visitor.h (+265/-1)
src/runtime/visitors/pregenerated/printer_visitor.cpp (+687/-0)
src/runtime/visitors/pregenerated/printer_visitor.h (+168/-0)
src/runtime/visitors/printer_visitor_impl.cpp (+241/-171)
src/runtime/visitors/printer_visitor_impl.h (+61/-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 (+203/-38)
src/store/api/item_factory.h (+25/-145)
src/store/api/pul.h (+50/-0)
src/store/api/shared_types.h (+3/-0)
src/store/api/store.h (+42/-13)
src/store/api/temp_seq.h (+47/-47)
src/store/api/update_consts.h (+9/-1)
src/store/api/xs_type_codes.h (+96/-0)
src/store/naive/CMakeLists.txt (+8/-0)
src/store/naive/atomic_items.cpp (+857/-100)
src/store/naive/atomic_items.h (+247/-67)
src/store/naive/item.cpp (+302/-27)
src/store/naive/json_items.cpp (+384/-0)
src/store/naive/json_items.h (+391/-0)
src/store/naive/json_loader.cpp (+312/-0)
src/store/naive/json_loader.h (+72/-0)
src/store/naive/loader_dtd.cpp (+92/-56)
src/store/naive/loader_fast.cpp (+31/-36)
src/store/naive/node_factory.cpp (+2/-2)
src/store/naive/node_factory.h (+2/-2)
src/store/naive/node_items.cpp (+635/-266)
src/store/naive/node_items.h (+175/-73)
src/store/naive/node_iterators.cpp (+35/-9)
src/store/naive/node_iterators.h (+63/-9)
src/store/naive/node_updates.cpp (+10/-10)
src/store/naive/nsbindings.cpp (+3/-3)
src/store/naive/nsbindings.h (+3/-2)
src/store/naive/ordpath.cpp (+94/-0)
src/store/naive/ordpath.h (+11/-4)
src/store/naive/pul_primitive_factory.cpp (+14/-0)
src/store/naive/pul_primitive_factory.h (+14/-0)
src/store/naive/pul_primitives.cpp (+65/-26)
src/store/naive/pul_primitives.h (+37/-1)
src/store/naive/qname_pool.cpp (+2/-2)
src/store/naive/qname_pool.h (+1/-1)
src/store/naive/shared_types.h (+25/-0)
src/store/naive/simple_collection.cpp (+4/-2)
src/store/naive/simple_collection.h (+2/-3)
src/store/naive/simple_index.cpp (+312/-302)
src/store/naive/simple_index.h (+163/-204)
src/store/naive/simple_index_general.cpp (+1560/-2172)
src/store/naive/simple_index_general.h (+313/-174)
src/store/naive/simple_index_value.cpp (+187/-51)
src/store/naive/simple_index_value.h (+84/-39)
src/store/naive/simple_item_factory.cpp (+174/-4)
src/store/naive/simple_item_factory.h (+45/-0)
src/store/naive/simple_lazy_temp_seq.cpp (+158/-96)
src/store/naive/simple_lazy_temp_seq.h (+29/-144)
src/store/naive/simple_pul.cpp (+127/-8)
src/store/naive/simple_pul.h (+55/-0)
src/store/naive/simple_store.cpp (+262/-181)
src/store/naive/simple_store.h (+93/-48)
src/store/naive/simple_temp_seq.cpp (+166/-219)
src/store/naive/simple_temp_seq.h (+42/-43)
src/store/naive/store_defs.h (+0/-78)
src/store/naive/store_properties.h (+36/-17)
src/system/globalenv.cpp (+73/-25)
src/system/globalenv.h (+41/-22)
src/system/zorba_properties.h (+50/-12)
src/system/zorba_properties.txt (+4/-2)
src/types/casting.cpp (+544/-282)
src/types/casting.h (+39/-17)
src/types/root_typemanager.cpp (+263/-169)
src/types/root_typemanager.h (+78/-39)
src/types/schema/EventSchemaValidator.cpp (+3/-1)
src/types/schema/revalidateUtils.cpp (+6/-5)
src/types/schema/schema.cpp (+7/-7)
src/types/schema/schema.h (+2/-2)
src/types/schema/validate.cpp (+5/-2)
src/types/typeconstants.h (+1/-51)
src/types/typeimpl.cpp (+415/-60)
src/types/typeimpl.h (+258/-180)
src/types/typemanager.h (+30/-19)
src/types/typemanagerimpl.cpp (+138/-101)
src/types/typemanagerimpl.h (+32/-24)
src/types/typeops.cpp (+691/-512)
src/types/typeops.h (+21/-44)
src/unit_tests/CMakeLists.txt (+1/-6)
src/unit_tests/json_parser.cpp (+636/-0)
src/unit_tests/json_parser.cpp.moved (+623/-0)
src/unit_tests/test_debugger_protocol.cpp (+0/-414)
src/unit_tests/unit_test_list.h (+1/-0)
src/unit_tests/unit_tests.cpp (+1/-0)
src/util/CMakeLists.txt (+1/-0)
src/util/http_util.cpp (+2/-2)
src/util/json_parser.cpp (+634/-0)
src/util/json_parser.h (+553/-0)
src/util/stl_util.h (+2/-0)
src/util/string_util.h (+6/-0)
src/util/unicode_util.h (+4/-0)
src/util/utf8_util.cpp (+17/-0)
src/util/utf8_util_base.h (+27/-0)
src/zorbamisc/ns_consts.h (+6/-5)
src/zorbaserialization/zorba_class_serializer.cpp (+1/-0)
src/zorbatypes/URI.cpp (+0/-3)
src/zorbautils/hashmap_itemh.h (+112/-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 (+14/-0)
swig/Zorba.i (+28/-1)
swig/java/CMakeLists.txt (+2/-0)
swig/php/CMakeLists.txt (+23/-6)
swig/php/XQueryProcessor.php (+397/-0)
swig/php/generate_proxy.php.in (+7/-4)
swig/php/test.xq (+1/-0)
swig/php/zorba_api.i (+7/-1)
swig/python/CMakeLists.txt (+2/-0)
swig/ruby/CMakeLists.txt (+10/-0)
swig/zorba_api.i (+4/-1)
test/apitest.cpp (+21/-6)
test/rbkt/ExpCompilerResults/IterPlan/iterscript.cmake (+14/-10)
test/rbkt/ExpCompilerResults/IterPlan/zorba/error/trace1.iter (+8/-0)
test/rbkt/ExpCompilerResults/IterPlan/zorba/hashjoins/idx4.iter (+24/-22)
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 (+170/-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/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/eval9.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/eval/invoke1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/fulltext/ft-same-sentence-false-2.xml.res (+1/-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-parse-array-01.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-02.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-03.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-04.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-array-05.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-object-01.xml.res (+3/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-object-02.xml.res (+4/-0)
test/rbkt/ExpQueryResults/zorba/json/json-parse-snelson.xml.res (+14/-0)
test/rbkt/ExpQueryResults/zorba/json/json-serialize-array-01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_01.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_02.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_14.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_15.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_16.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_17.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_18.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_21.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_210.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_211.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_212.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_213.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_22.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_23.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_24.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_25.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_26.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_27.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_28.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_29.xml.res (+2/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_4.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_3_7.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_4_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_4_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_4_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_5_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_5_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_6_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_6_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_1.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_2.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_3.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_5.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/arr_constr_7_6.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/flatten_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/fn_boolean_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/insert01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/insert03.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/member_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/names_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/names_02.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/null.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/obj_constr_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/pair_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/value_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/jsoniq/values_01.xml.res (+1/-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/schemas/validate_xqdoc_01.xml.res (+1/-0)
test/rbkt/ExpQueryResults/zorba/schemas/validate_xqdoc_02.xml.res (+1/-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/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/Queries/CMakeLists.txt (+37/-17)
test/rbkt/Queries/w3c_known_failures.txt (+2/-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/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/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/fulltext/ft-same-sentence-false-2.xq (+2/-0)
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-parse-array-01.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-02.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-03.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-04.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-array-05.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-object-01.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-object-02.xq (+5/-0)
test/rbkt/Queries/zorba/json/json-parse-snelson.xq (+20/-0)
test/rbkt/Queries/zorba/json/json-serialize-array-01.xq (+8/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_01.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_02.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_03.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_14.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_15.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_16.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_17.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_18.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_21.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_210.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_211.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_212.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_213.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_22.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_23.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_24.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_25.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_26.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_27.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_28.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_29.xq (+9/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_1.xq (+11/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_2.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_3.xq (+10/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_4.xq (+14/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_5.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_6.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_3_7.xq (+6/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_4_1.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_4_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_4_3.xq (+1/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_5_1.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_5_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_6_1.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_6_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_6_3.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_1.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_2.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_3.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_4.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_5.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/arr_constr_7_6.xq (+2/-0)
test/rbkt/Queries/zorba/jsoniq/flatten_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/fn_boolean_01.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/insert01.xq (+7/-0)
test/rbkt/Queries/zorba/jsoniq/insert02.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/insert02.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/insert03.xq (+8/-0)
test/rbkt/Queries/zorba/jsoniq/member_01.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/names_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/names_02.xq (+4/-0)
test/rbkt/Queries/zorba/jsoniq/null01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/obj_constr_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/pair_01.xq (+5/-0)
test/rbkt/Queries/zorba/jsoniq/parser_01.spec (+1/-0)
test/rbkt/Queries/zorba/jsoniq/parser_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/value_01.xq (+3/-0)
test/rbkt/Queries/zorba/jsoniq/values_01.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/schemas/validate_xqdoc_01.xq (+4/-0)
test/rbkt/Queries/zorba/schemas/validate_xqdoc_02.xq (+4/-0)
test/rbkt/Queries/zorba/store/documents.xq (+1/-0)
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/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/Scripts/w3c/Readme.txt (+15/-6)
test/rbkt/Scripts/w3c/Submit_xqts.cmake (+19/-8)
test/rbkt/Scripts/w3c/generate-submission-xqftts.xq (+4/-4)
test/rbkt/Scripts/w3c/generate-submission-xqts.xq (+1/-6)
test/rbkt/itertest.xq.in (+58/-44)
test/rbkt/specification.h (+1/-1)
test/rbkt/testdriver_common.cpp (+14/-3)
test/rbkt/testdriver_mt.cpp (+31/-4)
test/unit/CMakeLists.txt (+24/-0)
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_main3.xq (+21/-0)
test/unit/ext_mod2.xq (+19/-0)
test/unit/external_function.cpp (+59/-1)
test/unit/guestbook.xq (+9/-0)
test/unit/guestbook_main.xq (+1/-1)
test/unit/main_invoke.xq (+9/-0)
test/unit/module2.xq (+6/-0)
test/unit/module4.xq (+6/-0)
test/unit/static_context.cpp (+75/-0)
test/unit/staticcollectionmanager.cpp (+65/-2)
test/unit/testGetExtVarA.xq (+13/-0)
test/unit/testGetExtVarB.xq (+6/-0)
test/unit/thesaurus.cpp (+9/-13)
test/update/CMakeLists.txt (+1/-1)
test/update/Queries/zorba/store/sc3.spec (+0/-2)
test/update/Scripts/Readme.txt (+1/-1)
test/update/Scripts/generate-submission-xquts.xq (+1/-0)
test/zperf/src/start.xq (+154/-100)
To merge this branch: bzr merge lp:~zorba-coders/zorba/jsoniq
Reviewer Review Type Date Requested Status
Zorba Coders Pending
Review via email: mp+90370@code.launchpad.net

This proposal supersedes a proposal from 2012-01-25.

This proposal has been superseded by a proposal from 2012-01-28.

Commit message

just another try

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote : Posted in a previous version of this proposal

The attempt to merge lp:zorba/3.0 into lp:~zorba-coders/zorba/zorba-experimental failed. Below is the output from the failed tests.

experimental build started for lp:zorba/3.0. Check out http://3.0.zorba-xquery.com/ in half an hour or so. Logfile at http://zorbatest.lambda.nu:8080/remotequeue/experimental/3.0.log .

Revision history for this message
Matthias Brantner (matthias-brantner) wrote :

retry building the web interface with jsoniq support

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

The attempt to merge lp:zorba/3.0 into lp:~zorba-coders/zorba/zorba-experimental failed. Below is the output from the failed tests.

experimental build started for lp:zorba/3.0. Check out http://3.0.zorba-xquery.com/ in half an hour or so. Logfile at http://zorbatest.lambda.nu:8080/remotequeue/experimental/3.0.log .

lp:~zorba-coders/zorba/jsoniq updated
10591. By Markos Zaharioudakis

fixed bug #922432

10592. By Matthias Brantner

skeletons for updating functions

10593. By Matthias Brantner

implemented the j:null() function to create null items

10594. By Matthias Brantner

implemented copy for object pairs and removed obsolete container member

10595. By Matthias Brantner

Implemented copy for JSONObjects and JSONArrays.
Fixed misleading name in SimpleJSONArrays.

10596. By Matthias Brantner

added more complex test

10597. By Matthias Brantner

fix for object lookup

10598. By Matthias Brantner

implemented equals and hash for json null

10599. By Matthias Brantner

fixed build without json

10600. By Markos Zaharioudakis

cosmetic

10601. By Markos Zaharioudakis

merge from trunk

10602. By Till Westmann

moved JSONiq errors to the http://www.jsoniq.org/errors namespace

10603. By Chris Hillery

Check out HEAD of data-converters module rather than head, so we don't have
the old Jansson-based JSON module.

10604. By Matthias Brantner

- typed value for null and pairs
- return pairs in order of insertion
- most of the delete UP (no errors or undo, yet)

10605. By Chris Hillery

More serialization method changes:
1. Re-introduced json_emitter which only outputs JSON ("json" output method
will explicitly use this)
2. Introduce new jsoniq_emitter which detects whether first item is JDM or
XDM and uses an xml_emitter or json_emitter accordingly ("jsoniq" output
method will use this, and is the default)

10606. By Markos Zaharioudakis

work on jsoniq collections

10607. By Matthias Brantner

error checking and fixes for json:delete

10608. By Till Westmann

added support for the serialization method "JSONiq" in the testdriver

10609. By Till Westmann

introduced diagnostic categories JSONIQ_CORE and JSONIQ_UPDATE

10610. By Till Westmann

fixed expeted error for jsoniq/insert02

10611. By Markos Zaharioudakis

work on jsoniq collections

10612. By Matthias Brantner

array inserting updates

10613. By Matthias Brantner

fix generation of the jsoniq error module

10614. By Matthias Brantner

- manual maintenance of reference count for array members
- cleanup json puls

10615. By Markos Zaharioudakis

implemented ddl module for dynamic jsoniq collections + fixed bug #924595 + added syntax for structured-item() type test

10616. By Markos Zaharioudakis

work on jsoniq collections + fixed a bug in SimpleJSONArray::copy

10617. By Markos Zaharioudakis

work on jsoniq collections

10618. By Matthias Brantner

- upd:rename
- upd:replace-value
- improved upd:delete (with type promotion)
- fixed implementation of delete by using the position of an array in apply

10619. By Markos Zaharioudakis

finished DML module for dynamic jsoniq collections + fixed memory problem in root_typemanager

10620. By Paul J. Lucas

Merge from trunk.

10621. By Matthias Brantner

bugfix to report errors for duplicate keys in an object

10622. By Matthias Brantner

fixed the build without ZORBA_WITH_JSON

10623. By Matthias Brantner

fixed error messages

10624. By Matthias Brantner

empty member accessor

10625. By Chris Hillery

Support all atomic types when serializing, including those serialized as
"JSONiq value".

10626. By Matthias Brantner

- objects and pairs don't have a string value
- better error for fn:data on objects and arrays
- fixed return type for j:size()

10627. By Matthias Brantner

- fixed copy-transform to also allow json-items
- fixed flatten for json pairs
- added all queries from the use case document as tests

10628. By Matthias Brantner

better error for member accessor with wrong arg type

10629. By Chris Hillery

Add serialization of nested XML. Escape all strings appropriately.

10630. By Markos Zaharioudakis

fixed bug in implicit invocation of json item accessor functions

10631. By Chris Hillery

Added Item API methods for JSONiq.

10632. By Matthias Brantner

undo fix for type-promotion wrapping. this is fixed by normalize_fo

10633. By Matthias Brantner

raise an error if json:values is called with a pair

10634. By Matthias Brantner

hack for allowing true, false, and null in the content of a pair

10635. By Matthias Brantner

hack to treat a block whose expression returns only pairs as an object constructor

this means that the top-level sequential top-level program can never return pairs (only an object)

10636. By Matthias Brantner

fixed fn:boolean for json pairs and json:null

- fn:boolean(json:null()) => false
- fn:boolean(pair) => fn:boolean(value(pair))
- fn:booelean(pair*) => error

10637. By Matthias Brantner

merge

10638. By Matthias Brantner

fixed test case such that fn:data and explicit unboxing and flattening is not needed anymore

10639. By Matthias Brantner

changed semantics of the member selector to automatically do iteration

10640. By Matthias Brantner

implicit iteration for member selectors

10641. By Matthias Brantner

allow true, false, and null everywhere

10642. By Matthias Brantner

support for pairs with colon operator (removed direct and computed object and array constructors)

10643. By Chris Hillery

Fix serialization of control sequences.

10644. By Chris Hillery

Ignore standard "build" directory, and CMakeLists.txt.user (which is a
project file created by the QtCreator IDE).

10645. By Chris Hillery

Adding documentation for all functions.

10646. By Chris Hillery

Merge from trunk.

10647. By Chris Hillery

Added ItemFactory methods to create JSON items, along with test cases.

10648. By Markos Zaharioudakis

predeclared jn prefix

10649. By Markos Zaharioudakis

predeclared jn prefix (2nd try)

10650. By Matthias Brantner

commit the pre-generated parser files

10651. By Matthias Brantner

fixed jsoniq namespace + always process the jsoniq module because it contains udfs

10652. By Matthias Brantner

build fixes for without json

10653. By Matthias Brantner

added two tutorials as html. also temporarily removed the json module declaration
in order to make xqdoc work

10654. By Matthias Brantner

merge with trunk

10655. By Matthias Brantner

always indent by default in the swig bindings (this is a hack to get a nicer output in the web interface)

10656. By Matthias Brantner

fixed output of JSON_Test in xqdoc (e.g. array())

10657. By Chris Hillery

Allow "jsoniq" serialization method to serve for SAX output.

10658. By Chris Hillery

There are now 6 built-in namespace bindings (including jn: ).

10659. By Chris Hillery

Use Store::populateJSONArray() in ItemFactory.

10660. By Matthias Brantner

updated namespace prefix in the jsoniq module to jn

10661. By Matthias Brantner

- revert rev. 10655
- in execute, make the default indent + no xml decl

10662. By Matthias Brantner

updated jsoniq tutorials to latest drafts

10663. By Nicolae Brinza

Implementation of the new Cloudscript grammar.

10664. By Markos Zaharioudakis

removed pairs from type system and compiler

10665. By Markos Zaharioudakis

merge from trunk

10666. By Markos Zaharioudakis

forbid json items in xml constructors

10667. By Markos Zaharioudakis

translation of json constructor exprs

10668. By Markos Zaharioudakis

re-implemented json constructors

10669. By Markos Zaharioudakis

fixed EBV for jsoniq

10670. By Markos Zaharioudakis

work on jsoniq functions

10671. By Markos Zaharioudakis

fixed error codes and tests

10672. By Markos Zaharioudakis

implemented values( as object()) function

10673. By Markos Zaharioudakis

implemented accumulating object constructor

10674. By Markos Zaharioudakis

implemented the project function

10675. By Markos Zaharioudakis

implemented object insertions

10676. By Markos Zaharioudakis

more work on jsoniq updates

10677. By Markos Zaharioudakis

more work on jsoniq updates

10678. By Chris Hillery

Add Cloudscript-defined serialization parameters (boilerplate; not all
features implemented fully yet). Enable setting of serialization
parameters via .spec files.

10679. By Chris Hillery

Added CloudScript serialization error codes, and implementation checks to
throw them when appropriate. Several test cases.

10680. By Markos Zaharioudakis

done with object updates

10681. By Markos Zaharioudakis

fixed tests failing due to serialization changes

10682. By Markos Zaharioudakis

more work on array updates

10683. By Markos Zaharioudakis

done with array updates

10684. By Markos Zaharioudakis

renamed jn:names to jn:keys + removed 0-arity navigation

10685. By Markos Zaharioudakis

removed array(ItemType) type

10686. By Markos Zaharioudakis

introduced JNTY0002 error

10687. By Markos Zaharioudakis

merge from trunk + work on static and dynamic collection modules

10688. By Markos Zaharioudakis

merged with trunk

10689. By Markos Zaharioudakis

fixed no-copy rule omission

10690. By Chris Hillery

Re-enable support for "old-style" Serialization: .spec file options
(should be deprecated, but still used by some non-core modules)

10691. By Chris Hillery

Remove public API methods that are specific to Object Pairs (no longer part
of the JSONiq spec).

10692. By Ghislain Fourny

Merged jsoniq-plan_serialization branch.

10693. By Ghislain Fourny

Merged trunk back.

10694. By Ghislain Fourny

Fixed flwor expression clause getter.

10695. By Ghislain Fourny

Now compiles and links.

10696. By Ghislain Fourny

Merged trunk back (10838).

10697. By Ghislain Fourny

Fixed some tests.

10698. By Chris Hillery

Additional fixes to handle old-style --method Serialization args correctly.

10699. By Ghislain Fourny

Copied pregenerated scanner and parser files.

10700. By Ghislain Fourny

Merged changes from child branch.

10701. By Ghislain Fourny

Merged trunk back.

10702. By Ghislain Fourny

Added curly braces in JSON insert expressions.

10703. By Ghislain Fourny

Extended update syntax to general FilterExprs.

10704. By Ghislain Fourny

Solved memory leak.

10705. By Ghislain Fourny

Adding tests.

10706. By Ghislain Fourny

Collection functions now work with general items.

10707. By Ghislain Fourny

Began removing pairs in the implementation. Still build errors.

10708. By Ghislain Fourny

Now compiles, but does not link yet.

10709. By Ghislain Fourny

Now links.

10710. By Ghislain Fourny

All JSONiq tests now pass.

10711. By Ghislain Fourny

Renamed cloudscript-extensions to jsoniq-extensions

10712. By Ghislain Fourny

Renamed cloudscript to jsoniq.

10713. By Ghislain Fourny

Renamed cloudscript to jsoniq.

10714. By Ghislain Fourny

Renamed cloudscript to jsoniq.

10715. By Ghislain Fourny

Now outputs INF upon positive infinity.

10716. By Ghislain Fourny

Using the pre-imported jn: prefix in some tests.

10717. By Ghislain Fourny

JSON items are now pointing to the root of their tree.

10718. By Ghislain Fourny

Indices should now work.

10719. By Ghislain Fourny

Index creation and probe should now work.

10720. By Ghislain Fourny

Reverted rename.

10721. By Ghislain Fourny

Reverted renaming.

10722. By Ghislain Fourny

Merged trunk back.

10723. By Ghislain Fourny

Merged jsoniq-deactivated back.

10724. By Ghislain Fourny

Fixed index maintenance.

10725. By Ghislain Fourny

Fixed tests.

10726. By Ghislain Fourny

Merged trunk back.

10727. By Ghislain Fourny

Synced error codes.

10728. By Ghislain Fourny

Added guards.

10729. By Ghislain Fourny

Deactivating JSON for merge proposal and one more fix.

10730. By Ghislain Fourny

Synced error codes.

10731. By Ghislain Fourny

Solved bug 918151 by allowing mixed items if a flag is set.

10732. By Ghislain Fourny

Removed useless and obsolete code that still contained JSON Pairs.

10733. By Ghislain Fourny

Fixed comment.

10734. By Ghislain Fourny

Added files.

10735. By Markos Zaharioudakis

small cosmetic changes

10736. By Ghislain Fourny

Implemented Markos' comments 1 through 5.

10737. By Ghislain Fourny

Implemented Markos' comments 7, 8 and 9.

10738. By Ghislain Fourny

Changed signature of getArraySize() to xs_integer.

10739. By Ghislain Fourny

Corrected bug and reverted mappings.xml to JSONiq deactivated version.

10740. By Ghislain Fourny

Adding tests.

10741. By Ghislain Fourny

Updated pregenerated parser files.

10742. By Ghislain Fourny

Generating preprocessor guards for STRUCTURED_ITEM.

10743. By Ghislain Fourny

Fixed emit_end().

10744. By Ghislain Fourny

Updated updating error code and adding wrappers.

10745. By Ghislain Fourny

Now back to original order when outputting keys.

10746. By Ghislain Fourny

Optimized JSON root management system.

10747. By Ghislain Fourny

Optimized JSON item value memory management.

10748. By Ghislain Fourny

Using items instead of zstrings as keys in JSON objects.

10749. By Ghislain Fourny

Replaced dynamic casts with static casts and added dynamic cast assertions for debug mode.

10750. By Ghislain Fourny

Merged trunk back.

10751. By Markos Zaharioudakis

compilation fixes

10752. By Markos Zaharioudakis

compilation fixes

10753. By Markos Zaharioudakis

added all variants of getStringValue() for JSONNull + cosmetic

10754. By Markos Zaharioudakis

merge from trunk

10755. By Ghislain Fourny

Implemented Markos' comments, except 10.

10756. By Ghislain Fourny

Merged trunk back.

10757. By Ghislain Fourny

Fixed tests.

10758. By Ghislain Fourny

Merged trunk back.

10759. By Ghislain Fourny

Implemented more efficient data structure on objects.

10760. By Ghislain Fourny

Changed parameter of getObjectValue() to an item.

10761. By Ghislain Fourny

Removed free list.

10762. By Ghislain Fourny

changed 1st param of setJSONRoot() to Item* to save some ref counting + eliminated some compiler warnings

10763. By Ghislain Fourny

Fixed compilation error on Windows.

10764. By Ghislain Fourny

Improved efficiency of removing an object pair.

10765. By Markos Zaharioudakis

a better implementation for SimpleJSONObject::remove()

10766. By Markos Zaharioudakis

small optimizations + cosmetic

10767. By Markos Zaharioudakis

commented out ZORBA_TEST_PLAN_SERIALIZATION flag in testdriver.cpp

10768. By Markos Zaharioudakis

fixed compiler warnings

10769. By Markos Zaharioudakis

fixed print out of jsoniq errors

10770. By Markos Zaharioudakis

added missing <value> to a couple of jsoniq errors

10771. By Ghislain Fourny

Deactivated invariant assertions for the moment.

10772. By Ghislain Fourny

Merged trunk back.

10773. By Ghislain Fourny

Regenerated files.

10774. By Ghislain Fourny

A small fix (already in trunk).

Unmerged revisions

10774. By Ghislain Fourny

A small fix (already in trunk).

10773. By Ghislain Fourny

Regenerated files.

10772. By Ghislain Fourny

Merged trunk back.

10771. By Ghislain Fourny

Deactivated invariant assertions for the moment.

10770. By Markos Zaharioudakis

added missing <value> to a couple of jsoniq errors

10769. By Markos Zaharioudakis

fixed print out of jsoniq errors

10768. By Markos Zaharioudakis

fixed compiler warnings

10767. By Markos Zaharioudakis

commented out ZORBA_TEST_PLAN_SERIALIZATION flag in testdriver.cpp

10766. By Markos Zaharioudakis

small optimizations + cosmetic

10765. By Markos Zaharioudakis

a better implementation for SimpleJSONObject::remove()

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

Subscribers

People subscribed via source and target branches

to all changes: