Update of /cvsroot/monetdb/pathfinder/compiler/debug
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14484/debug

Modified Files:
        logdebug.c 
Log Message:
-- Implemented generic function application facility (for the logical algebra).

   Generic functions can now be implemented in the logical algebra using
   the following 4 operators:

   o la_fun_call:
     The head of a function call whose left child is the loop relation and the
     right child a function parameter list. The operator is prepared for a set
     of different kinds (e.g., xrpc and tijah), stores the function name and a
     pointer to an arbitrary context (for XRPC this is a reference to the core
     apply node).

   o la_fun_param:
     An item of the function parameter list refering to an algebra expression
     (left child) and to the rest of the function parameter list (right child).
     Its schema stores the names of all input columns. The order of columns
     in the schema is important!

   o la_fun_frag_param:
     An item of the function parameter list refering to a fragment (left child)
     and to the rest of the function parameter list (right child). It has a
     further position argument that indicates to which column of the next
     la_fun_param operator in the right child the fragment information refers
     to. This operator is only used if a column contains node references.

   o la_frag_extract:
     If a function call returns nodes a frag_extract operator sits on top of
     the la_fun_call operator to fix the fragment information needed by our
     compilation scheme. Similar to the la_fun_frag_param operator it stores
     the schema position of the item column it refers to.



Index: logdebug.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/debug/logdebug.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -d -r1.82 -r1.83
--- logdebug.c  10 Dec 2007 15:10:04 -0000      1.82
+++ logdebug.c  13 Dec 2007 13:08:17 -0000      1.83
@@ -106,6 +106,7 @@
     , [la_merge_adjacent]   = "#pf:merge-adjacent-text-nodes"
     , [la_roots]            = "ROOTS"
     , [la_fragment]         = "FRAGs"
+    , [la_frag_extract]     = "FRAG EXTRACT"
     , [la_frag_union]       = "FRAG_UNION"
     , [la_empty_frag]       = "EMPTY_FRAG"
     , [la_error]            = "!ERROR"
@@ -118,6 +119,9 @@
     , [la_rec_param]        = "rec param"
     , [la_rec_arg]          = "rec arg"
     , [la_rec_base]         = "rec base"
+    , [la_fun_call]         = "fun call"
+    , [la_fun_param]        = "fun param"
+    , [la_fun_frag_param]   = "fun frag param"
     , [la_proxy]            = "PROXY"
     , [la_proxy_base]       = "PROXY_BASE"
     , [la_string_join]      = "fn:string_join"
@@ -184,6 +188,7 @@
     , [la_merge_adjacent]   = "#pf:merge-adjacent-text-nodes"
     , [la_roots]            = "ROOTS"
     , [la_fragment]         = "FRAG"
+    , [la_frag_extract]     = "FRAG EXTRACT"
     , [la_frag_union]       = "FRAG_UNION"
     , [la_empty_frag]       = "EMPTY_FRAG"
     , [la_error]            = "error"
@@ -196,6 +201,9 @@
     , [la_rec_param]        = "recursion param"
     , [la_rec_arg]          = "recursion arg"
     , [la_rec_base]         = "recursion base"
+    , [la_fun_call]         = "function call"
+    , [la_fun_param]        = "function call parameter"
+    , [la_fun_frag_param]   = "function call fragment parameter"
     , [la_proxy]            = "proxy"
     , [la_proxy_base]       = "proxy base"
     , [la_string_join]      = "fn:string-join"
@@ -377,6 +385,7 @@
         , [la_merge_adjacent]  = "#00D000"
         , [la_roots]           = "#E0E0E0"
         , [la_fragment]        = "#E0E0E0"
+        , [la_frag_extract]    = "#DD22DD"
         , [la_frag_union]      = "#E0E0E0"
         , [la_empty_frag]      = "#E0E0E0"
         , [la_error]           = "#C0C0C0"
@@ -389,6 +398,9 @@
         , [la_rec_param]       = "#FF00FF"
         , [la_rec_arg]         = "#BB00BB"
         , [la_rec_base]        = "#BB00BB"
+        , [la_fun_call]        = "#BB00BB"
+        , [la_fun_param]       = "#BB00BB"
+        , [la_fun_frag_param]  = "#BB00BB"
         , [la_proxy]           = "#DFFFFF"
         , [la_proxy_base]      = "#DFFFFF"
         , [la_string_join]     = "#C0C0C0"
@@ -882,6 +894,35 @@
                             PFatt_str (n->sem.trace_map.outer));
             break;
         
+        case la_fun_call:
+            PFarray_printf (dot,
+                            "%s function \\\"%s\\\" (",
+                            PFalg_fun_call_kind_str (n->sem.fun_call.kind),
+                            PFqname_uri_str (n->sem.fun_call.qname));
+            for (unsigned int i = 0; i < n->schema.count; i++)
+                PFarray_printf (dot, "%s%s",
+                                i?", ":"",
+                                PFatt_str (n->schema.items[i].name));
+            PFarray_printf (dot,
+                            ")\\n(loop: %s)",
+                            PFatt_str (n->sem.fun_call.iter));
+            break;
+            
+        case la_fun_param:
+            PFarray_printf (dot, "%s (", a_id[n->kind]);
+            for (unsigned int i = 0; i < n->schema.count; i++)
+                PFarray_printf (dot, "%s%s",
+                                i?", ":"",
+                                PFatt_str (n->schema.items[i].name));
+            PFarray_printf (dot, ")");
+            break;
+            
+        case la_frag_extract:
+        case la_fun_frag_param:
+            PFarray_printf (dot, "%s (referencing column %i)",
+                            a_id[n->kind], n->sem.col_ref.pos);
+            break;
+            
         case la_proxy:
             PFarray_printf (dot, "%s %i (", a_id[n->kind], n->sem.proxy.kind);
 
@@ -2020,6 +2061,37 @@
                             PFatt_str (n->sem.trace_map.outer));
             break;
         
+        case la_fun_call:
+            PFarray_printf (xml,
+                            "    <content>\n"
+                            "      <function uri=\"%s\" name=\"%s\"/>\n"
+                            "      <kind name=\"%s\"/>\n"
+                            "      <column name=\"%s\" function=\"iter\"/>\n"
+                            "    </content>\n",
+                            PFqname_uri (n->sem.fun_call.qname),
+                            PFqname_loc (n->sem.fun_call.qname),
+                            PFalg_fun_call_kind_str (n->sem.fun_call.kind),
+                            PFatt_str (n->sem.fun_call.iter));
+            break;
+            
+        case la_fun_param:
+            PFarray_printf (xml, "    <content>\n"); 
+            for (c = 0; c < n->schema.count; c++)
+                PFarray_printf (xml, 
+                                "      <column name=\"%s\" 
position=\"%u\"/>\n",
+                                PFatt_str (n->schema.items[c].name), c);
+            PFarray_printf (xml, "    </content>\n");
+            break;
+
+        case la_frag_extract:
+        case la_fun_frag_param:
+            PFarray_printf (xml,
+                            "    <content>\n"
+                            "      <column reference=\"%i\"/>\n"
+                            "    </content>\n",
+                            n->sem.col_ref.pos);
+            break;
+
         case la_string_join:
             PFarray_printf (xml,
                             "    <content>\n"


-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to