You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by tm...@apache.org on 2001/11/09 16:14:21 UTC
cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Parser.java xpath.cup xpath.lex Constants.java CastExpr.java
tmiller 01/11/09 07:14:21
Modified: java/src/org/apache/xalan/xsltc/compiler Parser.java
xpath.cup xpath.lex Constants.java CastExpr.java
Log:
bug fix 3592, handles long now
Revision Changes Path
1.35 +4 -2 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java
Index: Parser.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- Parser.java 2001/11/08 15:08:06 1.34
+++ Parser.java 2001/11/09 15:14:21 1.35
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Parser.java,v 1.34 2001/11/08 15:08:06 morten Exp $
+ * @(#)$Id: Parser.java,v 1.35 2001/11/09 15:14:21 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -645,6 +645,7 @@
MethodType R_D = new MethodType(Type.Real, Type.NodeSet);
MethodType R_O = new MethodType(Type.Real, Type.Reference);
MethodType I_I = new MethodType(Type.Int, Type.Int);
+ MethodType J_J = new MethodType(Type.Lng, Type.Lng); //GTM,bug 3592
MethodType D_O = new MethodType(Type.NodeSet, Type.Reference);
MethodType D_V = new MethodType(Type.NodeSet, Type.Void);
MethodType D_S = new MethodType(Type.NodeSet, Type.String);
@@ -780,7 +781,8 @@
// Unary minus.
_symbolTable.addPrimop("u-", R_R);
- _symbolTable.addPrimop("u-", I_I);
+ _symbolTable.addPrimop("u-", I_I);
+ _symbolTable.addPrimop("u-", J_J); // GTM,bug 3592
}
public SymbolTable getSymbolTable() {
1.29 +11 -10 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup
Index: xpath.cup
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.cup,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- xpath.cup 2001/11/09 13:40:05 1.28
+++ xpath.cup 2001/11/09 15:14:21 1.29
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: xpath.cup,v 1.28 2001/11/09 13:40:05 morten Exp $
+ * @(#)$Id: xpath.cup,v 1.29 2001/11/09 15:14:21 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -226,7 +226,7 @@
terminal SELF, PARENT, CHILD, ATTRIBUTE, ANCESTOR, ANCESTORORSELF, DESCENDANT;
terminal DESCENDANTORSELF, FOLLOWING, FOLLOWINGSIBLING, NAMESPACE, PRECEDING;
terminal Double REAL;
-terminal Integer INT;
+terminal Long INT;
terminal PATTERN, EXPRESSION;
non terminal SyntaxTreeNode TopLevel;
@@ -729,14 +729,15 @@
| INT:num
{:
- if (num.doubleValue() == -0)
- RESULT = new RealExpr(num.doubleValue());
- else if (num.intValue() == 0)
- RESULT = new IntExpr(num.intValue());
- else if (num.doubleValue() == 0.0)
- RESULT = new RealExpr(num.doubleValue());
- else
- RESULT = new IntExpr(num.intValue());
+ // bug fix 3592, num comes in as a Long rather than an Integer
+ // see xpath.lex, {Digit}+ rule.
+ long value = num.longValue();
+ if ( (value > Integer.MIN_VALUE) && (value < Integer.MAX_VALUE)) {
+ RESULT = new IntExpr(num.intValue());
+ }
+ else {
+ RESULT = new LongExpr(num.longValue());
+ }
:}
| REAL:num
1.4 +2 -2 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.lex
Index: xpath.lex
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/xpath.lex,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- xpath.lex 2001/11/09 13:40:05 1.3
+++ xpath.lex 2001/11/09 15:14:21 1.4
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: xpath.lex,v 1.3 2001/11/09 13:40:05 morten Exp $
+ * @(#)$Id: xpath.lex,v 1.4 2001/11/09 15:14:21 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -140,7 +140,7 @@
yytext().substring(1, yytext().length() - 1)); }
\'[^\']*\' { return new Symbol(sym.Literal,
yytext().substring(1, yytext().length() - 1)); }
-{Digit}+ { return new Symbol(sym.INT, new Integer(yytext())); }
+{Digit}+ { return new Symbol(sym.INT, new Long(yytext())); }
{Digit}+("."{Digit}*)? { return new Symbol(sym.REAL, new Double(yytext())); }
"."{Digit}+ { return new Symbol(sym.REAL, new Double(yytext())); }
"." { return new Symbol(sym.DOT); }
1.16 +7 -1 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Constants.java
Index: Constants.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Constants.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- Constants.java 2001/11/08 10:23:39 1.15
+++ Constants.java 2001/11/09 15:14:21 1.16
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: Constants.java,v 1.15 2001/11/08 10:23:39 morten Exp $
+ * @(#)$Id: Constants.java,v 1.16 2001/11/09 15:14:21 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -286,6 +286,8 @@
= "java.lang.Double";
public static final String INTEGER_CLASS
= "java.lang.Integer";
+ public static final String LONG_CLASS
+ = "java.lang.Long";
public static final String RUNTIME_NODE_CLASS
= "org.apache.xalan.xsltc.runtime.Node";
public static final String MATH_CLASS
@@ -299,6 +301,10 @@
= "intValue";
public static final String INT_VALUE_SIG
= "()I";
+ public static final String LONG_VALUE
+ = "longValue";
+ public static final String LONG_VALUE_SIG
+ = "()J";
public static final String DOUBLE_VALUE
= "doubleValue";
public static final String DOUBLE_VALUE_SIG
1.8 +10 -1 xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CastExpr.java
Index: CastExpr.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/CastExpr.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- CastExpr.java 2001/11/06 13:42:04 1.7
+++ CastExpr.java 2001/11/09 15:14:21 1.8
@@ -1,5 +1,5 @@
/*
- * @(#)$Id: CastExpr.java,v 1.7 2001/11/06 13:42:04 morten Exp $
+ * @(#)$Id: CastExpr.java,v 1.8 2001/11/09 15:14:21 tmiller Exp $
*
* The Apache Software License, Version 1.1
*
@@ -88,15 +88,24 @@
InternalTypeMap.put(Type.Real, Type.Real);
InternalTypeMap.put(Type.Real, Type.Int);
+ InternalTypeMap.put(Type.Real, Type.Lng);
InternalTypeMap.put(Type.Real, Type.Boolean);
InternalTypeMap.put(Type.Real, Type.String);
InternalTypeMap.put(Type.Real, Type.Reference);
InternalTypeMap.put(Type.Int, Type.Int);
InternalTypeMap.put(Type.Int, Type.Real);
+ InternalTypeMap.put(Type.Int, Type.Lng);
InternalTypeMap.put(Type.Int, Type.Boolean);
InternalTypeMap.put(Type.Int, Type.String);
InternalTypeMap.put(Type.Int, Type.Reference);
+
+ // GTM, bug 3592 fix.
+ InternalTypeMap.put(Type.Lng, Type.Int);
+ InternalTypeMap.put(Type.Lng, Type.Real);
+ InternalTypeMap.put(Type.Lng, Type.Boolean);
+ InternalTypeMap.put(Type.Lng, Type.String);
+ InternalTypeMap.put(Type.Lng, Type.Reference);
InternalTypeMap.put(Type.String, Type.String);
InternalTypeMap.put(Type.String, Type.Boolean);
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org