curcuru 2003/02/21 09:21:49
Modified: java/xpath_rwapi/src/org/apache/xpath/rwapi/impl Tag: xslt20
LiteralImpl.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser Tag:
xslt20 XPath.java XPathTreeConstants.java
XPathVisitor.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/expression Tag:
xslt20 Literal.java
Log:
Update to use BigInteger/BigDecimal
Submitted by: [EMAIL PROTECTED]
Revision Changes Path
No revision
No revision
1.1.2.6 +9 -6
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/LiteralImpl.java
Index: LiteralImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/LiteralImpl.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- LiteralImpl.java 19 Feb 2003 14:24:01 -0000 1.1.2.5
+++ LiteralImpl.java 21 Feb 2003 17:21:48 -0000 1.1.2.6
@@ -55,6 +55,9 @@
*/
package org.apache.xpath.rwapi.impl;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
import org.apache.xpath.rwapi.XPathException;
import org.apache.xpath.rwapi.expression.Expr;
import org.apache.xpath.rwapi.expression.Literal;
@@ -118,11 +121,11 @@
/**
* @see org.apache.xpath.rwapi.expression.Literal#getDecimalLiteral()
*/
- public float getDecimalLiteral() throws XPathException
+ public BigDecimal getDecimalLiteral() throws XPathException
{
if (getLiteralType() == DECIMAL_LITERAL)
{
- return ((Float) m_literal).floatValue();
+ return (BigDecimal) m_literal;
}
throw new XPathException(
@@ -146,11 +149,11 @@
/**
* @see org.apache.xpath.rwapi.expression.Literal#getIntegerLiteral()
*/
- public int getIntegerLiteral() throws XPathException
+ public BigInteger getIntegerLiteral() throws XPathException
{
if (getLiteralType() == INTEGER_LITERAL)
{
- return ((Integer) m_literal).intValue();
+ return (BigInteger) m_literal;
}
throw new XPathException(
@@ -224,7 +227,7 @@
switch (id)
{
case XPathTreeConstants.JJTINTEGERLITERAL:
- m_literal = new Integer(token.image);
+ m_literal = new BigInteger(token.image);
break;
@@ -238,7 +241,7 @@
break;
case XPathTreeConstants.JJTDECIMALLITERAL:
- m_literal = new Float(token.image);
+ m_literal = new BigDecimal(token.image);
break;
No revision
No revision
1.1.2.5 +29 -53
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPath.java
Index: XPath.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPath.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- XPath.java 12 Feb 2003 16:14:55 -0000 1.1.2.4
+++ XPath.java 21 Feb 2003 17:21:48 -0000 1.1.2.5
@@ -2118,97 +2118,73 @@
}
final public void SimpleForClause() throws ParseException {
- /[EMAIL PROTECTED](jjtree) SimpleForClause */
- SimpleNode jjtn000 = (SimpleNode)SimpleNode.jjtCreate(this,
JJTSIMPLEFORCLAUSE);
- boolean jjtc000 = true;
- jjtree.openNodeScope(jjtn000);
- try {
- jj_consume_token(ForVariable);
- jj_consume_token(VarName);
+ jj_consume_token(ForVariable);
+ jj_consume_token(VarName);
SimpleNode jjtn001 =
(SimpleNode)SimpleNode.jjtCreate(this, JJTVARNAME);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
- try {
+ try {
jjtree.closeNodeScope(jjtn001, true);
jjtc001 = false;
jjtn001.processToken(token);
- } finally {
+ } finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, true);
}
- }
- jj_consume_token(In);
+ }
+ jj_consume_token(In);
SimpleNode jjtn002 = (SimpleNode)SimpleNode.jjtCreate(this, JJTIN);
boolean jjtc002 = true;
jjtree.openNodeScope(jjtn002);
- try {
+ try {
jjtree.closeNodeScope(jjtn002, true);
jjtc002 = false;
jjtn002.processToken(token);
- } finally {
+ } finally {
if (jjtc002) {
jjtree.closeNodeScope(jjtn002, true);
}
+ }
+ Expr();
+ label_15:
+ while (true) {
+ switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
+ case Comma:
+ ;
+ break;
+ default:
+ jj_la1[42] = jj_gen;
+ break label_15;
}
- Expr();
- label_15:
- while (true) {
- switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
- case Comma:
- ;
- break;
- default:
- jj_la1[42] = jj_gen;
- break label_15;
- }
- jj_consume_token(Comma);
- jj_consume_token(VariableIndicator);
- jj_consume_token(VarName);
+ jj_consume_token(Comma);
+ jj_consume_token(VariableIndicator);
+ jj_consume_token(VarName);
SimpleNode jjtn003 = (SimpleNode)SimpleNode.jjtCreate(this, JJTVARNAME);
boolean jjtc003 = true;
jjtree.openNodeScope(jjtn003);
- try {
+ try {
jjtree.closeNodeScope(jjtn003, true);
jjtc003 = false;
jjtn003.processToken(token);
- } finally {
+ } finally {
if (jjtc003) {
jjtree.closeNodeScope(jjtn003, true);
}
- }
- jj_consume_token(In);
+ }
+ jj_consume_token(In);
SimpleNode jjtn004 =
(SimpleNode)SimpleNode.jjtCreate(this, JJTIN);
boolean jjtc004 =
true;
jjtree.openNodeScope(jjtn004);
- try {
+ try {
jjtree.closeNodeScope(jjtn004, true);
jjtc004 = false;
jjtn004.processToken(token);
- } finally {
+ } finally {
if (jjtc004) {
jjtree.closeNodeScope(jjtn004, true);
}
- }
- Expr();
}
- } catch (Throwable jjte000) {
- if (jjtc000) {
- jjtree.clearNodeScope(jjtn000);
- jjtc000 = false;
- } else {
- jjtree.popNode();
- }
- if (jjte000 instanceof RuntimeException) {
- {if (true) throw (RuntimeException)jjte000;}
- }
- if (jjte000 instanceof ParseException) {
- {if (true) throw (ParseException)jjte000;}
- }
- {if (true) throw (Error)jjte000;}
- } finally {
- if (jjtc000) {
- jjtree.closeNodeScope(jjtn000, true);
- }
+ Expr();
}
}
1.1.2.5 +65 -67
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathTreeConstants.java
Index: XPathTreeConstants.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathTreeConstants.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- XPathTreeConstants.java 19 Feb 2003 14:24:02 -0000 1.1.2.4
+++ XPathTreeConstants.java 21 Feb 2003 17:21:49 -0000 1.1.2.5
@@ -1,4 +1,4 @@
-/* Generated By:JJTree: Do not edit this line.
E:/ast/xslt20/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser\XPathTreeConstants.java
*/
+/* Generated By:JJTree: Do not edit this line.
E:/ast/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser\XPathTreeConstants.java
*/
package org.apache.xpath.rwapi.impl.parser;
@@ -50,71 +50,70 @@
public int JJTINTERSECTEXCEPTEXPR = 43;
public int JJTPATHEXPR = 44;
public int JJTSTEPEXPR = 45;
- public int JJTSIMPLEFORCLAUSE = 46;
- public int JJTVALIDATEEXPR = 47;
- public int JJTVALIDATELBRACE = 48;
- public int JJTVALIDATECONTEXT = 49;
- public int JJTSLASH = 50;
- public int JJTLBRACEEXPRENCLOSURE = 51;
- public int JJTRBRACE = 52;
- public int JJTCASTEXPR = 53;
- public int JJTCASTAS = 54;
- public int JJTTREATEXPR = 55;
- public int JJTTREATAS = 56;
- public int JJTAXISDESCENDANT = 57;
- public int JJTAXISSELF = 58;
- public int JJTAXISDESCENDANTORSELF = 59;
- public int JJTAXISFOLLOWINGSIBLING = 60;
- public int JJTAXISFOLLOWING = 61;
- public int JJTAXISNAMESPACE = 62;
- public int JJTAXISPARENT = 63;
- public int JJTAXISANCESTOR = 64;
- public int JJTAXISPRECEDINGSIBLING = 65;
- public int JJTAXISPRECEDING = 66;
- public int JJTAXISANCESTORORSELF = 67;
- public int JJTNODETEST = 68;
- public int JJTNAMETEST = 69;
- public int JJTQNAME = 70;
- public int JJTSTAR = 71;
- public int JJTNCNAMECOLONSTAR = 72;
- public int JJTSTARCOLONNCNAME = 73;
- public int JJTPROCESSINGINSTRUCTIONTEST = 74;
- public int JJTCOMMENTTEST = 75;
- public int JJTTEXTTEST = 76;
- public int JJTANYKINDTEST = 77;
- public int JJTDOT = 78;
- public int JJTDOTDOT = 79;
- public int JJTPREDICATES = 80;
- public int JJTINTEGERLITERAL = 81;
- public int JJTDECIMALLITERAL = 82;
- public int JJTDOUBLELITERAL = 83;
- public int JJTFUNCTIONCALL = 84;
- public int JJTSCHEMACONTEXT = 85;
- public int JJTINCONTEXT = 86;
- public int JJTSCHEMAGLOBALCONTEXT = 87;
- public int JJTTYPEQNAME = 88;
- public int JJTSCHEMACONTEXTSTEP = 89;
- public int JJTSINGLETYPE = 90;
- public int JJTQMARK = 91;
- public int JJTSEQUENCETYPE = 92;
- public int JJTEMPTY = 93;
- public int JJTITEMTYPE = 94;
- public int JJTELEMENTTYPE = 95;
- public int JJTATTRIBUTETYPE = 96;
- public int JJTNODE = 97;
- public int JJTPROCESSINGINSTRUCTION = 98;
- public int JJTCOMMENT = 99;
- public int JJTTEXT = 100;
- public int JJTDOCUMENT = 101;
- public int JJTITEM = 102;
- public int JJTUNTYPED = 103;
- public int JJTATOMICVALUE = 104;
- public int JJTELEMORATTRTYPE = 105;
- public int JJTSCHEMATYPE = 106;
- public int JJTOFTYPE = 107;
- public int JJTATOMICTYPE = 108;
- public int JJTOCCURRENCEINDICATOR = 109;
- public int JJTMULTIPLY = 110;
+ public int JJTVALIDATEEXPR = 46;
+ public int JJTVALIDATELBRACE = 47;
+ public int JJTVALIDATECONTEXT = 48;
+ public int JJTSLASH = 49;
+ public int JJTLBRACEEXPRENCLOSURE = 50;
+ public int JJTRBRACE = 51;
+ public int JJTCASTEXPR = 52;
+ public int JJTCASTAS = 53;
+ public int JJTTREATEXPR = 54;
+ public int JJTTREATAS = 55;
+ public int JJTAXISDESCENDANT = 56;
+ public int JJTAXISSELF = 57;
+ public int JJTAXISDESCENDANTORSELF = 58;
+ public int JJTAXISFOLLOWINGSIBLING = 59;
+ public int JJTAXISFOLLOWING = 60;
+ public int JJTAXISNAMESPACE = 61;
+ public int JJTAXISPARENT = 62;
+ public int JJTAXISANCESTOR = 63;
+ public int JJTAXISPRECEDINGSIBLING = 64;
+ public int JJTAXISPRECEDING = 65;
+ public int JJTAXISANCESTORORSELF = 66;
+ public int JJTNODETEST = 67;
+ public int JJTNAMETEST = 68;
+ public int JJTQNAME = 69;
+ public int JJTSTAR = 70;
+ public int JJTNCNAMECOLONSTAR = 71;
+ public int JJTSTARCOLONNCNAME = 72;
+ public int JJTPROCESSINGINSTRUCTIONTEST = 73;
+ public int JJTCOMMENTTEST = 74;
+ public int JJTTEXTTEST = 75;
+ public int JJTANYKINDTEST = 76;
+ public int JJTDOT = 77;
+ public int JJTDOTDOT = 78;
+ public int JJTPREDICATES = 79;
+ public int JJTINTEGERLITERAL = 80;
+ public int JJTDECIMALLITERAL = 81;
+ public int JJTDOUBLELITERAL = 82;
+ public int JJTFUNCTIONCALL = 83;
+ public int JJTSCHEMACONTEXT = 84;
+ public int JJTINCONTEXT = 85;
+ public int JJTSCHEMAGLOBALCONTEXT = 86;
+ public int JJTTYPEQNAME = 87;
+ public int JJTSCHEMACONTEXTSTEP = 88;
+ public int JJTSINGLETYPE = 89;
+ public int JJTQMARK = 90;
+ public int JJTSEQUENCETYPE = 91;
+ public int JJTEMPTY = 92;
+ public int JJTITEMTYPE = 93;
+ public int JJTELEMENTTYPE = 94;
+ public int JJTATTRIBUTETYPE = 95;
+ public int JJTNODE = 96;
+ public int JJTPROCESSINGINSTRUCTION = 97;
+ public int JJTCOMMENT = 98;
+ public int JJTTEXT = 99;
+ public int JJTDOCUMENT = 100;
+ public int JJTITEM = 101;
+ public int JJTUNTYPED = 102;
+ public int JJTATOMICVALUE = 103;
+ public int JJTELEMORATTRTYPE = 104;
+ public int JJTSCHEMATYPE = 105;
+ public int JJTOFTYPE = 106;
+ public int JJTATOMICTYPE = 107;
+ public int JJTOCCURRENCEINDICATOR = 108;
+ public int JJTMULTIPLY = 109;
public String[] jjtNodeName = {
@@ -164,7 +163,6 @@
"IntersectExceptExpr",
"PathExpr",
"StepExpr",
- "SimpleForClause",
"ValidateExpr",
"ValidateLbrace",
"ValidateContext",
1.1.2.5 +1 -1
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathVisitor.java
Index: XPathVisitor.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathVisitor.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- XPathVisitor.java 19 Feb 2003 14:24:02 -0000 1.1.2.4
+++ XPathVisitor.java 21 Feb 2003 17:21:49 -0000 1.1.2.5
@@ -1,4 +1,4 @@
-/* Generated By:JJTree: Do not edit this line.
E:/ast/xslt20/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser\XPathVisitor.java
*/
+/* Generated By:JJTree: Do not edit this line.
E:/ast/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser\XPathVisitor.java */
package org.apache.xpath.rwapi.impl.parser;
No revision
No revision
1.1.2.4 +126 -123
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Literal.java
Index: Literal.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Literal.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Literal.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
+++ Literal.java 21 Feb 2003 17:21:49 -0000 1.1.2.4
@@ -1,123 +1,126 @@
-/*
- * The Apache Software License, Version 1.1
- *
- * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
- * reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. The end-user documentation included with the redistribution,
- * if any, must include the following acknowledgment:
- * "This product includes software developed by the
- * Apache Software Foundation (http://www.apache.org/)."
- * Alternately, this acknowledgment may appear in the software itself,
- * if and wherever such third-party acknowledgments normally appear.
- *
- * 4. The names "Xalan" and "Apache Software Foundation" must
- * not be used to endorse or promote products derived from this
- * software without prior written permission. For written
- * permission, please contact [EMAIL PROTECTED]
- *
- * 5. Products derived from this software may not be called "Apache",
- * nor may "Apache" appear in their name, without prior written
- * permission of the Apache Software Foundation.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation and was
- * originally based on software copyright (c) 1999, Lotus
- * Development Corporation., http://www.lotus.com. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- */
-package org.apache.xpath.rwapi.expression;
-
-import org.apache.xpath.rwapi.XPathException;
-
-/**
- * Represents literal expressions
- * <pre>
- * [59] Literal ::= NumericLiteral | StringLiteral
- * [58] NumericLiteral ::= IntegerLiteral | DecimalLiteral |
DoubleLiteral
- * [1] IntegerLiteral ::= Digits
- * [2] DecimalLiteral ::= ("." Digits) | (Digits "." [0-9]*)
- * [3] DoubleLiteral ::= (("." Digits) | (Digits ("." [0-9]*)?)) ("e"
| "E") ("+" | "-")? Digits
- * [4] StringLiteral ::= ('"' (('"' '"') | [^"])* '"') | ("'" (("'"
"'") | [^'])* "'")
- * </pre>
- * @see <a href="http://www.w3.org/TR/xpath20#id-literals">XPath 2.0
Specification</a>
- */
-public interface Literal extends Expr {
-
- /**
- *
- */
- short INTEGER_LITERAL = 0;
-
- /**
- *
- */
- short DECIMAL_LITERAL = 1;
-
- /**
- *
- */
- short STRING_LITERAL = 2;
-
- /**
- *
- */
- short DOUBLE_LITERAL = 3;
-
- /**
- * Gets the literal
- * @return short One of the four following literal type:
<code>INTEGER_LITERAL</code>,
- * <code>DECIMAL_LITERAL</code>, <code>STRING_LITERAL</code>,
<code>DOUBLE_LITERAL</code>.
- */
- short getLiteralType();
-
- /**
- * @throws XPathException when the literal isn't an integer
- */
- int getIntegerLiteral() throws XPathException;
-
- /**
- * @throws XPathException when the literal isn't a decimal
- */
- float getDecimalLiteral() throws XPathException;
-
- /**
- * @throws XPathException when the literal isn't a double
- */
- double getDoubleLiteral() throws XPathException;
-
- /**
- * @throws XPathException when the literal isn't a string
- */
- String getStringLiteral() throws XPathException;
-
-
-
-}
+/*
+ * The Apache Software License, Version 1.1
+ *
+ * Copyright (c) 2002-2003 The Apache Software Foundation. All rights
+ * reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * 3. The end-user documentation included with the redistribution,
+ * if any, must include the following acknowledgment:
+ * "This product includes software developed by the
+ * Apache Software Foundation (http://www.apache.org/)."
+ * Alternately, this acknowledgment may appear in the software itself,
+ * if and wherever such third-party acknowledgments normally appear.
+ *
+ * 4. The names "Xalan" and "Apache Software Foundation" must
+ * not be used to endorse or promote products derived from this
+ * software without prior written permission. For written
+ * permission, please contact [EMAIL PROTECTED]
+ *
+ * 5. Products derived from this software may not be called "Apache",
+ * nor may "Apache" appear in their name, without prior written
+ * permission of the Apache Software Foundation.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation and was
+ * originally based on software copyright (c) 1999, Lotus
+ * Development Corporation., http://www.lotus.com. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ */
+package org.apache.xpath.rwapi.expression;
+
+import java.math.BigDecimal;
+import java.math.BigInteger;
+
+import org.apache.xpath.rwapi.XPathException;
+
+/**
+ * Represents literal expressions
+ * <pre>
+ * [59] Literal ::= NumericLiteral | StringLiteral
+ * [58] NumericLiteral ::= IntegerLiteral | DecimalLiteral |
DoubleLiteral
+ * [1] IntegerLiteral ::= Digits
+ * [2] DecimalLiteral ::= ("." Digits) | (Digits "." [0-9]*)
+ * [3] DoubleLiteral ::= (("." Digits) | (Digits ("." [0-9]*)?)) ("e"
| "E") ("+" | "-")? Digits
+ * [4] StringLiteral ::= ('"' (('"' '"') | [^"])* '"') | ("'" (("'"
"'") | [^'])* "'")
+ * </pre>
+ * @see <a href="http://www.w3.org/TR/xpath20#id-literals">XPath 2.0
Specification</a>
+ */
+public interface Literal extends Expr {
+
+ /**
+ *
+ */
+ short INTEGER_LITERAL = 0;
+
+ /**
+ *
+ */
+ short DECIMAL_LITERAL = 1;
+
+ /**
+ *
+ */
+ short STRING_LITERAL = 2;
+
+ /**
+ *
+ */
+ short DOUBLE_LITERAL = 3;
+
+ /**
+ * Gets the literal
+ * @return short One of the four following literal type:
<code>INTEGER_LITERAL</code>,
+ * <code>DECIMAL_LITERAL</code>, <code>STRING_LITERAL</code>,
<code>DOUBLE_LITERAL</code>.
+ */
+ short getLiteralType();
+
+ /**
+ * @throws XPathException when the literal isn't an integer
+ */
+ BigInteger getIntegerLiteral() throws XPathException;
+
+ /**
+ * @throws XPathException when the literal isn't a decimal
+ */
+ BigDecimal getDecimalLiteral() throws XPathException;
+
+ /**
+ * @throws XPathException when the literal isn't a double
+ */
+ double getDoubleLiteral() throws XPathException;
+
+ /**
+ * @throws XPathException when the literal isn't a string
+ */
+ String getStringLiteral() throws XPathException;
+
+
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]