← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/markos-scratch into lp:zorba

 

Markos Zaharioudakis has proposed merging lp:~zorba-coders/zorba/markos-scratch into lp:zorba.

Requested reviews:
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/93397

Optimization: changed the implementation of the free-vars annotation and got rid of the annotations map in expressions
-- 
https://code.launchpad.net/~zorba-coders/zorba/markos-scratch/+merge/93397
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2012-02-16 02:05:23 +0000
+++ ChangeLog	2012-02-16 12:50:29 +0000
@@ -10,6 +10,8 @@
   * Added %ann:cache and %ann:no-cache to enable or disable caching of results of functions with atomic parameter and return types.
   * Fixed bug 917923 (bug in copying outer var values into the eval dynamic context)
   * Fixed bug 924063 (sentence is incorrectly incremented when token characters end without sentence terminator)
+  * Optimization: change the implementation of the free-vars annotation and got rid
+    of the annotations map in expressions.
   * Fixed bug 909126 (bug in cloning of var_expr)
   * Fixed bug in destruction of exit_catcher_expr
   * Types-related optimizations for runtime operators (comparisons, FnBoolean, Or, And,
@@ -31,6 +33,8 @@
     and CtxVarIterator.
   * Optimization: enhanced push-down of positional predicate into LetVarITerator
     and CtxVarIterator.
+  * Fixed bug #867266 (do not hoist updating expressions)
+  * Fixed bug #867022 (added location and params to some XPTY0004 errors)
   * zerr is not predeclared anymore to be http://www.zorba-xquery.com/errors
   * Add new XQuery interface for the PHP bindings.
   * Added API method Item::getNamespaceBindings().

=== modified file 'src/compiler/expression/expr.cpp'
--- src/compiler/expression/expr.cpp	2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr.cpp	2012-02-16 12:50:29 +0000
@@ -41,7 +41,6 @@
 #include "compiler/expression/var_expr.h"
 #include "compiler/expression/expr_utils.h"
 #include "compiler/expression/expr_visitor.h"
-#include "compiler/semantic_annotations/annotation_keys.h"
 #include "compiler/parser/parse_constants.h"
 
 #include "store/api/store.h"
@@ -50,9 +49,6 @@
 namespace zorba 
 {
 
-SERIALIZABLE_CLASS_VERSIONS(AnnotationHolder)
-END_SERIALIZABLE_CLASS_VERSIONS(AnnotationHolder)
-
 SERIALIZABLE_CLASS_VERSIONS(expr)
 END_SERIALIZABLE_CLASS_VERSIONS(expr)
 

=== modified file 'src/compiler/expression/expr_base.cpp'
--- src/compiler/expression/expr_base.cpp	2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr_base.cpp	2012-02-16 12:50:29 +0000
@@ -150,8 +150,6 @@
 ********************************************************************************/
 void expr::serialize(::zorba::serialization::Archiver& ar)
 {
-  //serialize_baseclass(ar, (SimpleRCObject*)this);
-  serialize_baseclass(ar, (AnnotationHolder*)this);
   ar & theSctx;
   ar & theLoc;
   ar & theType;
@@ -296,9 +294,18 @@
 /*******************************************************************************
 
 ********************************************************************************/
+void expr::setFreeVars(FreeVars& s)
+{
+  theFreeVars.swap(s);
+}
+
+
+/*******************************************************************************
+
+********************************************************************************/
 void expr::clear_annotations()
 {
-  m_annotations.clear();
+  theFreeVars.clear();
 
   if (getProducesSortedNodes() != ANNOTATION_TRUE_FIXED)
     setProducesSortedNodes(ANNOTATION_UNKNOWN);

=== modified file 'src/compiler/expression/expr_base.h'
--- src/compiler/expression/expr_base.h	2012-01-11 17:30:25 +0000
+++ src/compiler/expression/expr_base.h	2012-02-16 12:50:29 +0000
@@ -24,7 +24,6 @@
 #include "compiler/parser/query_loc.h"
 #include "compiler/parser/parse_constants.h"
 #include "compiler/expression/expr_consts.h"
-#include "compiler/semantic_annotations/annotation_holder.h"
 
 #include "functions/function_consts.h"
 
@@ -116,7 +115,7 @@
 /*******************************************************************************
   Base class for the expression tree node hierarchy
 ********************************************************************************/
-class expr : public AnnotationHolder
+class expr : public SimpleRCObject
 {
   friend class expr_iterator_data;
   friend class ExprIterator;
@@ -133,6 +132,8 @@
 
   typedef substitution_t::iterator subst_iter_t;
 
+  typedef std::set<const var_expr *> FreeVars;
+
   typedef enum
   {
     PRODUCES_SORTED_NODES   = 0,
@@ -178,6 +179,8 @@
 
   ulong              theFlags1;
 
+  FreeVars           theFreeVars;
+
 public:
   static bool is_sequential(short theScriptingKind);
 
@@ -187,7 +190,7 @@
 
 public:
   SERIALIZABLE_ABSTRACT_CLASS(expr)
-  SERIALIZABLE_CLASS_CONSTRUCTOR2(expr, AnnotationHolder)
+  SERIALIZABLE_CLASS_CONSTRUCTOR2(expr, SimpleRCObject)
   void serialize(::zorba::serialization::Archiver& ar);
 
 public:
@@ -310,6 +313,13 @@
 
   bool willBeSerialized() const;
 
+  // Annotation : free vars
+  const FreeVars& getFreeVars() const { return theFreeVars; }
+
+  FreeVars& getFreeVars() { return theFreeVars; }
+
+  void setFreeVars(FreeVars& s);
+
   bool is_constant() const;
 
   bool is_nondeterministic() const;

=== modified file 'src/compiler/rewriter/rules/flwor_rules.cpp'
--- src/compiler/rewriter/rules/flwor_rules.cpp	2012-02-02 09:56:52 +0000
+++ src/compiler/rewriter/rules/flwor_rules.cpp	2012-02-16 12:50:29 +0000
@@ -40,7 +40,7 @@
 namespace zorba
 {
 
-static void collect_flw_vars(const flwor_expr&, expr_tools::VarSetAnnVal&);
+static void collect_flw_vars(const flwor_expr&, expr::FreeVars&);
 
 static bool is_trivial_expr(const expr*);
 
@@ -148,18 +148,18 @@
   flwor_expr* flworp = static_cast<flwor_expr *>(node);
   flwor_expr& flwor = *flworp;
 
-  expr_tools::VarSetAnnVal myVars;
+  expr::FreeVars myVars;
   collect_flw_vars(flwor, myVars);
 
   const forletwin_clause& flwc = *reinterpret_cast<const forletwin_clause *>(flwor[0]);
 
-  unsigned numClauses = flwor.num_clauses();
-  unsigned numForLetClauses = 0;
+  csize numClauses = flwor.num_clauses();
+  csize numForLetClauses = 0;
 
   // "for $x in E return $x"  --> "E"
   // "let $x := E return $x"  --> "E"
   if (numClauses == 1 &&
-      myVars.theVarset.size() == 1 &&
+      myVars.size() == 1 &&
       flwor.get_return_expr()->get_expr_kind() == wrapper_expr_kind)
   {
     const wrapper_expr* w = static_cast<const wrapper_expr*>(flwor.get_return_expr());
@@ -173,12 +173,11 @@
   expr* whereExpr;
   if ((whereExpr = flwor.get_where()) != NULL && !flwor.has_sequential_clauses())
   {
-    const expr_tools::var_ptr_set& whereVars = 
-    expr_tools::get_varset_annotation(whereExpr);
+    const expr::FreeVars& whereVars = whereExpr->getFreeVars();
 
-    expr_tools::var_ptr_set diff;
-    std::set_intersection(myVars.theVarset.begin(),
-                          myVars.theVarset.end(),
+    expr::FreeVars diff;
+    std::set_intersection(myVars.begin(),
+                          myVars.end(),
                           whereVars.begin(),
                           whereVars.end(),
                           std::inserter(diff, diff.begin()));
@@ -407,9 +406,9 @@
 ********************************************************************************/
 static void collect_flw_vars(
     const flwor_expr& flwor, 
-    expr_tools::VarSetAnnVal& vars)
+    expr::FreeVars& vars)
 {
-  for (uint32_t i = 0; i < flwor.num_clauses(); ++i)
+  for (csize i = 0; i < flwor.num_clauses(); ++i)
   {
     const flwor_clause& c = *flwor[i];
 
@@ -417,34 +416,34 @@
     {
       const for_clause* fc = static_cast<const for_clause *>(&c);
 
-      vars.add(fc->get_var());
+      vars.insert(fc->get_var());
 
       if (fc->get_pos_var() != NULL)
-        vars.add(fc->get_pos_var());
+        vars.insert(fc->get_pos_var());
     }
 
     else if (c.get_kind() == flwor_clause::let_clause)
     {
       const let_clause* lc = static_cast<const let_clause *>(&c);
 
-      vars.add(lc->get_var());
+      vars.insert(lc->get_var());
     }
 
     else if (c.get_kind() == flwor_clause::window_clause)
     {
       const window_clause* wc = static_cast<const window_clause *>(&c);
 
-      vars.add(wc->get_var());
+      vars.insert(wc->get_var());
 
       if (wc->get_win_start() != NULL)
       {
         const flwor_wincond* cond = wc->get_win_start();
         const flwor_wincond::vars& condvars = cond->get_out_vars();
 
-        if (condvars.posvar != NULL) vars.add(condvars.posvar);
-        if (condvars.curr != NULL) vars.add(condvars.curr);
-        if (condvars.prev != NULL) vars.add(condvars.prev);
-        if (condvars.next != NULL) vars.add(condvars.next);
+        if (condvars.posvar != NULL) vars.insert(condvars.posvar);
+        if (condvars.curr != NULL) vars.insert(condvars.curr);
+        if (condvars.prev != NULL) vars.insert(condvars.prev);
+        if (condvars.next != NULL) vars.insert(condvars.next);
       }
 
       if (wc->get_win_stop() != NULL)
@@ -452,10 +451,10 @@
         const flwor_wincond* cond = wc->get_win_stop();
         const flwor_wincond::vars& condvars = cond->get_out_vars();
 
-        if (condvars.posvar != NULL) vars.add(condvars.posvar);
-        if (condvars.curr != NULL) vars.add(condvars.curr);
-        if (condvars.prev != NULL) vars.add(condvars.prev);
-        if (condvars.next != NULL) vars.add(condvars.next);
+        if (condvars.posvar != NULL) vars.insert(condvars.posvar);
+        if (condvars.curr != NULL) vars.insert(condvars.curr);
+        if (condvars.prev != NULL) vars.insert(condvars.prev);
+        if (condvars.next != NULL) vars.insert(condvars.next);
       }
     }
   }

=== modified file 'src/compiler/rewriter/rules/fold_rules.cpp'
--- src/compiler/rewriter/rules/fold_rules.cpp	2012-02-10 10:48:17 +0000
+++ src/compiler/rewriter/rules/fold_rules.cpp	2012-02-16 12:50:29 +0000
@@ -53,7 +53,7 @@
 
 namespace zorba {
 
-static void remove_wincond_vars(const flwor_wincond*, expr_tools::VarSetAnnVal*);
+static void remove_wincond_vars(const flwor_wincond*, expr::FreeVars&);
 
 static bool standalone_expr(expr_t);
 
@@ -424,13 +424,14 @@
 
 RULE_REWRITE_POST(MarkFreeVars)
 {
-  expr_tools::VarSetAnnVal* freevars = new expr_tools::VarSetAnnVal;
-  AnnotationValue_t new_ann = AnnotationValue_t(freevars);
-
-  if (node->get_expr_kind () == var_expr_kind)
+  expr::FreeVars& freevars = node->getFreeVars();
+
+  freevars.clear();
+
+  if (node->get_expr_kind() == var_expr_kind)
   {
-    var_expr_t v = dynamic_cast<var_expr *> (node);
-    freevars->add(v);
+    var_expr_t v = dynamic_cast<var_expr *>(node);
+    freevars.insert(v);
   }
   else
   {
@@ -441,10 +442,10 @@
     {
       expr* e = *iter;
 
-      const expr_tools::var_ptr_set& kfv = expr_tools::get_varset_annotation(e);
+      const expr::FreeVars& kfv = e->getFreeVars();
       std::copy(kfv.begin(),
                 kfv.end(),
-                inserter(freevars->theVarset, freevars->theVarset.begin()));
+                inserter(freevars, freevars.begin()));
 
       iter.next();
     }
@@ -465,21 +466,21 @@
         {
           const for_clause* fc = static_cast<const for_clause *>(c);
 
-          freevars->theVarset.erase(fc->get_var());
+          freevars.erase(fc->get_var());
           if (fc->get_pos_var() != NULL)
-            freevars->theVarset.erase(fc->get_pos_var());
+            freevars.erase(fc->get_pos_var());
         }
         else if (c->get_kind() == flwor_clause::let_clause)
         {
           const let_clause* lc = static_cast<const let_clause *>(c);
 
-          freevars->theVarset.erase(lc->get_var());
+          freevars.erase(lc->get_var());
         }
         else if (c->get_kind() == flwor_clause::window_clause)
         {
           const window_clause* wc = static_cast<const window_clause *>(c);
 
-          freevars->theVarset.erase(wc->get_var());
+          freevars.erase(wc->get_var());
 
           flwor_wincond* startCond = wc->get_win_start();
           flwor_wincond* stopCond = wc->get_win_stop();
@@ -495,53 +496,51 @@
           const group_clause* gc = static_cast<const group_clause *>(c);
 
           const flwor_clause::rebind_list_t& gvars = gc->get_grouping_vars();
-          unsigned numGroupVars = (unsigned)gvars.size();
+          csize numGroupVars = gvars.size();
 
-          for (unsigned i = 0; i < numGroupVars; ++i)
+          for (csize i = 0; i < numGroupVars; ++i)
           {
-            freevars->theVarset.erase(gvars[i].second.getp());
+            freevars.erase(gvars[i].second.getp());
           }
 
           const flwor_clause::rebind_list_t& ngvars = gc->get_nongrouping_vars();
-          unsigned numNonGroupVars = (unsigned)ngvars.size();
+          csize numNonGroupVars = ngvars.size();
 
-          for (unsigned i = 0; i < numNonGroupVars; ++i)
+          for (csize i = 0; i < numNonGroupVars; ++i)
           {
-            freevars->theVarset.erase(ngvars[i].second.getp());
+            freevars.erase(ngvars[i].second.getp());
           }
         }
         else if (c->get_kind() == flwor_clause::count_clause)
         {
           const count_clause* cc = static_cast<const count_clause *>(c);
 
-          freevars->theVarset.erase(cc->get_var());
+          freevars.erase(cc->get_var());
         }
       }
     }
   }
 
-  node->put_annotation(Annotations::FREE_VARS, new_ann);
-
   return NULL;
 }
 
 
 static void remove_wincond_vars(
     const flwor_wincond* cond,
-    expr_tools::VarSetAnnVal* freevars)
+    expr::FreeVars& freevars)
 {
   const flwor_wincond::vars& inVars = cond->get_in_vars();
   const flwor_wincond::vars& outVars = cond->get_out_vars();
 
-  freevars->theVarset.erase(inVars.posvar.getp());
-  freevars->theVarset.erase(inVars.curr.getp());
-  freevars->theVarset.erase(inVars.prev.getp());
-  freevars->theVarset.erase(inVars.next.getp());
+  freevars.erase(inVars.posvar.getp());
+  freevars.erase(inVars.curr.getp());
+  freevars.erase(inVars.prev.getp());
+  freevars.erase(inVars.next.getp());
 
-  freevars->theVarset.erase(outVars.posvar.getp());
-  freevars->theVarset.erase(outVars.curr.getp());
-  freevars->theVarset.erase(outVars.prev.getp());
-  freevars->theVarset.erase(outVars.next.getp());
+  freevars.erase(outVars.posvar.getp());
+  freevars.erase(outVars.curr.getp());
+  freevars.erase(outVars.prev.getp());
+  freevars.erase(outVars.next.getp());
 }
 
 
@@ -560,18 +559,18 @@
 
   if (standalone_expr(node) &&
       ! already_folded(node, rCtx) &&
-      expr_tools::get_varset_annotation(node).empty() &&
+      node->getFreeVars().empty() &&
       ! node->isUnfoldable() &&
       TypeOps::type_max_cnt(tm, *rtype) <= 1)
   {
     vector<store::Item_t> result;
-    expr_t folded = execute (rCtx.getCompilerCB(), node, result);
+    expr_t folded = execute(rCtx.getCompilerCB(), node, result);
     if (folded == NULL)
     {
       ZORBA_ASSERT (result.size () <= 1);
       folded = (result.size () == 1 ?
-                ((expr *) (new const_expr (node->get_sctx(), LOC (node), result [0]))) :
-                ((expr *) (fo_expr::create_seq (node->get_sctx(), LOC (node)))));
+                ((expr*) (new const_expr(node->get_sctx(), LOC(node), result[0]))) :
+                ((expr*) (fo_expr::create_seq(node->get_sctx(), LOC(node)))));
     }
     return folded;
   }

=== modified file 'src/compiler/rewriter/rules/index_join_rule.cpp'
--- src/compiler/rewriter/rules/index_join_rule.cpp	2011-08-16 16:13:50 +0000
+++ src/compiler/rewriter/rules/index_join_rule.cpp	2012-02-16 12:50:29 +0000
@@ -242,7 +242,6 @@
 
   // Determine the outer and inner side of the join
   ulong outerVarId;
-  ulong innerVarId;
 
   if (var1id < var2id)
   {
@@ -252,7 +251,6 @@
     predInfo.theInnerOp = op2;
     predInfo.theInnerVar = var2;
     outerVarId = var1id;
-    innerVarId = var2id;
   }
   else
   {
@@ -262,7 +260,6 @@
     predInfo.theInnerOp = op1;
     predInfo.theInnerVar = var1;
     outerVarId = var2id;
-    innerVarId = var1id;
   }
 
   TypeManager* tm = sctx->get_typemanager();

=== modified file 'src/compiler/rewriter/tools/expr_tools.cpp'
--- src/compiler/rewriter/tools/expr_tools.cpp	2012-01-11 17:30:25 +0000
+++ src/compiler/rewriter/tools/expr_tools.cpp	2012-02-16 12:50:29 +0000
@@ -124,20 +124,6 @@
 
 
 /*******************************************************************************
-
-********************************************************************************/
-const var_ptr_set& get_varset_annotation(const expr* e) 
-{
-  static var_ptr_set no_free_vars;
-
-  AnnotationValue_t ann = e->get_annotation(Annotations::FREE_VARS);
-  return (ann == NULL ?
-          no_free_vars :
-          dynamic_cast<VarSetAnnVal *>(ann.getp())->theVarset);
-}
-
-
-/*******************************************************************************
   copy annotations when wrapping an expression in a new one
 ********************************************************************************/
 expr_t fix_annotations(expr* new_expr, const expr* old_expr) 
@@ -155,25 +141,18 @@
     }
   }
   
-  for (int k = 0; k < Annotations::MAX_ANNOTATION; ++k) 
-  {
-    if (k == Annotations::FREE_VARS)
-    {
-      const var_ptr_set& old_set = get_varset_annotation(old_expr);
-      const var_ptr_set& new_set = get_varset_annotation(new_expr);
-
-      var_ptr_set s;
-      std::set_union(old_set.begin(),
-                     old_set.end(),
-                     new_set.begin(),
-                     new_set.end(),
-                     inserter(s, s.begin()));
-
-      new_expr->put_annotation(static_cast<Annotations::Key>(k),
-                               AnnotationValue_t(new VarSetAnnVal(s)));
-    }
-  }
-  
+  const expr::FreeVars& old_set = old_expr->getFreeVars();
+  const expr::FreeVars& new_set = new_expr->getFreeVars();
+
+  expr::FreeVars s;
+  std::set_union(old_set.begin(),
+                 old_set.end(),
+                 new_set.begin(),
+                 new_set.end(),
+                 inserter(s, s.begin()));
+
+  new_expr->setFreeVars(s);
+
   return new_expr;
 }
 

=== modified file 'src/compiler/rewriter/tools/expr_tools.h'
--- src/compiler/rewriter/tools/expr_tools.h	2011-08-12 10:21:10 +0000
+++ src/compiler/rewriter/tools/expr_tools.h	2012-02-16 12:50:29 +0000
@@ -70,32 +70,6 @@
 /*******************************************************************************
 
 ********************************************************************************/
-typedef std::set<const var_expr *> var_ptr_set;
-
-
-class VarSetAnnVal : public AnnotationValue
-{
-public:
-  var_ptr_set theVarset;
-
-public:
-  VarSetAnnVal() {}
-
-  VarSetAnnVal(var_ptr_set& varset) 
-  {
-    theVarset.swap(varset);
-  }
-
-  void add(const var_expr* v) { theVarset.insert(theVarset.begin(), v); }
-};
-
-
-const var_ptr_set& get_varset_annotation(const expr* e);
-
-
-/*******************************************************************************
-
-********************************************************************************/
 inline bool is_data(expr* e)
 {
   return (e->get_expr_kind() == fo_expr_kind &&

=== modified file 'src/compiler/semantic_annotations/annotation_holder.cpp'
--- src/compiler/semantic_annotations/annotation_holder.cpp	2011-06-14 17:26:33 +0000
+++ src/compiler/semantic_annotations/annotation_holder.cpp	2012-02-16 12:50:29 +0000
@@ -26,32 +26,5 @@
 }
 
 
-void AnnotationHolder::put_annotation(
-    Annotations::Key key,
-    AnnotationValue_t value)
-{
-  m_annotations[key] = value;
-}
-
-
-const AnnotationValue_t AnnotationHolder::get_annotation(
-    Annotations::Key key) const
-{
-  annotations_t::const_iterator i = m_annotations.find(key);
-  if (i == m_annotations.end()) {
-    return AnnotationValue_t();
-  }
-  return i->second;
-}
-
-
-void AnnotationHolder::remove_annotation(Annotations::Key key)
-{
-  annotations_t::iterator i = m_annotations.find(key);
-  if (i != m_annotations.end()) {
-    m_annotations.erase(i);
-  }
-}
-
 }
 /* vim:set et sw=2 ts=2: */

=== modified file 'src/compiler/semantic_annotations/annotation_holder.h'
--- src/compiler/semantic_annotations/annotation_holder.h	2011-08-15 14:17:09 +0000
+++ src/compiler/semantic_annotations/annotation_holder.h	2012-02-16 12:50:29 +0000
@@ -40,12 +40,6 @@
   AnnotationHolder() {}
 
   virtual ~AnnotationHolder() {}
-
-  void put_annotation(Annotations::Key key, AnnotationValue_t annot);
-
-  const AnnotationValue_t get_annotation(Annotations::Key key) const;
-
-  void remove_annotation(Annotations::Key key);
 };
 
 }

=== modified file 'src/compiler/semantic_annotations/annotation_keys.h'
--- src/compiler/semantic_annotations/annotation_keys.h	2011-06-14 17:26:33 +0000
+++ src/compiler/semantic_annotations/annotation_keys.h	2012-02-16 12:50:29 +0000
@@ -25,8 +25,6 @@
 
 typedef enum 
 {
-  FREE_VARS,
-
   MAX_ANNOTATION
 } Key;
 

=== modified file 'src/compiler/semantic_annotations/annotations.h'
--- src/compiler/semantic_annotations/annotations.h	2011-06-14 17:26:33 +0000
+++ src/compiler/semantic_annotations/annotations.h	2012-02-16 12:50:29 +0000
@@ -30,27 +30,8 @@
 {
 public:
   virtual ~AnnotationValue() {}
-
-  virtual bool equals(const AnnotationValue& other) { return this == &other; }
-};
-
-
-class IntAnnotationValue : public AnnotationValue 
-{
-public:
-  int theValue;
-  
-  IntAnnotationValue(int n) : theValue(n) {}
-};
-
-
-inline bool operator==(const AnnotationValue_t& v1, const AnnotationValue_t& v2) 
-{
-  if (v2 == NULL || v1 == NULL)
-    return v2 == NULL && v1 == NULL;
-
-  return v2->equals(*v1.getp());
-}
+};
+
 
 }
 

=== modified file 'src/functions/external_function.cpp'
--- src/functions/external_function.cpp	2012-01-11 17:30:25 +0000
+++ src/functions/external_function.cpp	2012-02-16 12:50:29 +0000
@@ -183,7 +183,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   return new ExtFunctionCallIterator(sctx,
                                      loc,

=== modified file 'src/functions/external_function.h'
--- src/functions/external_function.h	2012-01-11 17:30:25 +0000
+++ src/functions/external_function.h	2012-02-16 12:50:29 +0000
@@ -74,7 +74,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const;
+        expr& ann) const;
 };
 
 

=== modified file 'src/functions/func_accessors_impl.cpp'
--- src/functions/func_accessors_impl.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_accessors_impl.cpp	2012-02-16 12:50:29 +0000
@@ -43,7 +43,7 @@
       static_context* sctx,
       const QueryLoc& loc,
       std::vector<PlanIter_t>& argv,
-      AnnotationHolder& ann) const
+      expr& ann) const
 {
   return new FnStringIterator(sctx, loc, argv, true);
 }
@@ -150,7 +150,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
 }
@@ -164,7 +164,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   PlanIter_t nnIter = new NodeNameIterator(sctx, loc, argv);
   std::vector<PlanIter_t> lVec;

=== modified file 'src/functions/func_apply.cpp'
--- src/functions/func_apply.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_apply.cpp	2012-02-16 12:50:29 +0000
@@ -46,7 +46,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& aAnn) const
+    expr& aAnn) const
 {
   ZORBA_ASSERT(false);
 }

=== modified file 'src/functions/func_booleans_impl.cpp'
--- src/functions/func_booleans_impl.cpp	2012-01-26 19:56:14 +0000
+++ src/functions/func_booleans_impl.cpp	2012-02-16 12:50:29 +0000
@@ -76,7 +76,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder &ann) const
+        expr &ann) const
   {
     return createIterator(sctx, loc, argv);
   }
@@ -583,7 +583,7 @@
                     static_context* sctx,
                     const QueryLoc& loc,
                     std::vector<PlanIter_t>& argv,
-                    AnnotationHolder& ann) const
+                    expr& ann) const
   {
     return new AtomicValuesEquivalenceIterator(sctx, loc, argv[0], argv[1]);
   }
@@ -623,7 +623,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     assert(argv.size() > 0);
     return new AndIterator(sctx, loc, argv);
@@ -660,7 +660,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     assert(argv.size() > 0);
     return new OrIterator(sctx, loc, argv);
@@ -686,7 +686,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     store::Item_t res;
     GENV_ITEMFACTORY->createBoolean(res, true);
@@ -708,7 +708,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     store::Item_t res;
     GENV_ITEMFACTORY->createBoolean(res, false);
@@ -745,7 +745,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnBooleanIterator(sctx, loc, argv[0], true);
   }
@@ -783,7 +783,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnBooleanIterator(sctx, loc, argv[0]);
   }

=== modified file 'src/functions/func_collections_impl.cpp'
--- src/functions/func_collections_impl.cpp	2012-01-11 17:30:25 +0000
+++ src/functions/func_collections_impl.cpp	2012-02-16 12:50:29 +0000
@@ -31,7 +31,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaCollectionIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaIndexOfIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -61,7 +61,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaCreateCollectionIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS);
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaDeleteCollectionIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS);
@@ -91,7 +91,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaInsertNodesIterator(
       sctx, loc, argv, getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaInsertNodesFirstIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -121,7 +121,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaInsertNodesLastIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -136,7 +136,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaInsertNodesBeforeIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -151,7 +151,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaInsertNodesAfterIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -166,7 +166,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaApplyInsertNodesIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -189,7 +189,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaApplyInsertNodesFirstIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -212,7 +212,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaApplyInsertNodesLastIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -235,7 +235,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaApplyInsertNodesBeforeIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -259,7 +259,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaApplyInsertNodesAfterIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -283,7 +283,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaDeleteNodesIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -298,7 +298,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaDeleteNodesFirstIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -313,7 +313,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaDeleteNodesLastIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DML_FN_NS);
@@ -328,7 +328,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsAvailableCollectionIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS);
@@ -343,7 +343,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AvailableCollectionsIterator(sctx, loc, argv,
       getName()->getNamespace() == static_context::ZORBA_STORE_DYNAMIC_COLLECTIONS_DDL_FN_NS);

=== modified file 'src/functions/func_durations_dates_times_impl.cpp'
--- src/functions/func_durations_dates_times_impl.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_durations_dates_times_impl.cpp	2012-02-16 12:50:29 +0000
@@ -517,7 +517,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnFormatDateTimeIterator(sctx, loc, argv, DateTime::DATETIME_FACET);
   }
@@ -539,7 +539,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnFormatDateTimeIterator(sctx, loc, argv, DateTime::DATETIME_FACET);
   }
@@ -561,7 +561,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnFormatDateTimeIterator(sctx, loc, argv, DateTime::DATE_FACET);
   }
@@ -583,7 +583,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnFormatDateTimeIterator(sctx, loc, argv, DateTime::DATE_FACET);
   }
@@ -605,7 +605,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnFormatDateTimeIterator(sctx, loc, argv, DateTime::TIME_FACET);
   }
@@ -627,7 +627,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const
+        expr& ann) const
   {
     return new FnFormatDateTimeIterator(sctx, loc, argv, DateTime::TIME_FACET);
   }

=== modified file 'src/functions/func_errors_and_diagnostics_impl.cpp'
--- src/functions/func_errors_and_diagnostics_impl.cpp	2012-01-11 17:30:25 +0000
+++ src/functions/func_errors_and_diagnostics_impl.cpp	2012-02-16 12:50:29 +0000
@@ -53,7 +53,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder &ann) const
+    expr &ann) const
 {
   // tracing can be disabled using declare option op:disable-feature "trace";
   if ( sctx->is_feature_set( feature::trace ) )

=== modified file 'src/functions/func_eval.cpp'
--- src/functions/func_eval.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_eval.cpp	2012-02-16 12:50:29 +0000
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;
@@ -107,7 +107,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;
@@ -119,7 +119,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;
@@ -131,7 +131,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;

=== modified file 'src/functions/func_index_ddl.cpp'
--- src/functions/func_index_ddl.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_index_ddl.cpp	2012-02-16 12:50:29 +0000
@@ -32,7 +32,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   fo_expr* fo = static_cast<fo_expr*>(&ann);
 
@@ -51,7 +51,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CreateIndexIterator(sctx, loc, argv[0]);
 }
@@ -62,7 +62,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DeleteIndexIterator(sctx, loc, argv[0]);
 }
@@ -73,7 +73,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RefreshIndexIterator(sctx, loc, argv[0]);
 }
@@ -84,7 +84,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ValueIndexEntryBuilderIterator(sctx, loc, argv);
 }
@@ -95,7 +95,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new GeneralIndexEntryBuilderIterator(sctx, loc, argv);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ProbeIndexPointValueIterator(sctx, loc, argv);
 }
@@ -117,7 +117,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ProbeIndexPointGeneralIterator(sctx, loc, argv);
 }
@@ -128,7 +128,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ProbeIndexRangeValueIterator(sctx, loc, argv);
 }
@@ -139,7 +139,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ProbeIndexRangeGeneralIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/func_node_sort_distinct.cpp'
--- src/functions/func_node_sort_distinct.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_node_sort_distinct.cpp	2012-02-16 12:50:29 +0000
@@ -231,7 +231,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const 
+    expr& ann) const 
 {
   const bool* myActions = action();
   bool sort = (myActions[SORT_ASC]  || myActions[SORT_DESC]);

=== modified file 'src/functions/func_numerics_impl.cpp'
--- src/functions/func_numerics_impl.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_numerics_impl.cpp	2012-02-16 12:50:29 +0000
@@ -56,7 +56,7 @@
     static_context* sctx,                                                  \
     const QueryLoc& loc,                                                   \
     std::vector<PlanIter_t>& argv,                                         \
-    AnnotationHolder&) const                                               \
+    expr&) const                                               \
 {                                                                          \
   return new SpecificNumArithIterator<op, t>(sctx, loc, argv[0], argv[1]); \
 }
@@ -627,7 +627,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   return new OpNumericUnaryIterator(sctx, loc, argv[0], true);
 }
@@ -653,7 +653,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   return new OpDoubleUnaryIterator(sctx, loc, argv[0], true);
 }
@@ -689,7 +689,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   return new OpNumericUnaryIterator(sctx, loc, argv[0], false);
 }
@@ -715,7 +715,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   return new OpDoubleUnaryIterator(sctx, loc, argv[0], false);
 }

=== modified file 'src/functions/func_reflection.cpp'
--- src/functions/func_reflection.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_reflection.cpp	2012-02-16 12:50:29 +0000
@@ -95,7 +95,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;
@@ -107,7 +107,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;
@@ -119,7 +119,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;
@@ -131,7 +131,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   ZORBA_ASSERT(false);
   return NULL;

=== modified file 'src/functions/func_sequences_impl.cpp'
--- src/functions/func_sequences_impl.cpp	2012-02-13 21:49:40 +0000
+++ src/functions/func_sequences_impl.cpp	2012-02-16 12:50:29 +0000
@@ -261,7 +261,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& aAnn) const
+    expr& aAnn) const
 {
   fo_expr& subseqExpr = static_cast<fo_expr&>(aAnn);
 
@@ -344,7 +344,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& aAnn) const
+    expr& aAnn) const
 {
   fo_expr& subseqExpr = static_cast<fo_expr&>(aAnn);
 
@@ -439,7 +439,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& aAnn) const
+    expr& aAnn) const
 {
   fo_expr& subseqExpr = static_cast<fo_expr&>(aAnn);
 
@@ -532,7 +532,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   const std::type_info& counted_type = typeid(*argv[0]);
 
@@ -593,7 +593,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ) const
+    expr& ) const
 {
   return argv[0];
 }
@@ -624,7 +624,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& aAnn) const
+    expr& aAnn) const
 {
   return new FnZeroOrOneIterator(aSctx,
                                  aLoc,
@@ -679,7 +679,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& aAnn) const
+    expr& aAnn) const
 {
   return new FnExactlyOneIterator(aSctx,
                                   aLoc,
@@ -697,7 +697,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   return new FnConcatIterator(sctx, loc, argv);
 }
@@ -711,7 +711,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
 #if 0  // we can't access PRODUCES_* from the inputs, must rethink
   bool distinct = ann.get_annotation (Annotations::IGNORES_DUP_NODES) != TSVAnnotationValue::TRUE_VAL;
@@ -736,7 +736,7 @@
     static_context* sctx,
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   // TODO: use SortAntiJoinIterator when available (trac ticket 254)
   return new HashSemiJoinIterator(sctx, loc, argv, true);
@@ -769,7 +769,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& /*aAnn*/) const
+    expr& /*aAnn*/) const
 {
   return new FnMinMaxIterator(aSctx, aLoc, aArgs, FnMinMaxIterator::MAX);
 }
@@ -783,7 +783,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& /*ann*/) const
+    expr& /*ann*/) const
 {
   return new FnMinMaxIterator(aSctx, aLoc, aArgs, FnMinMaxIterator::MIN);
 }
@@ -949,7 +949,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& /*aAnn*/) const
+    expr& /*aAnn*/) const
 {
   ZORBA_ASSERT(false);
   return NULL;
@@ -964,7 +964,7 @@
     static_context* aSctx,
     const QueryLoc& aLoc,
     std::vector<PlanIter_t>& aArgs,
-    AnnotationHolder& /*aAnn*/) const
+    expr& /*aAnn*/) const
 {
   ZORBA_ASSERT(false);
   return NULL;

=== modified file 'src/functions/func_var_decl.cpp'
--- src/functions/func_var_decl.cpp	2012-01-23 10:06:24 +0000
+++ src/functions/func_var_decl.cpp	2012-02-16 12:50:29 +0000
@@ -67,7 +67,7 @@
     static_context* sctx, 
     const QueryLoc& loc,
     std::vector<PlanIter_t>& argv,
-    AnnotationHolder& ann) const
+    expr& ann) const
 {
   const fo_expr& foExpr = static_cast<const fo_expr&>(ann);
 

=== modified file 'src/functions/function.h'
--- src/functions/function.h	2012-01-11 17:30:25 +0000
+++ src/functions/function.h	2012-02-16 12:50:29 +0000
@@ -39,7 +39,6 @@
 class fo_expr;
 class CompilerCB;
 class expr;
-class AnnotationHolder;
 
 
 /*******************************************************************************
@@ -218,7 +217,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const = 0;
+        expr& ann) const = 0;
 };
 
 

=== modified file 'src/functions/function_impl.h'
--- src/functions/function_impl.h	2011-10-07 23:56:40 +0000
+++ src/functions/function_impl.h	2012-02-16 12:50:29 +0000
@@ -69,7 +69,7 @@
                    static_context* sctx,                  \
                    const QueryLoc& loc,                   \
                    std::vector<PlanIter_t>& argv,         \
-                   AnnotationHolder& ann) const;          \
+                   expr& ann) const;                      \
 
 
 #define CODEGEN_DEF(class)                                \
@@ -77,7 +77,7 @@
                           static_context* aSctx,          \
                           const QueryLoc& aLoc,           \
                           std::vector<PlanIter_t>& aArgs, \
-                          AnnotationHolder& aAnn) const
+                          expr& aAnn) const
 
 
 #define DEFAULT_NARY_CODEGEN(Iter)                        \
@@ -85,7 +85,7 @@
                    static_context* sctx,                  \
                    const QueryLoc& loc,                   \
                    std::vector<PlanIter_t>& argv,         \
-                   AnnotationHolder &/*ann*/) const       \
+                   expr&/*ann*/) const                    \
 {                                                         \
   return new Iter(sctx, loc, argv);                       \
 }
@@ -96,7 +96,7 @@
                    static_context* sctx,                  \
                    const QueryLoc& loc,                   \
                    std::vector<PlanIter_t>& argv,         \
-                   AnnotationHolder &/*ann*/) const       \
+                   expr&/*ann*/) const                    \
 {                                                         \
   return new Iter(sctx, loc, argv[0], argv[1]);           \
 }
@@ -107,7 +107,7 @@
                    static_context* sctx,                  \
                    const QueryLoc& loc,                   \
                    std::vector<PlanIter_t>& argv,         \
-                   AnnotationHolder &/*ann*/) const       \
+                   expr&/*ann*/) const                    \
 {                                                         \
   return new Iter(sctx, loc, argv[0]);                    \
 }
@@ -118,7 +118,7 @@
                    static_context* sctx,                  \
                    const QueryLoc& loc,                   \
                    std::vector<PlanIter_t>& argv,         \
-                   AnnotationHolder &/*ann*/) const       \
+                   expr&/*ann*/) const                    \
 {                                                         \
   return new Iter(sctx, loc);                             \
 }

=== modified file 'src/functions/pregenerated/func_accessors.cpp'
--- src/functions/pregenerated/func_accessors.cpp	2011-12-21 14:40:33 +0000
+++ src/functions/pregenerated/func_accessors.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NodeNameIterator(sctx, loc, argv);
 }
@@ -45,7 +45,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NodeNameIterator(sctx, loc, argv);
 }
@@ -55,7 +55,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NilledIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnDataIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new BaseUriIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DocumentUriIterator(sctx, loc, argv);
 }
@@ -95,7 +95,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DocumentUriIterator(sctx, loc, argv);
 }
@@ -105,7 +105,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RootIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_any_uri.cpp'
--- src/functions/pregenerated/func_any_uri.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_any_uri.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ResolveUriIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_base64.cpp'
--- src/functions/pregenerated/func_base64.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_base64.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new Base64DecodeIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new Base64EncodeIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_booleans.cpp'
--- src/functions/pregenerated/func_booleans.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_booleans.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsSameNodeIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NodeBeforeIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NodeAfterIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_collections.cpp'
--- src/functions/pregenerated/func_collections.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_collections.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnCollectionIterator(sctx, loc, argv);
 }
@@ -63,7 +63,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaCollectionNameIterator(sctx, loc, argv);
 }
@@ -75,7 +75,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsAvailableIndexIterator(sctx, loc, argv);
 }
@@ -85,7 +85,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AvailableIndexesIterator(sctx, loc, argv);
 }
@@ -95,7 +95,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsActivatedICIterator(sctx, loc, argv);
 }
@@ -105,7 +105,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ActivatedICsIterator(sctx, loc, argv);
 }
@@ -115,7 +115,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsDeclaredCollectionIterator(sctx, loc, argv);
 }
@@ -125,7 +125,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DeclaredCollectionsIterator(sctx, loc, argv);
 }
@@ -135,7 +135,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsDeclaredIndexIterator(sctx, loc, argv);
 }
@@ -145,7 +145,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DeclaredIndexesIterator(sctx, loc, argv);
 }
@@ -155,7 +155,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsDeclaredICIterator(sctx, loc, argv);
 }
@@ -165,7 +165,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DeclaredICsIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_context.cpp'
--- src/functions/pregenerated/func_context.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_context.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CurrentDateTimeIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CurrentDateIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CurrentTimeIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ImplicitTimezoneIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DefaultCollationIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return NULL;
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return NULL;
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return NULL;
 }

=== modified file 'src/functions/pregenerated/func_documents.cpp'
--- src/functions/pregenerated/func_documents.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_documents.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new PutDocumentIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RemoveDocumentIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RetrieveDocumentIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AvailableDocumentsIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsAvailableDocumentIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_durations_dates_times.cpp'
--- src/functions/pregenerated/func_durations_dates_times.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_durations_dates_times.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new YearsFromDurationIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MonthsFromDurationIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DaysFromDurationIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new HoursFromDurationIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MinutesFromDurationIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SecondsFromDurationIterator(sctx, loc, argv);
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new YearFromDatetimeIterator(sctx, loc, argv);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MonthFromDatetimeIterator(sctx, loc, argv);
 }
@@ -116,7 +116,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DayFromDatetimeIterator(sctx, loc, argv);
 }
@@ -126,7 +126,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new HoursFromDatetimeIterator(sctx, loc, argv);
 }
@@ -136,7 +136,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MinutesFromDatetimeIterator(sctx, loc, argv);
 }
@@ -146,7 +146,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SecondsFromDatetimeIterator(sctx, loc, argv);
 }
@@ -156,7 +156,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new TimezoneFromDatetimeIterator(sctx, loc, argv);
 }
@@ -166,7 +166,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new YearFromDateIterator(sctx, loc, argv);
 }
@@ -176,7 +176,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MonthFromDateIterator(sctx, loc, argv);
 }
@@ -186,7 +186,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DayFromDateIterator(sctx, loc, argv);
 }
@@ -196,7 +196,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new TimezoneFromDateIterator(sctx, loc, argv);
 }
@@ -206,7 +206,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new HoursFromTimeIterator(sctx, loc, argv);
 }
@@ -216,7 +216,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MinutesFromTimeIterator(sctx, loc, argv);
 }
@@ -226,7 +226,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SecondsFromTimeIterator(sctx, loc, argv);
 }
@@ -236,7 +236,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new TimezoneFromTimeIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_errors_and_diagnostics.cpp'
--- src/functions/pregenerated/func_errors_and_diagnostics.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_errors_and_diagnostics.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ErrorIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_fetch.cpp'
--- src/functions/pregenerated/func_fetch.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_fetch.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FetchContentIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FetchContentTypeIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_fnput.cpp'
--- src/functions/pregenerated/func_fnput.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_fnput.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnPutIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_function_item_iter.cpp'
--- src/functions/pregenerated/func_function_item_iter.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_function_item_iter.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FunctionNameIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FunctionArityIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new PartialApplyIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_ic_ddl.cpp'
--- src/functions/pregenerated/func_ic_ddl.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_ic_ddl.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ActivateICIterator(sctx, loc, argv[0]);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DeactivateICIterator(sctx, loc, argv[0]);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CheckICIterator(sctx, loc, argv[0]);
 }

=== modified file 'src/functions/pregenerated/func_maps.cpp'
--- src/functions/pregenerated/func_maps.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_maps.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MapCreateIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MapDestroyIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MapGetIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MapInsertIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MapRemoveIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MapKeysIterator(sctx, loc, argv);
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new MapSizeIterator(sctx, loc, argv);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AvailableMapsIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_maths.cpp'
--- src/functions/pregenerated/func_maths.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_maths.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SqrtIterator(sctx, loc, argv[0]);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ExpIterator(sctx, loc, argv[0]);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new Exp10Iterator(sctx, loc, argv[0]);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new LogIterator(sctx, loc, argv[0]);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new Log10Iterator(sctx, loc, argv[0]);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SinIterator(sctx, loc, argv[0]);
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CosIterator(sctx, loc, argv[0]);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new TanIterator(sctx, loc, argv[0]);
 }
@@ -116,7 +116,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ArcSinIterator(sctx, loc, argv[0]);
 }
@@ -126,7 +126,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ArcCosIterator(sctx, loc, argv[0]);
 }
@@ -136,7 +136,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ArcTanIterator(sctx, loc, argv[0]);
 }
@@ -146,7 +146,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new Atan2Iterator(sctx, loc, argv[0], argv[1]);
 }
@@ -156,7 +156,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CoshIterator(sctx, loc, argv[0]);
 }
@@ -166,7 +166,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AcoshIterator(sctx, loc, argv[0]);
 }
@@ -176,7 +176,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FmodIterator(sctx, loc, argv[0], argv[1]);
 }
@@ -186,7 +186,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new LdexpIterator(sctx, loc, argv[0], argv[1]);
 }
@@ -196,7 +196,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new PowIterator(sctx, loc, argv[0], argv[1]);
 }
@@ -206,7 +206,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SinhIterator(sctx, loc, argv[0]);
 }
@@ -216,7 +216,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AsinhIterator(sctx, loc, argv[0]);
 }
@@ -226,7 +226,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new TanhIterator(sctx, loc, argv[0]);
 }
@@ -236,7 +236,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AtanhIterator(sctx, loc, argv[0]);
 }
@@ -246,7 +246,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new PiNumberIterator(sctx, loc);
 }
@@ -256,7 +256,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsInfIterator(sctx, loc, argv[0]);
 }
@@ -266,7 +266,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsNaNIterator(sctx, loc, argv[0]);
 }
@@ -276,7 +276,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ModfIterator(sctx, loc, argv[0]);
 }
@@ -286,7 +286,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FrexpIterator(sctx, loc, argv[0]);
 }

=== modified file 'src/functions/pregenerated/func_node_position.cpp'
--- src/functions/pregenerated/func_node_position.cpp	2011-10-15 10:41:19 +0000
+++ src/functions/pregenerated/func_node_position.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NodePositionIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsAncestorPositionIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsFollowingSiblingPositionIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsFollowingPositionIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsInSubtreeOfPositionIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsDescendantPositionIterator(sctx, loc, argv);
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsPrecedingSiblingPositionIterator(sctx, loc, argv);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsPrecedingPositionIterator(sctx, loc, argv);
 }
@@ -116,7 +116,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsChildPositionIterator(sctx, loc, argv);
 }
@@ -126,7 +126,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsAttributeOfPositionIterator(sctx, loc, argv);
 }
@@ -136,7 +136,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsParentPositionIterator(sctx, loc, argv);
 }
@@ -146,7 +146,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsPrecedingInDocumentOrderPositionIterator(sctx, loc, argv);
 }
@@ -156,7 +156,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsFollowingInDocumentOrderPositionIterator(sctx, loc, argv);
 }
@@ -166,7 +166,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new LevelPositionIterator(sctx, loc, argv);
 }
@@ -176,7 +176,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsAttributePositionIterator(sctx, loc, argv);
 }
@@ -186,7 +186,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsCommentPositionIterator(sctx, loc, argv);
 }
@@ -196,7 +196,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsDocumentPositionIterator(sctx, loc, argv);
 }
@@ -206,7 +206,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsElementPositionIterator(sctx, loc, argv);
 }
@@ -216,7 +216,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsProcessingInstructionPositionIterator(sctx, loc, argv);
 }
@@ -226,7 +226,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsTextPositionIterator(sctx, loc, argv);
 }
@@ -236,7 +236,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsSiblingPositionIterator(sctx, loc, argv);
 }
@@ -246,7 +246,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InSameTreePositionIterator(sctx, loc, argv);
 }
@@ -256,7 +256,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InCollectionPositionIterator(sctx, loc, argv);
 }
@@ -266,7 +266,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InSameCollectionPositionIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_nodes.cpp'
--- src/functions/pregenerated/func_nodes.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_nodes.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NodeReferenceIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NodeByReferenceIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnLocalNameIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnNamespaceUriIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnLangIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return NULL;
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnHasChildrenIterator(sctx, loc, argv);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnInnermostIterator(sctx, loc, argv);
 }
@@ -116,7 +116,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnOutermostIterator(sctx, loc, argv);
 }
@@ -126,7 +126,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnGenerateIdIterator(sctx, loc, argv);
 }
@@ -136,7 +136,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsAncestorIterator(sctx, loc, argv);
 }
@@ -146,7 +146,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsDescendantIterator(sctx, loc, argv);
 }
@@ -156,7 +156,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsParentIterator(sctx, loc, argv);
 }
@@ -166,7 +166,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsChildIterator(sctx, loc, argv);
 }
@@ -176,7 +176,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsFollowingIterator(sctx, loc, argv);
 }
@@ -186,7 +186,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsPrecedingIterator(sctx, loc, argv);
 }
@@ -196,7 +196,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsFollowingSiblingIterator(sctx, loc, argv);
 }
@@ -206,7 +206,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IsPrecedingSiblingIterator(sctx, loc, argv);
 }
@@ -216,7 +216,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new LevelIterator(sctx, loc, argv);
 }
@@ -226,7 +226,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new LeastCommonAncestor(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_numerics.cpp'
--- src/functions/pregenerated/func_numerics.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_numerics.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new AbsIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CeilingIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FloorIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RoundIterator(sctx, loc, argv);
 }
@@ -75,7 +75,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RoundIterator(sctx, loc, argv);
 }
@@ -85,7 +85,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RoundHalfToEvenIterator(sctx, loc, argv);
 }
@@ -95,7 +95,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FormatNumberIterator(sctx, loc, argv);
 }
@@ -105,7 +105,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FormatIntegerIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_other_diagnostics.cpp'
--- src/functions/pregenerated/func_other_diagnostics.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_other_diagnostics.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ReadLineIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new PrintIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_parse_fragment.cpp'
--- src/functions/pregenerated/func_parse_fragment.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_parse_fragment.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnParseXmlFragmentIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_parsing_and_serializing.cpp'
--- src/functions/pregenerated/func_parsing_and_serializing.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_parsing_and_serializing.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnParseXmlIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnSerializeIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_qnames.cpp'
--- src/functions/pregenerated/func_qnames.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_qnames.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ResolveQNameIterator(sctx, loc, argv[0], argv[1]);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new QNameIterator(sctx, loc, argv[0], argv[1]);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new QNameEqualIterator(sctx, loc, argv[0], argv[1]);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new PrefixFromQNameIterator(sctx, loc, argv[0]);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new LocalNameFromQNameIterator(sctx, loc, argv[0]);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NamespaceUriFromQNameIterator(sctx, loc, argv[0]);
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NamespaceUriForPrefixIterator(sctx, loc, argv);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InScopePrefixesIterator(sctx, loc, argv[0]);
 }

=== modified file 'src/functions/pregenerated/func_random.cpp'
--- src/functions/pregenerated/func_random.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_random.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SeededRandomIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new RandomIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new UuidIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_schema.cpp'
--- src/functions/pregenerated/func_schema.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_schema.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaValidateInPlaceIterator(sctx, loc, argv[0]);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaSchemaTypeIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaSchemaTypeIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ZorbaIsValidatedIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_sctx.cpp'
--- src/functions/pregenerated/func_sctx.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_sctx.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StaticNamespacesIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DefaultFunctionNamespaceIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SctxBaseUriIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SctxDefaultCollationIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StaticNamespaceBindingIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InscopeVariablesIterator(sctx, loc, argv);
 }
@@ -96,7 +96,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DefaultCollectionTypeIterator(sctx, loc, argv);
 }
@@ -106,7 +106,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new XPath10CompatModeIterator(sctx, loc, argv);
 }
@@ -116,7 +116,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StaticallyKnownDocumentsIterator(sctx, loc, argv);
 }
@@ -126,7 +126,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StaticallyKnownDocumentTypeIterator(sctx, loc, argv);
 }
@@ -136,7 +136,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StaticallyKnownCollationsIterator(sctx, loc, argv);
 }
@@ -146,7 +146,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ConstructionModeIterator(sctx, loc, argv);
 }
@@ -156,7 +156,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new OrderingModeIterator(sctx, loc, argv);
 }
@@ -166,7 +166,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new DefaultOrderIterator(sctx, loc, argv);
 }
@@ -176,7 +176,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new BoundarySpacePolicyIterator(sctx, loc, argv);
 }
@@ -186,7 +186,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CopyNamespacesModeIterator(sctx, loc, argv);
 }
@@ -196,7 +196,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FunctionNamesIterator(sctx, loc, argv);
 }
@@ -206,7 +206,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FunctionArgumentsCountIterator(sctx, loc, argv);
 }
@@ -216,7 +216,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InScopeSchemaTypesIterator(sctx, loc, argv);
 }
@@ -226,7 +226,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InScopeElementDeclarationsIterator(sctx, loc, argv);
 }
@@ -236,7 +236,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InScopeAttributeDeclarationsIterator(sctx, loc, argv);
 }
@@ -246,7 +246,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InScopeElementGroupsIterator(sctx, loc, argv);
 }
@@ -256,7 +256,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new InScopeAttributeGroupsIterator(sctx, loc, argv);
 }
@@ -266,7 +266,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new OptionIterator(sctx, loc, argv);
 }
@@ -276,7 +276,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FunctionAnnotationsIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_sequences.cpp'
--- src/functions/pregenerated/func_sequences.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_sequences.cpp	2012-02-16 12:50:29 +0000
@@ -39,7 +39,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnConcatIterator(sctx, loc, argv);
 }
@@ -49,7 +49,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnIndexOfIterator(sctx, loc, argv);
 }
@@ -59,7 +59,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnEmptyIterator(sctx, loc, argv);
 }
@@ -69,7 +69,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnExistsIterator(sctx, loc, argv);
 }
@@ -79,7 +79,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnDistinctValuesIterator(sctx, loc, argv);
 }
@@ -89,7 +89,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnInsertBeforeIterator(sctx, loc, argv);
 }
@@ -99,7 +99,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnRemoveIterator(sctx, loc, argv);
 }
@@ -109,7 +109,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnReverseIterator(sctx, loc, argv);
 }
@@ -123,7 +123,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnOneOrMoreIterator(sctx, loc, argv);
 }
@@ -133,7 +133,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnDeepEqualIterator(sctx, loc, argv);
 }
@@ -144,7 +144,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnAvgIterator(sctx, loc, argv);
 }
@@ -154,7 +154,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnSumIterator(sctx, loc, argv);
 }
@@ -164,7 +164,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnSumDoubleIterator(sctx, loc, argv);
 }
@@ -174,7 +174,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnSumFloatIterator(sctx, loc, argv);
 }
@@ -184,7 +184,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnSumDecimalIterator(sctx, loc, argv);
 }
@@ -194,7 +194,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnSumIntegerIterator(sctx, loc, argv);
 }
@@ -204,7 +204,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new OpToIterator(sctx, loc, argv);
 }
@@ -214,7 +214,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnIdIterator(sctx, loc, argv);
 }
@@ -224,7 +224,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnElementWithIdIterator(sctx, loc, argv);
 }
@@ -234,7 +234,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnIdRefIterator(sctx, loc, argv);
 }
@@ -244,7 +244,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnDocIterator(sctx, loc, argv);
 }
@@ -254,7 +254,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnDocAvailableIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_strings.cpp'
--- src/functions/pregenerated/func_strings.cpp	2012-01-11 17:30:25 +0000
+++ src/functions/pregenerated/func_strings.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CodepointsToStringIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StringToCodepointsIterator(sctx, loc, argv);
 }
@@ -56,7 +56,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CompareStrIterator(sctx, loc, argv);
 }
@@ -66,7 +66,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new CodepointEqualIterator(sctx, loc, argv);
 }
@@ -76,7 +76,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ConcatStrIterator(sctx, loc, argv);
 }
@@ -86,7 +86,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StringJoinIterator(sctx, loc, argv);
 }
@@ -95,7 +95,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StringJoinIterator(sctx, loc, argv);
 }
@@ -105,7 +105,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SubstringIterator(sctx, loc, argv);
 }
@@ -115,7 +115,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SubstringIntOptIterator(sctx, loc, argv);
 }
@@ -125,7 +125,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StringLengthIterator(sctx, loc, argv);
 }
@@ -135,7 +135,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NormalizeSpaceIterator(sctx, loc, argv);
 }
@@ -145,7 +145,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new NormalizeUnicodeIterator(sctx, loc, argv);
 }
@@ -155,7 +155,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new UpperCaseIterator(sctx, loc, argv);
 }
@@ -165,7 +165,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new LowerCaseIterator(sctx, loc, argv);
 }
@@ -175,7 +175,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new TranslateIterator(sctx, loc, argv);
 }
@@ -185,7 +185,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new EncodeForUriIterator(sctx, loc, argv);
 }
@@ -195,7 +195,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new IriToUriIterator(sctx, loc, argv);
 }
@@ -205,7 +205,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new EscapeHtmlUriIterator(sctx, loc, argv);
 }
@@ -215,7 +215,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new ContainsIterator(sctx, loc, argv);
 }
@@ -225,7 +225,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StartsWithIterator(sctx, loc, argv);
 }
@@ -235,7 +235,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new EndsWithIterator(sctx, loc, argv);
 }
@@ -245,7 +245,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SubstringBeforeIterator(sctx, loc, argv);
 }
@@ -255,7 +255,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new SubstringAfterIterator(sctx, loc, argv);
 }
@@ -265,7 +265,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnMatchesIterator(sctx, loc, argv);
 }
@@ -275,7 +275,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnReplaceIterator(sctx, loc, argv);
 }
@@ -285,7 +285,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnTokenizeIterator(sctx, loc, argv);
 }
@@ -295,7 +295,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new FnAnalyzeStringIterator(sctx, loc, argv);
 }
@@ -305,7 +305,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StringMaterializeIterator(sctx, loc, argv);
 }
@@ -315,7 +315,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StringIsStreamableIterator(sctx, loc, argv);
 }
@@ -325,7 +325,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new StringSplitIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/pregenerated/func_xqdoc.cpp'
--- src/functions/pregenerated/func_xqdoc.cpp	2011-11-09 05:42:08 +0000
+++ src/functions/pregenerated/func_xqdoc.cpp	2012-02-16 12:50:29 +0000
@@ -36,7 +36,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new XQDocIterator(sctx, loc, argv);
 }
@@ -46,7 +46,7 @@
   static_context* sctx,
   const QueryLoc& loc,
   std::vector<PlanIter_t>& argv,
-  AnnotationHolder& ann) const
+  expr& ann) const
 {
   return new XQDocContentIterator(sctx, loc, argv);
 }

=== modified file 'src/functions/udf.cpp'
--- src/functions/udf.cpp	2012-02-02 09:56:52 +0000
+++ src/functions/udf.cpp	2012-02-16 12:50:29 +0000
@@ -598,7 +598,7 @@
       static_context* sctx,
       const QueryLoc& loc,
       std::vector<PlanIter_t>& argv,
-      AnnotationHolder& ann) const
+      expr& ann) const
 {
   return new UDFunctionCallIterator(sctx, loc, argv, this);
 }

=== modified file 'src/functions/udf.h'
--- src/functions/udf.h	2012-02-02 09:56:52 +0000
+++ src/functions/udf.h	2012-02-16 12:50:29 +0000
@@ -213,7 +213,7 @@
         static_context* sctx,
         const QueryLoc& loc,
         std::vector<PlanIter_t>& argv,
-        AnnotationHolder& ann) const;
+        expr& ann) const;
 };
 
 

=== modified file 'src/runtime/collections/collections_impl.cpp'
--- src/runtime/collections/collections_impl.cpp	2012-01-11 17:30:25 +0000
+++ src/runtime/collections/collections_impl.cpp	2012-02-16 12:50:29 +0000
@@ -1510,8 +1510,7 @@
     PlanState& planState) const
 {
   store::Collection_t              collection;
-  const StaticallyKnownCollection* collectionDecl;
-  store::Item_t                    collectionName;
+  store::Item_t                    name;
   store::Item_t                    node;
   std::vector<store::Item_t>       nodes;
   std::auto_ptr<store::PUL>        pul;
@@ -1521,10 +1520,12 @@
 
   while (consumeNext(node, theChildren[theChildren.size()-1].getp(), planState))
   {
-    if (! node->getCollection()) {
+    if (! node->getCollection()) 
+    {
       throw XQUERY_EXCEPTION( zerr::ZDDY0017_NODE_IS_ORPHAN, ERROR_LOC( loc ) );
     }
-    if (collection && collection != node->getCollection()) {
+    if (collection && collection != node->getCollection()) 
+    {
       throw XQUERY_EXCEPTION(
         zerr::ZDDY0018_NODES_NOT_IN_SAME_COLLECTION, ERROR_LOC( loc )
       );
@@ -1536,18 +1537,14 @@
 
   if (!nodes.empty())
   {
-    collectionName = collection->getName();
+    name = collection->getName();
 
-    collectionDecl = getCollection(theSctx,
-                                   collectionName,
-                                   loc,
-                                   theDynamicCollection,
-                                   collection);
+    (void)getCollection(theSctx, name, loc, theDynamicCollection, collection);
 
     // create the pul and add the primitive
     pul.reset(GENV_ITEMFACTORY->createPendingUpdateList());
 
-    pul->addDeleteFromCollection(&loc, collectionName, nodes, false, theDynamicCollection);
+    pul->addDeleteFromCollection(&loc, name, nodes, false, theDynamicCollection);
 
     // this should not be necessary. we reset everything in the sequential iterator
     theChildren[theChildren.size()-1]->reset(planState);

=== modified file 'src/runtime/spec/codegen-cpp.xq'
--- src/runtime/spec/codegen-cpp.xq	2011-08-05 02:21:55 +0000
+++ src/runtime/spec/codegen-cpp.xq	2012-02-16 12:50:29 +0000
@@ -206,7 +206,7 @@
                      $gen:newline, $gen:indent, 'static_context* sctx,',
                      $gen:newline, $gen:indent, 'const QueryLoc&amp; loc,',
                      $gen:newline, $gen:indent, 'std::vector&lt;PlanIter_t&gt;&amp; argv,',
-                     $gen:newline, $gen:indent, 'AnnotationHolder&amp; ann) const',
+                     $gen:newline, $gen:indent, 'expr&amp; ann) const',
                      $gen:newline,'{', $gen:newline, $gen:indent, $ret, $gen:newline,'}'), '')
   else
     ''


Follow ups