villard 2003/03/25 19:42:56
Modified: java/xpath_rwapi/src2/org/apache/xpath/impl Tag: xslt20
ExpressionFactoryImpl.java SequenceTypeImpl.java
java/xpath_rwapi/src2/org/apache/xpath/test Tag: xslt20
TestSamples.xml
java/xpath_rwapi/src2/org/apache/xpath/impl/parser Tag:
xslt20 XPath.java XPathTreeConstants.java
xpath-grammar.jj DefaultNodeFactory.java
NodeFactory.java xpath-grammar.jjt SimpleNode.java
XPathVisitor.java
java/xpath_rwapi/grammar Tag: xslt20 xpath-grammar.xml
java/xpath_rwapi/src2/org/apache/xpath/expression Tag:
xslt20 ExpressionFactory.java Expr.java
java/xpath_rwapi Tag: xslt20 build2.bat
Added: java/xpath_rwapi/src2/org/apache/xpath/impl Tag: xslt20
CastOrTreatAsExprImpl.java
java/xpath_rwapi/src2/org/apache/xpath/expression Tag:
xslt20 CastOrTreatAsExpr.java
Removed: java/xpath_rwapi/src2/org/apache/xpath/impl Tag: xslt20
CastExprImpl.java
java/xpath_rwapi/src2/org/apache/xpath/expression Tag:
xslt20 CastExpr.java
Log:
Implementation of cast as and treat as expression type.
Revision Changes Path
No revision
No revision
1.1.2.2 +2 -2
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/ExpressionFactoryImpl.java
Index: ExpressionFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/ExpressionFactoryImpl.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- ExpressionFactoryImpl.java 13 Mar 2003 20:28:14 -0000 1.1.2.1
+++ ExpressionFactoryImpl.java 26 Mar 2003 03:42:54 -0000 1.1.2.2
@@ -59,7 +59,7 @@
import org.apache.xpath.XPathException;
import org.apache.xpath.datamodel.SequenceType;
-import org.apache.xpath.expression.CastExpr;
+import org.apache.xpath.expression.CastOrTreatAsExpr;
import org.apache.xpath.expression.ConditionalExpr;
import org.apache.xpath.expression.Expr;
import org.apache.xpath.expression.ExpressionFactory;
@@ -173,7 +173,7 @@
/**
* @see
org.apache.xpath.expression.ExpressionFactory#createCastExpr(org.apache.xpath.datamodel.SequenceType,
org.apache.xpath.expression.OperatorExpr)
*/
- public CastExpr createCastExpr(SequenceType seqType, OperatorExpr
parExpr) {
+ public CastOrTreatAsExpr createCastExpr(SequenceType seqType,
OperatorExpr parExpr) {
return null;
}
1.1.2.2 +0 -1
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/SequenceTypeImpl.java
Index: SequenceTypeImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/SequenceTypeImpl.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- SequenceTypeImpl.java 25 Mar 2003 23:46:09 -0000 1.1.2.1
+++ SequenceTypeImpl.java 26 Mar 2003 03:42:54 -0000 1.1.2.2
@@ -57,7 +57,6 @@
import org.apache.xpath.datamodel.SequenceType;
import org.apache.xpath.impl.parser.Node;
-import org.apache.xpath.impl.parser.QName;
import org.apache.xpath.impl.parser.SimpleNode;
import org.apache.xpath.impl.parser.XPath;
import org.apache.xpath.impl.parser.XPathTreeConstants;
No revision
No revision
1.1.2.1 +168 -0
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/Attic/CastOrTreatAsExprImpl.java
No revision
No revision
1.1.2.4 +23 -1
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/test/Attic/TestSamples.xml
Index: TestSamples.xml
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/test/Attic/TestSamples.xml,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- TestSamples.xml 25 Mar 2003 23:46:10 -0000 1.1.2.3
+++ TestSamples.xml 26 Mar 2003 03:42:55 -0000 1.1.2.4
@@ -868,9 +868,31 @@
</ast>
</expr>
- <!-- Cast expr -->
+ <!-- Cast as expr -->
+ <expr value="cast as xs:integer($v)">
+ <ast>
+ <node name="ExprSequence">
+ <node name="CastExpr">
+ <node name="SingleType"/>
+ <node name="VarName"/>
+ </node>
+ </node>
+ </ast>
+ </expr>
+ <!-- Treat as expr -->
+
+ <expr value="treat as xs:integer($v)">
+ <ast>
+ <node name="ExprSequence">
+ <node name="TreatExpr">
+ <node name="SequenceType"/>
+ <node name="VarName"/>
+ </node>
+ </node>
+ </ast>
+ </expr>
<!-- Castable expr -->
No revision
No revision
1.1.2.4 +0 -24
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPath.java
Index: XPath.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPath.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- XPath.java 25 Mar 2003 23:46:07 -0000 1.1.2.3
+++ XPath.java 26 Mar 2003 03:42:55 -0000 1.1.2.4
@@ -2254,18 +2254,6 @@
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(CastAs);
- SimpleNode jjtn001 = (SimpleNode)SimpleNode.jjtCreate(this,
JJTCASTAS);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, true);
- jjtc001 = false;
- jjtn001.processToken(token);
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- }
- }
SingleType();
ParenthesizedExpr();
} catch (Throwable jjte000) {
@@ -2296,18 +2284,6 @@
jjtree.openNodeScope(jjtn000);
try {
jj_consume_token(TreatAs);
- SimpleNode jjtn001 = (SimpleNode)SimpleNode.jjtCreate(this,
JJTTREATAS);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- try {
- jjtree.closeNodeScope(jjtn001, true);
- jjtc001 = false;
- jjtn001.processToken(token);
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- }
- }
SequenceType();
ParenthesizedExpr();
} catch (Throwable jjte000) {
1.1.2.4 +54 -58
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathTreeConstants.java
Index: XPathTreeConstants.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathTreeConstants.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- XPathTreeConstants.java 25 Mar 2003 23:46:08 -0000 1.1.2.3
+++ XPathTreeConstants.java 26 Mar 2003 03:42:55 -0000 1.1.2.4
@@ -1,4 +1,4 @@
-/* Generated By:JJTree: Do not edit this line.
C:/data/projects/xml-xalan-xslt20/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathTreeConstants.java
*/
+/* Generated By:JJTree: Do not edit this line.
D:/projets/xml-xalan-xslt20/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathTreeConstants.java
*/
package org.apache.xpath.impl.parser;
@@ -53,61 +53,59 @@
public int JJTLBRACEEXPRENCLOSURE = 46;
public int JJTRBRACE = 47;
public int JJTCASTEXPR = 48;
- public int JJTCASTAS = 49;
- public int JJTTREATEXPR = 50;
- public int JJTTREATAS = 51;
- public int JJTAXISDESCENDANT = 52;
- public int JJTAXISSELF = 53;
- public int JJTAXISDESCENDANTORSELF = 54;
- public int JJTAXISFOLLOWINGSIBLING = 55;
- public int JJTAXISFOLLOWING = 56;
- public int JJTAXISNAMESPACE = 57;
- public int JJTAXISPARENT = 58;
- public int JJTAXISANCESTOR = 59;
- public int JJTAXISPRECEDINGSIBLING = 60;
- public int JJTAXISPRECEDING = 61;
- public int JJTAXISANCESTORORSELF = 62;
- public int JJTNODETEST = 63;
- public int JJTNAMETEST = 64;
- public int JJTQNAME = 65;
- public int JJTSTAR = 66;
- public int JJTNCNAMECOLONSTAR = 67;
- public int JJTSTARCOLONNCNAME = 68;
- public int JJTPROCESSINGINSTRUCTIONTEST = 69;
- public int JJTCOMMENTTEST = 70;
- public int JJTTEXTTEST = 71;
- public int JJTANYKINDTEST = 72;
- public int JJTDOT = 73;
- public int JJTDOTDOT = 74;
- public int JJTPREDICATES = 75;
- public int JJTINTEGERLITERAL = 76;
- public int JJTDECIMALLITERAL = 77;
- public int JJTDOUBLELITERAL = 78;
- public int JJTFUNCTIONCALL = 79;
- public int JJTSCHEMACONTEXT = 80;
- public int JJTINCONTEXT = 81;
- public int JJTSCHEMAGLOBALCONTEXT = 82;
- public int JJTTYPEQNAME = 83;
- public int JJTSCHEMACONTEXTSTEP = 84;
- public int JJTSINGLETYPE = 85;
- public int JJTQMARK = 86;
- public int JJTSEQUENCETYPE = 87;
- public int JJTEMPTY = 88;
- public int JJTELEMENTTYPE = 89;
- public int JJTATTRIBUTETYPE = 90;
- public int JJTNODE = 91;
- public int JJTPROCESSINGINSTRUCTION = 92;
- public int JJTCOMMENT = 93;
- public int JJTTEXT = 94;
- public int JJTDOCUMENT = 95;
- public int JJTITEM = 96;
- public int JJTUNTYPED = 97;
- public int JJTATOMICVALUE = 98;
- public int JJTELEMORATTRTYPE = 99;
- public int JJTSCHEMATYPE = 100;
- public int JJTOFTYPE = 101;
- public int JJTATOMICTYPE = 102;
- public int JJTMULTIPLY = 103;
+ public int JJTTREATEXPR = 49;
+ public int JJTAXISDESCENDANT = 50;
+ public int JJTAXISSELF = 51;
+ public int JJTAXISDESCENDANTORSELF = 52;
+ public int JJTAXISFOLLOWINGSIBLING = 53;
+ public int JJTAXISFOLLOWING = 54;
+ public int JJTAXISNAMESPACE = 55;
+ public int JJTAXISPARENT = 56;
+ public int JJTAXISANCESTOR = 57;
+ public int JJTAXISPRECEDINGSIBLING = 58;
+ public int JJTAXISPRECEDING = 59;
+ public int JJTAXISANCESTORORSELF = 60;
+ public int JJTNODETEST = 61;
+ public int JJTNAMETEST = 62;
+ public int JJTQNAME = 63;
+ public int JJTSTAR = 64;
+ public int JJTNCNAMECOLONSTAR = 65;
+ public int JJTSTARCOLONNCNAME = 66;
+ public int JJTPROCESSINGINSTRUCTIONTEST = 67;
+ public int JJTCOMMENTTEST = 68;
+ public int JJTTEXTTEST = 69;
+ public int JJTANYKINDTEST = 70;
+ public int JJTDOT = 71;
+ public int JJTDOTDOT = 72;
+ public int JJTPREDICATES = 73;
+ public int JJTINTEGERLITERAL = 74;
+ public int JJTDECIMALLITERAL = 75;
+ public int JJTDOUBLELITERAL = 76;
+ public int JJTFUNCTIONCALL = 77;
+ public int JJTSCHEMACONTEXT = 78;
+ public int JJTINCONTEXT = 79;
+ public int JJTSCHEMAGLOBALCONTEXT = 80;
+ public int JJTTYPEQNAME = 81;
+ public int JJTSCHEMACONTEXTSTEP = 82;
+ public int JJTSINGLETYPE = 83;
+ public int JJTQMARK = 84;
+ public int JJTSEQUENCETYPE = 85;
+ public int JJTEMPTY = 86;
+ public int JJTELEMENTTYPE = 87;
+ public int JJTATTRIBUTETYPE = 88;
+ public int JJTNODE = 89;
+ public int JJTPROCESSINGINSTRUCTION = 90;
+ public int JJTCOMMENT = 91;
+ public int JJTTEXT = 92;
+ public int JJTDOCUMENT = 93;
+ public int JJTITEM = 94;
+ public int JJTUNTYPED = 95;
+ public int JJTATOMICVALUE = 96;
+ public int JJTELEMORATTRTYPE = 97;
+ public int JJTSCHEMATYPE = 98;
+ public int JJTOFTYPE = 99;
+ public int JJTATOMICTYPE = 100;
+ public int JJTMULTIPLY = 101;
public String[] jjtNodeName = {
@@ -160,9 +158,7 @@
"LbraceExprEnclosure",
"Rbrace",
"CastExpr",
- "CastAs",
"TreatExpr",
- "TreatAs",
"AxisDescendant",
"AxisSelf",
"AxisDescendantOrSelf",
1.1.2.4 +3 -39
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/xpath-grammar.jj
Index: xpath-grammar.jj
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/xpath-grammar.jj,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- xpath-grammar.jj 25 Mar 2003 23:46:07 -0000 1.1.2.3
+++ xpath-grammar.jj 26 Mar 2003 03:42:55 -0000 1.1.2.4
@@ -1,4 +1,4 @@
-/[EMAIL PROTECTED](jjtree) Generated By:JJTree: Do not edit this line.
C:/data/projects/xml-xalan-xslt20/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\xpath-grammar.jj
*/
+/[EMAIL PROTECTED](jjtree) Generated By:JJTree: Do not edit this line.
D:/projets/xml-xalan-xslt20/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\xpath-grammar.jj
*/
/[EMAIL PROTECTED]/options {
@@ -2733,25 +2733,7 @@
{/[EMAIL PROTECTED](jjtree) CastExpr */
try {
/[EMAIL PROTECTED]/
- (<CastAs>/[EMAIL PROTECTED](jjtree) #CastAs( true) */
- {
- SimpleNode jjtn001 = (SimpleNode)SimpleNode.jjtCreate(this,
JJTCASTAS);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- }
- try {
-/[EMAIL PROTECTED]//[EMAIL PROTECTED](jjtree)*/
- {
- jjtree.closeNodeScope(jjtn001, true);
- jjtc001 = false;
- }
-/[EMAIL PROTECTED]/{jjtn001.processToken(token);}/[EMAIL PROTECTED](jjtree)*/
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- }
- }
-/[EMAIL PROTECTED]/ SingleType()) ParenthesizedExpr()/[EMAIL
PROTECTED](jjtree)*/
+ (<CastAs> SingleType()) ParenthesizedExpr()/[EMAIL PROTECTED](jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
@@ -2783,25 +2765,7 @@
{/[EMAIL PROTECTED](jjtree) TreatExpr */
try {
/[EMAIL PROTECTED]/
- (<TreatAs>/[EMAIL PROTECTED](jjtree) #TreatAs( true) */
- {
- SimpleNode jjtn001 = (SimpleNode)SimpleNode.jjtCreate(this,
JJTTREATAS);
- boolean jjtc001 = true;
- jjtree.openNodeScope(jjtn001);
- }
- try {
-/[EMAIL PROTECTED]//[EMAIL PROTECTED](jjtree)*/
- {
- jjtree.closeNodeScope(jjtn001, true);
- jjtc001 = false;
- }
-/[EMAIL PROTECTED]/{jjtn001.processToken(token);}/[EMAIL PROTECTED](jjtree)*/
- } finally {
- if (jjtc001) {
- jjtree.closeNodeScope(jjtn001, true);
- }
- }
-/[EMAIL PROTECTED]/ SequenceType()) ParenthesizedExpr()/[EMAIL
PROTECTED](jjtree)*/
+ (<TreatAs> SequenceType()) ParenthesizedExpr()/[EMAIL PROTECTED](jjtree)*/
} catch (Throwable jjte000) {
if (jjtc000) {
jjtree.clearNodeScope(jjtn000);
1.1.2.3 +15 -2
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/DefaultNodeFactory.java
Index: DefaultNodeFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/DefaultNodeFactory.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- DefaultNodeFactory.java 25 Mar 2003 23:46:08 -0000 1.1.2.2
+++ DefaultNodeFactory.java 26 Mar 2003 03:42:55 -0000 1.1.2.3
@@ -66,11 +66,10 @@
import org.apache.xpath.impl.VariableImpl;
/**
- * Default implementation for node factory
+ * Default implementation for node factory.
*/
public class DefaultNodeFactory implements NodeFactory {
-
/**
* @see
org.apache.xpath.impl.parser.NodeFactory#createFunctionCallNode()
@@ -141,6 +140,20 @@
public SequenceTypeImpl createSequenceTypeNode(int id) {
return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.xpath.impl.parser.NodeFactory#createCastAsNode(int)
+ */
+ public SequenceTypeImpl createCastAsNode(int id) {
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.apache.xpath.impl.parser.NodeFactory#createTreatAsNode(int)
+ */
+ public SequenceTypeImpl createTreatAsNode(int id) {
+ return null;
}
}
1.1.2.3 +20 -7
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/NodeFactory.java
Index: NodeFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/NodeFactory.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- NodeFactory.java 25 Mar 2003 23:46:08 -0000 1.1.2.2
+++ NodeFactory.java 26 Mar 2003 03:42:55 -0000 1.1.2.3
@@ -136,14 +136,27 @@
* @return a new VarName AST node or null.
*/
VariableImpl createVarNameNode(int id);
-
- /**
- * Creates SequenceType AST node
- *
- * @return a new SequenceType AST node or null.
- */
- SequenceTypeImpl createSequenceTypeNode(int id);
+ /**
+ * Creates SequenceType AST node
+ *
+ * @return a new SequenceType AST node or null.
+ */
+ SequenceTypeImpl createSequenceTypeNode(int id);
+
+ /**
+ * Creates Cast As AST node
+ *
+ * @return a new Cast As AST node or null.
+ */
+ SequenceTypeImpl createCastAsNode(int id);
+
+ /**
+ * Creates Treat As AST node
+ *
+ * @return a new Treat As AST node or null.
+ */
+ SequenceTypeImpl createTreatAsNode(int id);
/**
* Creates a generic AST node for the given tree node ID.
1.1.2.4 +2 -2
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/xpath-grammar.jjt
Index: xpath-grammar.jjt
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/xpath-grammar.jjt,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- xpath-grammar.jjt 25 Mar 2003 23:46:07 -0000 1.1.2.3
+++ xpath-grammar.jjt 26 Mar 2003 03:42:55 -0000 1.1.2.4
@@ -1340,13 +1340,13 @@
void CastExpr() :
{}
{
- (<CastAs>{jjtThis.processToken(token);} #CastAs(true) SingleType())
ParenthesizedExpr()
+ (<CastAs> SingleType()) ParenthesizedExpr()
}
void TreatExpr() :
{}
{
- (<TreatAs>{jjtThis.processToken(token);} #TreatAs(true) SequenceType())
ParenthesizedExpr()
+ (<TreatAs> SequenceType()) ParenthesizedExpr()
}
void GeneralComp() #void :
1.1.2.4 +116 -46
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/SimpleNode.java
Index: SimpleNode.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/SimpleNode.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- SimpleNode.java 25 Mar 2003 23:46:08 -0000 1.1.2.3
+++ SimpleNode.java 26 Mar 2003 03:42:55 -0000 1.1.2.4
@@ -1,7 +1,7 @@
/* Generated By:JJTree: Do not edit this line. SimpleNode.java */
package org.apache.xpath.impl.parser;
-import org.apache.xpath.impl.CastExprImpl;
+import org.apache.xpath.impl.CastOrTreatAsExprImpl;
import org.apache.xpath.impl.CastableExprImpl;
import org.apache.xpath.impl.ConditionalExprImpl;
import org.apache.xpath.impl.ForAndQuantifiedExprImpl;
@@ -28,20 +28,37 @@
protected Node[] children; // to remove
protected int id; // to remove
- protected SimpleNode()
- {
- }
+ protected SimpleNode() {}
+ /**
+ * Creates a new SimpleNode object.
+ *
+ * @param i DOCUMENT ME!
+ */
public SimpleNode(int i)
{
id = i;
}
+ /**
+ * Creates a new SimpleNode object.
+ *
+ * @param p DOCUMENT ME!
+ * @param i DOCUMENT ME!
+ */
public SimpleNode(XPath p, int i)
{
this(i);
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param p DOCUMENT ME!
+ * @param id DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
public static Node jjtCreate(XPath p, int id)
{
if (PRODUCE_RAW_TREE)
@@ -51,7 +68,7 @@
Node newNode;
NodeFactory nodeFactory = (p.m_nodeFactory == null)
- ? DEFAULT_NODE_FACTORY : p.m_nodeFactory;
+ ? DEFAULT_NODE_FACTORY : p.m_nodeFactory;
switch (id)
{
@@ -101,16 +118,7 @@
break;
- case XPathTreeConstants.JJTCASTEXPR:
- newNode = (CastExprImpl) nodeFactory.createNode(id);
-
- if (newNode == null)
- {
- newNode = new CastExprImpl(id);
- }
-
- break;
-
+
case XPathTreeConstants.JJTCASTABLEEXPR:
newNode = (CastableExprImpl) nodeFactory.createNode(id);
@@ -200,7 +208,8 @@
break;
- case XPathTreeConstants.JJTSEQUENCETYPE:
+ case XPathTreeConstants.JJTSEQUENCETYPE:
+ case XPathTreeConstants.JJTSINGLETYPE:
newNode = nodeFactory.createSequenceTypeNode(id);
if (newNode == null)
@@ -210,6 +219,26 @@
break;
+ case XPathTreeConstants.JJTCASTEXPR:
+ newNode = nodeFactory.createCastAsNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new CastOrTreatAsExprImpl(id);
+ }
+
+ break;
+
+ case XPathTreeConstants.JJTTREATEXPR: //50;
+ newNode = nodeFactory.createTreatAsNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new CastOrTreatAsExprImpl(id);
+ }
+
+ break;
+
// The nodes belows are filtered: no customisation possible
case XPathTreeConstants.JJTQNAME:
case XPathTreeConstants.JJTQNAMELPAR:
@@ -277,8 +306,6 @@
break;
-
-
case XPathTreeConstants.JJTELEMENTTYPE:
newNode = Singletons.ELEMENT;
@@ -323,16 +350,16 @@
newNode = Singletons.ITEM;
break;
-
- case XPathTreeConstants.JJTMULTIPLY: //106;
- newNode = Singletons.MULTIPLY;
- break;
-
- case XPathTreeConstants.JJTQMARK: //107;
- newNode = Singletons.QMARK;
- break;
-
-
+
+ case XPathTreeConstants.JJTMULTIPLY: //106;
+ newNode = Singletons.MULTIPLY;
+
+ break;
+
+ case XPathTreeConstants.JJTQMARK: //107;
+ newNode = Singletons.QMARK;
+
+ break;
case XPathTreeConstants.JJTROOT:
newNode = Singletons.ROOT;
@@ -428,17 +455,15 @@
case XPathTreeConstants.JJTINTERSECTEXCEPTEXPR: //37;
case XPathTreeConstants.JJTVALIDATEEXPR: //44;
case XPathTreeConstants.JJTRBRACE: //47;
- case XPathTreeConstants.JJTCASTAS: //49;
- case XPathTreeConstants.JJTTREATAS: //50;
+
case XPathTreeConstants.JJTSCHEMACONTEXT: //84;
case XPathTreeConstants.JJTSCHEMAGLOBALCONTEXT: //85;
case XPathTreeConstants.JJTSCHEMACONTEXTSTEP: //87;
- case XPathTreeConstants.JJTUNTYPED: //99;
+ case XPathTreeConstants.JJTUNTYPED: //99;
case XPathTreeConstants.JJTATOMICVALUE: //100;
case XPathTreeConstants.JJTELEMORATTRTYPE: //101;
case XPathTreeConstants.JJTSCHEMATYPE: //102;
case XPathTreeConstants.JJTOFTYPE: //103;
-
default:
@@ -449,30 +474,55 @@
return newNode;
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param id DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
public static Node jjtCreate(int id)
{
// When this one is called?
return new SimpleNode(id);
}
- public void jjtOpen()
- {
- }
+ /**
+ * DOCUMENT ME!
+ */
+ public void jjtOpen() {}
- public void jjtClose()
- {
- }
+ /**
+ * DOCUMENT ME!
+ */
+ public void jjtClose() {}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n DOCUMENT ME!
+ */
public void jjtSetParent(Node n)
{
parent = n;
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
public Node jjtGetParent()
{
return parent;
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param n DOCUMENT ME!
+ * @param i DOCUMENT ME!
+ */
public void jjtAddChild(Node n, int i)
{
if (children == null)
@@ -536,11 +586,23 @@
}
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param i DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
public Node jjtGetChild(int i)
{
return children[i];
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
public int jjtGetNumChildren()
{
return (children == null) ? 0 : children.length;
@@ -593,13 +655,11 @@
*
* @param token
*/
- public void processToken(Token token)
- {
- }
+ public void processToken(Token token) {}
/**
- *
- */
+ *
+ */
public boolean canBeReduced()
{
return false;
@@ -615,11 +675,23 @@
return XPathTreeConstants.jjtNodeName[id] + " classname=" +
getClass();
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param prefix DOCUMENT ME!
+ *
+ * @return DOCUMENT ME!
+ */
public String toString(String prefix)
{
return prefix + toString();
}
+ /**
+ * DOCUMENT ME!
+ *
+ * @param prefix DOCUMENT ME!
+ */
public void dump(String prefix)
{
dump(prefix, System.out);
@@ -651,7 +723,5 @@
* @param expr DOCUMENT ME!
* @param abbreviate DOCUMENT ME!
*/
- public void getString(StringBuffer expr, boolean abbreviate)
- {
- }
+ public void getString(StringBuffer expr, boolean abbreviate) {}
}
1.1.2.3 +1 -1
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathVisitor.java
Index: XPathVisitor.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/impl/parser/Attic/XPathVisitor.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XPathVisitor.java 24 Mar 2003 17:35:05 -0000 1.1.2.2
+++ XPathVisitor.java 26 Mar 2003 03:42:55 -0000 1.1.2.3
@@ -1,4 +1,4 @@
-/* Generated By:JJTree: Do not edit this line.
C:/data/projects/xml-xalan-xslt20/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathVisitor.java
*/
+/* Generated By:JJTree: Do not edit this line.
D:/projets/xml-xalan-xslt20/java/xpath_rwapi/src2/org/apache/xpath/impl/parser\XPathVisitor.java
*/
package org.apache.xpath.impl.parser;
No revision
No revision
1.1.2.7 +5 -5
xml-xalan/java/xpath_rwapi/grammar/Attic/xpath-grammar.xml
Index: xpath-grammar.xml
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/grammar/Attic/xpath-grammar.xml,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -r1.1.2.6 -r1.1.2.7
--- xpath-grammar.xml 24 Mar 2003 17:36:26 -0000 1.1.2.6
+++ xpath-grammar.xml 26 Mar 2003 03:42:56 -0000 1.1.2.7
@@ -1568,7 +1568,7 @@
<level>
<postfix name="InstanceofExpr" if="xquery xpath" prefix-seq-type="?"
condition="> 1">
<sequence>
- <ref name="Instanceof"/>
+ <ref name="Instanceof"
node-type="void"/>
<ref name="SequenceType"/>
</sequence>
</postfix>
@@ -1802,7 +1802,7 @@
<production name="CastExpr" if="xpath core xquery">
<sequence>
- <ref name="CastAs"/>
+ <ref name="CastAs" node-type="void"/>
<ref name="SingleType"/>
</sequence>
<ref name="ParenthesizedExpr"/>
@@ -1819,7 +1819,7 @@
<production name="TreatExpr" if="xpath core xquery">
<sequence>
- <ref name="TreatAs" if="xpath xquery"/>
+ <ref name="TreatAs" if="xpath xquery" node-type="void"/>
<ref name="SequenceType"/>
</sequence>
<ref name="ParenthesizedExpr"/>
@@ -2203,7 +2203,7 @@
</choice>
</production>
- <production name="ItemType" if="xquery core xpath">
+ <production name="ItemType" if="xquery core xpath" node-type="void">
<choice break="true">
<sequence>
<choice>
@@ -2263,7 +2263,7 @@
<ref name="QName"/>
</production>
- <production name="OccurrenceIndicator" if="xquery core xpath">
+ <production name="OccurrenceIndicator" if="xquery core xpath"
node-type="void">
<optional>
<choice>
<ref name="Star" if="xpath xquery core" show="no"/>
No revision
No revision
1.1.2.2 +1 -1
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/ExpressionFactory.java
Index: ExpressionFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/ExpressionFactory.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- ExpressionFactory.java 13 Mar 2003 20:28:17 -0000 1.1.2.1
+++ ExpressionFactory.java 26 Mar 2003 03:42:56 -0000 1.1.2.2
@@ -131,7 +131,7 @@
/**
* Create a cast as expression
*/
- public CastExpr createCastExpr(SequenceType seqType, OperatorExpr
parExpr);
+ public CastOrTreatAsExpr createCastExpr(SequenceType seqType,
OperatorExpr parExpr);
/**
* Create an integer expression
1.1.2.2 +7 -2
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/Expr.java
Index: Expr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/Expr.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- Expr.java 13 Mar 2003 20:28:17 -0000 1.1.2.1
+++ Expr.java 26 Mar 2003 03:42:56 -0000 1.1.2.2
@@ -165,14 +165,19 @@
static final short UNARY_EXPR = 19;
/**
- * The expression is a cast expression
+ * The expression is a cast as expression
*/
- static final short CAST_EXPR = 20;
+ static final short CAST_AS_EXPR = 20;
/**
* The expression is a castable expression
*/
static final short CASTABLE_EXPR = 21;
+
+ /**
+ * The expression is a treat as expression
+ */
+ static final short TREAT_AS_EXPR = 22;
/**
* Gets the global expression type.
No revision
No revision
1.1.2.1 +82 -0
xml-xalan/java/xpath_rwapi/src2/org/apache/xpath/expression/Attic/CastOrTreatAsExpr.java
No revision
No revision
1.1.2.2 +1 -1 xml-xalan/java/xpath_rwapi/Attic/build2.bat
Index: build2.bat
===================================================================
RCS file: /home/cvs/xml-xalan/java/xpath_rwapi/Attic/build2.bat,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- build2.bat 13 Mar 2003 20:29:41 -0000 1.1.2.1
+++ build2.bat 26 Mar 2003 03:42:56 -0000 1.1.2.2
@@ -45,7 +45,7 @@
set _CLASSPATH=%CLASSPATH%
if exist "%JAVA_HOME%\lib\tools.jar" set
_CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
if exist "%JAVA_HOME%\lib\classes.zip" set
_CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\classes.zip
-set _CLASSPATH=%_ANT_JAR%;%_XML-APIS_JAR%;%_PARSER_JAR%;%_CLASSPATH%
+set
_CLASSPATH=%_ANT_JAR%;%_XML-APIS_JAR%;%_PARSER_JAR%;../build/xalan.jar;%_CLASSPATH%
@echo on
"%_JAVACMD%" -mx64m %JAVA_OPTS% -Dant.home="%_ANT_HOME%" -classpath
"%_CLASSPATH%" org.apache.tools.ant.Main -f build2.xml %1 %2 %3 %4 %5 %6 %7 %8
%9
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]