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

Modified Files:
        mil.c mil_dce.c milgen.brg milprint.c 
Log Message:
* Implementation of the serialize operator for the UpdateTape proc.
* The order of a sequence is reversed for insertIntoAsFirst, InsertAfter.


Index: milprint.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milprint.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- milprint.c  26 Oct 2007 13:03:15 -0000      1.57
+++ milprint.c  26 Nov 2007 16:25:49 -0000      1.58
@@ -6,12 +6,12 @@
  * Serialization is done with the help of a simplified MIL grammar:
  *
  * @verbatim
- 
+
    statements    : statements statements                    <m_seq>
                  | 'if (' Expr ') {' stmts '} else {' stmts '}' <m_if>
                  | 'while (' Expr ') {' stmts '}'           <m_while>
                  | <nothing>                                <m_nop>
-                 | '#' c                                    <m_comment> 
+                 | '#' c                                    <m_comment>
                  | statement ';'                            <otherwise>
 
    statement     : Variable ':=' expression                 <m_assgn>
@@ -200,8 +200,8 @@
  * $Id$
  */
 
-/* always include pathfinder.h first! */ 
-#include "pathfinder.h" 
+/* always include pathfinder.h first! */
+#include "pathfinder.h"
 
 #include <stdio.h>
 #include <assert.h>
@@ -325,7 +325,7 @@
     , [m_llscj_anc_elem_ns]      = "loop_lifted_ancestor_step_with_ns_test"
     , [m_llscj_anc_pi_targ]      = "loop_lifted_ancestor_step_with_target_test"
 
-    , [m_llscj_anc_self]         
+    , [m_llscj_anc_self]
         = "loop_lifted_ancestor_or_self_step"
     , [m_llscj_anc_self_elem]
         = "loop_lifted_ancestor_or_self_step_with_kind_test"
@@ -543,7 +543,7 @@
             milprintf ("while (");
             print_expression (n->child[0]);
             milprintf (") {\n");
-            print_statements (n->child[1]);        
+            print_statements (n->child[1]);
             milprintf ("}\n");
             break;
 
@@ -580,7 +580,7 @@
             print_literal (n->child[0]);
             milprintf (")");
             break;
-            
+
         /* statement : variable ':=' expression */
         case m_assgn:
             print_variable (n->child[0]);
@@ -678,6 +678,12 @@
             milprintf (")");
             break;
 
+        case m_update_tape:
+            milprintf ("UpdateTape (");
+            print_args (n->child[0]);
+            milprintf (")");
+            break;
+
         default:
             debug_output;     /* Print MIL code so far when in debug mode. */
 #ifndef NDEBUG
@@ -1095,7 +1101,7 @@
             print_expression (n->child[1]);
             milprintf (", nil, nil)");
             break;
-            
+
         /* expression : 'll_htordered_unique_thetajoin ('
                             exp ',' exp ',' exp ',' exp ',' exp ', nil, nil)' 
*/
         case m_unq1_tjoin:
@@ -1499,7 +1505,7 @@
     /* print string */
     va_start (args, fmt);
 
-    if (PFarray_vprintf (out, fmt, args) == -1) 
+    if (PFarray_vprintf (out, fmt, args) == -1)
         PFoops (OOPS_FATAL, "unable to print MIL output");
 
     va_end (args);
@@ -1508,7 +1514,7 @@
 /**
  * Serialize the internal representation of a MIL program into a
  * string representation that can serve as an input to Monet.
- * 
+ *
  * @param m   The MIL tree to print
  * @return Dynamic (character) array holding the generated MIL script.
  */

Index: mil.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/mil.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- mil.c       26 Oct 2007 13:03:15 -0000      1.43
+++ mil.c       26 Nov 2007 16:25:48 -0000      1.44
@@ -2349,4 +2349,10 @@
     return wire1 (m_module, module);
 }
 
+PFmil_t *
+PFmil_upd (const PFmil_t *args)
+{
+    return wire1 (m_update_tape, args);
+}
+
 /* vim:set shiftwidth=4 expandtab: */

Index: milgen.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milgen.brg,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- milgen.brg  21 Nov 2007 15:17:42 -0000      1.88
+++ milgen.brg  26 Nov 2007 16:25:49 -0000      1.89
@@ -1174,411 +1174,646 @@
             time = new_var (1);
             execute (assgn (var (time->name), usec ()));
 
+            /* check if the type of the root node is aat_update
+               and if yes play the update tape */
             if (aat_update & type_of (R(p), pa_item)) {
-                /* play update tape and return (a.k.a. if-else) */
-            }
+                /* Set up all the value containers for update_tape(). */
+  /* UpdateTape (
+     BAT[void,bat] ws,                     BAT[void,int] kind,
[...965 lines suppressed...]
 
-            unpin (intVAL, 1);
-            unpin (dblVAL, 1);
-            /* unpin (decVAL, 1); as we currently have no
-                                           decimal support we use doubles */
-            unpin (strVAL, 1);
-            unpin (item, 1);
-            unpin (kind, 1);
+            } /* end of printing results */
 
             /* add timing information */
             execute (
@@ -4003,7 +4238,6 @@
                              update_str = 0; /* should never reach here */
                              break;     /* this is just to fool the compiler */
                     }
-
                     execute (
                         assgn (var (res->name),
                                project (

Index: mil_dce.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/mil_dce.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- mil_dce.c   27 Jun 2007 13:46:42 -0000      1.15
+++ mil_dce.c   26 Nov 2007 16:25:49 -0000      1.16
@@ -440,6 +440,7 @@
         case m_destroy_ws:
         case m_error:
         case m_print:
+        case m_update_tape:
 
 #ifndef NDEBUG
             /* update dirty vars */


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
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