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

Modified Files:
        prop_ocol.c 
Log Message:
* Algebra / MIL implementation of XQuery builtin function fn:translate.
* Erase trailing space chars.
* Introduce new algebra types for the document management functions:
   - aat_docmgmt
   - aat_str1
   - aat_str2
* Algebra implementation of the following document management functions:
   - pf:add-doc(str,str)
   - pf:add-doc(str,str, str)
   - pf:add-doc(str,str, int)
   - pf:add-doc(str,str, str, int)
   - pf:del-doc(str)
  mil code generation and runtime DocmgmTape function are still missing.


Index: prop_ocol.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/prop/prop_ocol.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- prop_ocol.c 11 Jan 2008 10:46:59 -0000      1.44
+++ prop_ocol.c 18 Jan 2008 16:11:36 -0000      1.45
@@ -397,6 +397,7 @@
                     res_type = aat_bln;
                     break;
 
+                case alg_fun_fn_translate:
                 case alg_fun_fn_replace:
                     assert (n->sem.fun_1to1.refs.count == 3);
                     /* make sure all attributes are of type string */
@@ -458,6 +459,71 @@
                     res_type = ocol_at (L(n), ix[0]).type;
                     break;
 
+
+                case alg_fun_pf_add_doc:
+                    assert(n->sem.fun_1to1.refs.count == 2);
+
+                    /* make sure atts are of the correct type */
+                    assert(ocol_at (L(n), ix[0]).type == aat_str);
+                    assert(ocol_at (L(n), ix[1]).type == aat_str);
+
+                    /* the returning type of doc management functions
+                     * is aat_docmgmt bitwise OR the attribute types*/
+                    res_type = aat_docmgmt | aat_str | aat_str1;
+                    break;
+
+                case alg_fun_pf_add_doc_str:
+                    assert(n->sem.fun_1to1.refs.count == 3);
+
+                    /* make sure atts are of the correct type */
+                    assert(ocol_at (L(n), ix[0]).type == aat_str);
+                    assert(ocol_at (L(n), ix[1]).type == aat_str);
+                    assert(ocol_at (L(n), ix[2]).type == aat_str);
+
+                    /* the returning type of doc management functions
+                     * is aat_docmgmt bitwise OR the attribute types*/
+                    res_type = aat_docmgmt | aat_str | aat_str1 | aat_str2;
+                    break;
+
+                case alg_fun_pf_add_doc_int:
+                    assert(n->sem.fun_1to1.refs.count == 3);
+
+                    /* make sure atts are of the correct type */
+                    assert(ocol_at (L(n), ix[0]).type == aat_str);
+                    assert(ocol_at (L(n), ix[1]).type == aat_str);
+                    assert(ocol_at (L(n), ix[2]).type == aat_int);
+
+                    /* the returning type of doc management functions
+                     * is aat_docmgmt bitwise OR the attribute types */
+                    res_type = aat_docmgmt | aat_str | aat_str1 | aat_int;
+                    break;
+
+                case alg_fun_pf_add_doc_str_int:
+                    assert(n->sem.fun_1to1.refs.count == 4);
+
+                    /* make sure atts are of the correct type */
+                    assert(ocol_at (L(n), ix[0]).type == aat_str);
+                    assert(ocol_at (L(n), ix[1]).type == aat_str);
+                    assert(ocol_at (L(n), ix[2]).type == aat_str);
+                    assert(ocol_at (L(n), ix[3]).type == aat_int);
+
+                    /* the returning type of doc management functions
+                     * is aat_docmgmt bitwise OR the attribute types */
+                    res_type = aat_docmgmt | aat_str | aat_str1 |
+                                            aat_str2 | aat_int;
+                    break;
+
+                case alg_fun_pf_del_doc:
+                    assert(n->sem.fun_1to1.refs.count == 1);
+
+                    /* make sure atts are of the correct type */
+                    assert(ocol_at (L(n), ix[0]).type == aat_str);
+
+                    /* the returning type of doc management functions
+                     * is aat_docmgmt bitwise OR the attribute types */
+                    res_type = aat_docmgmt | aat_str1;
+                    break;
+
                 case alg_fun_upd_delete:
                     assert(n->sem.fun_1to1.refs.count == 1);
                     /* make sure that the attribute is a node */


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to