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

Modified Files:
        typecheck.brg 
Log Message:
-- Refine typing and core optimization for path steps.


Index: typecheck.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/semantics/typecheck.brg,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -r1.67 -r1.68
--- typecheck.brg       17 Mar 2008 17:41:29 -0000      1.67
+++ typecheck.brg       20 Mar 2008 12:49:33 -0000      1.68
@@ -798,14 +798,24 @@
 
         /* LocationStep:       attribute (SequenceType) */
         case 28:
-            /*
+            /* attribute::node() maps to attribute::attribute() */
+            if (PFty_subtype (PFty_xs_anyNode(), TY(L(p))))
+                TY(p) = PFty_xs_anyAttribute();
+
+            /* all other kind tests (elem|text|doc|pi|comment)
+               provide empty results */
+            else if (!PFty_subtype (TY(L(p)), PFty_xs_anyAttribute()))
+                TY(p) = PFty_empty ();
+            
+            /* the following cases handle only attribute kind tests */
+
+            /* 
              * For attribute steps that do not contain any wildcards,
              * we know that there can be at most one match for each
              * context node.
              */
-            assert (TY(L(p)).type == ty_attr);
-            if (! (PFQNAME_NS_WILDCARD (TY(L(p)).name)
-                   || PFQNAME_LOC_WILDCARD (TY(L(p)).name)))
+            else if (! (PFQNAME_NS_WILDCARD (TY(L(p)).name)
+                        || PFQNAME_LOC_WILDCARD (TY(L(p)).name)))
                 TY(p) = PFty_opt (TY(L(p)));
             else
                 TY(p) = PFty_star (TY(L(p)));


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