Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory 
sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv9749/compiler/algebra

Modified Files:
      Tag: M5XQ
        core2alg.brg 
Log Message:
propagated changes of Friday Jan 22 2010
from the XQFT branch to the M5XQ branch

  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  2010/01/22 - sjoerd: compiler/algebra/core2alg.brg,1.92.2.3
  propagated changes of Friday Jan 22 2010
  from the development trunk to the XQFT branch
  
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    2010/01/22 - sjoerd: compiler/algebra/core2alg.brg,1.96
    propagated changes of Thursday Jan 21 2010 - Friday Jan 22 2010
    from the Feb2010 branch to the development trunk
  
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      2010/01/21 - tsheyar: compiler/algebra/core2alg.brg,1.95.2.1
      -- Push more type information into the algebra plan to avoid assertions
         in the MIL code generation.
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Index: core2alg.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/core2alg.brg,v
retrieving revision 1.89.2.5
retrieving revision 1.89.2.6
diff -u -d -r1.89.2.5 -r1.89.2.6
--- core2alg.brg        7 Jan 2010 16:54:57 -0000       1.89.2.5
+++ core2alg.brg        22 Jan 2010 08:00:57 -0000      1.89.2.6
@@ -2421,12 +2421,66 @@
 
         /* CoreExpr:           seqcast (seqtype, CoreExpr) */
         case 22:
+        {
             /*
              * `seqcast' nodes are only introduced for static typing.
              * They are not meant to be executed.
              */
-            A(p) = A(R(p));
-            break;
+            struct  PFla_pair_t pair = A(R(p));
+            PFty_t              t;
+            PFalg_simple_type_t algty;
+
+            t = PFty_prime (PFty_defn (L(p)->sem.type));
+
+            /*
+             * Unfortunately, we only know how to cast atomic types
+             * into (exactly) one of our builtin atomic types. We
+             * cannot sensibly cast, e.g., into subtypes thereof.
+             */
+            if (PFty_equality (t, PFty_xs_string ()))
+                algty = aat_str;
+            else if (PFty_equality (t, PFty_untypedAtomic ()))
+                algty = aat_uA;
+            else if (PFty_equality (t, PFty_xs_integer ()))
+                algty = aat_int;
+            else if (PFty_equality (t, PFty_xs_decimal ()))
+                algty = aat_dec;
+            else if (PFty_equality (t, PFty_xs_double ()))
+                algty = aat_dbl;
+            else if (PFty_equality (t, PFty_xs_boolean ()))
+                algty = aat_bln;
+            else if (PFty_equality (t, PFty_xs_datetime ()))
+                algty = aat_dtime;
+            else if (PFty_equality (t, PFty_xs_date ()))
+                algty = aat_date;
+            else if (PFty_equality (t, PFty_xs_time ()))
+                algty = aat_time;
+            else if (PFty_equality (t, PFty_xs_gyearmonth ()))
+                algty = aat_gymonth;
+            else if (PFty_equality (t, PFty_xs_gyear ()))
+                algty = aat_gyear;
+            else if (PFty_equality (t, PFty_xs_gmonthday ()))
+                algty = aat_gmday;
+            else if (PFty_equality (t, PFty_xs_gmonth ()))
+                algty = aat_gmonth;
+            else if (PFty_equality (t, PFty_xs_gday ()))
+                algty = aat_gday;
+            else if (PFty_equality (t, PFty_xs_duration ()))
+                algty = aat_duration;
+            else if (PFty_equality (t, PFty_xs_yearmonthduration ()))
+                algty = aat_ymduration;
+            else if (PFty_equality (t, PFty_xs_daytimeduration ()))
+                algty = aat_dtduration;
+            else
+                algty = 0;
+
+            if (algty)
+                A(p) = (struct PFla_pair_t) {
+                    .rel  = type_assert_pos (pair.rel, col_item, algty),
+                    .frag = pair.frag };
+            else
+                A(p) = pair;
+        }   break;
 
         /* CoreExpr:     locsteps (ancestor (seqtype), CoreExpr) */
         case 30:


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to