Update of /cvsroot/monetdb/pathfinder/compiler/algebra/prop
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv23266/algebra/prop

Modified Files:
        prop_ocol.c 
Log Message:
-- Prepare {ancestor-or-|descendant-or-|}self steps in the algebra
   for attribute context nodes.


U prop_ocol.c
Index: prop_ocol.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_ocol.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- prop_ocol.c 17 Mar 2008 17:41:19 -0000      1.53
+++ prop_ocol.c 26 Mar 2008 11:28:25 -0000      1.54
@@ -716,6 +716,9 @@
                         "wrong item type '0x%X' in the input of a path step",
                         PFprop_type_of (R(n), n->sem.step.item));
 #endif
+        {
+            PFalg_simple_type_t ty;
+            
             new_ocols (n, 2);
 
             ocol_at (n, 0)
@@ -725,14 +728,18 @@
                                                     n->sem.step.iter) };
 
             if (n->sem.step.spec.axis == alg_attr)
-                ocol_at (n, 1)
-                    = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
-                                            .type = aat_anode };
+                ty = aat_anode;
+            else if (n->sem.step.spec.axis == alg_anc_s)
+                ty = PFprop_type_of (R(n), n->sem.step.item) | aat_pnode;
+            else if (n->sem.step.spec.axis == alg_desc_s ||
+                     n->sem.step.spec.axis == alg_self)
+                ty = PFprop_type_of (R(n), n->sem.step.item);
             else
-                ocol_at (n, 1)
-                    = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
-                                            .type = aat_pnode };
-            break;
+                ty = aat_pnode;
+
+            ocol_at (n, 1) = (PFalg_schm_item_t) { .name = 
n->sem.step.item_res,
+                                                   .type = ty };
+        }   break;
 
         case la_step_join:
         case la_guide_step_join:
@@ -751,17 +758,25 @@
                         "wrong item type '0x%X' in the input of a path step",
                         PFprop_type_of (R(n), n->sem.step.item));
 #endif
+        {
+            PFalg_simple_type_t ty;
+            
             ocols (n) = copy_ocols (ocols (R(n)), ocols_count (R(n)) + 1);
             if (n->sem.step.spec.axis == alg_attr)
-                ocol_at (n, ocols_count (n))
-                    = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
-                                            .type = aat_anode };
+                ty = aat_anode;
+            else if (n->sem.step.spec.axis == alg_anc_s)
+                ty = PFprop_type_of (R(n), n->sem.step.item) | aat_pnode;
+            else if (n->sem.step.spec.axis == alg_desc_s ||
+                     n->sem.step.spec.axis == alg_self)
+                ty = PFprop_type_of (R(n), n->sem.step.item);
             else
-                ocol_at (n, ocols_count (n))
-                    = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
-                                            .type = aat_pnode };
+                ty = aat_pnode;
+
+            ocol_at (n, ocols_count (n))
+                = (PFalg_schm_item_t) { .name = n->sem.step.item_res,
+                                        .type = ty };
             ocols_count (n)++;
-            break;
+        }   break;
 
         case la_doc_index_join:
 #ifndef NDEBUG


-------------------------------------------------------------------------
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