← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/xquery3.0_funcs into lp:zorba

 

Matthias Brantner has proposed merging lp:~zorba-coders/zorba/xquery3.0_funcs into lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)
Related bugs:
  Bug #950616 in Zorba: "XQuery 3.0 vs Zorba: has-children#0 not implemented"
  https://bugs.launchpad.net/zorba/+bug/950616
  Bug #950617 in Zorba: "XQuery 3.0 vs Zorba: nilled#0 not implemented"
  https://bugs.launchpad.net/zorba/+bug/950617
  Bug #950618 in Zorba: "XQuery 3.0 vs Zorba: path not implemented"
  https://bugs.launchpad.net/zorba/+bug/950618

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/xquery3.0_funcs/+merge/104336

Added XQuery 3.0 Functions 
path, has-children#0, nilled#0
-- 
The attached diff has been truncated due to its size.
https://code.launchpad.net/~zorba-coders/zorba/xquery3.0_funcs/+merge/104336
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-05-01 15:54:27 +0000
+++ ChangeLog	2012-05-02 07:17:28 +0000
@@ -3,11 +3,15 @@
 version 2.5
 
 New Features:
-  * fn:available-environment-variables
-  * fn:environment-variables
-  * fn:uri-collection
-  * fn:unparsed-text
-  * fn:unparsed-text-available
+  * XQuery 3.0 functions
+    - fn:available-environment-variables
+    - fn:environment-variables
+    - fn:uri-collection
+    - fn:unparsed-text
+    - fn:unparsed-text-available
+    - fn:has-children#0
+    - fn:nilled#0
+    - fn:path
   * Extended API for Python, Java, PHP and Ruby.
   * Add jvm classpath to zorbacmd and to Zorba API. Tracked by #931816
   * Added full-text module.
@@ -15,14 +19,11 @@
   * Added XQJ support.
   * Added CollectionManager and DocumentManager support for XQJ.
 
-Optimization:
-
 Bug Fixes/Other Changes:
   * Fixed bugs #931501 and #866987 (improved error messages for fn:format-number(). Additionally, the function now throws the FODF1310 error instead of XTDE1310, as the 3.0 spec requires)
   * Fixed bug 955170 (Catch clause with URILiteral-based wilcard NameTest)
   * Fixed bug 955135 (err:XQDY0044 not caught by try-catch expressions)
-  * Fixed bug #986075 (encountering flwor expr with no clauses; due to common 
-	  subexression being formed when inlining var in if-then-else expression) 
+  * Fixed bug #986075 (encountering flwor expr with no clauses; due to common subexression being formed when inlining var in if-then-else expression) 
   * Fixed bug #967864 (var substitution did not update theFreeVars property)
   * Fixed bug #891650 (context size var not always declared within path expr)
   * Fixed bug #948879 (--uri-path doesn't work with fetch:content())
@@ -36,17 +37,14 @@
   * Fixed bug #988412 (date:current-dateTime daylight saving)
   * Fixed bug #912586, #912593 and #912722 (assertion failures with lax validation)
   * Fixed bug #921458 (file:read-text-lines() blocking)
-  * Fixed bug #981405 (do not hoist expr containing try-catch variables out of the
-          associated try-catch expression)
-  * Fixed bug #947627 (throw XQST0099 if more than one declarations of context item
-	               type in same module)
+  * Fixed bug #981405 (do not hoist expr containing try-catch variables out of the associated try-catch expression)
+  * Fixed bug #947627 (throw XQST0099 if more than one declarations of context item type in same module)
   * Fixed bug #980526 (no-copy rule bug due to global var being set in "distant" udf)
   * Fixed bug #949910 (has-children may be invoked on all nodes). Internally, zorba::store::Item::getChildren() now returns NULL on node classes without offspring (instead of raising an error).
-  * Fixed Bug #933490: Error ItemFactoryImpl::createBase64Binary with istream
+  * Fixed Bug #933490 (Error ItemFactoryImpl::createBase64Binary with istream)
   * Fixed bug #867112 (Diagnostic Handler was not working on external APIs)
   * Fixed bug #857842 (Assertion failed with simple content element with comments)
 
-
 version 2.2
 
 New Features:

=== modified file 'modules/w3c/xpath_functions.xq'
--- modules/w3c/xpath_functions.xq	2012-04-24 12:39:38 +0000
+++ modules/w3c/xpath_functions.xq	2012-05-02 07:17:28 +0000
@@ -522,6 +522,12 @@
 declare function fn:parse-xml( $arg as xs:string?, $baseURI as xs:string) as document-node(element(*, xs:untyped)) external;
 
 (:~
+ : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-parse-xml-fragment";>fn:parse-xml-fragment</a>
+ :)
+declare function fn:parse-xml-fragment( $arg as xs:string?) as document-node(element(*, xs:untyped)) external;
+
+
+(:~
  : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-prefix-from-QName";>fn:prefix-from-QName</a>
  :)
 declare function fn:prefix-from-QName($arg as xs:QName?) as xs:NCName? external;
@@ -864,6 +870,11 @@
 (:~
  : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-has-children";>fn:has-children</a>
  :)
+declare function fn:has-children() as xs:boolean external;
+
+(:~
+ : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-has-children";>fn:has-children</a>
+ :)
 declare function fn:has-children($node as node()?) as xs:boolean external;
 
 (:~
@@ -923,12 +934,17 @@
 
 (:~
  : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-namespace-uri";>fn:namespace-uri</a>
- :)
+ :)       
 declare function fn:namespace-uri($arg as node()?) as xs:anyURI external;
 
 (:~
  : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-nilled";>fn:nilled</a>
  :)
+declare function fn:nilled() as xs:boolean external;
+
+(:~
+ : @see for semantics please check <a href="http://www.w3.org/TR/xpath-functions-30/#func-nilled";>fn:nilled</a>
+ :)
 declare function fn:nilled($arg as node()?) as xs:boolean? external;
 
 (:~

=== modified file 'src/compiler/translator/translator.cpp'
--- src/compiler/translator/translator.cpp	2012-05-01 21:21:04 +0000
+++ src/compiler/translator/translator.cpp	2012-05-02 07:17:28 +0000
@@ -694,6 +694,10 @@
   xquery_fns_def_dot.set(FunctionConsts::FN_DATA_0);
   xquery_fns_def_dot.set(FunctionConsts::FN_DOCUMENT_URI_0);
   xquery_fns_def_dot.set(FunctionConsts::FN_NODE_NAME_0);
+  xquery_fns_def_dot.set(FunctionConsts::FN_NILLED_0);
+  xquery_fns_def_dot.set(FunctionConsts::FN_HAS_CHILDREN_0);
+  xquery_fns_def_dot.set(FunctionConsts::FN_PATH_0);
+
 
   op_concatenate = GET_BUILTIN_FUNCTION(OP_CONCATENATE_N);
   assert(op_concatenate != NULL);

=== modified file 'src/functions/pregenerated/func_accessors.cpp'
--- src/functions/pregenerated/func_accessors.cpp	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_accessors.cpp	2012-05-02 07:17:28 +0000
@@ -50,6 +50,15 @@
   return new NodeNameIterator(sctx, loc, argv);
 }
 
+PlanIter_t fn_nilled_3_0::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new NilledIterator(sctx, loc, argv);
+}
 PlanIter_t fn_nilled::codegen(
   CompilerCB*,
   static_context* sctx,
@@ -138,6 +147,17 @@
   {
     
 
+    DECL_WITH_KIND(sctx, fn_nilled_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","nilled";), 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_NILLED_0);
+
+  }
+
+
+  {
+    
+
     DECL_WITH_KIND(sctx, fn_nilled,
         (createQName("http://www.w3.org/2005/xpath-functions","","nilled";), 
         GENV_TYPESYSTEM.ANY_NODE_TYPE_QUESTION, 

=== modified file 'src/functions/pregenerated/func_accessors.h'
--- src/functions/pregenerated/func_accessors.h	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_accessors.h	2012-05-02 07:17:28 +0000
@@ -72,6 +72,22 @@
 
 
 //fn:nilled
+class fn_nilled_3_0 : public function
+{
+public:
+  fn_nilled_3_0(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+theXQueryVersion = StaticContextConsts::xquery_version_3_0;
+  }
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return true; }
+
+  CODEGEN_DECL();
+};
+
+//fn:nilled
 class fn_nilled : public function
 {
 public:
@@ -82,7 +98,7 @@
 
   }
 
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return true; }
 
   CODEGEN_DECL();
 };

=== modified file 'src/functions/pregenerated/func_nodes.cpp'
--- src/functions/pregenerated/func_nodes.cpp	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_nodes.cpp	2012-05-02 07:17:28 +0000
@@ -231,6 +231,16 @@
   return new LeastCommonAncestor(sctx, loc, argv);
 }
 
+PlanIter_t fn_path_3_0::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnPathIterator(sctx, loc, argv);
+}
+
 void populate_context_nodes(static_context* sctx)
 {
   {
@@ -356,6 +366,17 @@
 
     DECL_WITH_KIND(sctx, fn_has_children_3_0,
         (createQName("http://www.w3.org/2005/xpath-functions","","has-children";), 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_HAS_CHILDREN_0);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_has_children_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","has-children";), 
         GENV_TYPESYSTEM.ANY_NODE_TYPE_QUESTION, 
         GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
         FunctionConsts::FN_HAS_CHILDREN_1);
@@ -538,6 +559,29 @@
 
   }
 
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_path_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","path";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION),
+        FunctionConsts::FN_PATH_0);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_path_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","path";), 
+        GENV_TYPESYSTEM.ANY_NODE_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION),
+        FunctionConsts::FN_PATH_1);
+
+  }
+
 }
 
 

=== modified file 'src/functions/pregenerated/func_nodes.h'
--- src/functions/pregenerated/func_nodes.h	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_nodes.h	2012-05-02 07:17:28 +0000
@@ -372,6 +372,21 @@
 };
 
 
+//fn:path
+class fn_path_3_0 : public function
+{
+public:
+  fn_path_3_0(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+theXQueryVersion = StaticContextConsts::xquery_version_3_0;
+  }
+
+  CODEGEN_DECL();
+};
+
+
 } //namespace zorba
 
 

=== modified file 'src/functions/pregenerated/func_parse_fragment.cpp'
--- src/functions/pregenerated/func_parse_fragment.cpp	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_parse_fragment.cpp	2012-05-02 07:17:28 +0000
@@ -38,7 +38,7 @@
   std::vector<PlanIter_t>& argv,
   expr& ann) const
 {
-  return new FnParseXmlFragmentIterator(sctx, loc, argv);
+  return new FnZorbaParseXmlFragmentIterator(sctx, loc, argv);
 }
 
 void populate_context_parse_fragment(static_context* sctx)

=== modified file 'src/functions/pregenerated/func_sequences.cpp'
--- src/functions/pregenerated/func_sequences.cpp	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_sequences.cpp	2012-05-02 07:17:28 +0000
@@ -1,923 +1,775 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-
-#include "stdafx.h"
-#include "runtime/sequences/sequences.h"
-#include "functions/func_sequences.h"
-#include "system/globalenv.h"
-#include "types/typeops.h"
-#include "compiler/expression/expr_base.h"
-
-
-namespace zorba{
-
-
-
-PlanIter_t op_concatenate::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnConcatIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_index_of::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnIndexOfIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_empty::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnEmptyIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_exists::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnExistsIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_distinct_values::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnDistinctValuesIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_insert_before::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnInsertBeforeIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_remove::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnRemoveIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_reverse::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnReverseIterator(sctx, loc, argv);
-}
-
-
-
-
-
-PlanIter_t fn_one_or_more::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnOneOrMoreIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_deep_equal::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnDeepEqualIterator(sctx, loc, argv);
-}
-
-
-PlanIter_t fn_avg::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnAvgIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_sum::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnSumIterator(sctx, loc, argv);
-}
-
-PlanIter_t op_sum_double::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnSumDoubleIterator(sctx, loc, argv);
-}
-
-PlanIter_t op_sum_float::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnSumFloatIterator(sctx, loc, argv);
-}
-
-PlanIter_t op_sum_decimal::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnSumDecimalIterator(sctx, loc, argv);
-}
-
-PlanIter_t op_sum_integer::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnSumIntegerIterator(sctx, loc, argv);
-}
-
-PlanIter_t op_to::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new OpToIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_id::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnIdIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_element_with_id::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnElementWithIdIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_idref::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnIdRefIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_doc::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnDocIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_doc_available::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnDocAvailableIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_available_environment_variables_3_0::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnAvailableEnvironmentVariablesIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_environment_variable_3_0::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnEnvironmentVariableIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_unparsed_text_3_0::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnUnparsedTextIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_unparsed_text_available_3_0::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnUnparsedTextAvailableIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_unparsed_text_lines_3_0::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnUnparsedTextLinesIterator(sctx, loc, argv);
-}
-
-void populate_context_sequences(static_context* sctx)
-{
-  {
-    std::vector<xqtref_t> lParamTypes;
-    lParamTypes.push_back(GENV_TYPESYSTEM.ITEM_TYPE_STAR);
-
-    DECL_WITH_KIND(sctx, op_concatenate,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","concatenate";), 
-        lParamTypes, GENV_TYPESYSTEM.ITEM_TYPE_STAR, true),
-        FunctionConsts::OP_CONCATENATE_N);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_index_of,
-        (createQName("http://www.w3.org/2005/xpath-functions","","index-of";), 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
-        FunctionConsts::FN_INDEX_OF_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_index_of,
-        (createQName("http://www.w3.org/2005/xpath-functions","","index-of";), 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
-        FunctionConsts::FN_INDEX_OF_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_empty,
-        (createQName("http://www.w3.org/2005/xpath-functions","","empty";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_EMPTY_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_exists,
-        (createQName("http://www.w3.org/2005/xpath-functions","","exists";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_EXISTS_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_distinct_values,
-        (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values";), 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR),
-        FunctionConsts::FN_DISTINCT_VALUES_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_distinct_values,
-        (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values";), 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR),
-        FunctionConsts::FN_DISTINCT_VALUES_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_insert_before,
-        (createQName("http://www.w3.org/2005/xpath-functions","","insert-before";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
-        FunctionConsts::FN_INSERT_BEFORE_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_remove,
-        (createQName("http://www.w3.org/2005/xpath-functions","","remove";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
-        FunctionConsts::FN_REMOVE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_reverse,
-        (createQName("http://www.w3.org/2005/xpath-functions","","reverse";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
-        FunctionConsts::FN_REVERSE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_subsequence,
-        (createQName("http://www.w3.org/2005/xpath-functions","","subsequence";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
-        FunctionConsts::FN_SUBSEQUENCE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_subsequence,
-        (createQName("http://www.w3.org/2005/xpath-functions","","subsequence";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
-        FunctionConsts::FN_SUBSEQUENCE_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_zorba_subsequence_int,
-        (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
-        FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_zorba_subsequence_int,
-        (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
-        FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_zorba_sequence_point_access,
-        (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","sequence-point-access";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.ITEM_TYPE_QUESTION),
-        FunctionConsts::OP_ZORBA_SEQUENCE_POINT_ACCESS_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_zero_or_one,
-        (createQName("http://www.w3.org/2005/xpath-functions","","zero-or-one";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.ITEM_TYPE_QUESTION),
-        FunctionConsts::FN_ZERO_OR_ONE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_one_or_more,
-        (createQName("http://www.w3.org/2005/xpath-functions","","one-or-more";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.ITEM_TYPE_PLUS),
-        FunctionConsts::FN_ONE_OR_MORE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_deep_equal,
-        (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_DEEP_EQUAL_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_deep_equal,
-        (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_DEEP_EQUAL_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_count,
-        (createQName("http://www.w3.org/2005/xpath-functions","","count";), 
-        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
-        FunctionConsts::FN_COUNT_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_avg,
-        (createQName("http://www.w3.org/2005/xpath-functions","","avg";), 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
-        FunctionConsts::FN_AVG_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_sum,
-        (createQName("http://www.w3.org/2005/xpath-functions","","sum";), 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE),
-        FunctionConsts::FN_SUM_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_sum,
-        (createQName("http://www.w3.org/2005/xpath-functions","","sum";), 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
-        FunctionConsts::FN_SUM_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_double,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double";), 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
-        FunctionConsts::OP_SUM_DOUBLE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_double,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double";), 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
-        FunctionConsts::OP_SUM_DOUBLE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_float,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float";), 
-        GENV_TYPESYSTEM.FLOAT_TYPE_STAR, 
-        GENV_TYPESYSTEM.FLOAT_TYPE_ONE),
-        FunctionConsts::OP_SUM_FLOAT_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_float,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float";), 
-        GENV_TYPESYSTEM.FLOAT_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
-        FunctionConsts::OP_SUM_FLOAT_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_decimal,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal";), 
-        GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, 
-        GENV_TYPESYSTEM.DECIMAL_TYPE_ONE),
-        FunctionConsts::OP_SUM_DECIMAL_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_decimal,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal";), 
-        GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
-        FunctionConsts::OP_SUM_DECIMAL_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_integer,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer";), 
-        GENV_TYPESYSTEM.INTEGER_TYPE_STAR, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
-        FunctionConsts::OP_SUM_INTEGER_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_sum_integer,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer";), 
-        GENV_TYPESYSTEM.INTEGER_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
-        FunctionConsts::OP_SUM_INTEGER_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_to,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","to";), 
-        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
-        FunctionConsts::OP_TO_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_id,
-        (createQName("http://www.w3.org/2005/xpath-functions","","id";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
-        FunctionConsts::FN_ID_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_id,
-        (createQName("http://www.w3.org/2005/xpath-functions","","id";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, 
-        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
-        FunctionConsts::FN_ID_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_element_with_id,
-        (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
-        FunctionConsts::FN_ELEMENT_WITH_ID_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_element_with_id,
-        (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, 
-        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
-        FunctionConsts::FN_ELEMENT_WITH_ID_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_idref,
-        (createQName("http://www.w3.org/2005/xpath-functions","","idref";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
-        FunctionConsts::FN_IDREF_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_idref,
-        (createQName("http://www.w3.org/2005/xpath-functions","","idref";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, 
-        GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
-        FunctionConsts::FN_IDREF_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_doc,
-        (createQName("http://www.w3.org/2005/xpath-functions","","doc";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.DOCUMENT_UNTYPED_TYPE_QUESTION),
-        FunctionConsts::FN_DOC_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_doc_available,
-        (createQName("http://www.w3.org/2005/xpath-functions","","doc-available";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_DOC_AVAILABLE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_available_environment_variables_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","available-environment-variables";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR),
-        FunctionConsts::FN_AVAILABLE_ENVIRONMENT_VARIABLES_0);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_environment_variable_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","environment-variable";), 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION),
-        FunctionConsts::FN_ENVIRONMENT_VARIABLE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_unparsed_text_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION),
-        FunctionConsts::FN_UNPARSED_TEXT_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_unparsed_text_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION),
-        FunctionConsts::FN_UNPARSED_TEXT_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_unparsed_text_available_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-available";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION),
-        FunctionConsts::FN_UNPARSED_TEXT_AVAILABLE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_unparsed_text_available_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-available";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION),
-        FunctionConsts::FN_UNPARSED_TEXT_AVAILABLE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_unparsed_text_lines_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-lines";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR),
-        FunctionConsts::FN_UNPARSED_TEXT_LINES_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_unparsed_text_lines_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","unparsed-text-lines";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR),
-        FunctionConsts::FN_UNPARSED_TEXT_LINES_2);
-
-  }
-
-}
-
-
-}
-
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+
+#include "stdafx.h"
+#include "runtime/sequences/sequences.h"
+#include "functions/func_sequences.h"
+#include "system/globalenv.h"
+#include "types/typeops.h"
+#include "compiler/expression/expr_base.h"
+
+
+namespace zorba{
+
+
+
+PlanIter_t op_concatenate::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnConcatIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_index_of::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnIndexOfIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_empty::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnEmptyIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_exists::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnExistsIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_distinct_values::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnDistinctValuesIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_insert_before::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnInsertBeforeIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_remove::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnRemoveIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_reverse::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnReverseIterator(sctx, loc, argv);
+}
+
+
+
+
+
+PlanIter_t fn_one_or_more::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnOneOrMoreIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_deep_equal::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnDeepEqualIterator(sctx, loc, argv);
+}
+
+
+PlanIter_t fn_avg::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnAvgIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_sum::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnSumIterator(sctx, loc, argv);
+}
+
+PlanIter_t op_sum_double::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnSumDoubleIterator(sctx, loc, argv);
+}
+
+PlanIter_t op_sum_float::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnSumFloatIterator(sctx, loc, argv);
+}
+
+PlanIter_t op_sum_decimal::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnSumDecimalIterator(sctx, loc, argv);
+}
+
+PlanIter_t op_sum_integer::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnSumIntegerIterator(sctx, loc, argv);
+}
+
+PlanIter_t op_to::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new OpToIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_id::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnIdIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_element_with_id::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnElementWithIdIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_idref::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnIdRefIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_doc::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnDocIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_doc_available::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnDocAvailableIterator(sctx, loc, argv);
+}
+
+void populate_context_sequences(static_context* sctx)
+{
+  {
+    std::vector<xqtref_t> lParamTypes;
+    lParamTypes.push_back(GENV_TYPESYSTEM.ITEM_TYPE_STAR);
+
+    DECL_WITH_KIND(sctx, op_concatenate,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","concatenate";), 
+        lParamTypes, GENV_TYPESYSTEM.ITEM_TYPE_STAR, true),
+        FunctionConsts::OP_CONCATENATE_N);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_index_of,
+        (createQName("http://www.w3.org/2005/xpath-functions","","index-of";), 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
+        FunctionConsts::FN_INDEX_OF_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_index_of,
+        (createQName("http://www.w3.org/2005/xpath-functions","","index-of";), 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
+        FunctionConsts::FN_INDEX_OF_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_empty,
+        (createQName("http://www.w3.org/2005/xpath-functions","","empty";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_EMPTY_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_exists,
+        (createQName("http://www.w3.org/2005/xpath-functions","","exists";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_EXISTS_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_distinct_values,
+        (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values";), 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR),
+        FunctionConsts::FN_DISTINCT_VALUES_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_distinct_values,
+        (createQName("http://www.w3.org/2005/xpath-functions","","distinct-values";), 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR),
+        FunctionConsts::FN_DISTINCT_VALUES_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_insert_before,
+        (createQName("http://www.w3.org/2005/xpath-functions","","insert-before";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
+        FunctionConsts::FN_INSERT_BEFORE_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_remove,
+        (createQName("http://www.w3.org/2005/xpath-functions","","remove";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
+        FunctionConsts::FN_REMOVE_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_reverse,
+        (createQName("http://www.w3.org/2005/xpath-functions","","reverse";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
+        FunctionConsts::FN_REVERSE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_subsequence,
+        (createQName("http://www.w3.org/2005/xpath-functions","","subsequence";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
+        FunctionConsts::FN_SUBSEQUENCE_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_subsequence,
+        (createQName("http://www.w3.org/2005/xpath-functions","","subsequence";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
+        FunctionConsts::FN_SUBSEQUENCE_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_zorba_subsequence_int,
+        (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
+        FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_zorba_subsequence_int,
+        (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","subsequence-int";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR),
+        FunctionConsts::OP_ZORBA_SUBSEQUENCE_INT_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_zorba_sequence_point_access,
+        (createQName("http://www.zorba-xquery.com/internal/zorba-ops","","sequence-point-access";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.ITEM_TYPE_QUESTION),
+        FunctionConsts::OP_ZORBA_SEQUENCE_POINT_ACCESS_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_zero_or_one,
+        (createQName("http://www.w3.org/2005/xpath-functions","","zero-or-one";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ITEM_TYPE_QUESTION),
+        FunctionConsts::FN_ZERO_OR_ONE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_one_or_more,
+        (createQName("http://www.w3.org/2005/xpath-functions","","one-or-more";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ITEM_TYPE_PLUS),
+        FunctionConsts::FN_ONE_OR_MORE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_deep_equal,
+        (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_DEEP_EQUAL_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_deep_equal,
+        (createQName("http://www.w3.org/2005/xpath-functions","","deep-equal";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_DEEP_EQUAL_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_count,
+        (createQName("http://www.w3.org/2005/xpath-functions","","count";), 
+        GENV_TYPESYSTEM.ITEM_TYPE_STAR, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
+        FunctionConsts::FN_COUNT_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_avg,
+        (createQName("http://www.w3.org/2005/xpath-functions","","avg";), 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
+        FunctionConsts::FN_AVG_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_sum,
+        (createQName("http://www.w3.org/2005/xpath-functions","","sum";), 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_ONE),
+        FunctionConsts::FN_SUM_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_sum,
+        (createQName("http://www.w3.org/2005/xpath-functions","","sum";), 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
+        FunctionConsts::FN_SUM_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_double,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double";), 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE),
+        FunctionConsts::OP_SUM_DOUBLE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_double,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_double";), 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
+        FunctionConsts::OP_SUM_DOUBLE_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_float,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float";), 
+        GENV_TYPESYSTEM.FLOAT_TYPE_STAR, 
+        GENV_TYPESYSTEM.FLOAT_TYPE_ONE),
+        FunctionConsts::OP_SUM_FLOAT_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_float,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_float";), 
+        GENV_TYPESYSTEM.FLOAT_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
+        FunctionConsts::OP_SUM_FLOAT_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_decimal,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal";), 
+        GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, 
+        GENV_TYPESYSTEM.DECIMAL_TYPE_ONE),
+        FunctionConsts::OP_SUM_DECIMAL_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_decimal,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_decimal";), 
+        GENV_TYPESYSTEM.DECIMAL_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
+        FunctionConsts::OP_SUM_DECIMAL_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_integer,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer";), 
+        GENV_TYPESYSTEM.INTEGER_TYPE_STAR, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
+        FunctionConsts::OP_SUM_INTEGER_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_sum_integer,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","sum_integer";), 
+        GENV_TYPESYSTEM.INTEGER_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION),
+        FunctionConsts::OP_SUM_INTEGER_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_to,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","to";), 
+        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
+        FunctionConsts::OP_TO_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_id,
+        (createQName("http://www.w3.org/2005/xpath-functions","","id";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
+        FunctionConsts::FN_ID_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_id,
+        (createQName("http://www.w3.org/2005/xpath-functions","","id";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, 
+        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
+        FunctionConsts::FN_ID_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_element_with_id,
+        (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
+        FunctionConsts::FN_ELEMENT_WITH_ID_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_element_with_id,
+        (createQName("http://www.w3.org/2005/xpath-functions","","element-with-id";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, 
+        GENV_TYPESYSTEM.ELEMENT_TYPE_STAR),
+        FunctionConsts::FN_ELEMENT_WITH_ID_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_idref,
+        (createQName("http://www.w3.org/2005/xpath-functions","","idref";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
+        FunctionConsts::FN_IDREF_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_idref,
+        (createQName("http://www.w3.org/2005/xpath-functions","","idref";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.ANY_NODE_TYPE_ONE, 
+        GENV_TYPESYSTEM.ANY_NODE_TYPE_STAR),
+        FunctionConsts::FN_IDREF_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_doc,
+        (createQName("http://www.w3.org/2005/xpath-functions","","doc";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.DOCUMENT_UNTYPED_TYPE_QUESTION),
+        FunctionConsts::FN_DOC_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_doc_available,
+        (createQName("http://www.w3.org/2005/xpath-functions","","doc-available";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_DOC_AVAILABLE_1);
+
+  }
+
+}
+
+
+}
+
+
+

=== modified file 'src/functions/pregenerated/func_sequences.h'
--- src/functions/pregenerated/func_sequences.h	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_sequences.h	2012-05-02 07:17:28 +0000
@@ -1,708 +1,633 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-
-#ifndef ZORBA_FUNCTIONS_SEQUENCES_H
-#define ZORBA_FUNCTIONS_SEQUENCES_H
-
-
-#include "common/shared_types.h"
-#include "functions/function_impl.h"
-
-
-namespace zorba {
-
-
-void populate_context_sequences(static_context* sctx);
-
-
-
-
-//op:concatenate
-class op_concatenate : public function
-{
-public:
-  op_concatenate(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:index-of
-class fn_index_of : public function
-{
-public:
-  fn_index_of(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:empty
-class fn_empty : public function
-{
-public:
-  fn_empty(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:exists
-class fn_exists : public function
-{
-public:
-  fn_exists(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:distinct-values
-class fn_distinct_values : public function
-{
-public:
-  fn_distinct_values(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  CODEGEN_DECL();
-};
-
-
-//fn:insert-before
-class fn_insert_before : public function
-{
-public:
-  fn_insert_before(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:remove
-class fn_remove : public function
-{
-public:
-  fn_remove(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
-
-  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:reverse
-class fn_reverse : public function
-{
-public:
-  fn_reverse(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:subsequence
-class fn_subsequence : public function
-{
-public:
-  fn_subsequence(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
-
-  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  bool serializable() const { return true; }
-
-  CODEGEN_DECL();
-};
-
-
-//op-zorba:subsequence-int
-class op_zorba_subsequence_int : public function
-{
-public:
-  op_zorba_subsequence_int(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
-
-  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//op-zorba:sequence-point-access
-class op_zorba_sequence_point_access : public function
-{
-public:
-  op_zorba_sequence_point_access(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
-
-  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:zero-or-one
-class fn_zero_or_one : public function
-{
-public:
-  fn_zero_or_one(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:one-or-more
-class fn_one_or_more : public function
-{
-public:
-  fn_one_or_more(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  xqtref_t getReturnType(const fo_expr* caller) const;
-
-  bool isMap(ulong producer) const { return producer == 0; }
-
-  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
-
-  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:deep-equal
-class fn_deep_equal : public function
-{
-public:
-  fn_deep_equal(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  bool accessesDynCtx() const { return true; }
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:count
-class fn_count : public function
-{
-public:
-  fn_count(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:avg
-class fn_avg : public function
-{
-public:
-  fn_avg(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  CODEGEN_DECL();
-};
-
-
-//fn:sum
-class fn_sum : public function
-{
-public:
-  fn_sum(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  bool specializable() const { return true; }
-
-  function* specialize( static_context* sctx,
-                        const std::vector<xqtref_t>& argTypes) const;
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  CODEGEN_DECL();
-};
-
-
-//op:sum_double
-class op_sum_double : public function
-{
-public:
-  op_sum_double(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  CODEGEN_DECL();
-};
-
-
-//op:sum_float
-class op_sum_float : public function
-{
-public:
-  op_sum_float(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  CODEGEN_DECL();
-};
-
-
-//op:sum_decimal
-class op_sum_decimal : public function
-{
-public:
-  op_sum_decimal(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  CODEGEN_DECL();
-};
-
-
-//op:sum_integer
-class op_sum_integer : public function
-{
-public:
-  op_sum_integer(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  CODEGEN_DECL();
-};
-
-
-//op:to
-class op_to : public function
-{
-public:
-  op_to(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:id
-class fn_id : public function
-{
-public:
-  fn_id(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  FunctionConsts::AnnotationValue producesDistinctNodes() const 
-  {
-    return FunctionConsts::YES;
-  }
-
-  FunctionConsts::AnnotationValue producesSortedNodes() const 
-  {
-    return FunctionConsts::YES;
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:element-with-id
-class fn_element_with_id : public function
-{
-public:
-  fn_element_with_id(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  FunctionConsts::AnnotationValue producesDistinctNodes() const 
-  {
-    return FunctionConsts::YES;
-  }
-
-  FunctionConsts::AnnotationValue producesSortedNodes() const 
-  {
-    return FunctionConsts::YES;
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:idref
-class fn_idref : public function
-{
-public:
-  fn_idref(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  FunctionConsts::AnnotationValue producesDistinctNodes() const 
-  {
-    return FunctionConsts::YES;
-  }
-
-  FunctionConsts::AnnotationValue producesSortedNodes() const 
-  {
-    return FunctionConsts::YES;
-  }
-
-  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
-
-  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
-
-  bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:doc
-class fn_doc : public function
-{
-public:
-  fn_doc(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  bool accessesDynCtx() const { return true; }
-
-  bool isSource() const { return true; }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:doc-available
-class fn_doc_available : public function
-{
-public:
-  fn_doc_available(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-
-  }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:available-environment-variables
-class fn_available_environment_variables_3_0 : public function
-{
-public:
-  fn_available_environment_variables_3_0(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-theXQueryVersion = StaticContextConsts::xquery_version_3_0;
-  }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:environment-variable
-class fn_environment_variable_3_0 : public function
-{
-public:
-  fn_environment_variable_3_0(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-theXQueryVersion = StaticContextConsts::xquery_version_3_0;
-  }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:unparsed-text
-class fn_unparsed_text_3_0 : public function
-{
-public:
-  fn_unparsed_text_3_0(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-theXQueryVersion = StaticContextConsts::xquery_version_3_0;
-  }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:unparsed-text-available
-class fn_unparsed_text_available_3_0 : public function
-{
-public:
-  fn_unparsed_text_available_3_0(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-theXQueryVersion = StaticContextConsts::xquery_version_3_0;
-  }
-
-  CODEGEN_DECL();
-};
-
-
-//fn:unparsed-text-lines
-class fn_unparsed_text_lines_3_0 : public function
-{
-public:
-  fn_unparsed_text_lines_3_0(const signature& sig, FunctionConsts::FunctionKind kind)
-    : 
-    function(sig, kind)
-  {
-theXQueryVersion = StaticContextConsts::xquery_version_3_0;
-  }
-
-  CODEGEN_DECL();
-};
-
-
-} //namespace zorba
-
-
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+
+#ifndef ZORBA_FUNCTIONS_SEQUENCES_H
+#define ZORBA_FUNCTIONS_SEQUENCES_H
+
+
+#include "common/shared_types.h"
+#include "functions/function_impl.h"
+
+
+namespace zorba {
+
+
+void populate_context_sequences(static_context* sctx);
+
+
+
+
+//op:concatenate
+class op_concatenate : public function
+{
+public:
+  op_concatenate(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:index-of
+class fn_index_of : public function
+{
+public:
+  fn_index_of(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:empty
+class fn_empty : public function
+{
+public:
+  fn_empty(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:exists
+class fn_exists : public function
+{
+public:
+  fn_exists(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:distinct-values
+class fn_distinct_values : public function
+{
+public:
+  fn_distinct_values(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  CODEGEN_DECL();
+};
+
+
+//fn:insert-before
+class fn_insert_before : public function
+{
+public:
+  fn_insert_before(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:remove
+class fn_remove : public function
+{
+public:
+  fn_remove(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
+
+  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:reverse
+class fn_reverse : public function
+{
+public:
+  fn_reverse(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:subsequence
+class fn_subsequence : public function
+{
+public:
+  fn_subsequence(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
+
+  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  bool serializable() const { return true; }
+
+  CODEGEN_DECL();
+};
+
+
+//op-zorba:subsequence-int
+class op_zorba_subsequence_int : public function
+{
+public:
+  op_zorba_subsequence_int(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
+
+  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//op-zorba:sequence-point-access
+class op_zorba_sequence_point_access : public function
+{
+public:
+  op_zorba_sequence_point_access(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
+
+  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:zero-or-one
+class fn_zero_or_one : public function
+{
+public:
+  fn_zero_or_one(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:one-or-more
+class fn_one_or_more : public function
+{
+public:
+  fn_one_or_more(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  xqtref_t getReturnType(const fo_expr* caller) const;
+
+  bool isMap(ulong producer) const { return producer == 0; }
+
+  bool propagatesDistinctNodes(csize producer) const { return producer == 0; }
+
+  bool propagatesSortedNodes(csize producer) const { return producer == 0; }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:deep-equal
+class fn_deep_equal : public function
+{
+public:
+  fn_deep_equal(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  bool accessesDynCtx() const { return true; }
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:count
+class fn_count : public function
+{
+public:
+  fn_count(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return false; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:avg
+class fn_avg : public function
+{
+public:
+  fn_avg(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  CODEGEN_DECL();
+};
+
+
+//fn:sum
+class fn_sum : public function
+{
+public:
+  fn_sum(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  bool specializable() const { return true; }
+
+  function* specialize( static_context* sctx,
+                        const std::vector<xqtref_t>& argTypes) const;
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  CODEGEN_DECL();
+};
+
+
+//op:sum_double
+class op_sum_double : public function
+{
+public:
+  op_sum_double(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  CODEGEN_DECL();
+};
+
+
+//op:sum_float
+class op_sum_float : public function
+{
+public:
+  op_sum_float(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  CODEGEN_DECL();
+};
+
+
+//op:sum_decimal
+class op_sum_decimal : public function
+{
+public:
+  op_sum_decimal(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  CODEGEN_DECL();
+};
+
+
+//op:sum_integer
+class op_sum_integer : public function
+{
+public:
+  op_sum_integer(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  CODEGEN_DECL();
+};
+
+
+//op:to
+class op_to : public function
+{
+public:
+  op_to(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:id
+class fn_id : public function
+{
+public:
+  fn_id(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  FunctionConsts::AnnotationValue producesDistinctNodes() const 
+  {
+    return FunctionConsts::YES;
+  }
+
+  FunctionConsts::AnnotationValue producesSortedNodes() const 
+  {
+    return FunctionConsts::YES;
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:element-with-id
+class fn_element_with_id : public function
+{
+public:
+  fn_element_with_id(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  FunctionConsts::AnnotationValue producesDistinctNodes() const 
+  {
+    return FunctionConsts::YES;
+  }
+
+  FunctionConsts::AnnotationValue producesSortedNodes() const 
+  {
+    return FunctionConsts::YES;
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:idref
+class fn_idref : public function
+{
+public:
+  fn_idref(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  FunctionConsts::AnnotationValue producesDistinctNodes() const 
+  {
+    return FunctionConsts::YES;
+  }
+
+  FunctionConsts::AnnotationValue producesSortedNodes() const 
+  {
+    return FunctionConsts::YES;
+  }
+
+  BoolAnnotationValue ignoresSortedNodes(expr* fo, csize producer) const;
+
+  BoolAnnotationValue ignoresDuplicateNodes(expr* fo, csize producer) const;
+
+  bool mustCopyInputNodes(expr* fo, csize producer) const { return producer == 1; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:doc
+class fn_doc : public function
+{
+public:
+  fn_doc(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  bool accessesDynCtx() const { return true; }
+
+  bool isSource() const { return true; }
+
+  CODEGEN_DECL();
+};
+
+
+//fn:doc-available
+class fn_doc_available : public function
+{
+public:
+  fn_doc_available(const signature& sig, FunctionConsts::FunctionKind kind)
+    : 
+    function(sig, kind)
+  {
+
+  }
+
+  CODEGEN_DECL();
+};
+
+
+} //namespace zorba
+
+
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/functions/pregenerated/func_strings.cpp'
--- src/functions/pregenerated/func_strings.cpp	2012-04-24 12:39:38 +0000
+++ src/functions/pregenerated/func_strings.cpp	2012-05-02 07:17:28 +0000
@@ -1,895 +1,922 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-
-#include "stdafx.h"
-#include "runtime/strings/strings.h"
-#include "functions/func_strings.h"
-
-
-namespace zorba{
-
-
-
-PlanIter_t fn_codepoints_to_string::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new CodepointsToStringIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_string_to_codepoints::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StringToCodepointsIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_compare::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new CompareStrIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_codepoint_equal::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new CodepointEqualIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_concat::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new ConcatStrIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_string_join_3_0::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StringJoinIterator(sctx, loc, argv);
-}
-PlanIter_t fn_string_join::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StringJoinIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_substring::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new SubstringIterator(sctx, loc, argv);
-}
-
-PlanIter_t op_substring_int::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new SubstringIntOptIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_string_length::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StringLengthIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_normalize_space::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new NormalizeSpaceIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_normalize_unicode::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new NormalizeUnicodeIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_upper_case::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new UpperCaseIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_lower_case::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new LowerCaseIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_translate::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new TranslateIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_encode_for_uri::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new EncodeForUriIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_iri_to_uri::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new IriToUriIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_escape_html_uri::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new EscapeHtmlUriIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_contains::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new ContainsIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_starts_with::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StartsWithIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_ends_with::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new EndsWithIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_substring_before::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new SubstringBeforeIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_substring_after::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new SubstringAfterIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_matches::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnMatchesIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_replace::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnReplaceIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_tokenize::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnTokenizeIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_analyze_string_3_0::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new FnAnalyzeStringIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_zorba_string_materialize::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StringMaterializeIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_zorba_string_is_streamable::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StringIsStreamableIterator(sctx, loc, argv);
-}
-
-PlanIter_t fn_zorba_string_split::codegen(
-  CompilerCB*,
-  static_context* sctx,
-  const QueryLoc& loc,
-  std::vector<PlanIter_t>& argv,
-  expr& ann) const
-{
-  return new StringSplitIterator(sctx, loc, argv);
-}
-
-void populate_context_strings(static_context* sctx)
-{
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_codepoints_to_string,
-        (createQName("http://www.w3.org/2005/xpath-functions","","codepoints-to-string";), 
-        GENV_TYPESYSTEM.INTEGER_TYPE_STAR, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_CODEPOINTS_TO_STRING_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_string_to_codepoints,
-        (createQName("http://www.w3.org/2005/xpath-functions","","string-to-codepoints";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
-        FunctionConsts::FN_STRING_TO_CODEPOINTS_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_compare,
-        (createQName("http://www.w3.org/2005/xpath-functions","","compare";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION),
-        FunctionConsts::FN_COMPARE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_compare,
-        (createQName("http://www.w3.org/2005/xpath-functions","","compare";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION),
-        FunctionConsts::FN_COMPARE_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_codepoint_equal,
-        (createQName("http://www.w3.org/2005/xpath-functions","","codepoint-equal";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_QUESTION),
-        FunctionConsts::FN_CODEPOINT_EQUAL_2);
-
-  }
-
-
-  {
-    std::vector<xqtref_t> lParamTypes;
-    lParamTypes.push_back(GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION);
-
-    DECL_WITH_KIND(sctx, fn_concat,
-        (createQName("http://www.w3.org/2005/xpath-functions","","concat";), 
-        lParamTypes, GENV_TYPESYSTEM.STRING_TYPE_ONE, true),
-        FunctionConsts::FN_CONCAT_N);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_string_join_3_0,
-        (createQName("http://www.w3.org/2005/xpath-functions","","string-join";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_STRING_JOIN_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_string_join,
-        (createQName("http://www.w3.org/2005/xpath-functions","","string-join";), 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_STRING_JOIN_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_substring,
-        (createQName("http://www.w3.org/2005/xpath-functions","","substring";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_SUBSTRING_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_substring,
-        (createQName("http://www.w3.org/2005/xpath-functions","","substring";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
-        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_SUBSTRING_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_substring_int,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::OP_SUBSTRING_INT_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, op_substring_int,
-        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::OP_SUBSTRING_INT_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_string_length,
-        (createQName("http://www.w3.org/2005/xpath-functions","","string-length";), 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
-        FunctionConsts::FN_STRING_LENGTH_0);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_string_length,
-        (createQName("http://www.w3.org/2005/xpath-functions","","string-length";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
-        FunctionConsts::FN_STRING_LENGTH_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_normalize_space,
-        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space";), 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_NORMALIZE_SPACE_0);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_normalize_space,
-        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_NORMALIZE_SPACE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_normalize_unicode,
-        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_NORMALIZE_UNICODE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_normalize_unicode,
-        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_NORMALIZE_UNICODE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_upper_case,
-        (createQName("http://www.w3.org/2005/xpath-functions","","upper-case";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_UPPER_CASE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_lower_case,
-        (createQName("http://www.w3.org/2005/xpath-functions","","lower-case";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_LOWER_CASE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_translate,
-        (createQName("http://www.w3.org/2005/xpath-functions","","translate";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_TRANSLATE_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_encode_for_uri,
-        (createQName("http://www.w3.org/2005/xpath-functions","","encode-for-uri";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_ENCODE_FOR_URI_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_iri_to_uri,
-        (createQName("http://www.w3.org/2005/xpath-functions","","iri-to-uri";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_IRI_TO_URI_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_escape_html_uri,
-        (createQName("http://www.w3.org/2005/xpath-functions","","escape-html-uri";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_ESCAPE_HTML_URI_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_contains,
-        (createQName("http://www.w3.org/2005/xpath-functions","","contains";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_CONTAINS_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_contains,
-        (createQName("http://www.w3.org/2005/xpath-functions","","contains";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_CONTAINS_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_starts_with,
-        (createQName("http://www.w3.org/2005/xpath-functions","","starts-with";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_STARTS_WITH_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_starts_with,
-        (createQName("http://www.w3.org/2005/xpath-functions","","starts-with";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_STARTS_WITH_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_ends_with,
-        (createQName("http://www.w3.org/2005/xpath-functions","","ends-with";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_ENDS_WITH_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_ends_with,
-        (createQName("http://www.w3.org/2005/xpath-functions","","ends-with";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_ENDS_WITH_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_substring_before,
-        (createQName("http://www.w3.org/2005/xpath-functions","","substring-before";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_SUBSTRING_BEFORE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_substring_before,
-        (createQName("http://www.w3.org/2005/xpath-functions","","substring-before";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_SUBSTRING_BEFORE_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_substring_after,
-        (createQName("http://www.w3.org/2005/xpath-functions","","substring-after";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_SUBSTRING_AFTER_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_substring_after,
-        (createQName("http://www.w3.org/2005/xpath-functions","","substring-after";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_SUBSTRING_AFTER_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_matches,
-        (createQName("http://www.w3.org/2005/xpath-functions","","matches";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_MATCHES_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_matches,
-        (createQName("http://www.w3.org/2005/xpath-functions","","matches";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_MATCHES_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_replace,
-        (createQName("http://www.w3.org/2005/xpath-functions","","replace";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_REPLACE_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_replace,
-        (createQName("http://www.w3.org/2005/xpath-functions","","replace";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_REPLACE_4);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_tokenize,
-        (createQName("http://www.w3.org/2005/xpath-functions","","tokenize";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR),
-        FunctionConsts::FN_TOKENIZE_2);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_tokenize,
-        (createQName("http://www.w3.org/2005/xpath-functions","","tokenize";), 
-        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR),
-        FunctionConsts::FN_TOKENIZE_3);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_zorba_string_materialize,
-        (createQName("http://www.zorba-xquery.com/modules/string","","materialize";), 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE),
-        FunctionConsts::FN_ZORBA_STRING_MATERIALIZE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_zorba_string_is_streamable,
-        (createQName("http://www.zorba-xquery.com/modules/string","","is-streamable";), 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
-        FunctionConsts::FN_ZORBA_STRING_IS_STREAMABLE_1);
-
-  }
-
-
-  {
-    
-
-    DECL_WITH_KIND(sctx, fn_zorba_string_split,
-        (createQName("http://www.zorba-xquery.com/modules/string","","split";), 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
-        GENV_TYPESYSTEM.STRING_TYPE_STAR),
-        FunctionConsts::FN_ZORBA_STRING_SPLIT_2);
-
-  }
-
-}
-
-
-}
-
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+
+#include "stdafx.h"
+#include "runtime/strings/strings.h"
+#include "functions/func_strings.h"
+
+
+namespace zorba{
+
+
+
+PlanIter_t fn_codepoints_to_string::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new CodepointsToStringIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_string_to_codepoints::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StringToCodepointsIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_compare::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new CompareStrIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_codepoint_equal::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new CodepointEqualIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_concat::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new ConcatStrIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_string_join_3_0::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StringJoinIterator(sctx, loc, argv);
+}
+PlanIter_t fn_string_join::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StringJoinIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_substring::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new SubstringIterator(sctx, loc, argv);
+}
+
+PlanIter_t op_substring_int::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new SubstringIntOptIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_string_length::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StringLengthIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_normalize_space::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new NormalizeSpaceIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_normalize_unicode::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new NormalizeUnicodeIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_upper_case::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new UpperCaseIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_lower_case::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new LowerCaseIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_translate::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new TranslateIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_encode_for_uri::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new EncodeForUriIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_iri_to_uri::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new IriToUriIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_escape_html_uri::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new EscapeHtmlUriIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_contains::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new ContainsIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_starts_with::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StartsWithIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_ends_with::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new EndsWithIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_substring_before::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new SubstringBeforeIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_substring_after::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new SubstringAfterIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_matches::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnMatchesIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_replace::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnReplaceIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_tokenize::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnTokenizeIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_analyze_string_3_0::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new FnAnalyzeStringIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_zorba_string_materialize::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StringMaterializeIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_zorba_string_is_streamable::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StringIsStreamableIterator(sctx, loc, argv);
+}
+
+PlanIter_t fn_zorba_string_split::codegen(
+  CompilerCB*,
+  static_context* sctx,
+  const QueryLoc& loc,
+  std::vector<PlanIter_t>& argv,
+  expr& ann) const
+{
+  return new StringSplitIterator(sctx, loc, argv);
+}
+
+void populate_context_strings(static_context* sctx)
+{
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_codepoints_to_string,
+        (createQName("http://www.w3.org/2005/xpath-functions","","codepoints-to-string";), 
+        GENV_TYPESYSTEM.INTEGER_TYPE_STAR, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_CODEPOINTS_TO_STRING_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_string_to_codepoints,
+        (createQName("http://www.w3.org/2005/xpath-functions","","string-to-codepoints";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_STAR),
+        FunctionConsts::FN_STRING_TO_CODEPOINTS_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_compare,
+        (createQName("http://www.w3.org/2005/xpath-functions","","compare";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION),
+        FunctionConsts::FN_COMPARE_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_compare,
+        (createQName("http://www.w3.org/2005/xpath-functions","","compare";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_QUESTION),
+        FunctionConsts::FN_COMPARE_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_codepoint_equal,
+        (createQName("http://www.w3.org/2005/xpath-functions","","codepoint-equal";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_QUESTION),
+        FunctionConsts::FN_CODEPOINT_EQUAL_2);
+
+  }
+
+
+  {
+    std::vector<xqtref_t> lParamTypes;
+    lParamTypes.push_back(GENV_TYPESYSTEM.ANY_ATOMIC_TYPE_QUESTION);
+
+    DECL_WITH_KIND(sctx, fn_concat,
+        (createQName("http://www.w3.org/2005/xpath-functions","","concat";), 
+        lParamTypes, GENV_TYPESYSTEM.STRING_TYPE_ONE, true),
+        FunctionConsts::FN_CONCAT_N);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_string_join_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","string-join";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_STRING_JOIN_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_string_join,
+        (createQName("http://www.w3.org/2005/xpath-functions","","string-join";), 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_STRING_JOIN_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_substring,
+        (createQName("http://www.w3.org/2005/xpath-functions","","substring";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_SUBSTRING_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_substring,
+        (createQName("http://www.w3.org/2005/xpath-functions","","substring";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
+        GENV_TYPESYSTEM.DOUBLE_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_SUBSTRING_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_substring_int,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::OP_SUBSTRING_INT_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, op_substring_int,
+        (createQName("http://www.zorba-xquery.com/internal/xquery-ops","","substring_int";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::OP_SUBSTRING_INT_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_string_length,
+        (createQName("http://www.w3.org/2005/xpath-functions","","string-length";), 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
+        FunctionConsts::FN_STRING_LENGTH_0);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_string_length,
+        (createQName("http://www.w3.org/2005/xpath-functions","","string-length";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.INTEGER_TYPE_ONE),
+        FunctionConsts::FN_STRING_LENGTH_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_normalize_space,
+        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space";), 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_NORMALIZE_SPACE_0);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_normalize_space,
+        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-space";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_NORMALIZE_SPACE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_normalize_unicode,
+        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_NORMALIZE_UNICODE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_normalize_unicode,
+        (createQName("http://www.w3.org/2005/xpath-functions","","normalize-unicode";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_NORMALIZE_UNICODE_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_upper_case,
+        (createQName("http://www.w3.org/2005/xpath-functions","","upper-case";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_UPPER_CASE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_lower_case,
+        (createQName("http://www.w3.org/2005/xpath-functions","","lower-case";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_LOWER_CASE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_translate,
+        (createQName("http://www.w3.org/2005/xpath-functions","","translate";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_TRANSLATE_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_encode_for_uri,
+        (createQName("http://www.w3.org/2005/xpath-functions","","encode-for-uri";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_ENCODE_FOR_URI_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_iri_to_uri,
+        (createQName("http://www.w3.org/2005/xpath-functions","","iri-to-uri";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_IRI_TO_URI_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_escape_html_uri,
+        (createQName("http://www.w3.org/2005/xpath-functions","","escape-html-uri";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_ESCAPE_HTML_URI_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_contains,
+        (createQName("http://www.w3.org/2005/xpath-functions","","contains";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_CONTAINS_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_contains,
+        (createQName("http://www.w3.org/2005/xpath-functions","","contains";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_CONTAINS_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_starts_with,
+        (createQName("http://www.w3.org/2005/xpath-functions","","starts-with";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_STARTS_WITH_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_starts_with,
+        (createQName("http://www.w3.org/2005/xpath-functions","","starts-with";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_STARTS_WITH_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_ends_with,
+        (createQName("http://www.w3.org/2005/xpath-functions","","ends-with";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_ENDS_WITH_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_ends_with,
+        (createQName("http://www.w3.org/2005/xpath-functions","","ends-with";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_ENDS_WITH_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_substring_before,
+        (createQName("http://www.w3.org/2005/xpath-functions","","substring-before";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_SUBSTRING_BEFORE_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_substring_before,
+        (createQName("http://www.w3.org/2005/xpath-functions","","substring-before";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_SUBSTRING_BEFORE_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_substring_after,
+        (createQName("http://www.w3.org/2005/xpath-functions","","substring-after";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_SUBSTRING_AFTER_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_substring_after,
+        (createQName("http://www.w3.org/2005/xpath-functions","","substring-after";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_SUBSTRING_AFTER_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_matches,
+        (createQName("http://www.w3.org/2005/xpath-functions","","matches";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_MATCHES_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_matches,
+        (createQName("http://www.w3.org/2005/xpath-functions","","matches";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_MATCHES_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_replace,
+        (createQName("http://www.w3.org/2005/xpath-functions","","replace";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_REPLACE_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_replace,
+        (createQName("http://www.w3.org/2005/xpath-functions","","replace";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_REPLACE_4);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_tokenize,
+        (createQName("http://www.w3.org/2005/xpath-functions","","tokenize";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR),
+        FunctionConsts::FN_TOKENIZE_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_tokenize,
+        (createQName("http://www.w3.org/2005/xpath-functions","","tokenize";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR),
+        FunctionConsts::FN_TOKENIZE_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_analyze_string_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.ELEMENT_TYPE_ONE),
+        FunctionConsts::FN_ANALYZE_STRING_2);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_analyze_string_3_0,
+        (createQName("http://www.w3.org/2005/xpath-functions","","analyze-string";), 
+        GENV_TYPESYSTEM.STRING_TYPE_QUESTION, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.ELEMENT_TYPE_ONE),
+        FunctionConsts::FN_ANALYZE_STRING_3);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_zorba_string_materialize,
+        (createQName("http://www.zorba-xquery.com/modules/string","","materialize";), 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE),
+        FunctionConsts::FN_ZORBA_STRING_MATERIALIZE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_zorba_string_is_streamable,
+        (createQName("http://www.zorba-xquery.com/modules/string","","is-streamable";), 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.BOOLEAN_TYPE_ONE),
+        FunctionConsts::FN_ZORBA_STRING_IS_STREAMABLE_1);
+
+  }
+
+
+  {
+    
+
+    DECL_WITH_KIND(sctx, fn_zorba_string_split,
+        (createQName("http://www.zorba-xquery.com/modules/string","","split";), 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_ONE, 
+        GENV_TYPESYSTEM.STRING_TYPE_STAR),
+        FunctionConsts::FN_ZORBA_STRING_SPLIT_2);
+
+  }
+
+}
+
+
+}
+
+
+

=== modified file 'src/functions/pregenerated/function_enum.h'
--- src/functions/pregenerated/function_enum.h	2012-04-26 13:25:13 +0000
+++ src/functions/pregenerated/function_enum.h	2012-05-02 07:17:28 +0000
@@ -22,6 +22,7 @@
 // ******************************************
   FN_NODE_NAME_0,
   FN_NODE_NAME_1,
+  FN_NILLED_0,
   FN_NILLED_1,
   FN_STRING_0,
   FN_STRING_1,
@@ -251,6 +252,7 @@
   FN_LANG_2,
   FN_NUMBER_0,
   FN_NUMBER_1,
+  FN_HAS_CHILDREN_0,
   FN_HAS_CHILDREN_1,
   FN_INNERMOST_1,
   FN_OUTERMOST_1,
@@ -266,6 +268,8 @@
   FN_ZORBA_NODE_PRECEDING_SIBLING_OF_2,
   FN_ZORBA_NODE_LEVEL_1,
   FN_ZORBA_NODE_LEAST_COMMON_ANCESTOR_2,
+  FN_PATH_0,
+  FN_PATH_1,
   FN_ABS_1,
   FN_CEILING_1,
   FN_FLOOR_1,

=== modified file 'src/runtime/accessors/accessors_impl.cpp'
--- src/runtime/accessors/accessors_impl.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/accessors/accessors_impl.cpp	2012-05-02 07:17:28 +0000
@@ -79,8 +79,7 @@
   if (consumeNext(inNode, theChildren[0].getp(), planState))
   {
     if (inNode->isNode()) {
-      result = inNode->getNilled();
-      STACK_PUSH(result != NULL, state);
+      STACK_PUSH(GENV_ITEMFACTORY->createBoolean(result, inNode->getNilled() != NULL), state);
     } else
 			throw XQUERY_EXCEPTION(
 				err::XPTY0004,

=== modified file 'src/runtime/any_uri/pregenerated/any_uri.cpp'
--- src/runtime/any_uri/pregenerated/any_uri.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/any_uri/pregenerated/any_uri.cpp	2012-05-02 07:17:28 +0000
@@ -1,60 +1,60 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/any_uri/any_uri.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <ResolveUriIterator>
-ResolveUriIterator::class_factory<ResolveUriIterator>
-ResolveUriIterator::g_class_factory;
-
-
-void ResolveUriIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-ResolveUriIterator::~ResolveUriIterator() {}
-
-// </ResolveUriIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/any_uri/any_uri.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <ResolveUriIterator>
+ResolveUriIterator::class_factory<ResolveUriIterator>
+ResolveUriIterator::g_class_factory;
+
+
+void ResolveUriIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+ResolveUriIterator::~ResolveUriIterator() {}
+
+// </ResolveUriIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/any_uri/pregenerated/any_uri.h'
--- src/runtime/any_uri/pregenerated/any_uri.h	2012-04-24 12:39:38 +0000
+++ src/runtime/any_uri/pregenerated/any_uri.h	2012-05-02 07:17:28 +0000
@@ -1,76 +1,76 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_ANY_URI_ANY_URI_H
-#define ZORBA_RUNTIME_ANY_URI_ANY_URI_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * fn:resolve-uri
- * Author: Zorba Team
- */
-class ResolveUriIterator : public NaryBaseIterator<ResolveUriIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ResolveUriIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ResolveUriIterator,
-    NaryBaseIterator<ResolveUriIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<ResolveUriIterator, PlanIteratorState>*)this);
-  }
-
-  ResolveUriIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<ResolveUriIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~ResolveUriIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_ANY_URI_ANY_URI_H
+#define ZORBA_RUNTIME_ANY_URI_ANY_URI_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * fn:resolve-uri
+ * Author: Zorba Team
+ */
+class ResolveUriIterator : public NaryBaseIterator<ResolveUriIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ResolveUriIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ResolveUriIterator,
+    NaryBaseIterator<ResolveUriIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<ResolveUriIterator, PlanIteratorState>*)this);
+  }
+
+  ResolveUriIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<ResolveUriIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~ResolveUriIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/base64/pregenerated/base64.cpp'
--- src/runtime/base64/pregenerated/base64.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/base64/pregenerated/base64.cpp	2012-05-02 07:17:28 +0000
@@ -1,82 +1,82 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/base64/base64.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <Base64DecodeIterator>
-Base64DecodeIterator::class_factory<Base64DecodeIterator>
-Base64DecodeIterator::g_class_factory;
-
-
-void Base64DecodeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-Base64DecodeIterator::~Base64DecodeIterator() {}
-
-// </Base64DecodeIterator>
-
-
-// <Base64EncodeIterator>
-Base64EncodeIterator::class_factory<Base64EncodeIterator>
-Base64EncodeIterator::g_class_factory;
-
-
-void Base64EncodeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-Base64EncodeIterator::~Base64EncodeIterator() {}
-
-// </Base64EncodeIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/base64/base64.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <Base64DecodeIterator>
+Base64DecodeIterator::class_factory<Base64DecodeIterator>
+Base64DecodeIterator::g_class_factory;
+
+
+void Base64DecodeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+Base64DecodeIterator::~Base64DecodeIterator() {}
+
+// </Base64DecodeIterator>
+
+
+// <Base64EncodeIterator>
+Base64EncodeIterator::class_factory<Base64EncodeIterator>
+Base64EncodeIterator::g_class_factory;
+
+
+void Base64EncodeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+Base64EncodeIterator::~Base64EncodeIterator() {}
+
+// </Base64EncodeIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/base64/pregenerated/base64.h'
--- src/runtime/base64/pregenerated/base64.h	2012-04-24 12:39:38 +0000
+++ src/runtime/base64/pregenerated/base64.h	2012-05-02 07:17:28 +0000
@@ -1,110 +1,110 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_BASE64_BASE64_H
-#define ZORBA_RUNTIME_BASE64_BASE64_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * base64:decode
- * Author: Zorba Team
- */
-class Base64DecodeIterator : public NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(Base64DecodeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Base64DecodeIterator,
-    NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>*)this);
-  }
-
-  Base64DecodeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~Base64DecodeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * base64:encode
- * Author: Zorba Team
- */
-class Base64EncodeIterator : public NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(Base64EncodeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Base64EncodeIterator,
-    NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>*)this);
-  }
-
-  Base64EncodeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~Base64EncodeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_BASE64_BASE64_H
+#define ZORBA_RUNTIME_BASE64_BASE64_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * base64:decode
+ * Author: Zorba Team
+ */
+class Base64DecodeIterator : public NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(Base64DecodeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Base64DecodeIterator,
+    NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>*)this);
+  }
+
+  Base64DecodeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<Base64DecodeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~Base64DecodeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * base64:encode
+ * Author: Zorba Team
+ */
+class Base64EncodeIterator : public NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(Base64EncodeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Base64EncodeIterator,
+    NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>*)this);
+  }
+
+  Base64EncodeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<Base64EncodeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~Base64EncodeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/booleans/pregenerated/booleans.cpp'
--- src/runtime/booleans/pregenerated/booleans.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/booleans/pregenerated/booleans.cpp	2012-05-02 07:17:28 +0000
@@ -1,104 +1,104 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/booleans/booleans.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <IsSameNodeIterator>
-IsSameNodeIterator::class_factory<IsSameNodeIterator>
-IsSameNodeIterator::g_class_factory;
-
-
-void IsSameNodeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-IsSameNodeIterator::~IsSameNodeIterator() {}
-
-// </IsSameNodeIterator>
-
-
-// <NodeBeforeIterator>
-NodeBeforeIterator::class_factory<NodeBeforeIterator>
-NodeBeforeIterator::g_class_factory;
-
-
-void NodeBeforeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-NodeBeforeIterator::~NodeBeforeIterator() {}
-
-// </NodeBeforeIterator>
-
-
-// <NodeAfterIterator>
-NodeAfterIterator::class_factory<NodeAfterIterator>
-NodeAfterIterator::g_class_factory;
-
-
-void NodeAfterIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-NodeAfterIterator::~NodeAfterIterator() {}
-
-// </NodeAfterIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/booleans/booleans.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <IsSameNodeIterator>
+IsSameNodeIterator::class_factory<IsSameNodeIterator>
+IsSameNodeIterator::g_class_factory;
+
+
+void IsSameNodeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+IsSameNodeIterator::~IsSameNodeIterator() {}
+
+// </IsSameNodeIterator>
+
+
+// <NodeBeforeIterator>
+NodeBeforeIterator::class_factory<NodeBeforeIterator>
+NodeBeforeIterator::g_class_factory;
+
+
+void NodeBeforeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+NodeBeforeIterator::~NodeBeforeIterator() {}
+
+// </NodeBeforeIterator>
+
+
+// <NodeAfterIterator>
+NodeAfterIterator::class_factory<NodeAfterIterator>
+NodeAfterIterator::g_class_factory;
+
+
+void NodeAfterIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+NodeAfterIterator::~NodeAfterIterator() {}
+
+// </NodeAfterIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/booleans/pregenerated/booleans.h'
--- src/runtime/booleans/pregenerated/booleans.h	2012-04-24 12:39:38 +0000
+++ src/runtime/booleans/pregenerated/booleans.h	2012-05-02 07:17:28 +0000
@@ -1,144 +1,144 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_BOOLEANS_BOOLEANS_H
-#define ZORBA_RUNTIME_BOOLEANS_BOOLEANS_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * op:is-same-node
- * Author: Zorba Team
- */
-class IsSameNodeIterator : public NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(IsSameNodeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsSameNodeIterator,
-    NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>*)this);
-  }
-
-  IsSameNodeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~IsSameNodeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * op:node-before
- * Author: Zorba Team
- */
-class NodeBeforeIterator : public NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(NodeBeforeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(NodeBeforeIterator,
-    NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>*)this);
-  }
-
-  NodeBeforeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~NodeBeforeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * op:node-after
- * Author: Zorba Team
- */
-class NodeAfterIterator : public NaryBaseIterator<NodeAfterIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(NodeAfterIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(NodeAfterIterator,
-    NaryBaseIterator<NodeAfterIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<NodeAfterIterator, PlanIteratorState>*)this);
-  }
-
-  NodeAfterIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<NodeAfterIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~NodeAfterIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_BOOLEANS_BOOLEANS_H
+#define ZORBA_RUNTIME_BOOLEANS_BOOLEANS_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * op:is-same-node
+ * Author: Zorba Team
+ */
+class IsSameNodeIterator : public NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(IsSameNodeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsSameNodeIterator,
+    NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>*)this);
+  }
+
+  IsSameNodeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<IsSameNodeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~IsSameNodeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * op:node-before
+ * Author: Zorba Team
+ */
+class NodeBeforeIterator : public NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(NodeBeforeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(NodeBeforeIterator,
+    NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>*)this);
+  }
+
+  NodeBeforeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<NodeBeforeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~NodeBeforeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * op:node-after
+ * Author: Zorba Team
+ */
+class NodeAfterIterator : public NaryBaseIterator<NodeAfterIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(NodeAfterIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(NodeAfterIterator,
+    NaryBaseIterator<NodeAfterIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<NodeAfterIterator, PlanIteratorState>*)this);
+  }
+
+  NodeAfterIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<NodeAfterIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~NodeAfterIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/collections/collections_impl.cpp'
--- src/runtime/collections/collections_impl.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/collections/collections_impl.cpp	2012-05-02 07:17:28 +0000
@@ -2504,122 +2504,122 @@
 /*******************************************************************************
   14.8.5 fn:uri-collection
 ********************************************************************************/
-  FnURICollectionIteratorState::~FnURICollectionIteratorState()
-  {
-    if(theIterator != NULL)
-    {
-      if(theIteratorOpened)
-      {
-        theIterator->close();
-        theIteratorOpened = false;
-      }
-      theIterator = NULL;
-    }
-  }
-
-  void FnURICollectionIteratorState::init(PlanState& planState)
-  {
-    PlanIteratorState::init(planState);
-    theIterator = NULL;
-  }
-
-  void FnURICollectionIteratorState::reset(PlanState& planState)
-  {
-    PlanIteratorState::reset(planState);
-
-    if(theIterator != NULL)
-    {
-      if(theIteratorOpened)
-      {
-        theIterator->close();
-        theIteratorOpened = false;
-      }
-      theIterator = NULL;
-    }
-  }
-  
-  bool FnURICollectionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
-  {
-    store::Item_t lURI, resolvedURIItem, lIte;
-    store::Collection_t coll;
-    std::auto_ptr<internal::Resource> lResource;
-    internal::CollectionResource* lCollResource;
-    zstring resolvedURIString;
-    zstring lErrorMessage;
-    zstring docuri;
-
-    FnURICollectionIteratorState* state;
-    DEFAULT_STACK_INIT(FnURICollectionIteratorState, state, planState);
-
-    if(theChildren.size() == 1 &&
-      consumeNext(lURI, theChildren[0].getp(),planState))
-    {
-      try
-      {
-        resolvedURIString= theSctx->resolve_relative_uri(lURI->getStringValue());
-      }
-      catch (ZorbaException const&)
-      {
-        throw XQUERY_EXCEPTION(
-          err::FODC0004,
-          ERROR_PARAMS(lURI->getStringValue(), ZED( BadAnyURI ) ),
-          ERROR_LOC( loc )
-        );
-      }
-    }
-    else
-    {
-      resolvedURIItem = planState.theGlobalDynCtx->get_default_collection();
-
-      if ( NULL == resolvedURIItem )
-        throw XQUERY_EXCEPTION(
-        err::FODC0002,
-        ERROR_PARAMS( ZED( DefaultCollection), ZED( NotDefInDynamicCtx ) ),
-        ERROR_LOC( loc )
-      );
-
-      resolvedURIString = theSctx->resolve_relative_uri(resolvedURIItem->getStringValue());
-    }
-
-    lResource = theSctx->resolve_uri(resolvedURIString,
-                                    internal::EntityData::COLLECTION,
-                                    lErrorMessage);
-
-    lCollResource = dynamic_cast<internal::CollectionResource*>(lResource.get());
-
-    if( lCollResource == 0 || !(coll = lCollResource->getCollection()) )
-    {
-      throw XQUERY_EXCEPTION(
-        err::FODC0002,
-        ERROR_PARAMS( resolvedURIString, lErrorMessage ),
-        ERROR_LOC( loc )
-      );
-    }
-
-    // return collection nodes
-    state->theIterator = coll->getIterator();
-    ZORBA_ASSERT(state->theIterator != NULL);
-    state->theIterator->open();
-    state->theIteratorOpened = true;
-
-    //return the DocumentURI of the Collection
-    while(state->theIterator->next(lIte))
-    {
-      lIte->getDocumentURI(docuri);
-      if(!docuri.empty())
-      {
-        STACK_PUSH(GENV_ITEMFACTORY->createAnyURI(result, docuri), state);
-      }
-    }
-
-    //close iterator
-    state->theIterator->close();
-    state->theIteratorOpened = false;
-
-    STACK_PUSH(false, state);
-    STACK_END(state);
-  
-  }
+FnURICollectionIteratorState::~FnURICollectionIteratorState()
+{
+  if(theIterator != NULL)
+  {
+    if(theIteratorOpened)
+    {
+      theIterator->close();
+      theIteratorOpened = false;
+    }
+    theIterator = NULL;
+  }
+}
+
+void FnURICollectionIteratorState::init(PlanState& planState)
+{
+  PlanIteratorState::init(planState);
+  theIterator = NULL;
+}
+
+void FnURICollectionIteratorState::reset(PlanState& planState)
+{
+  PlanIteratorState::reset(planState);
+
+  if(theIterator != NULL)
+  {
+    if(theIteratorOpened)
+    {
+      theIterator->close();
+      theIteratorOpened = false;
+    }
+    theIterator = NULL;
+  }
+}
+
+bool FnURICollectionIterator::nextImpl(store::Item_t& result, PlanState& planState) const
+{
+  store::Item_t lURI, resolvedURIItem, lIte;
+  store::Collection_t coll;
+  std::auto_ptr<internal::Resource> lResource;
+  internal::CollectionResource* lCollResource;
+  zstring resolvedURIString;
+  zstring lErrorMessage;
+  zstring docuri;
+
+  FnURICollectionIteratorState* state;
+  DEFAULT_STACK_INIT(FnURICollectionIteratorState, state, planState);
+
+  if(theChildren.size() == 1 &&
+    consumeNext(lURI, theChildren[0].getp(),planState))
+  {
+    try
+    {
+      resolvedURIString= theSctx->resolve_relative_uri(lURI->getStringValue());
+    }
+    catch (ZorbaException const&)
+    {
+      throw XQUERY_EXCEPTION(
+        err::FODC0004,
+        ERROR_PARAMS(lURI->getStringValue(), ZED( BadAnyURI ) ),
+        ERROR_LOC( loc )
+      );
+    }
+  }
+  else
+  {
+    resolvedURIItem = planState.theGlobalDynCtx->get_default_collection();
+
+    if ( NULL == resolvedURIItem )
+      throw XQUERY_EXCEPTION(
+      err::FODC0002,
+      ERROR_PARAMS( ZED( DefaultCollection), ZED( NotDefInDynamicCtx ) ),
+      ERROR_LOC( loc )
+    );
+
+    resolvedURIString = theSctx->resolve_relative_uri(resolvedURIItem->getStringValue());
+  }
+
+  lResource = theSctx->resolve_uri(resolvedURIString,
+                                  internal::EntityData::COLLECTION,
+                                  lErrorMessage);
+
+  lCollResource = dynamic_cast<internal::CollectionResource*>(lResource.get());
+
+  if( lCollResource == 0 || !(coll = lCollResource->getCollection()) )
+  {
+    throw XQUERY_EXCEPTION(
+      err::FODC0002,
+      ERROR_PARAMS( resolvedURIString, lErrorMessage ),
+      ERROR_LOC( loc )
+    );
+  }
+
+  // return collection nodes
+  state->theIterator = coll->getIterator();
+  ZORBA_ASSERT(state->theIterator != NULL);
+  state->theIterator->open();
+  state->theIteratorOpened = true;
+
+  //return the DocumentURI of the Collection
+  while(state->theIterator->next(lIte))
+  {
+    lIte->getDocumentURI(docuri);
+    if(!docuri.empty())
+    {
+      STACK_PUSH(GENV_ITEMFACTORY->createAnyURI(result, docuri), state);
+    }
+  }
+
+  //close iterator
+  state->theIterator->close();
+  state->theIteratorOpened = false;
+
+  STACK_PUSH(false, state);
+  STACK_END(state);
+
+}
 
 
 } // namespace zorba

=== modified file 'src/runtime/collections/pregenerated/collections.h'
--- src/runtime/collections/pregenerated/collections.h	2012-04-24 12:39:38 +0000
+++ src/runtime/collections/pregenerated/collections.h	2012-05-02 07:17:28 +0000
@@ -1469,9 +1469,9 @@
 
 /**
  * 
- *      Returns a sequence of xs:anyURI values representing the document URIs of the 
- *      documents in a collection.
- *    
+ *    Returns a sequence of xs:anyURI values representing the document URIs of the 
+ *    documents in a collection.
+ *  
  * Author: Zorba Team
  */
 class FnURICollectionIteratorState : public PlanIteratorState

=== modified file 'src/runtime/context/pregenerated/context.cpp'
--- src/runtime/context/pregenerated/context.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/context/pregenerated/context.cpp	2012-05-02 07:17:28 +0000
@@ -1,148 +1,148 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/context/context.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <CurrentDateTimeIterator>
-CurrentDateTimeIterator::class_factory<CurrentDateTimeIterator>
-CurrentDateTimeIterator::g_class_factory;
-
-
-void CurrentDateTimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-CurrentDateTimeIterator::~CurrentDateTimeIterator() {}
-
-// </CurrentDateTimeIterator>
-
-
-// <CurrentDateIterator>
-CurrentDateIterator::class_factory<CurrentDateIterator>
-CurrentDateIterator::g_class_factory;
-
-
-void CurrentDateIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-CurrentDateIterator::~CurrentDateIterator() {}
-
-// </CurrentDateIterator>
-
-
-// <CurrentTimeIterator>
-CurrentTimeIterator::class_factory<CurrentTimeIterator>
-CurrentTimeIterator::g_class_factory;
-
-
-void CurrentTimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-CurrentTimeIterator::~CurrentTimeIterator() {}
-
-// </CurrentTimeIterator>
-
-
-// <ImplicitTimezoneIterator>
-ImplicitTimezoneIterator::class_factory<ImplicitTimezoneIterator>
-ImplicitTimezoneIterator::g_class_factory;
-
-
-void ImplicitTimezoneIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-ImplicitTimezoneIterator::~ImplicitTimezoneIterator() {}
-
-// </ImplicitTimezoneIterator>
-
-
-// <DefaultCollationIterator>
-DefaultCollationIterator::class_factory<DefaultCollationIterator>
-DefaultCollationIterator::g_class_factory;
-
-
-void DefaultCollationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DefaultCollationIterator::~DefaultCollationIterator() {}
-
-// </DefaultCollationIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/context/context.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <CurrentDateTimeIterator>
+CurrentDateTimeIterator::class_factory<CurrentDateTimeIterator>
+CurrentDateTimeIterator::g_class_factory;
+
+
+void CurrentDateTimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+CurrentDateTimeIterator::~CurrentDateTimeIterator() {}
+
+// </CurrentDateTimeIterator>
+
+
+// <CurrentDateIterator>
+CurrentDateIterator::class_factory<CurrentDateIterator>
+CurrentDateIterator::g_class_factory;
+
+
+void CurrentDateIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+CurrentDateIterator::~CurrentDateIterator() {}
+
+// </CurrentDateIterator>
+
+
+// <CurrentTimeIterator>
+CurrentTimeIterator::class_factory<CurrentTimeIterator>
+CurrentTimeIterator::g_class_factory;
+
+
+void CurrentTimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+CurrentTimeIterator::~CurrentTimeIterator() {}
+
+// </CurrentTimeIterator>
+
+
+// <ImplicitTimezoneIterator>
+ImplicitTimezoneIterator::class_factory<ImplicitTimezoneIterator>
+ImplicitTimezoneIterator::g_class_factory;
+
+
+void ImplicitTimezoneIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+ImplicitTimezoneIterator::~ImplicitTimezoneIterator() {}
+
+// </ImplicitTimezoneIterator>
+
+
+// <DefaultCollationIterator>
+DefaultCollationIterator::class_factory<DefaultCollationIterator>
+DefaultCollationIterator::g_class_factory;
+
+
+void DefaultCollationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DefaultCollationIterator::~DefaultCollationIterator() {}
+
+// </DefaultCollationIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/context/pregenerated/context.h'
--- src/runtime/context/pregenerated/context.h	2012-04-24 12:39:38 +0000
+++ src/runtime/context/pregenerated/context.h	2012-05-02 07:17:28 +0000
@@ -1,212 +1,212 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_CONTEXT_CONTEXT_H
-#define ZORBA_RUNTIME_CONTEXT_CONTEXT_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * fn:current-dateTime
- * Author: Zorba Team
- */
-class CurrentDateTimeIterator : public NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(CurrentDateTimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentDateTimeIterator,
-    NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>*)this);
-  }
-
-  CurrentDateTimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~CurrentDateTimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:current-date
- * Author: Zorba Team
- */
-class CurrentDateIterator : public NaryBaseIterator<CurrentDateIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(CurrentDateIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentDateIterator,
-    NaryBaseIterator<CurrentDateIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<CurrentDateIterator, PlanIteratorState>*)this);
-  }
-
-  CurrentDateIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<CurrentDateIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~CurrentDateIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:current-time
- * Author: Zorba Team
- */
-class CurrentTimeIterator : public NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(CurrentTimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentTimeIterator,
-    NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>*)this);
-  }
-
-  CurrentTimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~CurrentTimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:implicit-timezone
- * Author: Zorba Team
- */
-class ImplicitTimezoneIterator : public NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ImplicitTimezoneIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ImplicitTimezoneIterator,
-    NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>*)this);
-  }
-
-  ImplicitTimezoneIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~ImplicitTimezoneIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:default-collation
- * Author: Zorba Team
- */
-class DefaultCollationIterator : public NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DefaultCollationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultCollationIterator,
-    NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>*)this);
-  }
-
-  DefaultCollationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~DefaultCollationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_CONTEXT_CONTEXT_H
+#define ZORBA_RUNTIME_CONTEXT_CONTEXT_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * fn:current-dateTime
+ * Author: Zorba Team
+ */
+class CurrentDateTimeIterator : public NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(CurrentDateTimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentDateTimeIterator,
+    NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>*)this);
+  }
+
+  CurrentDateTimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<CurrentDateTimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~CurrentDateTimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:current-date
+ * Author: Zorba Team
+ */
+class CurrentDateIterator : public NaryBaseIterator<CurrentDateIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(CurrentDateIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentDateIterator,
+    NaryBaseIterator<CurrentDateIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<CurrentDateIterator, PlanIteratorState>*)this);
+  }
+
+  CurrentDateIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<CurrentDateIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~CurrentDateIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:current-time
+ * Author: Zorba Team
+ */
+class CurrentTimeIterator : public NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(CurrentTimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CurrentTimeIterator,
+    NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>*)this);
+  }
+
+  CurrentTimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<CurrentTimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~CurrentTimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:implicit-timezone
+ * Author: Zorba Team
+ */
+class ImplicitTimezoneIterator : public NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ImplicitTimezoneIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ImplicitTimezoneIterator,
+    NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>*)this);
+  }
+
+  ImplicitTimezoneIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<ImplicitTimezoneIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~ImplicitTimezoneIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:default-collation
+ * Author: Zorba Team
+ */
+class DefaultCollationIterator : public NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DefaultCollationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultCollationIterator,
+    NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>*)this);
+  }
+
+  DefaultCollationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DefaultCollationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~DefaultCollationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/debug/pregenerated/debug_iterator.cpp'
--- src/runtime/debug/pregenerated/debug_iterator.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/debug/pregenerated/debug_iterator.cpp	2012-05-02 07:17:28 +0000
@@ -1,75 +1,75 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/debug/debug_iterator.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-#ifdef ZORBA_WITH_DEBUGGER
-// <DebugIterator>
-DebugIterator::class_factory<DebugIterator>
-DebugIterator::g_class_factory;
-
-
-void DebugIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DebugIterator::~DebugIterator() {}
-
-DebugIteratorState::DebugIteratorState() {}
-
-DebugIteratorState::~DebugIteratorState() {}
-
-
-void DebugIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-  notEmptySequence = false;
-}
-
-void DebugIteratorState::reset(PlanState& planState) {
-  PlanIteratorState::reset(planState);
-  notEmptySequence = false;
-}
-// </DebugIterator>
-
-#endif
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/debug/debug_iterator.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+#ifdef ZORBA_WITH_DEBUGGER
+// <DebugIterator>
+DebugIterator::class_factory<DebugIterator>
+DebugIterator::g_class_factory;
+
+
+void DebugIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DebugIterator::~DebugIterator() {}
+
+DebugIteratorState::DebugIteratorState() {}
+
+DebugIteratorState::~DebugIteratorState() {}
+
+
+void DebugIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+  notEmptySequence = false;
+}
+
+void DebugIteratorState::reset(PlanState& planState) {
+  PlanIteratorState::reset(planState);
+  notEmptySequence = false;
+}
+// </DebugIterator>
+
+#endif
+
+}
+
+

=== modified file 'src/runtime/debug/pregenerated/debug_iterator.h'
--- src/runtime/debug/pregenerated/debug_iterator.h	2012-04-24 12:39:38 +0000
+++ src/runtime/debug/pregenerated/debug_iterator.h	2012-05-02 07:17:28 +0000
@@ -1,135 +1,135 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_DEBUG_DEBUG_ITERATOR_H
-#define ZORBA_RUNTIME_DEBUG_DEBUG_ITERATOR_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-#include <vector>
-#include <map>
-#include <string>
-#include "runtime/util/plan_wrapper_holder.h"
-#include "zorba/options.h"
-#include "store/api/item.h"
-#include "types/typeimpl.h"
-
-
-namespace zorba {
-
-#ifdef ZORBA_WITH_DEBUGGER
-/**
- * 
- *      This iterator wrapps iterators in which represents breakable expression
- *      if the query is compiled in debug mode. It is used to break expressions,
- *      interrupt the execution and evaluate expressions while the engine is
- *      suspended.
- *    
- * Author: Zorba Team
- */
-class DebugIteratorState : public PlanIteratorState
-{
-public:
-  bool notEmptySequence; //
-
-  DebugIteratorState();
-
-  ~DebugIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class DebugIterator : public NaryBaseIterator<DebugIterator, DebugIteratorState>
-{ 
-protected:
-  checked_vector<store::Item_t> varnames; //
-  checked_vector<xqtref_t> vartypes; //
-  std::vector<DebugIterator*> theDebuggerChildren; //
-  DebugIterator* theDebuggerParent; //
-  bool theIsVarDeclaration; //
-public:
-  SERIALIZABLE_CLASS(DebugIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DebugIterator,
-    NaryBaseIterator<DebugIterator, DebugIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DebugIterator, DebugIteratorState>*)this);
-
-    ar & varnames;
-    ar & vartypes;
-    ar & theDebuggerChildren;
-    ar & theDebuggerParent;
-    ar & theIsVarDeclaration;
-  }
-
-  DebugIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DebugIterator, DebugIteratorState>(sctx, loc, children),
-    varnames(),
-    vartypes(),
-    theDebuggerChildren(),
-    theDebuggerParent(),
-    theIsVarDeclaration()
-  {}
-
-  virtual ~DebugIterator();
-
-  bool isVarDeclaration() const { return theIsVarDeclaration; }
-
-  void setVarDeclaration(bool aValue) { theIsVarDeclaration= aValue; }
-
-public:
-  const DebugIterator* getDebuggerParent() const;
-  std::vector<DebugIterator*> getDebuggerChildren() const;
-  const DebugIterator* getOverIterator() const;
-  QueryLoc getQueryLocation() const;
-  std::list<std::pair<zstring, zstring> > eval(PlanState* aState, Zorba_SerializerOptions* aSerOptions) const;
-  void checkBreak(PlanState* aState) const;
-  void setParent(DebugIterator* aParent);
-  void addChild(DebugIterator* aChild);
-  void setChildren(std::vector<PlanIter_t>* args);
-  void setVariables(checked_vector<store::Item_t> aVarNames, checked_vector<xqtref_t> aVarTypes);
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-#endif
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_DEBUG_DEBUG_ITERATOR_H
+#define ZORBA_RUNTIME_DEBUG_DEBUG_ITERATOR_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+#include <vector>
+#include <map>
+#include <string>
+#include "runtime/util/plan_wrapper_holder.h"
+#include "zorba/options.h"
+#include "store/api/item.h"
+#include "types/typeimpl.h"
+
+
+namespace zorba {
+
+#ifdef ZORBA_WITH_DEBUGGER
+/**
+ * 
+ *      This iterator wrapps iterators in which represents breakable expression
+ *      if the query is compiled in debug mode. It is used to break expressions,
+ *      interrupt the execution and evaluate expressions while the engine is
+ *      suspended.
+ *    
+ * Author: Zorba Team
+ */
+class DebugIteratorState : public PlanIteratorState
+{
+public:
+  bool notEmptySequence; //
+
+  DebugIteratorState();
+
+  ~DebugIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class DebugIterator : public NaryBaseIterator<DebugIterator, DebugIteratorState>
+{ 
+protected:
+  checked_vector<store::Item_t> varnames; //
+  checked_vector<xqtref_t> vartypes; //
+  std::vector<DebugIterator*> theDebuggerChildren; //
+  DebugIterator* theDebuggerParent; //
+  bool theIsVarDeclaration; //
+public:
+  SERIALIZABLE_CLASS(DebugIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DebugIterator,
+    NaryBaseIterator<DebugIterator, DebugIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DebugIterator, DebugIteratorState>*)this);
+
+    ar & varnames;
+    ar & vartypes;
+    ar & theDebuggerChildren;
+    ar & theDebuggerParent;
+    ar & theIsVarDeclaration;
+  }
+
+  DebugIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DebugIterator, DebugIteratorState>(sctx, loc, children),
+    varnames(),
+    vartypes(),
+    theDebuggerChildren(),
+    theDebuggerParent(),
+    theIsVarDeclaration()
+  {}
+
+  virtual ~DebugIterator();
+
+  bool isVarDeclaration() const { return theIsVarDeclaration; }
+
+  void setVarDeclaration(bool aValue) { theIsVarDeclaration= aValue; }
+
+public:
+  const DebugIterator* getDebuggerParent() const;
+  std::vector<DebugIterator*> getDebuggerChildren() const;
+  const DebugIterator* getOverIterator() const;
+  QueryLoc getQueryLocation() const;
+  std::list<std::pair<zstring, zstring> > eval(PlanState* aState, Zorba_SerializerOptions* aSerOptions) const;
+  void checkBreak(PlanState* aState) const;
+  void setParent(DebugIterator* aParent);
+  void addChild(DebugIterator* aChild);
+  void setChildren(std::vector<PlanIter_t>* args);
+  void setVariables(checked_vector<store::Item_t> aVarNames, checked_vector<xqtref_t> aVarTypes);
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+#endif
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/durations_dates_times/pregenerated/durations_dates_times.cpp'
--- src/runtime/durations_dates_times/pregenerated/durations_dates_times.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/durations_dates_times/pregenerated/durations_dates_times.cpp	2012-05-02 07:17:28 +0000
@@ -1,500 +1,500 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/durations_dates_times/durations_dates_times.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <YearsFromDurationIterator>
-YearsFromDurationIterator::class_factory<YearsFromDurationIterator>
-YearsFromDurationIterator::g_class_factory;
-
-
-void YearsFromDurationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-YearsFromDurationIterator::~YearsFromDurationIterator() {}
-
-// </YearsFromDurationIterator>
-
-
-// <MonthsFromDurationIterator>
-MonthsFromDurationIterator::class_factory<MonthsFromDurationIterator>
-MonthsFromDurationIterator::g_class_factory;
-
-
-void MonthsFromDurationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-MonthsFromDurationIterator::~MonthsFromDurationIterator() {}
-
-// </MonthsFromDurationIterator>
-
-
-// <DaysFromDurationIterator>
-DaysFromDurationIterator::class_factory<DaysFromDurationIterator>
-DaysFromDurationIterator::g_class_factory;
-
-
-void DaysFromDurationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DaysFromDurationIterator::~DaysFromDurationIterator() {}
-
-// </DaysFromDurationIterator>
-
-
-// <HoursFromDurationIterator>
-HoursFromDurationIterator::class_factory<HoursFromDurationIterator>
-HoursFromDurationIterator::g_class_factory;
-
-
-void HoursFromDurationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-HoursFromDurationIterator::~HoursFromDurationIterator() {}
-
-// </HoursFromDurationIterator>
-
-
-// <MinutesFromDurationIterator>
-MinutesFromDurationIterator::class_factory<MinutesFromDurationIterator>
-MinutesFromDurationIterator::g_class_factory;
-
-
-void MinutesFromDurationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-MinutesFromDurationIterator::~MinutesFromDurationIterator() {}
-
-// </MinutesFromDurationIterator>
-
-
-// <SecondsFromDurationIterator>
-SecondsFromDurationIterator::class_factory<SecondsFromDurationIterator>
-SecondsFromDurationIterator::g_class_factory;
-
-
-void SecondsFromDurationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-SecondsFromDurationIterator::~SecondsFromDurationIterator() {}
-
-// </SecondsFromDurationIterator>
-
-
-// <YearFromDatetimeIterator>
-YearFromDatetimeIterator::class_factory<YearFromDatetimeIterator>
-YearFromDatetimeIterator::g_class_factory;
-
-
-void YearFromDatetimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-YearFromDatetimeIterator::~YearFromDatetimeIterator() {}
-
-// </YearFromDatetimeIterator>
-
-
-// <MonthFromDatetimeIterator>
-MonthFromDatetimeIterator::class_factory<MonthFromDatetimeIterator>
-MonthFromDatetimeIterator::g_class_factory;
-
-
-void MonthFromDatetimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-MonthFromDatetimeIterator::~MonthFromDatetimeIterator() {}
-
-// </MonthFromDatetimeIterator>
-
-
-// <DayFromDatetimeIterator>
-DayFromDatetimeIterator::class_factory<DayFromDatetimeIterator>
-DayFromDatetimeIterator::g_class_factory;
-
-
-void DayFromDatetimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DayFromDatetimeIterator::~DayFromDatetimeIterator() {}
-
-// </DayFromDatetimeIterator>
-
-
-// <HoursFromDatetimeIterator>
-HoursFromDatetimeIterator::class_factory<HoursFromDatetimeIterator>
-HoursFromDatetimeIterator::g_class_factory;
-
-
-void HoursFromDatetimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-HoursFromDatetimeIterator::~HoursFromDatetimeIterator() {}
-
-// </HoursFromDatetimeIterator>
-
-
-// <MinutesFromDatetimeIterator>
-MinutesFromDatetimeIterator::class_factory<MinutesFromDatetimeIterator>
-MinutesFromDatetimeIterator::g_class_factory;
-
-
-void MinutesFromDatetimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-MinutesFromDatetimeIterator::~MinutesFromDatetimeIterator() {}
-
-// </MinutesFromDatetimeIterator>
-
-
-// <SecondsFromDatetimeIterator>
-SecondsFromDatetimeIterator::class_factory<SecondsFromDatetimeIterator>
-SecondsFromDatetimeIterator::g_class_factory;
-
-
-void SecondsFromDatetimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-SecondsFromDatetimeIterator::~SecondsFromDatetimeIterator() {}
-
-// </SecondsFromDatetimeIterator>
-
-
-// <TimezoneFromDatetimeIterator>
-TimezoneFromDatetimeIterator::class_factory<TimezoneFromDatetimeIterator>
-TimezoneFromDatetimeIterator::g_class_factory;
-
-
-void TimezoneFromDatetimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-TimezoneFromDatetimeIterator::~TimezoneFromDatetimeIterator() {}
-
-// </TimezoneFromDatetimeIterator>
-
-
-// <YearFromDateIterator>
-YearFromDateIterator::class_factory<YearFromDateIterator>
-YearFromDateIterator::g_class_factory;
-
-
-void YearFromDateIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-YearFromDateIterator::~YearFromDateIterator() {}
-
-// </YearFromDateIterator>
-
-
-// <MonthFromDateIterator>
-MonthFromDateIterator::class_factory<MonthFromDateIterator>
-MonthFromDateIterator::g_class_factory;
-
-
-void MonthFromDateIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-MonthFromDateIterator::~MonthFromDateIterator() {}
-
-// </MonthFromDateIterator>
-
-
-// <DayFromDateIterator>
-DayFromDateIterator::class_factory<DayFromDateIterator>
-DayFromDateIterator::g_class_factory;
-
-
-void DayFromDateIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DayFromDateIterator::~DayFromDateIterator() {}
-
-// </DayFromDateIterator>
-
-
-// <TimezoneFromDateIterator>
-TimezoneFromDateIterator::class_factory<TimezoneFromDateIterator>
-TimezoneFromDateIterator::g_class_factory;
-
-
-void TimezoneFromDateIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-TimezoneFromDateIterator::~TimezoneFromDateIterator() {}
-
-// </TimezoneFromDateIterator>
-
-
-// <HoursFromTimeIterator>
-HoursFromTimeIterator::class_factory<HoursFromTimeIterator>
-HoursFromTimeIterator::g_class_factory;
-
-
-void HoursFromTimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-HoursFromTimeIterator::~HoursFromTimeIterator() {}
-
-// </HoursFromTimeIterator>
-
-
-// <MinutesFromTimeIterator>
-MinutesFromTimeIterator::class_factory<MinutesFromTimeIterator>
-MinutesFromTimeIterator::g_class_factory;
-
-
-void MinutesFromTimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-MinutesFromTimeIterator::~MinutesFromTimeIterator() {}
-
-// </MinutesFromTimeIterator>
-
-
-// <SecondsFromTimeIterator>
-SecondsFromTimeIterator::class_factory<SecondsFromTimeIterator>
-SecondsFromTimeIterator::g_class_factory;
-
-
-void SecondsFromTimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-SecondsFromTimeIterator::~SecondsFromTimeIterator() {}
-
-// </SecondsFromTimeIterator>
-
-
-// <TimezoneFromTimeIterator>
-TimezoneFromTimeIterator::class_factory<TimezoneFromTimeIterator>
-TimezoneFromTimeIterator::g_class_factory;
-
-
-void TimezoneFromTimeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-TimezoneFromTimeIterator::~TimezoneFromTimeIterator() {}
-
-// </TimezoneFromTimeIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/durations_dates_times/durations_dates_times.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <YearsFromDurationIterator>
+YearsFromDurationIterator::class_factory<YearsFromDurationIterator>
+YearsFromDurationIterator::g_class_factory;
+
+
+void YearsFromDurationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+YearsFromDurationIterator::~YearsFromDurationIterator() {}
+
+// </YearsFromDurationIterator>
+
+
+// <MonthsFromDurationIterator>
+MonthsFromDurationIterator::class_factory<MonthsFromDurationIterator>
+MonthsFromDurationIterator::g_class_factory;
+
+
+void MonthsFromDurationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+MonthsFromDurationIterator::~MonthsFromDurationIterator() {}
+
+// </MonthsFromDurationIterator>
+
+
+// <DaysFromDurationIterator>
+DaysFromDurationIterator::class_factory<DaysFromDurationIterator>
+DaysFromDurationIterator::g_class_factory;
+
+
+void DaysFromDurationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DaysFromDurationIterator::~DaysFromDurationIterator() {}
+
+// </DaysFromDurationIterator>
+
+
+// <HoursFromDurationIterator>
+HoursFromDurationIterator::class_factory<HoursFromDurationIterator>
+HoursFromDurationIterator::g_class_factory;
+
+
+void HoursFromDurationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+HoursFromDurationIterator::~HoursFromDurationIterator() {}
+
+// </HoursFromDurationIterator>
+
+
+// <MinutesFromDurationIterator>
+MinutesFromDurationIterator::class_factory<MinutesFromDurationIterator>
+MinutesFromDurationIterator::g_class_factory;
+
+
+void MinutesFromDurationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+MinutesFromDurationIterator::~MinutesFromDurationIterator() {}
+
+// </MinutesFromDurationIterator>
+
+
+// <SecondsFromDurationIterator>
+SecondsFromDurationIterator::class_factory<SecondsFromDurationIterator>
+SecondsFromDurationIterator::g_class_factory;
+
+
+void SecondsFromDurationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+SecondsFromDurationIterator::~SecondsFromDurationIterator() {}
+
+// </SecondsFromDurationIterator>
+
+
+// <YearFromDatetimeIterator>
+YearFromDatetimeIterator::class_factory<YearFromDatetimeIterator>
+YearFromDatetimeIterator::g_class_factory;
+
+
+void YearFromDatetimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+YearFromDatetimeIterator::~YearFromDatetimeIterator() {}
+
+// </YearFromDatetimeIterator>
+
+
+// <MonthFromDatetimeIterator>
+MonthFromDatetimeIterator::class_factory<MonthFromDatetimeIterator>
+MonthFromDatetimeIterator::g_class_factory;
+
+
+void MonthFromDatetimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+MonthFromDatetimeIterator::~MonthFromDatetimeIterator() {}
+
+// </MonthFromDatetimeIterator>
+
+
+// <DayFromDatetimeIterator>
+DayFromDatetimeIterator::class_factory<DayFromDatetimeIterator>
+DayFromDatetimeIterator::g_class_factory;
+
+
+void DayFromDatetimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DayFromDatetimeIterator::~DayFromDatetimeIterator() {}
+
+// </DayFromDatetimeIterator>
+
+
+// <HoursFromDatetimeIterator>
+HoursFromDatetimeIterator::class_factory<HoursFromDatetimeIterator>
+HoursFromDatetimeIterator::g_class_factory;
+
+
+void HoursFromDatetimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+HoursFromDatetimeIterator::~HoursFromDatetimeIterator() {}
+
+// </HoursFromDatetimeIterator>
+
+
+// <MinutesFromDatetimeIterator>
+MinutesFromDatetimeIterator::class_factory<MinutesFromDatetimeIterator>
+MinutesFromDatetimeIterator::g_class_factory;
+
+
+void MinutesFromDatetimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+MinutesFromDatetimeIterator::~MinutesFromDatetimeIterator() {}
+
+// </MinutesFromDatetimeIterator>
+
+
+// <SecondsFromDatetimeIterator>
+SecondsFromDatetimeIterator::class_factory<SecondsFromDatetimeIterator>
+SecondsFromDatetimeIterator::g_class_factory;
+
+
+void SecondsFromDatetimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+SecondsFromDatetimeIterator::~SecondsFromDatetimeIterator() {}
+
+// </SecondsFromDatetimeIterator>
+
+
+// <TimezoneFromDatetimeIterator>
+TimezoneFromDatetimeIterator::class_factory<TimezoneFromDatetimeIterator>
+TimezoneFromDatetimeIterator::g_class_factory;
+
+
+void TimezoneFromDatetimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+TimezoneFromDatetimeIterator::~TimezoneFromDatetimeIterator() {}
+
+// </TimezoneFromDatetimeIterator>
+
+
+// <YearFromDateIterator>
+YearFromDateIterator::class_factory<YearFromDateIterator>
+YearFromDateIterator::g_class_factory;
+
+
+void YearFromDateIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+YearFromDateIterator::~YearFromDateIterator() {}
+
+// </YearFromDateIterator>
+
+
+// <MonthFromDateIterator>
+MonthFromDateIterator::class_factory<MonthFromDateIterator>
+MonthFromDateIterator::g_class_factory;
+
+
+void MonthFromDateIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+MonthFromDateIterator::~MonthFromDateIterator() {}
+
+// </MonthFromDateIterator>
+
+
+// <DayFromDateIterator>
+DayFromDateIterator::class_factory<DayFromDateIterator>
+DayFromDateIterator::g_class_factory;
+
+
+void DayFromDateIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DayFromDateIterator::~DayFromDateIterator() {}
+
+// </DayFromDateIterator>
+
+
+// <TimezoneFromDateIterator>
+TimezoneFromDateIterator::class_factory<TimezoneFromDateIterator>
+TimezoneFromDateIterator::g_class_factory;
+
+
+void TimezoneFromDateIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+TimezoneFromDateIterator::~TimezoneFromDateIterator() {}
+
+// </TimezoneFromDateIterator>
+
+
+// <HoursFromTimeIterator>
+HoursFromTimeIterator::class_factory<HoursFromTimeIterator>
+HoursFromTimeIterator::g_class_factory;
+
+
+void HoursFromTimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+HoursFromTimeIterator::~HoursFromTimeIterator() {}
+
+// </HoursFromTimeIterator>
+
+
+// <MinutesFromTimeIterator>
+MinutesFromTimeIterator::class_factory<MinutesFromTimeIterator>
+MinutesFromTimeIterator::g_class_factory;
+
+
+void MinutesFromTimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+MinutesFromTimeIterator::~MinutesFromTimeIterator() {}
+
+// </MinutesFromTimeIterator>
+
+
+// <SecondsFromTimeIterator>
+SecondsFromTimeIterator::class_factory<SecondsFromTimeIterator>
+SecondsFromTimeIterator::g_class_factory;
+
+
+void SecondsFromTimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+SecondsFromTimeIterator::~SecondsFromTimeIterator() {}
+
+// </SecondsFromTimeIterator>
+
+
+// <TimezoneFromTimeIterator>
+TimezoneFromTimeIterator::class_factory<TimezoneFromTimeIterator>
+TimezoneFromTimeIterator::g_class_factory;
+
+
+void TimezoneFromTimeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+TimezoneFromTimeIterator::~TimezoneFromTimeIterator() {}
+
+// </TimezoneFromTimeIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/durations_dates_times/pregenerated/durations_dates_times.h'
--- src/runtime/durations_dates_times/pregenerated/durations_dates_times.h	2012-04-24 12:39:38 +0000
+++ src/runtime/durations_dates_times/pregenerated/durations_dates_times.h	2012-05-02 07:17:28 +0000
@@ -1,756 +1,756 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_DURATIONS_DATES_TIMES_DURATIONS_DATES_TIMES_H
-#define ZORBA_RUNTIME_DURATIONS_DATES_TIMES_DURATIONS_DATES_TIMES_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * fn:years-from-duration
- * Author: Zorba Team
- */
-class YearsFromDurationIterator : public NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(YearsFromDurationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(YearsFromDurationIterator,
-    NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>*)this);
-  }
-
-  YearsFromDurationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~YearsFromDurationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:months-from-duration
- * Author: Zorba Team
- */
-class MonthsFromDurationIterator : public NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(MonthsFromDurationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MonthsFromDurationIterator,
-    NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>*)this);
-  }
-
-  MonthsFromDurationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~MonthsFromDurationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:days-from-duration
- * Author: Zorba Team
- */
-class DaysFromDurationIterator : public NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DaysFromDurationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DaysFromDurationIterator,
-    NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>*)this);
-  }
-
-  DaysFromDurationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~DaysFromDurationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:hours-from-duration
- * Author: Zorba Team
- */
-class HoursFromDurationIterator : public NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(HoursFromDurationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(HoursFromDurationIterator,
-    NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>*)this);
-  }
-
-  HoursFromDurationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~HoursFromDurationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:minutes-from-duration
- * Author: Zorba Team
- */
-class MinutesFromDurationIterator : public NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(MinutesFromDurationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MinutesFromDurationIterator,
-    NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>*)this);
-  }
-
-  MinutesFromDurationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~MinutesFromDurationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:seconds-from-duration
- * Author: Zorba Team
- */
-class SecondsFromDurationIterator : public NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SecondsFromDurationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SecondsFromDurationIterator,
-    NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>*)this);
-  }
-
-  SecondsFromDurationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~SecondsFromDurationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:year-from-dateTime
- * Author: Zorba Team
- */
-class YearFromDatetimeIterator : public NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(YearFromDatetimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(YearFromDatetimeIterator,
-    NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>*)this);
-  }
-
-  YearFromDatetimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~YearFromDatetimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:month-from-dateTime
- * Author: Zorba Team
- */
-class MonthFromDatetimeIterator : public NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(MonthFromDatetimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MonthFromDatetimeIterator,
-    NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>*)this);
-  }
-
-  MonthFromDatetimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~MonthFromDatetimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:day-from-dateTime
- * Author: Zorba Team
- */
-class DayFromDatetimeIterator : public NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DayFromDatetimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DayFromDatetimeIterator,
-    NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>*)this);
-  }
-
-  DayFromDatetimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~DayFromDatetimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:hours-from-dateTime
- * Author: Zorba Team
- */
-class HoursFromDatetimeIterator : public NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(HoursFromDatetimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(HoursFromDatetimeIterator,
-    NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>*)this);
-  }
-
-  HoursFromDatetimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~HoursFromDatetimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:minutes-from-dateTime
- * Author: Zorba Team
- */
-class MinutesFromDatetimeIterator : public NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(MinutesFromDatetimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MinutesFromDatetimeIterator,
-    NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>*)this);
-  }
-
-  MinutesFromDatetimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~MinutesFromDatetimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:seconds-from-dateTime
- * Author: Zorba Team
- */
-class SecondsFromDatetimeIterator : public NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SecondsFromDatetimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SecondsFromDatetimeIterator,
-    NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>*)this);
-  }
-
-  SecondsFromDatetimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~SecondsFromDatetimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:timezone-from-dateTime
- * Author: Zorba Team
- */
-class TimezoneFromDatetimeIterator : public NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(TimezoneFromDatetimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TimezoneFromDatetimeIterator,
-    NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>*)this);
-  }
-
-  TimezoneFromDatetimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~TimezoneFromDatetimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:year-from-date
- * Author: Zorba Team
- */
-class YearFromDateIterator : public NaryBaseIterator<YearFromDateIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(YearFromDateIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(YearFromDateIterator,
-    NaryBaseIterator<YearFromDateIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<YearFromDateIterator, PlanIteratorState>*)this);
-  }
-
-  YearFromDateIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<YearFromDateIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~YearFromDateIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:month-from-date
- * Author: Zorba Team
- */
-class MonthFromDateIterator : public NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(MonthFromDateIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MonthFromDateIterator,
-    NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>*)this);
-  }
-
-  MonthFromDateIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~MonthFromDateIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:day-from-date
- * Author: Zorba Team
- */
-class DayFromDateIterator : public NaryBaseIterator<DayFromDateIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DayFromDateIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DayFromDateIterator,
-    NaryBaseIterator<DayFromDateIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DayFromDateIterator, PlanIteratorState>*)this);
-  }
-
-  DayFromDateIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DayFromDateIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~DayFromDateIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:timezone-from-date
- * Author: Zorba Team
- */
-class TimezoneFromDateIterator : public NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(TimezoneFromDateIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TimezoneFromDateIterator,
-    NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>*)this);
-  }
-
-  TimezoneFromDateIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~TimezoneFromDateIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:hours-from-time
- * Author: Zorba Team
- */
-class HoursFromTimeIterator : public NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(HoursFromTimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(HoursFromTimeIterator,
-    NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>*)this);
-  }
-
-  HoursFromTimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~HoursFromTimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:minutes-from-time
- * Author: Zorba Team
- */
-class MinutesFromTimeIterator : public NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(MinutesFromTimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MinutesFromTimeIterator,
-    NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>*)this);
-  }
-
-  MinutesFromTimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~MinutesFromTimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:seconds-from-time
- * Author: Zorba Team
- */
-class SecondsFromTimeIterator : public NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SecondsFromTimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SecondsFromTimeIterator,
-    NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>*)this);
-  }
-
-  SecondsFromTimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~SecondsFromTimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:timezone-from-time
- * Author: Zorba Team
- */
-class TimezoneFromTimeIterator : public NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(TimezoneFromTimeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TimezoneFromTimeIterator,
-    NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>*)this);
-  }
-
-  TimezoneFromTimeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~TimezoneFromTimeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_DURATIONS_DATES_TIMES_DURATIONS_DATES_TIMES_H
+#define ZORBA_RUNTIME_DURATIONS_DATES_TIMES_DURATIONS_DATES_TIMES_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * fn:years-from-duration
+ * Author: Zorba Team
+ */
+class YearsFromDurationIterator : public NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(YearsFromDurationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(YearsFromDurationIterator,
+    NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>*)this);
+  }
+
+  YearsFromDurationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<YearsFromDurationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~YearsFromDurationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:months-from-duration
+ * Author: Zorba Team
+ */
+class MonthsFromDurationIterator : public NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(MonthsFromDurationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MonthsFromDurationIterator,
+    NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>*)this);
+  }
+
+  MonthsFromDurationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<MonthsFromDurationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~MonthsFromDurationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:days-from-duration
+ * Author: Zorba Team
+ */
+class DaysFromDurationIterator : public NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DaysFromDurationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DaysFromDurationIterator,
+    NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>*)this);
+  }
+
+  DaysFromDurationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DaysFromDurationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~DaysFromDurationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:hours-from-duration
+ * Author: Zorba Team
+ */
+class HoursFromDurationIterator : public NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(HoursFromDurationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(HoursFromDurationIterator,
+    NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>*)this);
+  }
+
+  HoursFromDurationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<HoursFromDurationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~HoursFromDurationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:minutes-from-duration
+ * Author: Zorba Team
+ */
+class MinutesFromDurationIterator : public NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(MinutesFromDurationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MinutesFromDurationIterator,
+    NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>*)this);
+  }
+
+  MinutesFromDurationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<MinutesFromDurationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~MinutesFromDurationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:seconds-from-duration
+ * Author: Zorba Team
+ */
+class SecondsFromDurationIterator : public NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SecondsFromDurationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SecondsFromDurationIterator,
+    NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>*)this);
+  }
+
+  SecondsFromDurationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<SecondsFromDurationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~SecondsFromDurationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:year-from-dateTime
+ * Author: Zorba Team
+ */
+class YearFromDatetimeIterator : public NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(YearFromDatetimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(YearFromDatetimeIterator,
+    NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>*)this);
+  }
+
+  YearFromDatetimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<YearFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~YearFromDatetimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:month-from-dateTime
+ * Author: Zorba Team
+ */
+class MonthFromDatetimeIterator : public NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(MonthFromDatetimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MonthFromDatetimeIterator,
+    NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>*)this);
+  }
+
+  MonthFromDatetimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<MonthFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~MonthFromDatetimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:day-from-dateTime
+ * Author: Zorba Team
+ */
+class DayFromDatetimeIterator : public NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DayFromDatetimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DayFromDatetimeIterator,
+    NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>*)this);
+  }
+
+  DayFromDatetimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DayFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~DayFromDatetimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:hours-from-dateTime
+ * Author: Zorba Team
+ */
+class HoursFromDatetimeIterator : public NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(HoursFromDatetimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(HoursFromDatetimeIterator,
+    NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>*)this);
+  }
+
+  HoursFromDatetimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<HoursFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~HoursFromDatetimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:minutes-from-dateTime
+ * Author: Zorba Team
+ */
+class MinutesFromDatetimeIterator : public NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(MinutesFromDatetimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MinutesFromDatetimeIterator,
+    NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>*)this);
+  }
+
+  MinutesFromDatetimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<MinutesFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~MinutesFromDatetimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:seconds-from-dateTime
+ * Author: Zorba Team
+ */
+class SecondsFromDatetimeIterator : public NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SecondsFromDatetimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SecondsFromDatetimeIterator,
+    NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>*)this);
+  }
+
+  SecondsFromDatetimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<SecondsFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~SecondsFromDatetimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:timezone-from-dateTime
+ * Author: Zorba Team
+ */
+class TimezoneFromDatetimeIterator : public NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(TimezoneFromDatetimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TimezoneFromDatetimeIterator,
+    NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>*)this);
+  }
+
+  TimezoneFromDatetimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<TimezoneFromDatetimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~TimezoneFromDatetimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:year-from-date
+ * Author: Zorba Team
+ */
+class YearFromDateIterator : public NaryBaseIterator<YearFromDateIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(YearFromDateIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(YearFromDateIterator,
+    NaryBaseIterator<YearFromDateIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<YearFromDateIterator, PlanIteratorState>*)this);
+  }
+
+  YearFromDateIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<YearFromDateIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~YearFromDateIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:month-from-date
+ * Author: Zorba Team
+ */
+class MonthFromDateIterator : public NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(MonthFromDateIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MonthFromDateIterator,
+    NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>*)this);
+  }
+
+  MonthFromDateIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<MonthFromDateIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~MonthFromDateIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:day-from-date
+ * Author: Zorba Team
+ */
+class DayFromDateIterator : public NaryBaseIterator<DayFromDateIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DayFromDateIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DayFromDateIterator,
+    NaryBaseIterator<DayFromDateIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DayFromDateIterator, PlanIteratorState>*)this);
+  }
+
+  DayFromDateIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DayFromDateIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~DayFromDateIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:timezone-from-date
+ * Author: Zorba Team
+ */
+class TimezoneFromDateIterator : public NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(TimezoneFromDateIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TimezoneFromDateIterator,
+    NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>*)this);
+  }
+
+  TimezoneFromDateIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<TimezoneFromDateIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~TimezoneFromDateIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:hours-from-time
+ * Author: Zorba Team
+ */
+class HoursFromTimeIterator : public NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(HoursFromTimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(HoursFromTimeIterator,
+    NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>*)this);
+  }
+
+  HoursFromTimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<HoursFromTimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~HoursFromTimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:minutes-from-time
+ * Author: Zorba Team
+ */
+class MinutesFromTimeIterator : public NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(MinutesFromTimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(MinutesFromTimeIterator,
+    NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>*)this);
+  }
+
+  MinutesFromTimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<MinutesFromTimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~MinutesFromTimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:seconds-from-time
+ * Author: Zorba Team
+ */
+class SecondsFromTimeIterator : public NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SecondsFromTimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SecondsFromTimeIterator,
+    NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>*)this);
+  }
+
+  SecondsFromTimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<SecondsFromTimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~SecondsFromTimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:timezone-from-time
+ * Author: Zorba Team
+ */
+class TimezoneFromTimeIterator : public NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(TimezoneFromTimeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TimezoneFromTimeIterator,
+    NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>*)this);
+  }
+
+  TimezoneFromTimeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<TimezoneFromTimeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~TimezoneFromTimeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.cpp'
--- src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.cpp	2012-05-02 07:17:28 +0000
@@ -1,100 +1,100 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/errors_and_diagnostics/errors_and_diagnostics.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <ErrorIterator>
-ErrorIterator::class_factory<ErrorIterator>
-ErrorIterator::g_class_factory;
-
-
-void ErrorIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-ErrorIterator::~ErrorIterator() {}
-
-// </ErrorIterator>
-
-
-// <TraceIterator>
-TraceIterator::class_factory<TraceIterator>
-TraceIterator::g_class_factory;
-
-
-void TraceIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-TraceIterator::~TraceIterator() {}
-
-TraceIteratorState::TraceIteratorState() {}
-
-TraceIteratorState::~TraceIteratorState() {}
-
-
-void TraceIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-  theTagItem = NULL;
-  theIndex = 0;
-  theOS = 0;
-}
-
-void TraceIteratorState::reset(PlanState& planState) {
-  PlanIteratorState::reset(planState);
-  theTagItem = NULL;
-  theIndex = 0;
-  theOS = 0;
-}
-// </TraceIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/errors_and_diagnostics/errors_and_diagnostics.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <ErrorIterator>
+ErrorIterator::class_factory<ErrorIterator>
+ErrorIterator::g_class_factory;
+
+
+void ErrorIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+ErrorIterator::~ErrorIterator() {}
+
+// </ErrorIterator>
+
+
+// <TraceIterator>
+TraceIterator::class_factory<TraceIterator>
+TraceIterator::g_class_factory;
+
+
+void TraceIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+TraceIterator::~TraceIterator() {}
+
+TraceIteratorState::TraceIteratorState() {}
+
+TraceIteratorState::~TraceIteratorState() {}
+
+
+void TraceIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+  theTagItem = NULL;
+  theIndex = 0;
+  theOS = 0;
+}
+
+void TraceIteratorState::reset(PlanState& planState) {
+  PlanIteratorState::reset(planState);
+  theTagItem = NULL;
+  theIndex = 0;
+  theOS = 0;
+}
+// </TraceIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.h'
--- src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.h	2012-04-24 12:39:38 +0000
+++ src/runtime/errors_and_diagnostics/pregenerated/errors_and_diagnostics.h	2012-05-02 07:17:28 +0000
@@ -1,125 +1,125 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_ERRORS_AND_DIAGNOSTICS_H
-#define ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_ERRORS_AND_DIAGNOSTICS_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * fn:error
- * Author: Zorba Team
- */
-class ErrorIterator : public NaryBaseIterator<ErrorIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ErrorIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ErrorIterator,
-    NaryBaseIterator<ErrorIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<ErrorIterator, PlanIteratorState>*)this);
-  }
-
-  ErrorIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<ErrorIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~ErrorIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * fn:trace
- * Author: Zorba Team
- */
-class TraceIteratorState : public PlanIteratorState
-{
-public:
-  store::Item_t theTagItem; //
-  uint32_t theIndex; //
-  std::ostream* theOS; //
-
-  TraceIteratorState();
-
-  ~TraceIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class TraceIterator : public NaryBaseIterator<TraceIterator, TraceIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(TraceIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TraceIterator,
-    NaryBaseIterator<TraceIterator, TraceIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<TraceIterator, TraceIteratorState>*)this);
-  }
-
-  TraceIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<TraceIterator, TraceIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~TraceIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_ERRORS_AND_DIAGNOSTICS_H
+#define ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_ERRORS_AND_DIAGNOSTICS_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * fn:error
+ * Author: Zorba Team
+ */
+class ErrorIterator : public NaryBaseIterator<ErrorIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ErrorIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ErrorIterator,
+    NaryBaseIterator<ErrorIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<ErrorIterator, PlanIteratorState>*)this);
+  }
+
+  ErrorIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<ErrorIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~ErrorIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * fn:trace
+ * Author: Zorba Team
+ */
+class TraceIteratorState : public PlanIteratorState
+{
+public:
+  store::Item_t theTagItem; //
+  uint32_t theIndex; //
+  std::ostream* theOS; //
+
+  TraceIteratorState();
+
+  ~TraceIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class TraceIterator : public NaryBaseIterator<TraceIterator, TraceIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(TraceIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TraceIterator,
+    NaryBaseIterator<TraceIterator, TraceIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<TraceIterator, TraceIteratorState>*)this);
+  }
+
+  TraceIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<TraceIterator, TraceIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~TraceIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.cpp'
--- src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.cpp	2012-05-02 07:17:28 +0000
@@ -1,105 +1,105 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/errors_and_diagnostics/other_diagnostics.h"
-#include "system/globalenv.h"
-
-
-#include "store/api/item.h"
-
-namespace zorba {
-
-// <ReadLineIterator>
-ReadLineIterator::class_factory<ReadLineIterator>
-ReadLineIterator::g_class_factory;
-
-
-void ReadLineIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-ReadLineIterator::~ReadLineIterator() {}
-
-// </ReadLineIterator>
-
-
-// <PrintIterator>
-PrintIterator::class_factory<PrintIterator>
-PrintIterator::g_class_factory;
-
-
-void PrintIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-PrintIterator::~PrintIterator() {}
-
-// </PrintIterator>
-
-
-// <FunctionTraceIterator>
-FunctionTraceIterator::class_factory<FunctionTraceIterator>
-FunctionTraceIterator::g_class_factory;
-
-
-void FunctionTraceIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FunctionTraceIterator::~FunctionTraceIterator() {}
-
-// </FunctionTraceIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/errors_and_diagnostics/other_diagnostics.h"
+#include "system/globalenv.h"
+
+
+#include "store/api/item.h"
+
+namespace zorba {
+
+// <ReadLineIterator>
+ReadLineIterator::class_factory<ReadLineIterator>
+ReadLineIterator::g_class_factory;
+
+
+void ReadLineIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+ReadLineIterator::~ReadLineIterator() {}
+
+// </ReadLineIterator>
+
+
+// <PrintIterator>
+PrintIterator::class_factory<PrintIterator>
+PrintIterator::g_class_factory;
+
+
+void PrintIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+PrintIterator::~PrintIterator() {}
+
+// </PrintIterator>
+
+
+// <FunctionTraceIterator>
+FunctionTraceIterator::class_factory<FunctionTraceIterator>
+FunctionTraceIterator::g_class_factory;
+
+
+void FunctionTraceIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FunctionTraceIterator::~FunctionTraceIterator() {}
+
+// </FunctionTraceIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.h'
--- src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.h	2012-04-24 12:39:38 +0000
+++ src/runtime/errors_and_diagnostics/pregenerated/other_diagnostics.h	2012-05-02 07:17:28 +0000
@@ -1,174 +1,174 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_OTHER_DIAGNOSTICS_H
-#define ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_OTHER_DIAGNOSTICS_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * op-zorba:read-line
- * Author: Zorba Team
- */
-class ReadLineIterator : public NaryBaseIterator<ReadLineIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ReadLineIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ReadLineIterator,
-    NaryBaseIterator<ReadLineIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<ReadLineIterator, PlanIteratorState>*)this);
-  }
-
-  ReadLineIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<ReadLineIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~ReadLineIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * op-zorba:print
- * Author: Zorba Team
- */
-class PrintIterator : public NaryBaseIterator<PrintIterator, PlanIteratorState>
-{ 
-protected:
-  bool thePrintToConsole; //
-public:
-  SERIALIZABLE_CLASS(PrintIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PrintIterator,
-    NaryBaseIterator<PrintIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<PrintIterator, PlanIteratorState>*)this);
-
-    ar & thePrintToConsole;
-  }
-
-  PrintIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children,
-    bool aPrintToConsole = true)
-    : 
-    NaryBaseIterator<PrintIterator, PlanIteratorState>(sctx, loc, children),
-    thePrintToConsole(aPrintToConsole)
-  {}
-
-  virtual ~PrintIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      This is just a dummy iterator, which calls
- *      its children. This iterator is used to wrap
- *      inlined expressions to be able to add the call
- *      to the call stack in case of an exception.
- *    
- * Author: Zorba Team
- */
-class FunctionTraceIterator : public NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>
-{ 
-protected:
-  store::Item_t theFunctionName; //stores the name of the function it substitutes
-  QueryLoc theFunctionLocation; //stores the location of the function call
-  QueryLoc theFunctionCallLocation; //stores the location of the function which it calls
-  unsigned int theFunctionArity; //stores the arity of the function being called
-public:
-  SERIALIZABLE_CLASS(FunctionTraceIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionTraceIterator,
-    NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>*)this);
-
-    ar & theFunctionName;
-    ar & theFunctionLocation;
-    ar & theFunctionCallLocation;
-    ar & theFunctionArity;
-  }
-
-  FunctionTraceIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>(sctx, loc, children),
-    theFunctionName(),
-    theFunctionLocation(),
-    theFunctionCallLocation(),
-    theFunctionArity()
-  {}
-
-  virtual ~FunctionTraceIterator();
-
-public:
-  void setFunctionName(const store::Item_t& aFunctionName);
-  void setFunctionCallLocation(const QueryLoc& aFunctionLocation);
-  void setFunctionLocation(const QueryLoc& aFunctionLocation);
-  void setFunctionArity(unsigned int arity);
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_OTHER_DIAGNOSTICS_H
+#define ZORBA_RUNTIME_ERRORS_AND_DIAGNOSTICS_OTHER_DIAGNOSTICS_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * op-zorba:read-line
+ * Author: Zorba Team
+ */
+class ReadLineIterator : public NaryBaseIterator<ReadLineIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ReadLineIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ReadLineIterator,
+    NaryBaseIterator<ReadLineIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<ReadLineIterator, PlanIteratorState>*)this);
+  }
+
+  ReadLineIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<ReadLineIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~ReadLineIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * op-zorba:print
+ * Author: Zorba Team
+ */
+class PrintIterator : public NaryBaseIterator<PrintIterator, PlanIteratorState>
+{ 
+protected:
+  bool thePrintToConsole; //
+public:
+  SERIALIZABLE_CLASS(PrintIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PrintIterator,
+    NaryBaseIterator<PrintIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<PrintIterator, PlanIteratorState>*)this);
+
+    ar & thePrintToConsole;
+  }
+
+  PrintIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children,
+    bool aPrintToConsole = true)
+    : 
+    NaryBaseIterator<PrintIterator, PlanIteratorState>(sctx, loc, children),
+    thePrintToConsole(aPrintToConsole)
+  {}
+
+  virtual ~PrintIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      This is just a dummy iterator, which calls
+ *      its children. This iterator is used to wrap
+ *      inlined expressions to be able to add the call
+ *      to the call stack in case of an exception.
+ *    
+ * Author: Zorba Team
+ */
+class FunctionTraceIterator : public NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>
+{ 
+protected:
+  store::Item_t theFunctionName; //stores the name of the function it substitutes
+  QueryLoc theFunctionLocation; //stores the location of the function call
+  QueryLoc theFunctionCallLocation; //stores the location of the function which it calls
+  unsigned int theFunctionArity; //stores the arity of the function being called
+public:
+  SERIALIZABLE_CLASS(FunctionTraceIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionTraceIterator,
+    NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>*)this);
+
+    ar & theFunctionName;
+    ar & theFunctionLocation;
+    ar & theFunctionCallLocation;
+    ar & theFunctionArity;
+  }
+
+  FunctionTraceIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FunctionTraceIterator, PlanIteratorState>(sctx, loc, children),
+    theFunctionName(),
+    theFunctionLocation(),
+    theFunctionCallLocation(),
+    theFunctionArity()
+  {}
+
+  virtual ~FunctionTraceIterator();
+
+public:
+  void setFunctionName(const store::Item_t& aFunctionName);
+  void setFunctionCallLocation(const QueryLoc& aFunctionLocation);
+  void setFunctionLocation(const QueryLoc& aFunctionLocation);
+  void setFunctionArity(unsigned int arity);
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/fetch/pregenerated/fetch.cpp'
--- src/runtime/fetch/pregenerated/fetch.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/fetch/pregenerated/fetch.cpp	2012-05-02 07:17:28 +0000
@@ -1,82 +1,82 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/fetch/fetch.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <FetchContentIterator>
-FetchContentIterator::class_factory<FetchContentIterator>
-FetchContentIterator::g_class_factory;
-
-
-void FetchContentIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FetchContentIterator::~FetchContentIterator() {}
-
-// </FetchContentIterator>
-
-
-// <FetchContentTypeIterator>
-FetchContentTypeIterator::class_factory<FetchContentTypeIterator>
-FetchContentTypeIterator::g_class_factory;
-
-
-void FetchContentTypeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FetchContentTypeIterator::~FetchContentTypeIterator() {}
-
-// </FetchContentTypeIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/fetch/fetch.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <FetchContentIterator>
+FetchContentIterator::class_factory<FetchContentIterator>
+FetchContentIterator::g_class_factory;
+
+
+void FetchContentIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FetchContentIterator::~FetchContentIterator() {}
+
+// </FetchContentIterator>
+
+
+// <FetchContentTypeIterator>
+FetchContentTypeIterator::class_factory<FetchContentTypeIterator>
+FetchContentTypeIterator::g_class_factory;
+
+
+void FetchContentTypeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FetchContentTypeIterator::~FetchContentTypeIterator() {}
+
+// </FetchContentTypeIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/fetch/pregenerated/fetch.h'
--- src/runtime/fetch/pregenerated/fetch.h	2012-04-24 12:39:38 +0000
+++ src/runtime/fetch/pregenerated/fetch.h	2012-05-02 07:17:28 +0000
@@ -1,112 +1,112 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_FETCH_FETCH_H
-#define ZORBA_RUNTIME_FETCH_FETCH_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * 
- * Author: Matthias Brantner
- */
-class FetchContentIterator : public NaryBaseIterator<FetchContentIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FetchContentIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FetchContentIterator,
-    NaryBaseIterator<FetchContentIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FetchContentIterator, PlanIteratorState>*)this);
-  }
-
-  FetchContentIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FetchContentIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FetchContentIterator();
-
-public:
-  static void destroyStream(std::istream& aStream);
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- * Author: Matthias Brantner
- */
-class FetchContentTypeIterator : public NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FetchContentTypeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FetchContentTypeIterator,
-    NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>*)this);
-  }
-
-  FetchContentTypeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FetchContentTypeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_FETCH_FETCH_H
+#define ZORBA_RUNTIME_FETCH_FETCH_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * 
+ * Author: Matthias Brantner
+ */
+class FetchContentIterator : public NaryBaseIterator<FetchContentIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FetchContentIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FetchContentIterator,
+    NaryBaseIterator<FetchContentIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FetchContentIterator, PlanIteratorState>*)this);
+  }
+
+  FetchContentIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FetchContentIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FetchContentIterator();
+
+public:
+  static void destroyStream(std::istream& aStream);
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ * Author: Matthias Brantner
+ */
+class FetchContentTypeIterator : public NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FetchContentTypeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FetchContentTypeIterator,
+    NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>*)this);
+  }
+
+  FetchContentTypeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FetchContentTypeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FetchContentTypeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/fnput/pregenerated/fnput.cpp'
--- src/runtime/fnput/pregenerated/fnput.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/fnput/pregenerated/fnput.cpp	2012-05-02 07:17:28 +0000
@@ -1,60 +1,60 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/fnput/fnput.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <FnPutIterator>
-FnPutIterator::class_factory<FnPutIterator>
-FnPutIterator::g_class_factory;
-
-
-void FnPutIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FnPutIterator::~FnPutIterator() {}
-
-// </FnPutIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/fnput/fnput.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <FnPutIterator>
+FnPutIterator::class_factory<FnPutIterator>
+FnPutIterator::g_class_factory;
+
+
+void FnPutIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FnPutIterator::~FnPutIterator() {}
+
+// </FnPutIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/fnput/pregenerated/fnput.h'
--- src/runtime/fnput/pregenerated/fnput.h	2012-04-24 12:39:38 +0000
+++ src/runtime/fnput/pregenerated/fnput.h	2012-05-02 07:17:28 +0000
@@ -1,76 +1,76 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_FNPUT_FNPUT_H
-#define ZORBA_RUNTIME_FNPUT_FNPUT_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * fn:put
- * Author: Zorba Team
- */
-class FnPutIterator : public NaryBaseIterator<FnPutIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FnPutIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnPutIterator,
-    NaryBaseIterator<FnPutIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FnPutIterator, PlanIteratorState>*)this);
-  }
-
-  FnPutIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FnPutIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FnPutIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_FNPUT_FNPUT_H
+#define ZORBA_RUNTIME_FNPUT_FNPUT_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * fn:put
+ * Author: Zorba Team
+ */
+class FnPutIterator : public NaryBaseIterator<FnPutIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FnPutIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FnPutIterator,
+    NaryBaseIterator<FnPutIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FnPutIterator, PlanIteratorState>*)this);
+  }
+
+  FnPutIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FnPutIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FnPutIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/function_item/pregenerated/function_item_iter.cpp'
--- src/runtime/function_item/pregenerated/function_item_iter.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/function_item/pregenerated/function_item_iter.cpp	2012-05-02 07:17:28 +0000
@@ -1,107 +1,107 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/function_item/function_item_iter.h"
-#include "system/globalenv.h"
-
-
-#include "context/static_context.h"
-#include "compiler/api/compilercb.h"
-#include "context/dynamic_context.h"
-
-namespace zorba {
-
-// <FunctionNameIterator>
-FunctionNameIterator::class_factory<FunctionNameIterator>
-FunctionNameIterator::g_class_factory;
-
-
-void FunctionNameIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FunctionNameIterator::~FunctionNameIterator() {}
-
-// </FunctionNameIterator>
-
-
-// <FunctionArityIterator>
-FunctionArityIterator::class_factory<FunctionArityIterator>
-FunctionArityIterator::g_class_factory;
-
-
-void FunctionArityIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FunctionArityIterator::~FunctionArityIterator() {}
-
-// </FunctionArityIterator>
-
-
-// <PartialApplyIterator>
-PartialApplyIterator::class_factory<PartialApplyIterator>
-PartialApplyIterator::g_class_factory;
-
-
-void PartialApplyIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-PartialApplyIterator::~PartialApplyIterator() {}
-
-// </PartialApplyIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/function_item/function_item_iter.h"
+#include "system/globalenv.h"
+
+
+#include "context/static_context.h"
+#include "compiler/api/compilercb.h"
+#include "context/dynamic_context.h"
+
+namespace zorba {
+
+// <FunctionNameIterator>
+FunctionNameIterator::class_factory<FunctionNameIterator>
+FunctionNameIterator::g_class_factory;
+
+
+void FunctionNameIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FunctionNameIterator::~FunctionNameIterator() {}
+
+// </FunctionNameIterator>
+
+
+// <FunctionArityIterator>
+FunctionArityIterator::class_factory<FunctionArityIterator>
+FunctionArityIterator::g_class_factory;
+
+
+void FunctionArityIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FunctionArityIterator::~FunctionArityIterator() {}
+
+// </FunctionArityIterator>
+
+
+// <PartialApplyIterator>
+PartialApplyIterator::class_factory<PartialApplyIterator>
+PartialApplyIterator::g_class_factory;
+
+
+void PartialApplyIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+PartialApplyIterator::~PartialApplyIterator() {}
+
+// </PartialApplyIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/function_item/pregenerated/function_item_iter.h'
--- src/runtime/function_item/pregenerated/function_item_iter.h	2012-04-24 12:39:38 +0000
+++ src/runtime/function_item/pregenerated/function_item_iter.h	2012-05-02 07:17:28 +0000
@@ -1,155 +1,155 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
-#define ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-#include "compiler/expression/expr_base.h"
-#include "runtime/util/plan_wrapper_holder.h"
-#include "types/typeimpl.h"
-#include "functions/function.h"
-
-
-namespace zorba {
-
-/**
- * 
- *      Returns the name of the function identified by a function item.
- *    
- * Author: Zorba Team
- */
-class FunctionNameIterator : public NaryBaseIterator<FunctionNameIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FunctionNameIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionNameIterator,
-    NaryBaseIterator<FunctionNameIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FunctionNameIterator, PlanIteratorState>*)this);
-  }
-
-  FunctionNameIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FunctionNameIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FunctionNameIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      Returns the arity of the function identified by a function item.
- *    
- * Author: Zorba Team
- */
-class FunctionArityIterator : public NaryBaseIterator<FunctionArityIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FunctionArityIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionArityIterator,
-    NaryBaseIterator<FunctionArityIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FunctionArityIterator, PlanIteratorState>*)this);
-  }
-
-  FunctionArityIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FunctionArityIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FunctionArityIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      Returns the new function item obtained by binding one of the arguments of a supplied function item to a value.
- *      That is, it curries the supplied function.
- *    
- * Author: Zorba Team
- */
-class PartialApplyIterator : public NaryBaseIterator<PartialApplyIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(PartialApplyIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PartialApplyIterator,
-    NaryBaseIterator<PartialApplyIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<PartialApplyIterator, PlanIteratorState>*)this);
-  }
-
-  PartialApplyIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<PartialApplyIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~PartialApplyIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
+#define ZORBA_RUNTIME_FUNCTION_ITEM_FUNCTION_ITEM_ITER_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+#include "compiler/expression/expr_base.h"
+#include "runtime/util/plan_wrapper_holder.h"
+#include "types/typeimpl.h"
+#include "functions/function.h"
+
+
+namespace zorba {
+
+/**
+ * 
+ *      Returns the name of the function identified by a function item.
+ *    
+ * Author: Zorba Team
+ */
+class FunctionNameIterator : public NaryBaseIterator<FunctionNameIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FunctionNameIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionNameIterator,
+    NaryBaseIterator<FunctionNameIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FunctionNameIterator, PlanIteratorState>*)this);
+  }
+
+  FunctionNameIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FunctionNameIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FunctionNameIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      Returns the arity of the function identified by a function item.
+ *    
+ * Author: Zorba Team
+ */
+class FunctionArityIterator : public NaryBaseIterator<FunctionArityIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FunctionArityIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionArityIterator,
+    NaryBaseIterator<FunctionArityIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FunctionArityIterator, PlanIteratorState>*)this);
+  }
+
+  FunctionArityIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FunctionArityIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FunctionArityIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      Returns the new function item obtained by binding one of the arguments of a supplied function item to a value.
+ *      That is, it curries the supplied function.
+ *    
+ * Author: Zorba Team
+ */
+class PartialApplyIterator : public NaryBaseIterator<PartialApplyIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(PartialApplyIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PartialApplyIterator,
+    NaryBaseIterator<PartialApplyIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<PartialApplyIterator, PlanIteratorState>*)this);
+  }
+
+  PartialApplyIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<PartialApplyIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~PartialApplyIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/indexing/pregenerated/ic_ddl.cpp'
--- src/runtime/indexing/pregenerated/ic_ddl.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/indexing/pregenerated/ic_ddl.cpp	2012-05-02 07:17:28 +0000
@@ -1,93 +1,93 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/indexing/ic_ddl.h"
-#include "system/globalenv.h"
-
-
-#include "store/api/iterator.h"
-
-namespace zorba {
-
-// <ActivateICIterator>
-ActivateICIterator::class_factory<ActivateICIterator>
-ActivateICIterator::g_class_factory;
-
-
-void ActivateICIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-ActivateICIterator::~ActivateICIterator() {}
-
-// </ActivateICIterator>
-
-
-// <DeactivateICIterator>
-DeactivateICIterator::class_factory<DeactivateICIterator>
-DeactivateICIterator::g_class_factory;
-
-
-void DeactivateICIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-DeactivateICIterator::~DeactivateICIterator() {}
-
-// </DeactivateICIterator>
-
-
-// <CheckICIterator>
-CheckICIterator::class_factory<CheckICIterator>
-CheckICIterator::g_class_factory;
-
-
-void CheckICIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-CheckICIterator::~CheckICIterator() {}
-
-// </CheckICIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/indexing/ic_ddl.h"
+#include "system/globalenv.h"
+
+
+#include "store/api/iterator.h"
+
+namespace zorba {
+
+// <ActivateICIterator>
+ActivateICIterator::class_factory<ActivateICIterator>
+ActivateICIterator::g_class_factory;
+
+
+void ActivateICIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+ActivateICIterator::~ActivateICIterator() {}
+
+// </ActivateICIterator>
+
+
+// <DeactivateICIterator>
+DeactivateICIterator::class_factory<DeactivateICIterator>
+DeactivateICIterator::g_class_factory;
+
+
+void DeactivateICIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+DeactivateICIterator::~DeactivateICIterator() {}
+
+// </DeactivateICIterator>
+
+
+// <CheckICIterator>
+CheckICIterator::class_factory<CheckICIterator>
+CheckICIterator::g_class_factory;
+
+
+void CheckICIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+CheckICIterator::~CheckICIterator() {}
+
+// </CheckICIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/indexing/pregenerated/ic_ddl.h'
--- src/runtime/indexing/pregenerated/ic_ddl.h	2012-04-24 12:39:38 +0000
+++ src/runtime/indexing/pregenerated/ic_ddl.h	2012-05-02 07:17:28 +0000
@@ -1,167 +1,167 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_INDEXING_IC_DDL_H
-#define ZORBA_RUNTIME_INDEXING_IC_DDL_H
-
-
-#include "common/shared_types.h"
-#include "runtime/base/unarybase.h"
-
-
-
-
-
-namespace zorba {
-
-/**
- * 
- *  activate($icName as xs:QName) as ()
- *
- *  Activates a staticaly declared integrity constraint for runtime
- *  check durring apply updates. After activation, the integrity
- *  constraint will become available in the dynamic context.
- *
- *  Error XXX is risen if $icName is not available in the static context.
- *    
- * Author: Zorba Team
- */
-class ActivateICIterator : public UnaryBaseIterator<ActivateICIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ActivateICIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ActivateICIterator,
-    UnaryBaseIterator<ActivateICIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<ActivateICIterator, PlanIteratorState>*)this);
-  }
-
-  ActivateICIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<ActivateICIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~ActivateICIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *  deactivate($icName as xs:QName) as ()
- *
- *  Deactivates the runtime check of the $icName integrity constraint
- *  and it also removes it from dynamic context.
- *
- *  Error XXX is risen if $icName is not activated, i.e. available in 
- *  dynamic context.
- *    
- * Author: Zorba Team
- */
-class DeactivateICIterator : public UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DeactivateICIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DeactivateICIterator,
-    UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>*)this);
-  }
-
-  DeactivateICIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~DeactivateICIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *  check-integrity-constraint($icName as xs:QName) as ()
- *
- *  Calls the runtime check of the $icName integrity constraint.
- *
- *  Error XXX is risen if $icName is not activated, i.e. available in 
- *  dynamic context.
- *    
- * Author: Zorba Team
- */
-class CheckICIterator : public UnaryBaseIterator<CheckICIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(CheckICIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CheckICIterator,
-    UnaryBaseIterator<CheckICIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<CheckICIterator, PlanIteratorState>*)this);
-  }
-
-  CheckICIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<CheckICIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~CheckICIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_INDEXING_IC_DDL_H
+#define ZORBA_RUNTIME_INDEXING_IC_DDL_H
+
+
+#include "common/shared_types.h"
+#include "runtime/base/unarybase.h"
+
+
+
+
+
+namespace zorba {
+
+/**
+ * 
+ *  activate($icName as xs:QName) as ()
+ *
+ *  Activates a staticaly declared integrity constraint for runtime
+ *  check durring apply updates. After activation, the integrity
+ *  constraint will become available in the dynamic context.
+ *
+ *  Error XXX is risen if $icName is not available in the static context.
+ *    
+ * Author: Zorba Team
+ */
+class ActivateICIterator : public UnaryBaseIterator<ActivateICIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ActivateICIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ActivateICIterator,
+    UnaryBaseIterator<ActivateICIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<ActivateICIterator, PlanIteratorState>*)this);
+  }
+
+  ActivateICIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<ActivateICIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~ActivateICIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *  deactivate($icName as xs:QName) as ()
+ *
+ *  Deactivates the runtime check of the $icName integrity constraint
+ *  and it also removes it from dynamic context.
+ *
+ *  Error XXX is risen if $icName is not activated, i.e. available in 
+ *  dynamic context.
+ *    
+ * Author: Zorba Team
+ */
+class DeactivateICIterator : public UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DeactivateICIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DeactivateICIterator,
+    UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>*)this);
+  }
+
+  DeactivateICIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<DeactivateICIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~DeactivateICIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *  check-integrity-constraint($icName as xs:QName) as ()
+ *
+ *  Calls the runtime check of the $icName integrity constraint.
+ *
+ *  Error XXX is risen if $icName is not activated, i.e. available in 
+ *  dynamic context.
+ *    
+ * Author: Zorba Team
+ */
+class CheckICIterator : public UnaryBaseIterator<CheckICIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(CheckICIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CheckICIterator,
+    UnaryBaseIterator<CheckICIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<CheckICIterator, PlanIteratorState>*)this);
+  }
+
+  CheckICIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<CheckICIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~CheckICIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/introspection/pregenerated/sctx.cpp'
--- src/runtime/introspection/pregenerated/sctx.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/introspection/pregenerated/sctx.cpp	2012-05-02 07:17:28 +0000
@@ -1,662 +1,662 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/introspection/sctx.h"
-#include "system/globalenv.h"
-
-
-#include "store/api/iterator.h"
-#include "compiler/expression/var_expr.h"
-
-namespace zorba {
-
-// <StaticNamespacesIterator>
-StaticNamespacesIterator::class_factory<StaticNamespacesIterator>
-StaticNamespacesIterator::g_class_factory;
-
-
-void StaticNamespacesIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-StaticNamespacesIterator::~StaticNamespacesIterator() {}
-
-StaticNamespacesIteratorState::StaticNamespacesIteratorState() {}
-
-
-void StaticNamespacesIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </StaticNamespacesIterator>
-
-
-// <DefaultFunctionNamespaceIterator>
-DefaultFunctionNamespaceIterator::class_factory<DefaultFunctionNamespaceIterator>
-DefaultFunctionNamespaceIterator::g_class_factory;
-
-
-void DefaultFunctionNamespaceIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DefaultFunctionNamespaceIterator::~DefaultFunctionNamespaceIterator() {}
-
-// </DefaultFunctionNamespaceIterator>
-
-
-// <SctxBaseUriIterator>
-SctxBaseUriIterator::class_factory<SctxBaseUriIterator>
-SctxBaseUriIterator::g_class_factory;
-
-
-void SctxBaseUriIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-SctxBaseUriIterator::~SctxBaseUriIterator() {}
-
-// </SctxBaseUriIterator>
-
-
-// <SctxDefaultCollationIterator>
-SctxDefaultCollationIterator::class_factory<SctxDefaultCollationIterator>
-SctxDefaultCollationIterator::g_class_factory;
-
-
-void SctxDefaultCollationIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-SctxDefaultCollationIterator::~SctxDefaultCollationIterator() {}
-
-// </SctxDefaultCollationIterator>
-
-
-// <StaticNamespaceBindingIterator>
-StaticNamespaceBindingIterator::class_factory<StaticNamespaceBindingIterator>
-StaticNamespaceBindingIterator::g_class_factory;
-
-
-void StaticNamespaceBindingIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-StaticNamespaceBindingIterator::~StaticNamespaceBindingIterator() {}
-
-// </StaticNamespaceBindingIterator>
-
-
-// <InscopeVariablesIterator>
-InscopeVariablesIterator::class_factory<InscopeVariablesIterator>
-InscopeVariablesIterator::g_class_factory;
-
-
-void InscopeVariablesIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-InscopeVariablesIterator::~InscopeVariablesIterator() {}
-
-InscopeVariablesIteratorState::InscopeVariablesIteratorState() {}
-
-
-void InscopeVariablesIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </InscopeVariablesIterator>
-
-
-// <DefaultCollectionTypeIterator>
-DefaultCollectionTypeIterator::class_factory<DefaultCollectionTypeIterator>
-DefaultCollectionTypeIterator::g_class_factory;
-
-
-void DefaultCollectionTypeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DefaultCollectionTypeIterator::~DefaultCollectionTypeIterator() {}
-
-// </DefaultCollectionTypeIterator>
-
-
-// <XPath10CompatModeIterator>
-XPath10CompatModeIterator::class_factory<XPath10CompatModeIterator>
-XPath10CompatModeIterator::g_class_factory;
-
-
-void XPath10CompatModeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-XPath10CompatModeIterator::~XPath10CompatModeIterator() {}
-
-// </XPath10CompatModeIterator>
-
-
-// <StaticallyKnownDocumentsIterator>
-StaticallyKnownDocumentsIterator::class_factory<StaticallyKnownDocumentsIterator>
-StaticallyKnownDocumentsIterator::g_class_factory;
-
-
-void StaticallyKnownDocumentsIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-StaticallyKnownDocumentsIterator::~StaticallyKnownDocumentsIterator() {}
-
-StaticallyKnownDocumentsIteratorState::StaticallyKnownDocumentsIteratorState() {}
-
-
-void StaticallyKnownDocumentsIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </StaticallyKnownDocumentsIterator>
-
-
-// <StaticallyKnownDocumentTypeIterator>
-StaticallyKnownDocumentTypeIterator::class_factory<StaticallyKnownDocumentTypeIterator>
-StaticallyKnownDocumentTypeIterator::g_class_factory;
-
-
-void StaticallyKnownDocumentTypeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-StaticallyKnownDocumentTypeIterator::~StaticallyKnownDocumentTypeIterator() {}
-
-// </StaticallyKnownDocumentTypeIterator>
-
-
-// <StaticallyKnownCollationsIterator>
-StaticallyKnownCollationsIterator::class_factory<StaticallyKnownCollationsIterator>
-StaticallyKnownCollationsIterator::g_class_factory;
-
-
-void StaticallyKnownCollationsIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-StaticallyKnownCollationsIterator::~StaticallyKnownCollationsIterator() {}
-
-StaticallyKnownCollationsIteratorState::StaticallyKnownCollationsIteratorState() {}
-
-
-void StaticallyKnownCollationsIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </StaticallyKnownCollationsIterator>
-
-
-// <ConstructionModeIterator>
-ConstructionModeIterator::class_factory<ConstructionModeIterator>
-ConstructionModeIterator::g_class_factory;
-
-
-void ConstructionModeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-ConstructionModeIterator::~ConstructionModeIterator() {}
-
-// </ConstructionModeIterator>
-
-
-// <OrderingModeIterator>
-OrderingModeIterator::class_factory<OrderingModeIterator>
-OrderingModeIterator::g_class_factory;
-
-
-void OrderingModeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-OrderingModeIterator::~OrderingModeIterator() {}
-
-// </OrderingModeIterator>
-
-
-// <DefaultOrderIterator>
-DefaultOrderIterator::class_factory<DefaultOrderIterator>
-DefaultOrderIterator::g_class_factory;
-
-
-void DefaultOrderIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-DefaultOrderIterator::~DefaultOrderIterator() {}
-
-// </DefaultOrderIterator>
-
-
-// <BoundarySpacePolicyIterator>
-BoundarySpacePolicyIterator::class_factory<BoundarySpacePolicyIterator>
-BoundarySpacePolicyIterator::g_class_factory;
-
-
-void BoundarySpacePolicyIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-BoundarySpacePolicyIterator::~BoundarySpacePolicyIterator() {}
-
-// </BoundarySpacePolicyIterator>
-
-
-// <CopyNamespacesModeIterator>
-CopyNamespacesModeIterator::class_factory<CopyNamespacesModeIterator>
-CopyNamespacesModeIterator::g_class_factory;
-
-
-void CopyNamespacesModeIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-CopyNamespacesModeIterator::~CopyNamespacesModeIterator() {}
-
-// </CopyNamespacesModeIterator>
-
-
-// <FunctionNamesIterator>
-FunctionNamesIterator::class_factory<FunctionNamesIterator>
-FunctionNamesIterator::g_class_factory;
-
-
-void FunctionNamesIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FunctionNamesIterator::~FunctionNamesIterator() {}
-
-FunctionNamesIteratorState::FunctionNamesIteratorState() {}
-
-
-void FunctionNamesIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </FunctionNamesIterator>
-
-
-// <FunctionArgumentsCountIterator>
-FunctionArgumentsCountIterator::class_factory<FunctionArgumentsCountIterator>
-FunctionArgumentsCountIterator::g_class_factory;
-
-
-void FunctionArgumentsCountIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FunctionArgumentsCountIterator::~FunctionArgumentsCountIterator() {}
-
-FunctionArgumentsCountIteratorState::FunctionArgumentsCountIteratorState() {}
-
-
-void FunctionArgumentsCountIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </FunctionArgumentsCountIterator>
-
-
-// <InScopeSchemaTypesIterator>
-InScopeSchemaTypesIterator::class_factory<InScopeSchemaTypesIterator>
-InScopeSchemaTypesIterator::g_class_factory;
-
-
-void InScopeSchemaTypesIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-InScopeSchemaTypesIterator::~InScopeSchemaTypesIterator() {}
-
-InScopeSchemaTypesIteratorState::InScopeSchemaTypesIteratorState() {}
-
-
-void InScopeSchemaTypesIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </InScopeSchemaTypesIterator>
-
-
-// <InScopeElementDeclarationsIterator>
-InScopeElementDeclarationsIterator::class_factory<InScopeElementDeclarationsIterator>
-InScopeElementDeclarationsIterator::g_class_factory;
-
-
-void InScopeElementDeclarationsIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-InScopeElementDeclarationsIterator::~InScopeElementDeclarationsIterator() {}
-
-InScopeElementDeclarationsIteratorState::InScopeElementDeclarationsIteratorState() {}
-
-
-void InScopeElementDeclarationsIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </InScopeElementDeclarationsIterator>
-
-
-// <InScopeAttributeDeclarationsIterator>
-InScopeAttributeDeclarationsIterator::class_factory<InScopeAttributeDeclarationsIterator>
-InScopeAttributeDeclarationsIterator::g_class_factory;
-
-
-void InScopeAttributeDeclarationsIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-InScopeAttributeDeclarationsIterator::~InScopeAttributeDeclarationsIterator() {}
-
-InScopeAttributeDeclarationsIteratorState::InScopeAttributeDeclarationsIteratorState() {}
-
-
-void InScopeAttributeDeclarationsIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </InScopeAttributeDeclarationsIterator>
-
-
-// <InScopeElementGroupsIterator>
-InScopeElementGroupsIterator::class_factory<InScopeElementGroupsIterator>
-InScopeElementGroupsIterator::g_class_factory;
-
-
-void InScopeElementGroupsIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-InScopeElementGroupsIterator::~InScopeElementGroupsIterator() {}
-
-InScopeElementGroupsIteratorState::InScopeElementGroupsIteratorState() {}
-
-
-void InScopeElementGroupsIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </InScopeElementGroupsIterator>
-
-
-// <InScopeAttributeGroupsIterator>
-InScopeAttributeGroupsIterator::class_factory<InScopeAttributeGroupsIterator>
-InScopeAttributeGroupsIterator::g_class_factory;
-
-
-void InScopeAttributeGroupsIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-InScopeAttributeGroupsIterator::~InScopeAttributeGroupsIterator() {}
-
-InScopeAttributeGroupsIteratorState::InScopeAttributeGroupsIteratorState() {}
-
-
-void InScopeAttributeGroupsIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </InScopeAttributeGroupsIterator>
-
-
-// <OptionIterator>
-OptionIterator::class_factory<OptionIterator>
-OptionIterator::g_class_factory;
-
-
-void OptionIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-OptionIterator::~OptionIterator() {}
-
-// </OptionIterator>
-
-
-// <FunctionAnnotationsIterator>
-FunctionAnnotationsIterator::class_factory<FunctionAnnotationsIterator>
-FunctionAnnotationsIterator::g_class_factory;
-
-
-void FunctionAnnotationsIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-FunctionAnnotationsIterator::~FunctionAnnotationsIterator() {}
-
-FunctionAnnotationsIteratorState::FunctionAnnotationsIteratorState() {}
-
-
-void FunctionAnnotationsIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-}
-// </FunctionAnnotationsIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/introspection/sctx.h"
+#include "system/globalenv.h"
+
+
+#include "store/api/iterator.h"
+#include "compiler/expression/var_expr.h"
+
+namespace zorba {
+
+// <StaticNamespacesIterator>
+StaticNamespacesIterator::class_factory<StaticNamespacesIterator>
+StaticNamespacesIterator::g_class_factory;
+
+
+void StaticNamespacesIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+StaticNamespacesIterator::~StaticNamespacesIterator() {}
+
+StaticNamespacesIteratorState::StaticNamespacesIteratorState() {}
+
+
+void StaticNamespacesIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </StaticNamespacesIterator>
+
+
+// <DefaultFunctionNamespaceIterator>
+DefaultFunctionNamespaceIterator::class_factory<DefaultFunctionNamespaceIterator>
+DefaultFunctionNamespaceIterator::g_class_factory;
+
+
+void DefaultFunctionNamespaceIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DefaultFunctionNamespaceIterator::~DefaultFunctionNamespaceIterator() {}
+
+// </DefaultFunctionNamespaceIterator>
+
+
+// <SctxBaseUriIterator>
+SctxBaseUriIterator::class_factory<SctxBaseUriIterator>
+SctxBaseUriIterator::g_class_factory;
+
+
+void SctxBaseUriIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+SctxBaseUriIterator::~SctxBaseUriIterator() {}
+
+// </SctxBaseUriIterator>
+
+
+// <SctxDefaultCollationIterator>
+SctxDefaultCollationIterator::class_factory<SctxDefaultCollationIterator>
+SctxDefaultCollationIterator::g_class_factory;
+
+
+void SctxDefaultCollationIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+SctxDefaultCollationIterator::~SctxDefaultCollationIterator() {}
+
+// </SctxDefaultCollationIterator>
+
+
+// <StaticNamespaceBindingIterator>
+StaticNamespaceBindingIterator::class_factory<StaticNamespaceBindingIterator>
+StaticNamespaceBindingIterator::g_class_factory;
+
+
+void StaticNamespaceBindingIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+StaticNamespaceBindingIterator::~StaticNamespaceBindingIterator() {}
+
+// </StaticNamespaceBindingIterator>
+
+
+// <InscopeVariablesIterator>
+InscopeVariablesIterator::class_factory<InscopeVariablesIterator>
+InscopeVariablesIterator::g_class_factory;
+
+
+void InscopeVariablesIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+InscopeVariablesIterator::~InscopeVariablesIterator() {}
+
+InscopeVariablesIteratorState::InscopeVariablesIteratorState() {}
+
+
+void InscopeVariablesIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </InscopeVariablesIterator>
+
+
+// <DefaultCollectionTypeIterator>
+DefaultCollectionTypeIterator::class_factory<DefaultCollectionTypeIterator>
+DefaultCollectionTypeIterator::g_class_factory;
+
+
+void DefaultCollectionTypeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DefaultCollectionTypeIterator::~DefaultCollectionTypeIterator() {}
+
+// </DefaultCollectionTypeIterator>
+
+
+// <XPath10CompatModeIterator>
+XPath10CompatModeIterator::class_factory<XPath10CompatModeIterator>
+XPath10CompatModeIterator::g_class_factory;
+
+
+void XPath10CompatModeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+XPath10CompatModeIterator::~XPath10CompatModeIterator() {}
+
+// </XPath10CompatModeIterator>
+
+
+// <StaticallyKnownDocumentsIterator>
+StaticallyKnownDocumentsIterator::class_factory<StaticallyKnownDocumentsIterator>
+StaticallyKnownDocumentsIterator::g_class_factory;
+
+
+void StaticallyKnownDocumentsIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+StaticallyKnownDocumentsIterator::~StaticallyKnownDocumentsIterator() {}
+
+StaticallyKnownDocumentsIteratorState::StaticallyKnownDocumentsIteratorState() {}
+
+
+void StaticallyKnownDocumentsIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </StaticallyKnownDocumentsIterator>
+
+
+// <StaticallyKnownDocumentTypeIterator>
+StaticallyKnownDocumentTypeIterator::class_factory<StaticallyKnownDocumentTypeIterator>
+StaticallyKnownDocumentTypeIterator::g_class_factory;
+
+
+void StaticallyKnownDocumentTypeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+StaticallyKnownDocumentTypeIterator::~StaticallyKnownDocumentTypeIterator() {}
+
+// </StaticallyKnownDocumentTypeIterator>
+
+
+// <StaticallyKnownCollationsIterator>
+StaticallyKnownCollationsIterator::class_factory<StaticallyKnownCollationsIterator>
+StaticallyKnownCollationsIterator::g_class_factory;
+
+
+void StaticallyKnownCollationsIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+StaticallyKnownCollationsIterator::~StaticallyKnownCollationsIterator() {}
+
+StaticallyKnownCollationsIteratorState::StaticallyKnownCollationsIteratorState() {}
+
+
+void StaticallyKnownCollationsIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </StaticallyKnownCollationsIterator>
+
+
+// <ConstructionModeIterator>
+ConstructionModeIterator::class_factory<ConstructionModeIterator>
+ConstructionModeIterator::g_class_factory;
+
+
+void ConstructionModeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+ConstructionModeIterator::~ConstructionModeIterator() {}
+
+// </ConstructionModeIterator>
+
+
+// <OrderingModeIterator>
+OrderingModeIterator::class_factory<OrderingModeIterator>
+OrderingModeIterator::g_class_factory;
+
+
+void OrderingModeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+OrderingModeIterator::~OrderingModeIterator() {}
+
+// </OrderingModeIterator>
+
+
+// <DefaultOrderIterator>
+DefaultOrderIterator::class_factory<DefaultOrderIterator>
+DefaultOrderIterator::g_class_factory;
+
+
+void DefaultOrderIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+DefaultOrderIterator::~DefaultOrderIterator() {}
+
+// </DefaultOrderIterator>
+
+
+// <BoundarySpacePolicyIterator>
+BoundarySpacePolicyIterator::class_factory<BoundarySpacePolicyIterator>
+BoundarySpacePolicyIterator::g_class_factory;
+
+
+void BoundarySpacePolicyIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+BoundarySpacePolicyIterator::~BoundarySpacePolicyIterator() {}
+
+// </BoundarySpacePolicyIterator>
+
+
+// <CopyNamespacesModeIterator>
+CopyNamespacesModeIterator::class_factory<CopyNamespacesModeIterator>
+CopyNamespacesModeIterator::g_class_factory;
+
+
+void CopyNamespacesModeIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+CopyNamespacesModeIterator::~CopyNamespacesModeIterator() {}
+
+// </CopyNamespacesModeIterator>
+
+
+// <FunctionNamesIterator>
+FunctionNamesIterator::class_factory<FunctionNamesIterator>
+FunctionNamesIterator::g_class_factory;
+
+
+void FunctionNamesIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FunctionNamesIterator::~FunctionNamesIterator() {}
+
+FunctionNamesIteratorState::FunctionNamesIteratorState() {}
+
+
+void FunctionNamesIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </FunctionNamesIterator>
+
+
+// <FunctionArgumentsCountIterator>
+FunctionArgumentsCountIterator::class_factory<FunctionArgumentsCountIterator>
+FunctionArgumentsCountIterator::g_class_factory;
+
+
+void FunctionArgumentsCountIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FunctionArgumentsCountIterator::~FunctionArgumentsCountIterator() {}
+
+FunctionArgumentsCountIteratorState::FunctionArgumentsCountIteratorState() {}
+
+
+void FunctionArgumentsCountIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </FunctionArgumentsCountIterator>
+
+
+// <InScopeSchemaTypesIterator>
+InScopeSchemaTypesIterator::class_factory<InScopeSchemaTypesIterator>
+InScopeSchemaTypesIterator::g_class_factory;
+
+
+void InScopeSchemaTypesIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+InScopeSchemaTypesIterator::~InScopeSchemaTypesIterator() {}
+
+InScopeSchemaTypesIteratorState::InScopeSchemaTypesIteratorState() {}
+
+
+void InScopeSchemaTypesIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </InScopeSchemaTypesIterator>
+
+
+// <InScopeElementDeclarationsIterator>
+InScopeElementDeclarationsIterator::class_factory<InScopeElementDeclarationsIterator>
+InScopeElementDeclarationsIterator::g_class_factory;
+
+
+void InScopeElementDeclarationsIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+InScopeElementDeclarationsIterator::~InScopeElementDeclarationsIterator() {}
+
+InScopeElementDeclarationsIteratorState::InScopeElementDeclarationsIteratorState() {}
+
+
+void InScopeElementDeclarationsIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </InScopeElementDeclarationsIterator>
+
+
+// <InScopeAttributeDeclarationsIterator>
+InScopeAttributeDeclarationsIterator::class_factory<InScopeAttributeDeclarationsIterator>
+InScopeAttributeDeclarationsIterator::g_class_factory;
+
+
+void InScopeAttributeDeclarationsIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+InScopeAttributeDeclarationsIterator::~InScopeAttributeDeclarationsIterator() {}
+
+InScopeAttributeDeclarationsIteratorState::InScopeAttributeDeclarationsIteratorState() {}
+
+
+void InScopeAttributeDeclarationsIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </InScopeAttributeDeclarationsIterator>
+
+
+// <InScopeElementGroupsIterator>
+InScopeElementGroupsIterator::class_factory<InScopeElementGroupsIterator>
+InScopeElementGroupsIterator::g_class_factory;
+
+
+void InScopeElementGroupsIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+InScopeElementGroupsIterator::~InScopeElementGroupsIterator() {}
+
+InScopeElementGroupsIteratorState::InScopeElementGroupsIteratorState() {}
+
+
+void InScopeElementGroupsIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </InScopeElementGroupsIterator>
+
+
+// <InScopeAttributeGroupsIterator>
+InScopeAttributeGroupsIterator::class_factory<InScopeAttributeGroupsIterator>
+InScopeAttributeGroupsIterator::g_class_factory;
+
+
+void InScopeAttributeGroupsIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+InScopeAttributeGroupsIterator::~InScopeAttributeGroupsIterator() {}
+
+InScopeAttributeGroupsIteratorState::InScopeAttributeGroupsIteratorState() {}
+
+
+void InScopeAttributeGroupsIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </InScopeAttributeGroupsIterator>
+
+
+// <OptionIterator>
+OptionIterator::class_factory<OptionIterator>
+OptionIterator::g_class_factory;
+
+
+void OptionIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+OptionIterator::~OptionIterator() {}
+
+// </OptionIterator>
+
+
+// <FunctionAnnotationsIterator>
+FunctionAnnotationsIterator::class_factory<FunctionAnnotationsIterator>
+FunctionAnnotationsIterator::g_class_factory;
+
+
+void FunctionAnnotationsIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+FunctionAnnotationsIterator::~FunctionAnnotationsIterator() {}
+
+FunctionAnnotationsIteratorState::FunctionAnnotationsIteratorState() {}
+
+
+void FunctionAnnotationsIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+}
+// </FunctionAnnotationsIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/introspection/pregenerated/sctx.h'
--- src/runtime/introspection/pregenerated/sctx.h	2012-04-24 12:39:38 +0000
+++ src/runtime/introspection/pregenerated/sctx.h	2012-05-02 07:17:28 +0000
@@ -1,1110 +1,1110 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_INTROSPECTION_SCTX_H
-#define ZORBA_RUNTIME_INTROSPECTION_SCTX_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * 
- *      sc:statically-known-namespaces
- *    
- * Author: Zorba Team
- */
-class StaticNamespacesIteratorState : public PlanIteratorState
-{
-public:
-  store::NsBindings theBindings; //vector of namespace bindings
-  ulong thePosition; //current position
-
-  StaticNamespacesIteratorState();
-
-  ~StaticNamespacesIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class StaticNamespacesIterator : public NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(StaticNamespacesIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticNamespacesIterator,
-    NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>*)this);
-  }
-
-  StaticNamespacesIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~StaticNamespacesIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      sc:default-function-namespace
- *    
- * Author: Zorba Team
- */
-class DefaultFunctionNamespaceIterator : public NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DefaultFunctionNamespaceIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultFunctionNamespaceIterator,
-    NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>*)this);
-  }
-
-  DefaultFunctionNamespaceIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~DefaultFunctionNamespaceIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      sc:base-uri
- *    
- * Author: Zorba Team
- */
-class SctxBaseUriIterator : public NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SctxBaseUriIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SctxBaseUriIterator,
-    NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>*)this);
-  }
-
-  SctxBaseUriIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~SctxBaseUriIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      sc:default-collation
- *    
- * Author: Zorba Team
- */
-class SctxDefaultCollationIterator : public NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SctxDefaultCollationIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SctxDefaultCollationIterator,
-    NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>*)this);
-  }
-
-  SctxDefaultCollationIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~SctxDefaultCollationIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      sc:statically-known-namespace-binding
- *    
- * Author: Zorba Team
- */
-class StaticNamespaceBindingIterator : public NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(StaticNamespaceBindingIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticNamespaceBindingIterator,
-    NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>*)this);
-  }
-
-  StaticNamespaceBindingIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~StaticNamespaceBindingIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:in-scope-variables
- *  
- * Author: Zorba Team
- */
-class InscopeVariablesIteratorState : public PlanIteratorState
-{
-public:
-  std::vector<var_expr_t> theVariables; //vector of variables
-  ulong thePosition; //current position
-
-  InscopeVariablesIteratorState();
-
-  ~InscopeVariablesIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class InscopeVariablesIterator : public NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(InscopeVariablesIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InscopeVariablesIterator,
-    NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>*)this);
-  }
-
-  InscopeVariablesIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~InscopeVariablesIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:default-collection-type
- *  
- * Author: Zorba Team
- */
-class DefaultCollectionTypeIterator : public NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DefaultCollectionTypeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultCollectionTypeIterator,
-    NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>*)this);
-  }
-
-  DefaultCollectionTypeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~DefaultCollectionTypeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:xpath10-compatibility-mode
- *  
- * Author: Zorba Team
- */
-class XPath10CompatModeIterator : public NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(XPath10CompatModeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(XPath10CompatModeIterator,
-    NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>*)this);
-  }
-
-  XPath10CompatModeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~XPath10CompatModeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:statically-known-documents
- *  
- * Author: Zorba Team
- */
-class StaticallyKnownDocumentsIteratorState : public PlanIteratorState
-{
-public:
-  std::vector < zstring > theDocuments; //vector of document URIs
-  ulong thePosition; //current position
-
-  StaticallyKnownDocumentsIteratorState();
-
-  ~StaticallyKnownDocumentsIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class StaticallyKnownDocumentsIterator : public NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(StaticallyKnownDocumentsIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticallyKnownDocumentsIterator,
-    NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>*)this);
-  }
-
-  StaticallyKnownDocumentsIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~StaticallyKnownDocumentsIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:statically-known-document-type
- *  
- * Author: Zorba Team
- */
-class StaticallyKnownDocumentTypeIterator : public NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(StaticallyKnownDocumentTypeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticallyKnownDocumentTypeIterator,
-    NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>*)this);
-  }
-
-  StaticallyKnownDocumentTypeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~StaticallyKnownDocumentTypeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:statically-known-collations
- *  
- * Author: Zorba Team
- */
-class StaticallyKnownCollationsIteratorState : public PlanIteratorState
-{
-public:
-  std::vector < std::string > theCollations; //vector of collation uris
-  ulong thePosition; //current position
-
-  StaticallyKnownCollationsIteratorState();
-
-  ~StaticallyKnownCollationsIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class StaticallyKnownCollationsIterator : public NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(StaticallyKnownCollationsIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticallyKnownCollationsIterator,
-    NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>*)this);
-  }
-
-  StaticallyKnownCollationsIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~StaticallyKnownCollationsIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:construction-mode
- *  
- * Author: Zorba Team
- */
-class ConstructionModeIterator : public NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ConstructionModeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ConstructionModeIterator,
-    NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>*)this);
-  }
-
-  ConstructionModeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~ConstructionModeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:ordering-mode
- *  
- * Author: Zorba Team
- */
-class OrderingModeIterator : public NaryBaseIterator<OrderingModeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(OrderingModeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(OrderingModeIterator,
-    NaryBaseIterator<OrderingModeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<OrderingModeIterator, PlanIteratorState>*)this);
-  }
-
-  OrderingModeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<OrderingModeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~OrderingModeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:default-order
- *  
- * Author: Zorba Team
- */
-class DefaultOrderIterator : public NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(DefaultOrderIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultOrderIterator,
-    NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>*)this);
-  }
-
-  DefaultOrderIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~DefaultOrderIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:boundary-space-policy
- *  
- * Author: Zorba Team
- */
-class BoundarySpacePolicyIterator : public NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(BoundarySpacePolicyIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(BoundarySpacePolicyIterator,
-    NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>*)this);
-  }
-
-  BoundarySpacePolicyIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~BoundarySpacePolicyIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:copy-namespaces-mode
- *  
- * Author: Zorba Team
- */
-class CopyNamespacesModeIterator : public NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(CopyNamespacesModeIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CopyNamespacesModeIterator,
-    NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>*)this);
-  }
-
-  CopyNamespacesModeIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~CopyNamespacesModeIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:function-names
- *  
- * Author: Zorba Team
- */
-class FunctionNamesIteratorState : public PlanIteratorState
-{
-public:
-  std::vector < function *> theFunctions; //vector of functions
-  ulong thePosition; //current position
-
-  FunctionNamesIteratorState();
-
-  ~FunctionNamesIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class FunctionNamesIterator : public NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FunctionNamesIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionNamesIterator,
-    NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>*)this);
-  }
-
-  FunctionNamesIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FunctionNamesIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:function-arguments-count
- *  
- * Author: Zorba Team
- */
-class FunctionArgumentsCountIteratorState : public PlanIteratorState
-{
-public:
-  std::vector < int > arities; //vector of arities
-  unsigned int position; //current position
-
-  FunctionArgumentsCountIteratorState();
-
-  ~FunctionArgumentsCountIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class FunctionArgumentsCountIterator : public NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FunctionArgumentsCountIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionArgumentsCountIterator,
-    NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>*)this);
-  }
-
-  FunctionArgumentsCountIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FunctionArgumentsCountIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:in-scope-schema-types
- *  
- * Author: Zorba Team
- */
-class InScopeSchemaTypesIteratorState : public PlanIteratorState
-{
-public:
-  unsigned int ns_pos; //current position
-  unsigned int elem_pos; //current position
-
-  InScopeSchemaTypesIteratorState();
-
-  ~InScopeSchemaTypesIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class InScopeSchemaTypesIterator : public NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(InScopeSchemaTypesIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeSchemaTypesIterator,
-    NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>*)this);
-  }
-
-  InScopeSchemaTypesIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~InScopeSchemaTypesIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:in-scope-element-declarations
- *  
- * Author: Zorba Team
- */
-class InScopeElementDeclarationsIteratorState : public PlanIteratorState
-{
-public:
-  unsigned int ns_pos; //current position
-  unsigned int elem_pos; //current position
-
-  InScopeElementDeclarationsIteratorState();
-
-  ~InScopeElementDeclarationsIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class InScopeElementDeclarationsIterator : public NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(InScopeElementDeclarationsIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeElementDeclarationsIterator,
-    NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>*)this);
-  }
-
-  InScopeElementDeclarationsIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~InScopeElementDeclarationsIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:in-scope-attribute-declarations
- *  
- * Author: Zorba Team
- */
-class InScopeAttributeDeclarationsIteratorState : public PlanIteratorState
-{
-public:
-  unsigned int ns_pos; //current position
-  unsigned int elem_pos; //current position
-
-  InScopeAttributeDeclarationsIteratorState();
-
-  ~InScopeAttributeDeclarationsIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class InScopeAttributeDeclarationsIterator : public NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(InScopeAttributeDeclarationsIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeAttributeDeclarationsIterator,
-    NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>*)this);
-  }
-
-  InScopeAttributeDeclarationsIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~InScopeAttributeDeclarationsIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:in-scope-schema-types
- *  
- * Author: Zorba Team
- */
-class InScopeElementGroupsIteratorState : public PlanIteratorState
-{
-public:
-  unsigned int ns_pos; //current position
-  unsigned int elem_pos; //current position
-
-  InScopeElementGroupsIteratorState();
-
-  ~InScopeElementGroupsIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class InScopeElementGroupsIterator : public NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(InScopeElementGroupsIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeElementGroupsIterator,
-    NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>*)this);
-  }
-
-  InScopeElementGroupsIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~InScopeElementGroupsIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    sc:in-scope-schema-types
- *  
- * Author: Zorba Team
- */
-class InScopeAttributeGroupsIteratorState : public PlanIteratorState
-{
-public:
-  unsigned int ns_pos; //current position
-  unsigned int elem_pos; //current position
-
-  InScopeAttributeGroupsIteratorState();
-
-  ~InScopeAttributeGroupsIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class InScopeAttributeGroupsIterator : public NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(InScopeAttributeGroupsIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeAttributeGroupsIterator,
-    NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>*)this);
-  }
-
-  InScopeAttributeGroupsIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~InScopeAttributeGroupsIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      sc:option
- *    
- * Author: Zorba Team
- */
-class OptionIterator : public NaryBaseIterator<OptionIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(OptionIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(OptionIterator,
-    NaryBaseIterator<OptionIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<OptionIterator, PlanIteratorState>*)this);
-  }
-
-  OptionIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<OptionIterator, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~OptionIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *      sc:option
- *    
- * Author: Zorba Team
- */
-class FunctionAnnotationsIteratorState : public PlanIteratorState
-{
-public:
-  const function* theFunction; //the function
-  ulong thePosition; //current position
-
-  FunctionAnnotationsIteratorState();
-
-  ~FunctionAnnotationsIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class FunctionAnnotationsIterator : public NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FunctionAnnotationsIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionAnnotationsIterator,
-    NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>*)this);
-  }
-
-  FunctionAnnotationsIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~FunctionAnnotationsIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_INTROSPECTION_SCTX_H
+#define ZORBA_RUNTIME_INTROSPECTION_SCTX_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * 
+ *      sc:statically-known-namespaces
+ *    
+ * Author: Zorba Team
+ */
+class StaticNamespacesIteratorState : public PlanIteratorState
+{
+public:
+  store::NsBindings theBindings; //vector of namespace bindings
+  ulong thePosition; //current position
+
+  StaticNamespacesIteratorState();
+
+  ~StaticNamespacesIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class StaticNamespacesIterator : public NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(StaticNamespacesIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticNamespacesIterator,
+    NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>*)this);
+  }
+
+  StaticNamespacesIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<StaticNamespacesIterator, StaticNamespacesIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~StaticNamespacesIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      sc:default-function-namespace
+ *    
+ * Author: Zorba Team
+ */
+class DefaultFunctionNamespaceIterator : public NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DefaultFunctionNamespaceIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultFunctionNamespaceIterator,
+    NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>*)this);
+  }
+
+  DefaultFunctionNamespaceIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DefaultFunctionNamespaceIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~DefaultFunctionNamespaceIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      sc:base-uri
+ *    
+ * Author: Zorba Team
+ */
+class SctxBaseUriIterator : public NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SctxBaseUriIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SctxBaseUriIterator,
+    NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>*)this);
+  }
+
+  SctxBaseUriIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<SctxBaseUriIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~SctxBaseUriIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      sc:default-collation
+ *    
+ * Author: Zorba Team
+ */
+class SctxDefaultCollationIterator : public NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SctxDefaultCollationIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SctxDefaultCollationIterator,
+    NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>*)this);
+  }
+
+  SctxDefaultCollationIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<SctxDefaultCollationIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~SctxDefaultCollationIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      sc:statically-known-namespace-binding
+ *    
+ * Author: Zorba Team
+ */
+class StaticNamespaceBindingIterator : public NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(StaticNamespaceBindingIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticNamespaceBindingIterator,
+    NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>*)this);
+  }
+
+  StaticNamespaceBindingIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<StaticNamespaceBindingIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~StaticNamespaceBindingIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:in-scope-variables
+ *  
+ * Author: Zorba Team
+ */
+class InscopeVariablesIteratorState : public PlanIteratorState
+{
+public:
+  std::vector<var_expr_t> theVariables; //vector of variables
+  ulong thePosition; //current position
+
+  InscopeVariablesIteratorState();
+
+  ~InscopeVariablesIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class InscopeVariablesIterator : public NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(InscopeVariablesIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InscopeVariablesIterator,
+    NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>*)this);
+  }
+
+  InscopeVariablesIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<InscopeVariablesIterator, InscopeVariablesIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~InscopeVariablesIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:default-collection-type
+ *  
+ * Author: Zorba Team
+ */
+class DefaultCollectionTypeIterator : public NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DefaultCollectionTypeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultCollectionTypeIterator,
+    NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>*)this);
+  }
+
+  DefaultCollectionTypeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DefaultCollectionTypeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~DefaultCollectionTypeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:xpath10-compatibility-mode
+ *  
+ * Author: Zorba Team
+ */
+class XPath10CompatModeIterator : public NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(XPath10CompatModeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(XPath10CompatModeIterator,
+    NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>*)this);
+  }
+
+  XPath10CompatModeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<XPath10CompatModeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~XPath10CompatModeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:statically-known-documents
+ *  
+ * Author: Zorba Team
+ */
+class StaticallyKnownDocumentsIteratorState : public PlanIteratorState
+{
+public:
+  std::vector < zstring > theDocuments; //vector of document URIs
+  ulong thePosition; //current position
+
+  StaticallyKnownDocumentsIteratorState();
+
+  ~StaticallyKnownDocumentsIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class StaticallyKnownDocumentsIterator : public NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(StaticallyKnownDocumentsIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticallyKnownDocumentsIterator,
+    NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>*)this);
+  }
+
+  StaticallyKnownDocumentsIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<StaticallyKnownDocumentsIterator, StaticallyKnownDocumentsIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~StaticallyKnownDocumentsIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:statically-known-document-type
+ *  
+ * Author: Zorba Team
+ */
+class StaticallyKnownDocumentTypeIterator : public NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(StaticallyKnownDocumentTypeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticallyKnownDocumentTypeIterator,
+    NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>*)this);
+  }
+
+  StaticallyKnownDocumentTypeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<StaticallyKnownDocumentTypeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~StaticallyKnownDocumentTypeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:statically-known-collations
+ *  
+ * Author: Zorba Team
+ */
+class StaticallyKnownCollationsIteratorState : public PlanIteratorState
+{
+public:
+  std::vector < std::string > theCollations; //vector of collation uris
+  ulong thePosition; //current position
+
+  StaticallyKnownCollationsIteratorState();
+
+  ~StaticallyKnownCollationsIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class StaticallyKnownCollationsIterator : public NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(StaticallyKnownCollationsIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(StaticallyKnownCollationsIterator,
+    NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>*)this);
+  }
+
+  StaticallyKnownCollationsIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<StaticallyKnownCollationsIterator, StaticallyKnownCollationsIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~StaticallyKnownCollationsIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:construction-mode
+ *  
+ * Author: Zorba Team
+ */
+class ConstructionModeIterator : public NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ConstructionModeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ConstructionModeIterator,
+    NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>*)this);
+  }
+
+  ConstructionModeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<ConstructionModeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~ConstructionModeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:ordering-mode
+ *  
+ * Author: Zorba Team
+ */
+class OrderingModeIterator : public NaryBaseIterator<OrderingModeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(OrderingModeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(OrderingModeIterator,
+    NaryBaseIterator<OrderingModeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<OrderingModeIterator, PlanIteratorState>*)this);
+  }
+
+  OrderingModeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<OrderingModeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~OrderingModeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:default-order
+ *  
+ * Author: Zorba Team
+ */
+class DefaultOrderIterator : public NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(DefaultOrderIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(DefaultOrderIterator,
+    NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>*)this);
+  }
+
+  DefaultOrderIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<DefaultOrderIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~DefaultOrderIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:boundary-space-policy
+ *  
+ * Author: Zorba Team
+ */
+class BoundarySpacePolicyIterator : public NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(BoundarySpacePolicyIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(BoundarySpacePolicyIterator,
+    NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>*)this);
+  }
+
+  BoundarySpacePolicyIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<BoundarySpacePolicyIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~BoundarySpacePolicyIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:copy-namespaces-mode
+ *  
+ * Author: Zorba Team
+ */
+class CopyNamespacesModeIterator : public NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(CopyNamespacesModeIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CopyNamespacesModeIterator,
+    NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>*)this);
+  }
+
+  CopyNamespacesModeIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<CopyNamespacesModeIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~CopyNamespacesModeIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:function-names
+ *  
+ * Author: Zorba Team
+ */
+class FunctionNamesIteratorState : public PlanIteratorState
+{
+public:
+  std::vector < function *> theFunctions; //vector of functions
+  ulong thePosition; //current position
+
+  FunctionNamesIteratorState();
+
+  ~FunctionNamesIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class FunctionNamesIterator : public NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FunctionNamesIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionNamesIterator,
+    NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>*)this);
+  }
+
+  FunctionNamesIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FunctionNamesIterator, FunctionNamesIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FunctionNamesIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:function-arguments-count
+ *  
+ * Author: Zorba Team
+ */
+class FunctionArgumentsCountIteratorState : public PlanIteratorState
+{
+public:
+  std::vector < int > arities; //vector of arities
+  unsigned int position; //current position
+
+  FunctionArgumentsCountIteratorState();
+
+  ~FunctionArgumentsCountIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class FunctionArgumentsCountIterator : public NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FunctionArgumentsCountIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionArgumentsCountIterator,
+    NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>*)this);
+  }
+
+  FunctionArgumentsCountIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FunctionArgumentsCountIterator, FunctionArgumentsCountIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FunctionArgumentsCountIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:in-scope-schema-types
+ *  
+ * Author: Zorba Team
+ */
+class InScopeSchemaTypesIteratorState : public PlanIteratorState
+{
+public:
+  unsigned int ns_pos; //current position
+  unsigned int elem_pos; //current position
+
+  InScopeSchemaTypesIteratorState();
+
+  ~InScopeSchemaTypesIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class InScopeSchemaTypesIterator : public NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(InScopeSchemaTypesIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeSchemaTypesIterator,
+    NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>*)this);
+  }
+
+  InScopeSchemaTypesIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<InScopeSchemaTypesIterator, InScopeSchemaTypesIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~InScopeSchemaTypesIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:in-scope-element-declarations
+ *  
+ * Author: Zorba Team
+ */
+class InScopeElementDeclarationsIteratorState : public PlanIteratorState
+{
+public:
+  unsigned int ns_pos; //current position
+  unsigned int elem_pos; //current position
+
+  InScopeElementDeclarationsIteratorState();
+
+  ~InScopeElementDeclarationsIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class InScopeElementDeclarationsIterator : public NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(InScopeElementDeclarationsIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeElementDeclarationsIterator,
+    NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>*)this);
+  }
+
+  InScopeElementDeclarationsIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<InScopeElementDeclarationsIterator, InScopeElementDeclarationsIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~InScopeElementDeclarationsIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:in-scope-attribute-declarations
+ *  
+ * Author: Zorba Team
+ */
+class InScopeAttributeDeclarationsIteratorState : public PlanIteratorState
+{
+public:
+  unsigned int ns_pos; //current position
+  unsigned int elem_pos; //current position
+
+  InScopeAttributeDeclarationsIteratorState();
+
+  ~InScopeAttributeDeclarationsIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class InScopeAttributeDeclarationsIterator : public NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(InScopeAttributeDeclarationsIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeAttributeDeclarationsIterator,
+    NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>*)this);
+  }
+
+  InScopeAttributeDeclarationsIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<InScopeAttributeDeclarationsIterator, InScopeAttributeDeclarationsIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~InScopeAttributeDeclarationsIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:in-scope-schema-types
+ *  
+ * Author: Zorba Team
+ */
+class InScopeElementGroupsIteratorState : public PlanIteratorState
+{
+public:
+  unsigned int ns_pos; //current position
+  unsigned int elem_pos; //current position
+
+  InScopeElementGroupsIteratorState();
+
+  ~InScopeElementGroupsIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class InScopeElementGroupsIterator : public NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(InScopeElementGroupsIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeElementGroupsIterator,
+    NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>*)this);
+  }
+
+  InScopeElementGroupsIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<InScopeElementGroupsIterator, InScopeElementGroupsIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~InScopeElementGroupsIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    sc:in-scope-schema-types
+ *  
+ * Author: Zorba Team
+ */
+class InScopeAttributeGroupsIteratorState : public PlanIteratorState
+{
+public:
+  unsigned int ns_pos; //current position
+  unsigned int elem_pos; //current position
+
+  InScopeAttributeGroupsIteratorState();
+
+  ~InScopeAttributeGroupsIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class InScopeAttributeGroupsIterator : public NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(InScopeAttributeGroupsIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(InScopeAttributeGroupsIterator,
+    NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>*)this);
+  }
+
+  InScopeAttributeGroupsIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<InScopeAttributeGroupsIterator, InScopeAttributeGroupsIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~InScopeAttributeGroupsIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      sc:option
+ *    
+ * Author: Zorba Team
+ */
+class OptionIterator : public NaryBaseIterator<OptionIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(OptionIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(OptionIterator,
+    NaryBaseIterator<OptionIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<OptionIterator, PlanIteratorState>*)this);
+  }
+
+  OptionIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<OptionIterator, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~OptionIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *      sc:option
+ *    
+ * Author: Zorba Team
+ */
+class FunctionAnnotationsIteratorState : public PlanIteratorState
+{
+public:
+  const function* theFunction; //the function
+  ulong thePosition; //current position
+
+  FunctionAnnotationsIteratorState();
+
+  ~FunctionAnnotationsIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class FunctionAnnotationsIterator : public NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FunctionAnnotationsIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FunctionAnnotationsIterator,
+    NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>*)this);
+  }
+
+  FunctionAnnotationsIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<FunctionAnnotationsIterator, FunctionAnnotationsIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~FunctionAnnotationsIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/json/pregenerated/json.cpp'
--- src/runtime/json/pregenerated/json.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/json/pregenerated/json.cpp	2012-05-02 07:17:28 +0000
@@ -1,82 +1,82 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/json/json.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <JSONParseInternal>
-JSONParseInternal::class_factory<JSONParseInternal>
-JSONParseInternal::g_class_factory;
-
-
-void JSONParseInternal::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-JSONParseInternal::~JSONParseInternal() {}
-
-// </JSONParseInternal>
-
-
-// <JSONSerializeInternal>
-JSONSerializeInternal::class_factory<JSONSerializeInternal>
-JSONSerializeInternal::g_class_factory;
-
-
-void JSONSerializeInternal::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
-  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
-  for ( ; lIter != lEnd; ++lIter ){
-    (*lIter)->accept(v);
-  }
-
-  v.endVisit(*this);
-}
-
-JSONSerializeInternal::~JSONSerializeInternal() {}
-
-// </JSONSerializeInternal>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/json/json.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <JSONParseInternal>
+JSONParseInternal::class_factory<JSONParseInternal>
+JSONParseInternal::g_class_factory;
+
+
+void JSONParseInternal::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+JSONParseInternal::~JSONParseInternal() {}
+
+// </JSONParseInternal>
+
+
+// <JSONSerializeInternal>
+JSONSerializeInternal::class_factory<JSONSerializeInternal>
+JSONSerializeInternal::g_class_factory;
+
+
+void JSONSerializeInternal::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  std::vector<PlanIter_t>::const_iterator lIter = theChildren.begin();
+  std::vector<PlanIter_t>::const_iterator lEnd = theChildren.end();
+  for ( ; lIter != lEnd; ++lIter ){
+    (*lIter)->accept(v);
+  }
+
+  v.endVisit(*this);
+}
+
+JSONSerializeInternal::~JSONSerializeInternal() {}
+
+// </JSONSerializeInternal>
+
+
+
+}
+
+

=== modified file 'src/runtime/json/pregenerated/json.h'
--- src/runtime/json/pregenerated/json.h	2012-04-24 12:39:38 +0000
+++ src/runtime/json/pregenerated/json.h	2012-05-02 07:17:28 +0000
@@ -1,114 +1,114 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_JSON_JSON_H
-#define ZORBA_RUNTIME_JSON_JSON_H
-
-
-#include "common/shared_types.h"
-
-
-
-#include "runtime/base/narybase.h"
-
-
-namespace zorba {
-
-/**
- * 
- *    function for parsing strings into json-xdm
- *  
- * Author: Zorba Team
- */
-class JSONParseInternal : public NaryBaseIterator<JSONParseInternal, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(JSONParseInternal);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONParseInternal,
-    NaryBaseIterator<JSONParseInternal, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<JSONParseInternal, PlanIteratorState>*)this);
-  }
-
-  JSONParseInternal(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<JSONParseInternal, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~JSONParseInternal();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * 
- *    Function to serialize json/jsonml xdm to string
- *  
- * Author: Zorba Team
- */
-class JSONSerializeInternal : public NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(JSONSerializeInternal);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONSerializeInternal,
-    NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>*)this);
-  }
-
-  JSONSerializeInternal(
-    static_context* sctx,
-    const QueryLoc& loc,
-    std::vector<PlanIter_t>& children)
-    : 
-    NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>(sctx, loc, children)
-  {}
-
-  virtual ~JSONSerializeInternal();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_JSON_JSON_H
+#define ZORBA_RUNTIME_JSON_JSON_H
+
+
+#include "common/shared_types.h"
+
+
+
+#include "runtime/base/narybase.h"
+
+
+namespace zorba {
+
+/**
+ * 
+ *    function for parsing strings into json-xdm
+ *  
+ * Author: Zorba Team
+ */
+class JSONParseInternal : public NaryBaseIterator<JSONParseInternal, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(JSONParseInternal);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONParseInternal,
+    NaryBaseIterator<JSONParseInternal, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<JSONParseInternal, PlanIteratorState>*)this);
+  }
+
+  JSONParseInternal(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<JSONParseInternal, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~JSONParseInternal();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * 
+ *    Function to serialize json/jsonml xdm to string
+ *  
+ * Author: Zorba Team
+ */
+class JSONSerializeInternal : public NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(JSONSerializeInternal);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(JSONSerializeInternal,
+    NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>*)this);
+  }
+
+  JSONSerializeInternal(
+    static_context* sctx,
+    const QueryLoc& loc,
+    std::vector<PlanIter_t>& children)
+    : 
+    NaryBaseIterator<JSONSerializeInternal, PlanIteratorState>(sctx, loc, children)
+  {}
+
+  virtual ~JSONSerializeInternal();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/maths/pregenerated/maths.cpp'
--- src/runtime/maths/pregenerated/maths.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/maths/pregenerated/maths.cpp	2012-05-02 07:17:28 +0000
@@ -1,538 +1,538 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-
-#include "stdafx.h"
-#include "zorbatypes/rchandle.h"
-#include "zorbatypes/zstring.h"
-#include "runtime/visitors/planiter_visitor.h"
-#include "runtime/maths/maths.h"
-#include "system/globalenv.h"
-
-
-
-namespace zorba {
-
-// <SqrtIterator>
-SqrtIterator::class_factory<SqrtIterator>
-SqrtIterator::g_class_factory;
-
-
-void SqrtIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-SqrtIterator::~SqrtIterator() {}
-
-// </SqrtIterator>
-
-
-// <ExpIterator>
-ExpIterator::class_factory<ExpIterator>
-ExpIterator::g_class_factory;
-
-
-void ExpIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-ExpIterator::~ExpIterator() {}
-
-// </ExpIterator>
-
-
-// <Exp10Iterator>
-Exp10Iterator::class_factory<Exp10Iterator>
-Exp10Iterator::g_class_factory;
-
-
-void Exp10Iterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-Exp10Iterator::~Exp10Iterator() {}
-
-// </Exp10Iterator>
-
-
-// <LogIterator>
-LogIterator::class_factory<LogIterator>
-LogIterator::g_class_factory;
-
-
-void LogIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-LogIterator::~LogIterator() {}
-
-// </LogIterator>
-
-
-// <Log10Iterator>
-Log10Iterator::class_factory<Log10Iterator>
-Log10Iterator::g_class_factory;
-
-
-void Log10Iterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-Log10Iterator::~Log10Iterator() {}
-
-// </Log10Iterator>
-
-
-// <SinIterator>
-SinIterator::class_factory<SinIterator>
-SinIterator::g_class_factory;
-
-
-void SinIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-SinIterator::~SinIterator() {}
-
-// </SinIterator>
-
-
-// <CosIterator>
-CosIterator::class_factory<CosIterator>
-CosIterator::g_class_factory;
-
-
-void CosIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-CosIterator::~CosIterator() {}
-
-// </CosIterator>
-
-
-// <TanIterator>
-TanIterator::class_factory<TanIterator>
-TanIterator::g_class_factory;
-
-
-void TanIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-TanIterator::~TanIterator() {}
-
-// </TanIterator>
-
-
-// <ArcSinIterator>
-ArcSinIterator::class_factory<ArcSinIterator>
-ArcSinIterator::g_class_factory;
-
-
-void ArcSinIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-ArcSinIterator::~ArcSinIterator() {}
-
-// </ArcSinIterator>
-
-
-// <ArcCosIterator>
-ArcCosIterator::class_factory<ArcCosIterator>
-ArcCosIterator::g_class_factory;
-
-
-void ArcCosIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-ArcCosIterator::~ArcCosIterator() {}
-
-// </ArcCosIterator>
-
-
-// <ArcTanIterator>
-ArcTanIterator::class_factory<ArcTanIterator>
-ArcTanIterator::g_class_factory;
-
-
-void ArcTanIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-ArcTanIterator::~ArcTanIterator() {}
-
-// </ArcTanIterator>
-
-
-// <Atan2Iterator>
-Atan2Iterator::class_factory<Atan2Iterator>
-Atan2Iterator::g_class_factory;
-
-
-void Atan2Iterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild0->accept(v);
-theChild1->accept(v);
-
-  v.endVisit(*this);
-}
-
-Atan2Iterator::~Atan2Iterator() {}
-
-// </Atan2Iterator>
-
-
-// <CoshIterator>
-CoshIterator::class_factory<CoshIterator>
-CoshIterator::g_class_factory;
-
-
-void CoshIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-CoshIterator::~CoshIterator() {}
-
-// </CoshIterator>
-
-
-// <AcoshIterator>
-AcoshIterator::class_factory<AcoshIterator>
-AcoshIterator::g_class_factory;
-
-
-void AcoshIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-AcoshIterator::~AcoshIterator() {}
-
-// </AcoshIterator>
-
-
-// <FmodIterator>
-FmodIterator::class_factory<FmodIterator>
-FmodIterator::g_class_factory;
-
-
-void FmodIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild0->accept(v);
-theChild1->accept(v);
-
-  v.endVisit(*this);
-}
-
-FmodIterator::~FmodIterator() {}
-
-// </FmodIterator>
-
-
-// <LdexpIterator>
-LdexpIterator::class_factory<LdexpIterator>
-LdexpIterator::g_class_factory;
-
-
-void LdexpIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild0->accept(v);
-theChild1->accept(v);
-
-  v.endVisit(*this);
-}
-
-LdexpIterator::~LdexpIterator() {}
-
-// </LdexpIterator>
-
-
-// <PowIterator>
-PowIterator::class_factory<PowIterator>
-PowIterator::g_class_factory;
-
-
-void PowIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild0->accept(v);
-theChild1->accept(v);
-
-  v.endVisit(*this);
-}
-
-PowIterator::~PowIterator() {}
-
-// </PowIterator>
-
-
-// <SinhIterator>
-SinhIterator::class_factory<SinhIterator>
-SinhIterator::g_class_factory;
-
-
-void SinhIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-SinhIterator::~SinhIterator() {}
-
-// </SinhIterator>
-
-
-// <AsinhIterator>
-AsinhIterator::class_factory<AsinhIterator>
-AsinhIterator::g_class_factory;
-
-
-void AsinhIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-AsinhIterator::~AsinhIterator() {}
-
-// </AsinhIterator>
-
-
-// <TanhIterator>
-TanhIterator::class_factory<TanhIterator>
-TanhIterator::g_class_factory;
-
-
-void TanhIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-TanhIterator::~TanhIterator() {}
-
-// </TanhIterator>
-
-
-// <AtanhIterator>
-AtanhIterator::class_factory<AtanhIterator>
-AtanhIterator::g_class_factory;
-
-
-void AtanhIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-AtanhIterator::~AtanhIterator() {}
-
-// </AtanhIterator>
-
-
-// <PiNumberIterator>
-PiNumberIterator::class_factory<PiNumberIterator>
-PiNumberIterator::g_class_factory;
-
-
-void PiNumberIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  
-
-  v.endVisit(*this);
-}
-
-PiNumberIterator::~PiNumberIterator() {}
-
-// </PiNumberIterator>
-
-
-// <IsInfIterator>
-IsInfIterator::class_factory<IsInfIterator>
-IsInfIterator::g_class_factory;
-
-
-void IsInfIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-IsInfIterator::~IsInfIterator() {}
-
-// </IsInfIterator>
-
-
-// <IsNaNIterator>
-IsNaNIterator::class_factory<IsNaNIterator>
-IsNaNIterator::g_class_factory;
-
-
-void IsNaNIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-IsNaNIterator::~IsNaNIterator() {}
-
-// </IsNaNIterator>
-
-
-// <ModfIterator>
-ModfIterator::class_factory<ModfIterator>
-ModfIterator::g_class_factory;
-
-
-void ModfIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-ModfIterator::~ModfIterator() {}
-
-ModfIteratorState::ModfIteratorState() {}
-
-ModfIteratorState::~ModfIteratorState() {}
-
-
-void ModfIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-  theDoubInteger = xs_double::zero();
-}
-
-void ModfIteratorState::reset(PlanState& planState) {
-  PlanIteratorState::reset(planState);
-  theDoubInteger = xs_double::zero();
-}
-// </ModfIterator>
-
-
-// <FrexpIterator>
-FrexpIterator::class_factory<FrexpIterator>
-FrexpIterator::g_class_factory;
-
-
-void FrexpIterator::accept(PlanIterVisitor& v) const {
-  v.beginVisit(*this);
-
-  theChild->accept(v);
-
-  v.endVisit(*this);
-}
-
-FrexpIterator::~FrexpIterator() {}
-
-FrexpIteratorState::FrexpIteratorState() {}
-
-FrexpIteratorState::~FrexpIteratorState() {}
-
-
-void FrexpIteratorState::init(PlanState& planState) {
-  PlanIteratorState::init(planState);
-  theIntExponent = xs_integer::zero();
-}
-
-void FrexpIteratorState::reset(PlanState& planState) {
-  PlanIteratorState::reset(planState);
-  theIntExponent = xs_integer::zero();
-}
-// </FrexpIterator>
-
-
-
-}
-
-
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+
+#include "stdafx.h"
+#include "zorbatypes/rchandle.h"
+#include "zorbatypes/zstring.h"
+#include "runtime/visitors/planiter_visitor.h"
+#include "runtime/maths/maths.h"
+#include "system/globalenv.h"
+
+
+
+namespace zorba {
+
+// <SqrtIterator>
+SqrtIterator::class_factory<SqrtIterator>
+SqrtIterator::g_class_factory;
+
+
+void SqrtIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+SqrtIterator::~SqrtIterator() {}
+
+// </SqrtIterator>
+
+
+// <ExpIterator>
+ExpIterator::class_factory<ExpIterator>
+ExpIterator::g_class_factory;
+
+
+void ExpIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+ExpIterator::~ExpIterator() {}
+
+// </ExpIterator>
+
+
+// <Exp10Iterator>
+Exp10Iterator::class_factory<Exp10Iterator>
+Exp10Iterator::g_class_factory;
+
+
+void Exp10Iterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+Exp10Iterator::~Exp10Iterator() {}
+
+// </Exp10Iterator>
+
+
+// <LogIterator>
+LogIterator::class_factory<LogIterator>
+LogIterator::g_class_factory;
+
+
+void LogIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+LogIterator::~LogIterator() {}
+
+// </LogIterator>
+
+
+// <Log10Iterator>
+Log10Iterator::class_factory<Log10Iterator>
+Log10Iterator::g_class_factory;
+
+
+void Log10Iterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+Log10Iterator::~Log10Iterator() {}
+
+// </Log10Iterator>
+
+
+// <SinIterator>
+SinIterator::class_factory<SinIterator>
+SinIterator::g_class_factory;
+
+
+void SinIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+SinIterator::~SinIterator() {}
+
+// </SinIterator>
+
+
+// <CosIterator>
+CosIterator::class_factory<CosIterator>
+CosIterator::g_class_factory;
+
+
+void CosIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+CosIterator::~CosIterator() {}
+
+// </CosIterator>
+
+
+// <TanIterator>
+TanIterator::class_factory<TanIterator>
+TanIterator::g_class_factory;
+
+
+void TanIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+TanIterator::~TanIterator() {}
+
+// </TanIterator>
+
+
+// <ArcSinIterator>
+ArcSinIterator::class_factory<ArcSinIterator>
+ArcSinIterator::g_class_factory;
+
+
+void ArcSinIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+ArcSinIterator::~ArcSinIterator() {}
+
+// </ArcSinIterator>
+
+
+// <ArcCosIterator>
+ArcCosIterator::class_factory<ArcCosIterator>
+ArcCosIterator::g_class_factory;
+
+
+void ArcCosIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+ArcCosIterator::~ArcCosIterator() {}
+
+// </ArcCosIterator>
+
+
+// <ArcTanIterator>
+ArcTanIterator::class_factory<ArcTanIterator>
+ArcTanIterator::g_class_factory;
+
+
+void ArcTanIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+ArcTanIterator::~ArcTanIterator() {}
+
+// </ArcTanIterator>
+
+
+// <Atan2Iterator>
+Atan2Iterator::class_factory<Atan2Iterator>
+Atan2Iterator::g_class_factory;
+
+
+void Atan2Iterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild0->accept(v);
+theChild1->accept(v);
+
+  v.endVisit(*this);
+}
+
+Atan2Iterator::~Atan2Iterator() {}
+
+// </Atan2Iterator>
+
+
+// <CoshIterator>
+CoshIterator::class_factory<CoshIterator>
+CoshIterator::g_class_factory;
+
+
+void CoshIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+CoshIterator::~CoshIterator() {}
+
+// </CoshIterator>
+
+
+// <AcoshIterator>
+AcoshIterator::class_factory<AcoshIterator>
+AcoshIterator::g_class_factory;
+
+
+void AcoshIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+AcoshIterator::~AcoshIterator() {}
+
+// </AcoshIterator>
+
+
+// <FmodIterator>
+FmodIterator::class_factory<FmodIterator>
+FmodIterator::g_class_factory;
+
+
+void FmodIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild0->accept(v);
+theChild1->accept(v);
+
+  v.endVisit(*this);
+}
+
+FmodIterator::~FmodIterator() {}
+
+// </FmodIterator>
+
+
+// <LdexpIterator>
+LdexpIterator::class_factory<LdexpIterator>
+LdexpIterator::g_class_factory;
+
+
+void LdexpIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild0->accept(v);
+theChild1->accept(v);
+
+  v.endVisit(*this);
+}
+
+LdexpIterator::~LdexpIterator() {}
+
+// </LdexpIterator>
+
+
+// <PowIterator>
+PowIterator::class_factory<PowIterator>
+PowIterator::g_class_factory;
+
+
+void PowIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild0->accept(v);
+theChild1->accept(v);
+
+  v.endVisit(*this);
+}
+
+PowIterator::~PowIterator() {}
+
+// </PowIterator>
+
+
+// <SinhIterator>
+SinhIterator::class_factory<SinhIterator>
+SinhIterator::g_class_factory;
+
+
+void SinhIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+SinhIterator::~SinhIterator() {}
+
+// </SinhIterator>
+
+
+// <AsinhIterator>
+AsinhIterator::class_factory<AsinhIterator>
+AsinhIterator::g_class_factory;
+
+
+void AsinhIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+AsinhIterator::~AsinhIterator() {}
+
+// </AsinhIterator>
+
+
+// <TanhIterator>
+TanhIterator::class_factory<TanhIterator>
+TanhIterator::g_class_factory;
+
+
+void TanhIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+TanhIterator::~TanhIterator() {}
+
+// </TanhIterator>
+
+
+// <AtanhIterator>
+AtanhIterator::class_factory<AtanhIterator>
+AtanhIterator::g_class_factory;
+
+
+void AtanhIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+AtanhIterator::~AtanhIterator() {}
+
+// </AtanhIterator>
+
+
+// <PiNumberIterator>
+PiNumberIterator::class_factory<PiNumberIterator>
+PiNumberIterator::g_class_factory;
+
+
+void PiNumberIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  
+
+  v.endVisit(*this);
+}
+
+PiNumberIterator::~PiNumberIterator() {}
+
+// </PiNumberIterator>
+
+
+// <IsInfIterator>
+IsInfIterator::class_factory<IsInfIterator>
+IsInfIterator::g_class_factory;
+
+
+void IsInfIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+IsInfIterator::~IsInfIterator() {}
+
+// </IsInfIterator>
+
+
+// <IsNaNIterator>
+IsNaNIterator::class_factory<IsNaNIterator>
+IsNaNIterator::g_class_factory;
+
+
+void IsNaNIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+IsNaNIterator::~IsNaNIterator() {}
+
+// </IsNaNIterator>
+
+
+// <ModfIterator>
+ModfIterator::class_factory<ModfIterator>
+ModfIterator::g_class_factory;
+
+
+void ModfIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+ModfIterator::~ModfIterator() {}
+
+ModfIteratorState::ModfIteratorState() {}
+
+ModfIteratorState::~ModfIteratorState() {}
+
+
+void ModfIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+  theDoubInteger = xs_double::zero();
+}
+
+void ModfIteratorState::reset(PlanState& planState) {
+  PlanIteratorState::reset(planState);
+  theDoubInteger = xs_double::zero();
+}
+// </ModfIterator>
+
+
+// <FrexpIterator>
+FrexpIterator::class_factory<FrexpIterator>
+FrexpIterator::g_class_factory;
+
+
+void FrexpIterator::accept(PlanIterVisitor& v) const {
+  v.beginVisit(*this);
+
+  theChild->accept(v);
+
+  v.endVisit(*this);
+}
+
+FrexpIterator::~FrexpIterator() {}
+
+FrexpIteratorState::FrexpIteratorState() {}
+
+FrexpIteratorState::~FrexpIteratorState() {}
+
+
+void FrexpIteratorState::init(PlanState& planState) {
+  PlanIteratorState::init(planState);
+  theIntExponent = xs_integer::zero();
+}
+
+void FrexpIteratorState::reset(PlanState& planState) {
+  PlanIteratorState::reset(planState);
+  theIntExponent = xs_integer::zero();
+}
+// </FrexpIterator>
+
+
+
+}
+
+

=== modified file 'src/runtime/maths/pregenerated/maths.h'
--- src/runtime/maths/pregenerated/maths.h	2012-04-24 12:39:38 +0000
+++ src/runtime/maths/pregenerated/maths.h	2012-05-02 07:17:28 +0000
@@ -1,952 +1,952 @@
-/*
- * Copyright 2006-2008 The FLWOR Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
- 
-// ******************************************
-// *                                        *
-// * THIS IS A GENERATED FILE. DO NOT EDIT! *
-// * SEE .xml FILE WITH SAME NAME           *
-// *                                        *
-// ******************************************
-#ifndef ZORBA_RUNTIME_MATHS_MATHS_H
-#define ZORBA_RUNTIME_MATHS_MATHS_H
-
-
-#include "common/shared_types.h"
-#include "runtime/base/unarybase.h"
-#include "runtime/base/binarybase.h"
-#include "runtime/base/noarybase.h"
-
-#include "zorbatypes/schema_types.h"
-
-
-namespace zorba {
-
-/**
- * math:sqrt
- * Author: Zorba Team
- */
-class SqrtIterator : public UnaryBaseIterator<SqrtIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SqrtIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SqrtIterator,
-    UnaryBaseIterator<SqrtIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<SqrtIterator, PlanIteratorState>*)this);
-  }
-
-  SqrtIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<SqrtIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~SqrtIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:exp
- * Author: Zorba Team
- */
-class ExpIterator : public UnaryBaseIterator<ExpIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ExpIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ExpIterator,
-    UnaryBaseIterator<ExpIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<ExpIterator, PlanIteratorState>*)this);
-  }
-
-  ExpIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<ExpIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~ExpIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:exp10
- * Author: Zorba Team
- */
-class Exp10Iterator : public UnaryBaseIterator<Exp10Iterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(Exp10Iterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Exp10Iterator,
-    UnaryBaseIterator<Exp10Iterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<Exp10Iterator, PlanIteratorState>*)this);
-  }
-
-  Exp10Iterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<Exp10Iterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~Exp10Iterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:log
- * Author: Zorba Team
- */
-class LogIterator : public UnaryBaseIterator<LogIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(LogIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(LogIterator,
-    UnaryBaseIterator<LogIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<LogIterator, PlanIteratorState>*)this);
-  }
-
-  LogIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<LogIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~LogIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:log10
- * Author: Zorba Team
- */
-class Log10Iterator : public UnaryBaseIterator<Log10Iterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(Log10Iterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Log10Iterator,
-    UnaryBaseIterator<Log10Iterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<Log10Iterator, PlanIteratorState>*)this);
-  }
-
-  Log10Iterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<Log10Iterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~Log10Iterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:sin
- * Author: Zorba Team
- */
-class SinIterator : public UnaryBaseIterator<SinIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SinIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SinIterator,
-    UnaryBaseIterator<SinIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<SinIterator, PlanIteratorState>*)this);
-  }
-
-  SinIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<SinIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~SinIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:cos
- * Author: Zorba Team
- */
-class CosIterator : public UnaryBaseIterator<CosIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(CosIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CosIterator,
-    UnaryBaseIterator<CosIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<CosIterator, PlanIteratorState>*)this);
-  }
-
-  CosIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<CosIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~CosIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:tan
- * Author: Zorba Team
- */
-class TanIterator : public UnaryBaseIterator<TanIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(TanIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TanIterator,
-    UnaryBaseIterator<TanIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<TanIterator, PlanIteratorState>*)this);
-  }
-
-  TanIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<TanIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~TanIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:asin
- * Author: Zorba Team
- */
-class ArcSinIterator : public UnaryBaseIterator<ArcSinIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ArcSinIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ArcSinIterator,
-    UnaryBaseIterator<ArcSinIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<ArcSinIterator, PlanIteratorState>*)this);
-  }
-
-  ArcSinIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<ArcSinIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~ArcSinIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:acos
- * Author: Zorba Team
- */
-class ArcCosIterator : public UnaryBaseIterator<ArcCosIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ArcCosIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ArcCosIterator,
-    UnaryBaseIterator<ArcCosIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<ArcCosIterator, PlanIteratorState>*)this);
-  }
-
-  ArcCosIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<ArcCosIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~ArcCosIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:atan
- * Author: Zorba Team
- */
-class ArcTanIterator : public UnaryBaseIterator<ArcTanIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ArcTanIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ArcTanIterator,
-    UnaryBaseIterator<ArcTanIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<ArcTanIterator, PlanIteratorState>*)this);
-  }
-
-  ArcTanIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<ArcTanIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~ArcTanIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:atan2
- * Author: Zorba Team
- */
-class Atan2Iterator : public BinaryBaseIterator<Atan2Iterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(Atan2Iterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Atan2Iterator,
-    BinaryBaseIterator<Atan2Iterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (BinaryBaseIterator<Atan2Iterator, PlanIteratorState>*)this);
-  }
-
-  Atan2Iterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child1, PlanIter_t& child2)
-    : 
-    BinaryBaseIterator<Atan2Iterator, PlanIteratorState>(sctx, loc, child1, child2)
-  {}
-
-  virtual ~Atan2Iterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:cosh
- * Author: Zorba Team
- */
-class CoshIterator : public UnaryBaseIterator<CoshIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(CoshIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CoshIterator,
-    UnaryBaseIterator<CoshIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<CoshIterator, PlanIteratorState>*)this);
-  }
-
-  CoshIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<CoshIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~CoshIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:acosh
- * Author: Zorba Team
- */
-class AcoshIterator : public UnaryBaseIterator<AcoshIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(AcoshIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(AcoshIterator,
-    UnaryBaseIterator<AcoshIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<AcoshIterator, PlanIteratorState>*)this);
-  }
-
-  AcoshIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<AcoshIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~AcoshIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:fmod
- * Author: Zorba Team
- */
-class FmodIterator : public BinaryBaseIterator<FmodIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FmodIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FmodIterator,
-    BinaryBaseIterator<FmodIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (BinaryBaseIterator<FmodIterator, PlanIteratorState>*)this);
-  }
-
-  FmodIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child1, PlanIter_t& child2)
-    : 
-    BinaryBaseIterator<FmodIterator, PlanIteratorState>(sctx, loc, child1, child2)
-  {}
-
-  virtual ~FmodIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:ldexp
- * Author: Zorba Team
- */
-class LdexpIterator : public BinaryBaseIterator<LdexpIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(LdexpIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(LdexpIterator,
-    BinaryBaseIterator<LdexpIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (BinaryBaseIterator<LdexpIterator, PlanIteratorState>*)this);
-  }
-
-  LdexpIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child1, PlanIter_t& child2)
-    : 
-    BinaryBaseIterator<LdexpIterator, PlanIteratorState>(sctx, loc, child1, child2)
-  {}
-
-  virtual ~LdexpIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:pow
- * Author: Zorba Team
- */
-class PowIterator : public BinaryBaseIterator<PowIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(PowIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PowIterator,
-    BinaryBaseIterator<PowIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (BinaryBaseIterator<PowIterator, PlanIteratorState>*)this);
-  }
-
-  PowIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child1, PlanIter_t& child2)
-    : 
-    BinaryBaseIterator<PowIterator, PlanIteratorState>(sctx, loc, child1, child2)
-  {}
-
-  virtual ~PowIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:sinh
- * Author: Zorba Team
- */
-class SinhIterator : public UnaryBaseIterator<SinhIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(SinhIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SinhIterator,
-    UnaryBaseIterator<SinhIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<SinhIterator, PlanIteratorState>*)this);
-  }
-
-  SinhIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<SinhIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~SinhIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:asinh
- * Author: Zorba Team
- */
-class AsinhIterator : public UnaryBaseIterator<AsinhIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(AsinhIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(AsinhIterator,
-    UnaryBaseIterator<AsinhIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<AsinhIterator, PlanIteratorState>*)this);
-  }
-
-  AsinhIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<AsinhIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~AsinhIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:tanh
- * Author: Zorba Team
- */
-class TanhIterator : public UnaryBaseIterator<TanhIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(TanhIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TanhIterator,
-    UnaryBaseIterator<TanhIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<TanhIterator, PlanIteratorState>*)this);
-  }
-
-  TanhIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<TanhIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~TanhIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:atanh
- * Author: Zorba Team
- */
-class AtanhIterator : public UnaryBaseIterator<AtanhIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(AtanhIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(AtanhIterator,
-    UnaryBaseIterator<AtanhIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<AtanhIterator, PlanIteratorState>*)this);
-  }
-
-  AtanhIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<AtanhIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~AtanhIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * math:pi
- * Author: Zorba Team
- */
-class PiNumberIterator : public NoaryBaseIterator<PiNumberIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(PiNumberIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PiNumberIterator,
-    NoaryBaseIterator<PiNumberIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (NoaryBaseIterator<PiNumberIterator, PlanIteratorState>*)this);
-  }
-
-  PiNumberIterator(
-    static_context* sctx,
-    const QueryLoc& loc)
-    : 
-    NoaryBaseIterator<PiNumberIterator, PlanIteratorState>(sctx, loc)
-  {}
-
-  virtual ~PiNumberIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:is_inf
- * Author: Zorba Team
- */
-class IsInfIterator : public UnaryBaseIterator<IsInfIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(IsInfIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsInfIterator,
-    UnaryBaseIterator<IsInfIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<IsInfIterator, PlanIteratorState>*)this);
-  }
-
-  IsInfIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<IsInfIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~IsInfIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:is_nan
- * Author: Zorba Team
- */
-class IsNaNIterator : public UnaryBaseIterator<IsNaNIterator, PlanIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(IsNaNIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsNaNIterator,
-    UnaryBaseIterator<IsNaNIterator, PlanIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<IsNaNIterator, PlanIteratorState>*)this);
-  }
-
-  IsNaNIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<IsNaNIterator, PlanIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~IsNaNIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:modf
- * Author: Zorba Team
- */
-class ModfIteratorState : public PlanIteratorState
-{
-public:
-  xs_double theDoubInteger; //
-
-  ModfIteratorState();
-
-  ~ModfIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class ModfIterator : public UnaryBaseIterator<ModfIterator, ModfIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(ModfIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ModfIterator,
-    UnaryBaseIterator<ModfIterator, ModfIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<ModfIterator, ModfIteratorState>*)this);
-  }
-
-  ModfIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<ModfIterator, ModfIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~ModfIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-/**
- * zorba-math:frexp
- * Author: Zorba Team
- */
-class FrexpIteratorState : public PlanIteratorState
-{
-public:
-  xs_integer theIntExponent; //
-
-  FrexpIteratorState();
-
-  ~FrexpIteratorState();
-
-  void init(PlanState&);
-  void reset(PlanState&);
-};
-
-class FrexpIterator : public UnaryBaseIterator<FrexpIterator, FrexpIteratorState>
-{ 
-public:
-  SERIALIZABLE_CLASS(FrexpIterator);
-
-  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FrexpIterator,
-    UnaryBaseIterator<FrexpIterator, FrexpIteratorState>);
-
-  void serialize( ::zorba::serialization::Archiver& ar)
-  {
-    serialize_baseclass(ar,
-    (UnaryBaseIterator<FrexpIterator, FrexpIteratorState>*)this);
-  }
-
-  FrexpIterator(
-    static_context* sctx,
-    const QueryLoc& loc,
-    PlanIter_t& child)
-    : 
-    UnaryBaseIterator<FrexpIterator, FrexpIteratorState>(sctx, loc, child)
-  {}
-
-  virtual ~FrexpIterator();
-
-  void accept(PlanIterVisitor& v) const;
-
-  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
-};
-
-
-}
-#endif
-/*
- * Local variables:
- * mode: c++
- * End:
- */ 
+/*
+ * Copyright 2006-2008 The FLWOR Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ 
+// ******************************************
+// *                                        *
+// * THIS IS A GENERATED FILE. DO NOT EDIT! *
+// * SEE .xml FILE WITH SAME NAME           *
+// *                                        *
+// ******************************************
+#ifndef ZORBA_RUNTIME_MATHS_MATHS_H
+#define ZORBA_RUNTIME_MATHS_MATHS_H
+
+
+#include "common/shared_types.h"
+#include "runtime/base/unarybase.h"
+#include "runtime/base/binarybase.h"
+#include "runtime/base/noarybase.h"
+
+#include "zorbatypes/schema_types.h"
+
+
+namespace zorba {
+
+/**
+ * math:sqrt
+ * Author: Zorba Team
+ */
+class SqrtIterator : public UnaryBaseIterator<SqrtIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SqrtIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SqrtIterator,
+    UnaryBaseIterator<SqrtIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<SqrtIterator, PlanIteratorState>*)this);
+  }
+
+  SqrtIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<SqrtIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~SqrtIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:exp
+ * Author: Zorba Team
+ */
+class ExpIterator : public UnaryBaseIterator<ExpIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ExpIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ExpIterator,
+    UnaryBaseIterator<ExpIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<ExpIterator, PlanIteratorState>*)this);
+  }
+
+  ExpIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<ExpIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~ExpIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:exp10
+ * Author: Zorba Team
+ */
+class Exp10Iterator : public UnaryBaseIterator<Exp10Iterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(Exp10Iterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Exp10Iterator,
+    UnaryBaseIterator<Exp10Iterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<Exp10Iterator, PlanIteratorState>*)this);
+  }
+
+  Exp10Iterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<Exp10Iterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~Exp10Iterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:log
+ * Author: Zorba Team
+ */
+class LogIterator : public UnaryBaseIterator<LogIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(LogIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(LogIterator,
+    UnaryBaseIterator<LogIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<LogIterator, PlanIteratorState>*)this);
+  }
+
+  LogIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<LogIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~LogIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:log10
+ * Author: Zorba Team
+ */
+class Log10Iterator : public UnaryBaseIterator<Log10Iterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(Log10Iterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Log10Iterator,
+    UnaryBaseIterator<Log10Iterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<Log10Iterator, PlanIteratorState>*)this);
+  }
+
+  Log10Iterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<Log10Iterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~Log10Iterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:sin
+ * Author: Zorba Team
+ */
+class SinIterator : public UnaryBaseIterator<SinIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SinIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SinIterator,
+    UnaryBaseIterator<SinIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<SinIterator, PlanIteratorState>*)this);
+  }
+
+  SinIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<SinIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~SinIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:cos
+ * Author: Zorba Team
+ */
+class CosIterator : public UnaryBaseIterator<CosIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(CosIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CosIterator,
+    UnaryBaseIterator<CosIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<CosIterator, PlanIteratorState>*)this);
+  }
+
+  CosIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<CosIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~CosIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:tan
+ * Author: Zorba Team
+ */
+class TanIterator : public UnaryBaseIterator<TanIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(TanIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TanIterator,
+    UnaryBaseIterator<TanIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<TanIterator, PlanIteratorState>*)this);
+  }
+
+  TanIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<TanIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~TanIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:asin
+ * Author: Zorba Team
+ */
+class ArcSinIterator : public UnaryBaseIterator<ArcSinIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ArcSinIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ArcSinIterator,
+    UnaryBaseIterator<ArcSinIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<ArcSinIterator, PlanIteratorState>*)this);
+  }
+
+  ArcSinIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<ArcSinIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~ArcSinIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:acos
+ * Author: Zorba Team
+ */
+class ArcCosIterator : public UnaryBaseIterator<ArcCosIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ArcCosIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ArcCosIterator,
+    UnaryBaseIterator<ArcCosIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<ArcCosIterator, PlanIteratorState>*)this);
+  }
+
+  ArcCosIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<ArcCosIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~ArcCosIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:atan
+ * Author: Zorba Team
+ */
+class ArcTanIterator : public UnaryBaseIterator<ArcTanIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ArcTanIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ArcTanIterator,
+    UnaryBaseIterator<ArcTanIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<ArcTanIterator, PlanIteratorState>*)this);
+  }
+
+  ArcTanIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<ArcTanIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~ArcTanIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:atan2
+ * Author: Zorba Team
+ */
+class Atan2Iterator : public BinaryBaseIterator<Atan2Iterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(Atan2Iterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(Atan2Iterator,
+    BinaryBaseIterator<Atan2Iterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (BinaryBaseIterator<Atan2Iterator, PlanIteratorState>*)this);
+  }
+
+  Atan2Iterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child1, PlanIter_t& child2)
+    : 
+    BinaryBaseIterator<Atan2Iterator, PlanIteratorState>(sctx, loc, child1, child2)
+  {}
+
+  virtual ~Atan2Iterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:cosh
+ * Author: Zorba Team
+ */
+class CoshIterator : public UnaryBaseIterator<CoshIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(CoshIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(CoshIterator,
+    UnaryBaseIterator<CoshIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<CoshIterator, PlanIteratorState>*)this);
+  }
+
+  CoshIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<CoshIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~CoshIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:acosh
+ * Author: Zorba Team
+ */
+class AcoshIterator : public UnaryBaseIterator<AcoshIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(AcoshIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(AcoshIterator,
+    UnaryBaseIterator<AcoshIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<AcoshIterator, PlanIteratorState>*)this);
+  }
+
+  AcoshIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<AcoshIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~AcoshIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:fmod
+ * Author: Zorba Team
+ */
+class FmodIterator : public BinaryBaseIterator<FmodIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FmodIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FmodIterator,
+    BinaryBaseIterator<FmodIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (BinaryBaseIterator<FmodIterator, PlanIteratorState>*)this);
+  }
+
+  FmodIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child1, PlanIter_t& child2)
+    : 
+    BinaryBaseIterator<FmodIterator, PlanIteratorState>(sctx, loc, child1, child2)
+  {}
+
+  virtual ~FmodIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:ldexp
+ * Author: Zorba Team
+ */
+class LdexpIterator : public BinaryBaseIterator<LdexpIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(LdexpIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(LdexpIterator,
+    BinaryBaseIterator<LdexpIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (BinaryBaseIterator<LdexpIterator, PlanIteratorState>*)this);
+  }
+
+  LdexpIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child1, PlanIter_t& child2)
+    : 
+    BinaryBaseIterator<LdexpIterator, PlanIteratorState>(sctx, loc, child1, child2)
+  {}
+
+  virtual ~LdexpIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:pow
+ * Author: Zorba Team
+ */
+class PowIterator : public BinaryBaseIterator<PowIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(PowIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PowIterator,
+    BinaryBaseIterator<PowIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (BinaryBaseIterator<PowIterator, PlanIteratorState>*)this);
+  }
+
+  PowIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child1, PlanIter_t& child2)
+    : 
+    BinaryBaseIterator<PowIterator, PlanIteratorState>(sctx, loc, child1, child2)
+  {}
+
+  virtual ~PowIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:sinh
+ * Author: Zorba Team
+ */
+class SinhIterator : public UnaryBaseIterator<SinhIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(SinhIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(SinhIterator,
+    UnaryBaseIterator<SinhIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<SinhIterator, PlanIteratorState>*)this);
+  }
+
+  SinhIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<SinhIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~SinhIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:asinh
+ * Author: Zorba Team
+ */
+class AsinhIterator : public UnaryBaseIterator<AsinhIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(AsinhIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(AsinhIterator,
+    UnaryBaseIterator<AsinhIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<AsinhIterator, PlanIteratorState>*)this);
+  }
+
+  AsinhIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<AsinhIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~AsinhIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:tanh
+ * Author: Zorba Team
+ */
+class TanhIterator : public UnaryBaseIterator<TanhIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(TanhIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(TanhIterator,
+    UnaryBaseIterator<TanhIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<TanhIterator, PlanIteratorState>*)this);
+  }
+
+  TanhIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<TanhIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~TanhIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:atanh
+ * Author: Zorba Team
+ */
+class AtanhIterator : public UnaryBaseIterator<AtanhIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(AtanhIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(AtanhIterator,
+    UnaryBaseIterator<AtanhIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<AtanhIterator, PlanIteratorState>*)this);
+  }
+
+  AtanhIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<AtanhIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~AtanhIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * math:pi
+ * Author: Zorba Team
+ */
+class PiNumberIterator : public NoaryBaseIterator<PiNumberIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(PiNumberIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(PiNumberIterator,
+    NoaryBaseIterator<PiNumberIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (NoaryBaseIterator<PiNumberIterator, PlanIteratorState>*)this);
+  }
+
+  PiNumberIterator(
+    static_context* sctx,
+    const QueryLoc& loc)
+    : 
+    NoaryBaseIterator<PiNumberIterator, PlanIteratorState>(sctx, loc)
+  {}
+
+  virtual ~PiNumberIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:is_inf
+ * Author: Zorba Team
+ */
+class IsInfIterator : public UnaryBaseIterator<IsInfIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(IsInfIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsInfIterator,
+    UnaryBaseIterator<IsInfIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<IsInfIterator, PlanIteratorState>*)this);
+  }
+
+  IsInfIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<IsInfIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~IsInfIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:is_nan
+ * Author: Zorba Team
+ */
+class IsNaNIterator : public UnaryBaseIterator<IsNaNIterator, PlanIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(IsNaNIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(IsNaNIterator,
+    UnaryBaseIterator<IsNaNIterator, PlanIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<IsNaNIterator, PlanIteratorState>*)this);
+  }
+
+  IsNaNIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<IsNaNIterator, PlanIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~IsNaNIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:modf
+ * Author: Zorba Team
+ */
+class ModfIteratorState : public PlanIteratorState
+{
+public:
+  xs_double theDoubInteger; //
+
+  ModfIteratorState();
+
+  ~ModfIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class ModfIterator : public UnaryBaseIterator<ModfIterator, ModfIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(ModfIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(ModfIterator,
+    UnaryBaseIterator<ModfIterator, ModfIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<ModfIterator, ModfIteratorState>*)this);
+  }
+
+  ModfIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<ModfIterator, ModfIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~ModfIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+/**
+ * zorba-math:frexp
+ * Author: Zorba Team
+ */
+class FrexpIteratorState : public PlanIteratorState
+{
+public:
+  xs_integer theIntExponent; //
+
+  FrexpIteratorState();
+
+  ~FrexpIteratorState();
+
+  void init(PlanState&);
+  void reset(PlanState&);
+};
+
+class FrexpIterator : public UnaryBaseIterator<FrexpIterator, FrexpIteratorState>
+{ 
+public:
+  SERIALIZABLE_CLASS(FrexpIterator);
+
+  SERIALIZABLE_CLASS_CONSTRUCTOR2T(FrexpIterator,
+    UnaryBaseIterator<FrexpIterator, FrexpIteratorState>);
+
+  void serialize( ::zorba::serialization::Archiver& ar)
+  {
+    serialize_baseclass(ar,
+    (UnaryBaseIterator<FrexpIterator, FrexpIteratorState>*)this);
+  }
+
+  FrexpIterator(
+    static_context* sctx,
+    const QueryLoc& loc,
+    PlanIter_t& child)
+    : 
+    UnaryBaseIterator<FrexpIterator, FrexpIteratorState>(sctx, loc, child)
+  {}
+
+  virtual ~FrexpIterator();
+
+  void accept(PlanIterVisitor& v) const;
+
+  bool nextImpl(store::Item_t& result, PlanState& aPlanState) const;
+};
+
+
+}
+#endif
+/*
+ * Local variables:
+ * mode: c++
+ * End:
+ */ 

=== modified file 'src/runtime/nodes/nodes_impl.cpp'
--- src/runtime/nodes/nodes_impl.cpp	2012-04-24 12:39:38 +0000
+++ src/runtime/nodes/nodes_impl.cpp	2012-05-02 07:17:28 +0000
@@ -628,5 +628,122 @@
   STACK_END (state);
 }
 
+/*******************************************************************************
+********************************************************************************/
+int getNodePosition(store::Item_t aNode)
+{
+  int count = 1;
+  store::Iterator_t lIterator = aNode->getParent()->getChildren();
+  store::Item_t lItem;
+  lIterator->open();
+  while(lIterator->next(lItem))
+  {
+    if(lItem->getNodeKind() == aNode->getNodeKind())
+      if(lItem->equals(aNode))
+        break;
+      else
+        count++;
+  }
+  lIterator->close();
+  return count;
+}
+
+bool FnPathIterator::nextImpl(store::Item_t& result, PlanState& planState) const
+{
+  store::Item_t inNode;
+  store::Item_t nodeName;
+  store::NsBindings nsBindings;
+  zstring path;
+  zstring temp;
+  zstring zNamespace;
+  zstring zLocalName;
+  zstring zPosition;
+  bool rootIsDocument = false;
+
+  PlanIteratorState* state;
+  DEFAULT_STACK_INIT(PlanIteratorState, state, planState);
+
+  if (consumeNext(inNode, theChildren[0], planState));
+  {
+    do
+    { 
+      switch (inNode->getNodeKind())
+      {
+        case store::StoreConsts::documentNode:
+          temp = path;
+          path = "/";
+          path += temp;
+          rootIsDocument = true;
+          break;
+        case store::StoreConsts::elementNode:
+          nodeName = inNode->getNodeName();
+          zNamespace = nodeName->getNamespace();
+          zLocalName = nodeName->ge

Follow ups