[kaffe] CVS kaffe (robilad): Resynced with GNU JAXP: further XPath fixes

Kaffe CVS cvs-commits at kaffe.org
Wed Oct 20 11:08:38 PDT 2004


PatchSet 5316 
Date: 2004/10/20 18:04:43
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU JAXP: further XPath fixes

2004-10-20  Dalibor Topic  <robilad at kaffe.org>

        * libraries/javalib/gnu/xml/xpath/XPathParser.y:
        New file taken from GNU JAXP.

        * libraries/javalib/gnu/xml/dom/DomXPathExpression.java,
        libraries/javalib/gnu/xml/dom/DomXPathResult.java,
        libraries/javalib/gnu/xml/xpath/Expr.java,
        libraries/javalib/gnu/xml/xpath/FunctionCall.java,
        libraries/javalib/gnu/xml/xpath/Index.java,
        libraries/javalib/gnu/xml/xpath/NameTest.java,
        libraries/javalib/gnu/xml/xpath/XPathParser.java,
        libraries/javalib/gnu/xml/xpath/XPathTokenizer.java:
        Resynced with GNU JAXP.

        2004-10-18  Chris Burdess  <dog at gnu.org>

        * xpath: Number parsing fixes.

        2004-10-17  Chris Burdess  <dog at gnu.org>

        * xpath: XPath function calls.

        2004-10-18  Dalibor Topic  <robilad at kaffe.org>

       * sources/gnu/xml/xpath/Index.java: Added missing include.
          (toString) Convert left and right hand side to strings
          explicitely.

Members: 
	ChangeLog:1.2868->1.2869 
	libraries/javalib/gnu/xml/dom/DomXPathExpression.java:1.2->1.3 
	libraries/javalib/gnu/xml/dom/DomXPathResult.java:1.1->1.2 
	libraries/javalib/gnu/xml/xpath/Expr.java:1.1->1.2 
	libraries/javalib/gnu/xml/xpath/FunctionCall.java:1.1->1.2 
	libraries/javalib/gnu/xml/xpath/Index.java:1.1->1.2 
	libraries/javalib/gnu/xml/xpath/NameTest.java:1.1->1.2 
	libraries/javalib/gnu/xml/xpath/XPathParser.java:1.1->1.2 
	libraries/javalib/gnu/xml/xpath/XPathParser.y:INITIAL->1.1 
	libraries/javalib/gnu/xml/xpath/XPathTokenizer.java:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2868 kaffe/ChangeLog:1.2869
--- kaffe/ChangeLog:1.2868	Wed Oct 20 16:47:11 2004
+++ kaffe/ChangeLog	Wed Oct 20 18:04:43 2004
@@ -1,3 +1,32 @@
+2004-10-20  Dalibor Topic  <robilad at kaffe.org>
+
+	* libraries/javalib/gnu/xml/xpath/XPathParser.y:
+	New file taken from GNU JAXP.
+
+	* libraries/javalib/gnu/xml/dom/DomXPathExpression.java,
+	libraries/javalib/gnu/xml/dom/DomXPathResult.java,
+	libraries/javalib/gnu/xml/xpath/Expr.java,
+	libraries/javalib/gnu/xml/xpath/FunctionCall.java,
+	libraries/javalib/gnu/xml/xpath/Index.java,
+	libraries/javalib/gnu/xml/xpath/NameTest.java,
+	libraries/javalib/gnu/xml/xpath/XPathParser.java,
+	libraries/javalib/gnu/xml/xpath/XPathTokenizer.java:
+	Resynced with GNU JAXP.
+
+	2004-10-18  Chris Burdess  <dog at gnu.org>
+
+        * xpath: Number parsing fixes.
+
+	2004-10-17  Chris Burdess  <dog at gnu.org>
+
+        * xpath: XPath function calls.
+
+	2004-10-18  Dalibor Topic  <robilad at kaffe.org>
+
+       * sources/gnu/xml/xpath/Index.java: Added missing include.
+          (toString) Convert left and right hand side to strings
+          explicitely.
+
 2004-10-20  Guilhem Lavaux  <guilhem at kaffe.org>
 
 	* kaffe/kaffevm/gc.h
Index: kaffe/libraries/javalib/gnu/xml/dom/DomXPathExpression.java
diff -u kaffe/libraries/javalib/gnu/xml/dom/DomXPathExpression.java:1.2 kaffe/libraries/javalib/gnu/xml/dom/DomXPathExpression.java:1.3
--- kaffe/libraries/javalib/gnu/xml/dom/DomXPathExpression.java:1.2	Mon Oct 18 20:19:46 2004
+++ kaffe/libraries/javalib/gnu/xml/dom/DomXPathExpression.java	Wed Oct 20 18:04:46 2004
@@ -86,7 +86,6 @@
         throw new XPathException (XPathException.INVALID_EXPRESSION_ERR,
                                   e.getMessage ());
       }
-    System.out.println("expression="+this.expression);
   }
 
   public Object evaluate (Node contextNode, short type, Object result)
@@ -128,6 +127,11 @@
         throw new XPathException (XPathException.TYPE_ERR, null);
       }
     return new DomXPathResult (val, type);
+  }
+
+  public String toString ()
+  {
+    return getClass ().getName () + "[expression=" + expression + "]";
   }
   
 }
Index: kaffe/libraries/javalib/gnu/xml/dom/DomXPathResult.java
diff -u kaffe/libraries/javalib/gnu/xml/dom/DomXPathResult.java:1.1 kaffe/libraries/javalib/gnu/xml/dom/DomXPathResult.java:1.2
--- kaffe/libraries/javalib/gnu/xml/dom/DomXPathResult.java:1.1	Mon Oct 18 20:19:46 2004
+++ kaffe/libraries/javalib/gnu/xml/dom/DomXPathResult.java	Wed Oct 20 18:04:46 2004
@@ -198,8 +198,29 @@
 
   public String toString ()
   {
-    return getClass ().getName () + "[type=" + type + ",value=" +
+    return getClass ().getName () + "[type=" + typeName (type) + ",value=" +
       value + ']';
+  }
+
+  private String typeName (short type)
+  {
+    switch (type)
+      {
+      case XPathResult.BOOLEAN_TYPE:
+        return "BOOLEAN_TYPE";
+      case XPathResult.NUMBER_TYPE:
+        return "NUMBER_TYPE";
+      case XPathResult.STRING_TYPE:
+        return "STRING_TYPE";
+      case XPathResult.FIRST_ORDERED_NODE_TYPE:
+        return "FIRST_ORDERED_NODE_TYPE";
+      case XPathResult.UNORDERED_NODE_ITERATOR_TYPE:
+        return "UNORDERED_NODE_ITERATOR_TYPE";
+      case XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE:
+        return "UNORDERED_NODE_SNAPSHOT_TYPE";
+      default:
+        return "(unknown)";
+      }
   }
 
 }
Index: kaffe/libraries/javalib/gnu/xml/xpath/Expr.java
diff -u kaffe/libraries/javalib/gnu/xml/xpath/Expr.java:1.1 kaffe/libraries/javalib/gnu/xml/xpath/Expr.java:1.2
--- kaffe/libraries/javalib/gnu/xml/xpath/Expr.java:1.1	Mon Oct 18 20:19:46 2004
+++ kaffe/libraries/javalib/gnu/xml/xpath/Expr.java	Wed Oct 20 18:04:46 2004
@@ -68,8 +68,9 @@
    */
   final double _last (Node context)
   {
-    int ret = context.hasChildNodes () ? 0 :
-      context.getChildNodes ().getLength ();
+    Node parent = context.getParentNode ();
+    int ret = (parent == null || !parent.hasChildNodes ()) ? 0 :
+      parent.getChildNodes ().getLength ();
     if (ret > 0)
       {
         ret++;
@@ -127,7 +128,8 @@
       }
     else
       {
-        Document doc = context.getOwnerDocument ();
+        Document doc = (context instanceof Document) ? (Document) context :
+          context.getOwnerDocument ();
         String string = _string (context, object);
         StringTokenizer st = new StringTokenizer (string, " \t\r\n");
         while (st.hasMoreTokens ())
@@ -155,7 +157,8 @@
       {
         return context.getLocalName ();
       }
-    Document doc = context.getOwnerDocument ();
+    Document doc = (context instanceof Document) ? (Document) context :
+      context.getOwnerDocument ();
     Node node = firstNode (doc, nodeSet);
     return (node == null ) ? null : node.getLocalName ();
   }
@@ -174,7 +177,8 @@
       {
         return context.getNamespaceURI ();
       }
-    Document doc = context.getOwnerDocument ();
+    Document doc = (context instanceof Document) ? (Document) context :
+      context.getOwnerDocument ();
     Node node = firstNode (doc, nodeSet);
     return (node == null ) ? null : node.getNamespaceURI ();
   }
@@ -201,7 +205,8 @@
       {
         return context.getNodeName ();
       }
-    Document doc = context.getOwnerDocument ();
+    Document doc = (context instanceof Document) ? (Document) context :
+      context.getOwnerDocument ();
     Node node = firstNode (doc, nodeSet);
     return (node == null ) ? null : node.getNodeName ();
   }
@@ -266,7 +271,8 @@
           {
             return "";
           }
-        Document doc = context.getOwnerDocument ();
+        Document doc = (context instanceof Document) ? (Document) context : 
+          context.getOwnerDocument ();
         Node node = firstNode (doc, nodeSet);
         return (node == null) ? "" : stringValue (node);
       }
Index: kaffe/libraries/javalib/gnu/xml/xpath/FunctionCall.java
diff -u kaffe/libraries/javalib/gnu/xml/xpath/FunctionCall.java:1.1 kaffe/libraries/javalib/gnu/xml/xpath/FunctionCall.java:1.2
--- kaffe/libraries/javalib/gnu/xml/xpath/FunctionCall.java:1.1	Mon Oct 18 20:19:46 2004
+++ kaffe/libraries/javalib/gnu/xml/xpath/FunctionCall.java	Wed Oct 20 18:04:46 2004
@@ -38,6 +38,7 @@
 
 package gnu.xml.xpath;
 
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 import org.w3c.dom.Node;
@@ -67,8 +68,381 @@
 
   public Object evaluate (Node context)
   {
-    // TODO
-    return null;
+    if ("last".equals (name))
+      {
+        return new Double (_last (context));
+      }
+    else if ("position".equals (name))
+      {
+        return new Double (_position (context));
+      }
+    else if ("count".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Collection)
+              {
+                Collection ns = (Collection) val;
+                return new Double (_count (context, ns));
+              }
+          }
+      }
+    else if ("id".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            return _id (context, val);
+          }
+      }
+    else if ("local-name".equals (name))
+      {
+        
+        switch (args.size ())
+          {
+          case 0:
+            return _local_name (context, null);
+          case 1:
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Collection)
+              {
+                Collection ns = (Collection) val;
+                return _local_name (context, ns);
+              }
+          }
+      }
+    else if ("namespace-uri".equals (name))
+      {
+        switch (args.size ())
+          {
+          case 0:
+            return _namespace_uri (context, null);
+          case 1:  
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Collection)
+              {
+                Collection ns = (Collection) val;
+                return _namespace_uri (context, ns);
+              }
+          }
+      }
+    else if ("name".equals (name))
+      {
+        switch (args.size ())
+          {
+          case 0:
+            return _name (context, null);
+          case 1:
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Collection)
+              {
+                Collection ns = (Collection) val;
+                return _name (context, ns);
+              }
+          }
+      }
+    else if ("string".equals (name))
+      {
+        switch (args.size ())
+          {
+          case 0:
+            return _string (context, null);
+          case 1:
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            return _string (context, val);
+          }
+      }
+    else if ("concat".equals (name))
+      {
+        int len = args.size ();
+        if (len >= 2)
+          {
+            StringBuffer buf = new StringBuffer ();
+            for (int i = 0; i < len; i++)
+              {
+                Expr arg = (Expr) args.get (i);
+                Object val = arg.evaluate (context);
+                if (val instanceof String)
+                  {
+                    buf.append ((String) val);
+                  }
+              }
+            return buf.toString ();
+          }
+      }
+    else if ("starts-with".equals (name))
+      {
+        if (args.size () == 2)
+          {
+            Expr arg1 = (Expr) args.get (0);
+            Expr arg2 = (Expr) args.get (1);
+            Object val1 = arg1.evaluate (context);
+            Object val2 = arg2.evaluate (context);
+            if (val1 instanceof String && val2 instanceof String)
+              {
+                return _starts_with (context, (String) val1, (String) val2) ?
+                  Boolean.TRUE : Boolean.FALSE;
+              }
+          }
+      }
+    else if ("contains".equals (name))
+      {
+        if (args.size () == 2)
+          {
+            Expr arg1 = (Expr) args.get (0);
+            Expr arg2 = (Expr) args.get (1);
+            Object val1 = arg1.evaluate (context);
+            Object val2 = arg2.evaluate (context);
+            if (val1 instanceof String && val2 instanceof String)
+              {
+                return _contains (context, (String) val1, (String) val2) ?
+                  Boolean.TRUE : Boolean.FALSE;
+              }
+          }
+      }
+    else if ("substring-before".equals (name))
+      {
+        if (args.size () == 2)
+          {
+            Expr arg1 = (Expr) args.get (0);
+            Expr arg2 = (Expr) args.get (1);
+            Object val1 = arg1.evaluate (context);
+            Object val2 = arg2.evaluate (context);
+            if (val1 instanceof String && val2 instanceof String)
+              {
+                return _substring_before (context, (String) val1, (String) val2);
+              }
+          }
+      }
+    else if ("substring-after".equals (name))
+      {
+        if (args.size () == 2)
+          {
+            Expr arg1 = (Expr) args.get (0);
+            Expr arg2 = (Expr) args.get (1);
+            Object val1 = arg1.evaluate (context);
+            Object val2 = arg2.evaluate (context);
+            if (val1 instanceof String && val2 instanceof String)
+              {
+                return _substring_after (context, (String) val1, (String) val2);
+              }
+          }
+      }
+    else if ("substring".equals (name))
+      {
+        int len = args.size ();
+        if (len == 2 || len == 3)
+          {
+            Expr arg1 = (Expr) args.get (0);
+            Expr arg2 = (Expr) args.get (1);
+            Object val1 = arg1.evaluate (context);
+            Object val2 = arg2.evaluate (context);
+            if (val1 instanceof String && val2 instanceof Double)
+              {
+                String s = (String) val1;
+                double p = ((Double) val2).doubleValue ();
+                double l = (double) (s.length () + 1);
+                if (len == 3)
+                  {
+                    Expr arg3 = (Expr) args.get (2);
+                    Object val3 = arg3.evaluate (context);
+                    if (val3 instanceof Double)
+                      {
+                        l = ((Double) val3).doubleValue ();
+                      }
+                  }
+                return _substring (context, s, p, l);
+              }
+          }
+      }
+    else if ("string-length".equals (name))
+      {
+        switch (args.size ())
+          {
+          case 0:
+            return new Double (_string_length (context, null));
+          case 1:
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof String)
+              {
+                return new Double (_string_length (context, (String) val));
+              }
+          }
+      }
+    else if ("normalize-space".equals (name))
+      {
+        switch (args.size ())
+          {
+          case 0:
+            return _normalize_space (context, null);
+          case 1:
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof String)
+              {
+                return _normalize_space (context, (String) val);
+              }
+          }
+      }
+    else if ("translate".equals (name))
+      {
+        if (args.size () == 3)
+          {
+            Expr arg1 = (Expr) args.get (0);
+            Expr arg2 = (Expr) args.get (1);
+            Expr arg3 = (Expr) args.get (2);
+            Object val1 = arg1.evaluate (context);
+            Object val2 = arg2.evaluate (context);
+            Object val3 = arg3.evaluate (context);
+            if (val1 instanceof String && val2 instanceof String &&
+                val3 instanceof String)
+              {
+                return _translate (context, (String) val1, (String) val2,
+                                   (String) val3);
+              }
+          }
+      }
+    else if ("boolean".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            return _boolean (context, val) ? Boolean.TRUE : Boolean.FALSE;
+          }
+      }
+    else if ("not".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Boolean)
+              {
+                return ((Boolean) val).booleanValue () ?
+                  Boolean.FALSE : Boolean.TRUE;
+              }
+          }
+      }
+    else if ("true".equals (name))
+      {
+        if (args.size () == 0)
+          {
+            return Boolean.TRUE;
+          }
+      }
+    else if ("false".equals (name))
+      {
+        if (args.size () == 0)
+          {
+            return Boolean.FALSE;
+          }
+      }
+    else if ("lang".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof String)
+              {
+                return _lang (context, (String) val) ? Boolean.TRUE :
+                  Boolean.FALSE;
+              }
+          }
+      }
+    else if ("number".equals (name))
+      {
+        switch (args.size ())
+          {
+          case 0:
+            return new Double (_number (context, null));
+          case 1:
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            return new Double (_number (context, val));
+          }
+      }
+    else if ("sum".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Collection)
+              {
+                Collection ns = (Collection) val;
+                return new Double (_sum (context, ns));
+              }
+          }
+      }
+    else if ("floor".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Double)
+              {
+                double n = ((Double) val).doubleValue ();
+                return new Double (_floor (context, n));
+              }
+          }
+      }
+    else if ("ceiling".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Double)
+              {
+                double n = ((Double) val).doubleValue ();
+                return new Double (_ceiling (context, n));
+              }
+          }
+      }
+    else if ("round".equals (name))
+      {
+        if (args.size () == 1)
+          {
+            Expr arg = (Expr) args.get (0);
+            Object val = arg.evaluate (context);
+            if (val instanceof Double)
+              {
+                double n = ((Double) val).doubleValue ();
+                return new Double (_round (context, n));
+              }
+          }
+      }
+    throw new IllegalArgumentException ("Invalid function call: " +
+                                        toString ());
+  }
+
+  public String toString ()
+  {
+    StringBuffer buf = new StringBuffer ();
+    buf.append (name);
+    buf.append ('(');
+    int len = args.size ();
+    for (int i = 0; i < len; i++)
+      {
+        if (i > 0)
+          {
+            buf.append (',');
+          }
+        buf.append (args.get (i));
+      }
+    buf.append (')');
+    return buf.toString ();
   }
   
 }
Index: kaffe/libraries/javalib/gnu/xml/xpath/Index.java
diff -u kaffe/libraries/javalib/gnu/xml/xpath/Index.java:1.1 kaffe/libraries/javalib/gnu/xml/xpath/Index.java:1.2
--- kaffe/libraries/javalib/gnu/xml/xpath/Index.java:1.1	Mon Oct 18 20:19:46 2004
+++ kaffe/libraries/javalib/gnu/xml/xpath/Index.java	Wed Oct 20 18:04:46 2004
@@ -82,7 +82,7 @@
 
   public String toString ()
   {
-    return lhs.toString() + '[' + rhs.toString() + ']';
+    return lhs.toString () + "[" + rhs.toString () + "]";
   }
   
 }
Index: kaffe/libraries/javalib/gnu/xml/xpath/NameTest.java
diff -u kaffe/libraries/javalib/gnu/xml/xpath/NameTest.java:1.1 kaffe/libraries/javalib/gnu/xml/xpath/NameTest.java:1.2
--- kaffe/libraries/javalib/gnu/xml/xpath/NameTest.java:1.1	Mon Oct 18 20:19:46 2004
+++ kaffe/libraries/javalib/gnu/xml/xpath/NameTest.java	Wed Oct 20 18:04:46 2004
@@ -62,6 +62,15 @@
 
   boolean matches (Node node)
   {
+    switch (node.getNodeType ())
+      {
+      case Node.DOCUMENT_TYPE_NODE:
+      case Node.ENTITY_NODE:
+      case Node.ENTITY_REFERENCE_NODE:
+      case Node.NOTATION_NODE:
+        // XPath doesn't recognise these
+        return false;
+      }
     if (any)
       {
         return true;
Index: kaffe/libraries/javalib/gnu/xml/xpath/XPathParser.java
diff -u kaffe/libraries/javalib/gnu/xml/xpath/XPathParser.java:1.1 kaffe/libraries/javalib/gnu/xml/xpath/XPathParser.java:1.2
--- kaffe/libraries/javalib/gnu/xml/xpath/XPathParser.java:1.1	Mon Oct 18 20:19:46 2004
+++ kaffe/libraries/javalib/gnu/xml/xpath/XPathParser.java	Wed Oct 20 18:04:46 2004
@@ -496,55 +496,55 @@
     }
   break;
 case 31:
-					// line 279 "XPathParser.y"
+					// line 280 "XPathParser.y"
   {
-      yyVal = new NodeTypeTest (((Short) yyVals[-2+yyTop]).shortValue ());
+      yyVal = new NodeTypeTest (Node.PROCESSING_INSTRUCTION_NODE, (String) yyVals[-1+yyTop]);
     }
   break;
 case 32:
-					// line 283 "XPathParser.y"
+					// line 285 "XPathParser.y"
   {
-      yyVal = new NodeTypeTest (Node.PROCESSING_INSTRUCTION_NODE, (String) yyVals[-1+yyTop]);
+      yyVal = new NodeTypeTest (((Short) yyVals[-1+yyTop]).shortValue ());
     }
   break;
 case 33:
-					// line 290 "XPathParser.y"
+					// line 292 "XPathParser.y"
   {
       yyVal = new ExpressionTest ((Expr) yyVals[-1+yyTop]);
     }
   break;
 case 35:
-					// line 298 "XPathParser.y"
+					// line 300 "XPathParser.y"
   {
       yyVal = new ParenthesizedExpr ((Expr) yyVals[-1+yyTop]);
     }
   break;
 case 36:
-					// line 302 "XPathParser.y"
+					// line 304 "XPathParser.y"
   {
       yyVal = new Constant (yyVals[0+yyTop]);
     }
   break;
 case 37:
-					// line 306 "XPathParser.y"
+					// line 308 "XPathParser.y"
   {
       yyVal = new Constant (yyVals[0+yyTop]);
     }
   break;
 case 39:
-					// line 314 "XPathParser.y"
+					// line 316 "XPathParser.y"
   {
       yyVal = new FunctionCall ((String) yyVals[-2+yyTop]);
     }
   break;
 case 40:
-					// line 318 "XPathParser.y"
+					// line 320 "XPathParser.y"
   {
       yyVal = new FunctionCall ((String) yyVals[-3+yyTop], (List) yyVals[-1+yyTop]);
     }
   break;
 case 41:
-					// line 325 "XPathParser.y"
+					// line 327 "XPathParser.y"
   {
       List list = new ArrayList ();
       list.add (yyVals[0+yyTop]);
@@ -552,7 +552,7 @@
     }
   break;
 case 42:
-					// line 331 "XPathParser.y"
+					// line 333 "XPathParser.y"
   {
       List list = (List) yyVals[0+yyTop];
       list.add (0, yyVals[-2+yyTop]);
@@ -560,19 +560,19 @@
     }
   break;
 case 44:
-					// line 341 "XPathParser.y"
+					// line 343 "XPathParser.y"
   {
       yyVal = new UnionExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop]);
     }
   break;
 case 47:
-					// line 350 "XPathParser.y"
+					// line 352 "XPathParser.y"
   {
       yyVal = new Step ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop]);
     }
   break;
 case 48:
-					// line 354 "XPathParser.y"
+					// line 356 "XPathParser.y"
   {
       Test nt = new NodeTypeTest ((short) 0);
       Selector s = new Selector (Selector.DESCENDANT_OR_SELF,
@@ -582,7 +582,7 @@
     }
   break;
 case 50:
-					// line 366 "XPathParser.y"
+					// line 368 "XPathParser.y"
   {
       Test test = (Test) yyVals[0+yyTop];
       Selector s = new Selector (Selector.SELF,
@@ -591,164 +591,164 @@
     }
   break;
 case 52:
-					// line 377 "XPathParser.y"
+					// line 379 "XPathParser.y"
   {
       yyVal = new OrExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop]);
     }
   break;
 case 54:
-					// line 385 "XPathParser.y"
+					// line 387 "XPathParser.y"
   {
       yyVal = new AndExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop]);
     }
   break;
 case 56:
-					// line 393 "XPathParser.y"
+					// line 395 "XPathParser.y"
   {
       yyVal = new EqualityExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], false);
     }
   break;
 case 57:
-					// line 397 "XPathParser.y"
+					// line 399 "XPathParser.y"
   {
       yyVal = new EqualityExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], true);
     }
   break;
 case 59:
-					// line 405 "XPathParser.y"
+					// line 407 "XPathParser.y"
   {
       yyVal = new RelationalExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], true, false);
     }
   break;
 case 60:
-					// line 409 "XPathParser.y"
+					// line 411 "XPathParser.y"
   {
       yyVal = new RelationalExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], false, false);
     }
   break;
 case 61:
-					// line 413 "XPathParser.y"
+					// line 415 "XPathParser.y"
   {
       yyVal = new RelationalExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], true, true);
     }
   break;
 case 62:
-					// line 417 "XPathParser.y"
+					// line 419 "XPathParser.y"
   {
       yyVal = new RelationalExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], false, true);
     }
   break;
 case 64:
-					// line 425 "XPathParser.y"
+					// line 427 "XPathParser.y"
   {
       yyVal = new ArithmeticExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.ADD);
     }
   break;
 case 65:
-					// line 429 "XPathParser.y"
+					// line 431 "XPathParser.y"
   {
       yyVal = new ArithmeticExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.SUBTRACT);
     }
   break;
 case 67:
-					// line 437 "XPathParser.y"
+					// line 439 "XPathParser.y"
   {
       yyVal = new ArithmeticExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.MULTIPLY);
     }
   break;
 case 68:
-					// line 441 "XPathParser.y"
+					// line 443 "XPathParser.y"
   {
       yyVal = new ArithmeticExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.DIVIDE);
     }
   break;
 case 69:
-					// line 445 "XPathParser.y"
+					// line 447 "XPathParser.y"
   {
       yyVal = new ArithmeticExpr ((Expr) yyVals[-2+yyTop], (Expr) yyVals[0+yyTop], ArithmeticExpr.MODULO);
     }
   break;
 case 71:
-					// line 453 "XPathParser.y"
+					// line 455 "XPathParser.y"
   {
       yyVal = new NegativeExpr ((Expr) yyVals[0+yyTop]);
     }
   break;
 case 72:
-					// line 480 "XPathParser.y"
+					// line 462 "XPathParser.y"
   {
-      yyVal = new Integer ((String) yyVals[0+yyTop]);
+      yyVal = new Double ((String) yyVals[0+yyTop] + ".0");
     }
   break;
 case 73:
-					// line 484 "XPathParser.y"
+					// line 466 "XPathParser.y"
   {
-      yyVal = new Double ((String) yyVals[-1+yyTop]);
+      yyVal = new Double ((String) yyVals[-1+yyTop] + ".0");
     }
   break;
 case 74:
-					// line 488 "XPathParser.y"
+					// line 470 "XPathParser.y"
   {
-      yyVal = new Double ((String) yyVals[-2+yyTop] + '.' + (String) yyVals[0+yyTop]);
+      yyVal = new Double ((String) yyVals[-2+yyTop] + "." + (String) yyVals[0+yyTop]);
     }
   break;
 case 75:
-					// line 492 "XPathParser.y"
+					// line 474 "XPathParser.y"
   {
-      yyVal = new Double ('0' + '.' + (String) yyVals[0+yyTop]);
+      yyVal = new Double ("0." + (String) yyVals[0+yyTop]);
     }
   break;
 case 77:
-					// line 540 "XPathParser.y"
+					// line 503 "XPathParser.y"
   {
       Object value = bindings.get ((String) yyVals[0+yyTop]);
       yyVal = new Constant (value);
     }
   break;
 case 78:
-					// line 548 "XPathParser.y"
+					// line 511 "XPathParser.y"
   {
       yyVal = new NameTest (null, true, true);
     }
   break;
 case 79:
-					// line 552 "XPathParser.y"
+					// line 515 "XPathParser.y"
   {
       yyVal = new NameTest ((String) yyVals[-2+yyTop], true, false);
     }
   break;
 case 80:
-					// line 556 "XPathParser.y"
+					// line 519 "XPathParser.y"
   {
       yyVal = new NameTest ((String) yyVals[0+yyTop], false, false);
     }
   break;
 case 82:
-					// line 564 "XPathParser.y"
+					// line 527 "XPathParser.y"
   {
       yyVal = (String) yyVals[-2+yyTop] + ':' + (String) yyVals[0+yyTop];
     }
   break;
 case 83:
-					// line 571 "XPathParser.y"
+					// line 534 "XPathParser.y"
   {
       yyVal = new Short (Node.COMMENT_NODE);
     }
   break;
 case 84:
-					// line 575 "XPathParser.y"
+					// line 538 "XPathParser.y"
   {
       yyVal = new Short (Node.TEXT_NODE);
     }
   break;
 case 85:
-					// line 579 "XPathParser.y"
+					// line 542 "XPathParser.y"
   {
       yyVal = new Short (Node.PROCESSING_INSTRUCTION_NODE);
     }
   break;
 case 86:
-					// line 583 "XPathParser.y"
+					// line 546 "XPathParser.y"
   {
       yyVal = new Short ((short) 0);
     }
@@ -804,7 +804,7 @@
           1,    1,    1,    1,    2,    2,    1,    3,    3,    1,
           2,    3,    1,    1,    1,    2,    1,    1,    1,    1,
           1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-          3,    4,    3,    1,    3,    1,    1,    1,    3,    4,
+          3,    2,    3,    1,    3,    1,    1,    1,    3,    4,
           1,    3,    1,    3,    1,    1,    3,    3,    1,    2,
           1,    3,    1,    3,    1,    3,    3,    1,    3,    3,
           3,    3,    1,    3,    3,    1,    3,    3,    3,    1,
@@ -823,20 +823,20 @@
          49,   34,   37,   38,    0,    0,   43,    0,    0,    0,
           0,    0,    0,   66,    0,    0,    0,    0,   13,    0,
          80,    0,   71,    0,    0,   77,   75,    0,    0,    0,
-          0,    0,   16,    0,    0,    0,    0,    0,    0,   50,
+          0,    0,   16,    0,   32,    0,    0,    0,    0,   50,
           0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-          0,    0,   74,   82,   79,   35,    0,    0,    0,    8,
-          9,    0,    0,   31,   39,    0,    0,   44,    0,    0,
-          0,    0,    0,    0,    0,    0,    0,    0,    0,   67,
-         68,   69,   32,   33,    0,   40,   42,
+          0,    0,   74,   82,   79,   35,    0,   31,    0,    8,
+          9,    0,    0,   39,    0,    0,   44,    0,    0,    0,
+          0,    0,    0,    0,    0,    0,    0,    0,   67,   68,
+         69,   33,    0,   40,   42,
     };
   } /* End of class YyDefRedClass */
 
   protected static final class YyDgotoClass {
 
-    public static final short yyDgoto [] = {           106,
+    public static final short yyDgoto [] = {           105,
          31,   32,   33,   34,   35,   36,   37,   38,   73,   39,
-         40,   41,   42,   43,   44,   45,  107,   46,   47,   48,
+         40,   41,   42,   43,   44,   45,  106,   46,   47,   48,
          49,   50,   51,   52,   53,   54,   55,
     };
   } /* End of class YyDgotoClass */
@@ -846,17 +846,17 @@
     public static final short yySindex [] = {          -97,
           0, -271, -267,  -97, -239, -239,  -97, -199,    0, -236,
        -222,    0,    0,    0,    0,    0,    0,    0,    0,    0,
-          0,    0,    0,    0,    0,    0, -221,    0,    0,    0,
-       -257,    0, -241,    0,    0, -205, -213,    0,    0, -201,
+          0,    0,    0,    0,    0,    0, -218,    0,    0,    0,
+       -257,    0, -241,    0,    0, -205, -221,    0,    0, -194,
           0,    0,    0,    0, -190, -185,    0, -238, -211, -234,
        -255, -209, -275,    0,    0, -169, -250, -168,    0, -241,
-          0, -241,    0, -205, -187,    0,    0, -163,  -97, -239,
-       -239,  -97,    0, -199, -166, -151,  -43, -239, -239,    0,
+          0, -241,    0, -205, -187,    0,    0, -167,  -97, -239,
+       -239,  -97,    0, -199,    0, -151,  -43, -239, -239,    0,
         -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,  -97,

*** Patch too long, truncated ***




More information about the kaffe mailing list