santiagopg 2003/02/05 08:09:49
Modified: java/xpath_rwapi Tag: xslt20 build.xml
java/xpath_rwapi/grammar Tag: xslt20 etree.xsl javacc.xsl
jjtree.xsl xpath-grammar.xml
java/xpath_rwapi/src/org/apache/xpath/rwapi Tag: xslt20
XPathException.java XPathFactory.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel Tag:
xslt20 AtomicValue.java Item.java ItemFactory.java
Node.java Sequence.java SequenceType.java
SingleType.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/eval Tag: xslt20
DynamicContext.java Evaluator.java
EvaluatorFactory.java NamespaceContext.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/expression Tag:
xslt20 CastExpr.java CastableExpr.java
ConditionalExpr.java Expr.java ExprContext.java
ExpressionFactory.java ForAndQuantifiedExpr.java
FunctionCall.java InstanceOfExpr.java Literal.java
NodeTest.java OperatorExpr.java PathExpr.java
StaticContext.java StepExpr.java Variable.java
Visitable.java Visitor.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/impl Tag: xslt20
CastExprImpl.java CastableExprImpl.java
ConditionalExprImpl.java EvaluatorFactoryImpl.java
ExprContextImpl.java ExprImpl.java
ExpressionFactoryImpl.java
ForAndQuantifiedExprImpl.java FunctionCallImpl.java
InstanceOfExprImpl.java KindTestImpl.java
LiteralImpl.java NameTestImpl.java
OperatorImpl.java PathExprImpl.java
StepExprImpl.java VariableImpl.java
XPathFactoryImpl.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser Tag:
xslt20 Axis.java KindTest.java Predicates.java
QName.java SimpleNode.java Singletons.java
XPath.java XPath2Node.java XPathNode.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan Tag:
xslt20 EvaluatorImpl.java XObjectToSequence.java
java/xpath_rwapi/src/org/apache/xpath/rwapi/test Tag: xslt20
Test.java Test2.java xpathsamples.xml
Log:
Committing latest update from Lionel Villard ([EMAIL PROTECTED]) for
XPath API. This update consists of:
- the addition of an external AST node factory: applications can now
provide their own AST node implementation (but need to inherit the basic
implementation)
- the overall improvement of the documentation
Known problems:
- parentherized expressions are not correctly reduced
- the implementation is still partial
Revision Changes Path
No revision
No revision
1.1.2.4 +5 -1 xml-xalan/java/xpath_rwapi/Attic/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/xml-xalan/java/xpath_rwapi/Attic/build.xml,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- build.xml 23 Jan 2003 19:36:42 -0000 1.1.2.3
+++ build.xml 5 Feb 2003 16:09:44 -0000 1.1.2.4
@@ -67,7 +67,10 @@
</target>
<target name="jjtree" depends="gen-grammar">
- <jjtree target="${target.parser}/xpath-grammar.jjt" javacchome="../bin"
outputdirectory="${target.parser}"/>
+ <jjtree target="${target.parser}/xpath-grammar.jjt"
+ javacchome="../bin"
+ outputdirectory="${target.parser}"
+ static="false"/>
</target>
<target name="javacc" depends="jjtree">
@@ -77,6 +80,7 @@
debugtokenmanager="${debug}"
debugparser="${debug}"
sanitycheck="true"
+ static="false"
unicodeinput="${unicodeinput}"
javaunicodeescape="${unicodeinput}"
outputdirectory="${target.parser}"/>
No revision
No revision
1.1.2.3 +90 -69 xml-xalan/java/xpath_rwapi/grammar/Attic/etree.xsl
Index: etree.xsl
===================================================================
RCS file: /home/cvs/xml-xalan/java/xpath_rwapi/grammar/Attic/etree.xsl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- etree.xsl 23 Jan 2003 19:36:46 -0000 1.1.2.2
+++ etree.xsl 5 Feb 2003 16:09:45 -0000 1.1.2.3
@@ -1,69 +1,90 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:g="http://www.w3.org/2001/03/XPath/grammar">
-
- <xsl:import href="jjtree.xsl"/>
-
- <!-- override jjtree.xsl -->
- <xsl:template name="javacc-options">
- <!-- xsl:apply-imports/ -->
- STATIC = false;
- MULTI=false;
- // NODE_PACKAGE="org.apache.xpath.operations";
- NODE_PREFIX="";
- NODE_FACTORY=true;
- VISITOR=true; // invokes the JJTree Visitor support
- NODE_SCOPE_HOOK=false;
- NODE_USES_PARSER=true;
- </xsl:template>
-
- <xsl:template name="set-parser-package">
-package org.apache.xpath.rwapi.impl.parser;
- </xsl:template>
-
- <xsl:template name="extra-parser-code">
- org.apache.xml.utils.PrefixResolver m_prefixResolver;
- org.apache.xpath.patterns.FunctionPattern m_matchFunc = null; // short
lived.
-
- int m_predLevel = 0;
-
- public void setPrefixResolver(org.apache.xml.utils.PrefixResolver
resolver)
- {
- m_prefixResolver = resolver;
- }
-
- public org.apache.xml.utils.PrefixResolver getPrefixResolver()
- {
- return m_prefixResolver;
- }
-
- /**
- * The "version" property.
- * @serial
- */
- private double m_version;
-
- /**
- * Set the "version" property for XPath.
- *
- * @param v Value for the "version" property.
- */
- public void setVersion(double v)
- {
- m_version = v;
- }
-
- /**
- * Get the "version" property of XPath.
- *
- * @return The value of the "version" property.
- */
- public double getVersion()
- {
- return m_version;
- }
-
- </xsl:template>
-
-</xsl:stylesheet>
+<?xml version="1.0" encoding="utf-8"?>
+
+<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:g="http://www.w3.org/2001/03/XPath/grammar">
+
+ <xsl:import href="jjtree.xsl"/>
+
+ <!-- override jjtree.xsl -->
+ <xsl:template name="javacc-options">
+ <!-- xsl:apply-imports/ -->
+ STATIC = false;
+ MULTI=false;
+ // NODE_PACKAGE="org.apache.xpath.operations";
+ NODE_PREFIX="";
+ NODE_FACTORY=true;
+ VISITOR=true; // invokes the JJTree Visitor support
+ NODE_SCOPE_HOOK=false;
+ NODE_USES_PARSER=true;
+ </xsl:template>
+
+ <xsl:template name="set-parser-package">
+package org.apache.xpath.rwapi.impl.parser;
+ </xsl:template>
+
+ <xsl:template name="extra-parser-code">
+ org.apache.xml.utils.PrefixResolver m_prefixResolver;
+ org.apache.xpath.patterns.FunctionPattern m_matchFunc = null; // short
lived.
+
+
+ /**
+ * Node factory for customized parser
+ */
+ NodeFactory m_nodeFactory;
+
+ int m_predLevel = 0;
+
+ public void setPrefixResolver(org.apache.xml.utils.PrefixResolver
resolver)
+ {
+ m_prefixResolver = resolver;
+ }
+
+ public org.apache.xml.utils.PrefixResolver getPrefixResolver()
+ {
+ return m_prefixResolver;
+ }
+
+ /**
+ * Sets the node factory
+ */
+ public void setNodeFactory(NodeFactory nodeFactory) {
+ m_nodeFactory = nodeFactory;
+ }
+
+ /**
+ * Returns the node factory.
+ * @return NodeFactory
+ */
+ public NodeFactory getNodeFactory() {
+ return m_nodeFactory;
+ }
+
+ /**
+ * The "version" property.
+ * @serial
+ */
+ private double m_version;
+
+ /**
+ * Set the "version" property for XPath.
+ *
+ * @param v Value for the "version" property.
+ */
+ public void setVersion(double v)
+ {
+ m_version = v;
+ }
+
+ /**
+ * Get the "version" property of XPath.
+ *
+ * @return The value of the "version" property.
+ */
+ public double getVersion()
+ {
+ return m_version;
+ }
+
+ </xsl:template>
+
+</xsl:stylesheet>
1.1.2.3 +949 -949 xml-xalan/java/xpath_rwapi/grammar/Attic/javacc.xsl
Index: javacc.xsl
===================================================================
RCS file: /home/cvs/xml-xalan/java/xpath_rwapi/grammar/Attic/javacc.xsl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- javacc.xsl 23 Jan 2003 19:36:46 -0000 1.1.2.2
+++ javacc.xsl 5 Feb 2003 16:09:45 -0000 1.1.2.3
@@ -1,952 +1,963 @@
-<?xml version="1.0"?>
-
-<!--
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
--->
-
-<!-- $Id$ -->
-
-<!-- Use spec=xpath to generate an XQuery grammar rather
- than an XQuery grammar. -->
-
- <!-- ============== CHANGE LOG: ==============
+<?xml version="1.0"?>
+
+<!--
+ * Copyright (c) 2002 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
+-->
+
+<!-- $Id$ -->
+
+<!-- Use spec=xpath to generate an XQuery grammar rather
+ than an XQuery grammar. -->
+
+ <!-- ============== CHANGE LOG: ==============
$Log$
- Revision 1.1.2.2 2003/01/23 19:36:46 santiagopg
- Committing latest patch for XPath rwapi from Lionel Villard ([EMAIL
PROTECTED])
-
- Revision 1.1.2.1.2.1 2002/11/13 05:27:33 sboag
- Integrated new grammar from Nov. 15th draft, with a small tweak to allow
multiple
- comparison expressions (to allow success of xpath1 parsing).
-
- Revision 1.14 2002/11/06 07:42:25 sboag
- 1) I did some work on BNF production numbering. At least it is consecutive
- now in regards to the defined tokens.
-
- 2) (XQuery only) I added URL Literal to the main list of literals, and
added a
- short note that it is defined equivalently to string literal. URL Literal
has to
- exist right now for relatively esoteric purposes for transitioning the
lexical
- state (to DEFAULT rather than OPERATOR as StringLiteral does). It is
- used in DefaultCollationDecl, NamespaceDecl, SubNamespaceDecl, and
- DefaultNamespaceDecl. To be clear, URL Literal was already in the August
- draft, I just added it to the list of literals in the main doc.
-
- Revision 1.13 2002/10/22 16:51:08 sboag
- New Grammar Issues List. New productions:
- OrderBy, ComputedTextConstructor, PositionVar, Castable, As (TypeDecl).
- Removed:
- unordered, SortExpr
- Fixed reserved word bugs with:
- empty, stable
- Other minor "fixes":
- Change precedence of UnaryExpr to be looser binding than UnionExpr
- Change RangeExpr to only allow one "to".
-
- Revision 1.12 2002/07/28 19:54:13 sboag
- Fixed problems with import, '*', '?', and ',', reported by Jonathan and
Dana.
-
- Revision 1.11 2002/07/18 01:17:39 sboag
- Fixed some bugs.
-
- Revision 1.10 2002/07/15 07:25:47 sboag
- Bug fixes, added match patterns, and responses to
- Don's email
http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2002Jul/0156.html.
-
- Revision 1.9 2002/06/28 09:02:07 sboag
- Merged Don's latest work with new grammar proposal. Changes too numerous
- to detail.
-
- Revision 1.8 2002/03/17 21:31:08 sboag
- Made new grammar element, <next/> for use in primary or prefix expressions,
- to control when the next element is going to be called. Somewhat
experemental.
-
- Changed javacc stylesheet and bnf stylesheets to handle g:next.
-
- Fixed bugs with child::text(), by adding text, comment, etc., tokens to
after forward
- or reverse axis. (note: have to do the same to names after @). This is
yet
- another bad hack.
-
- Fixed bug with @type, by adding At token to lexical stateswitch into QNAME
state
- for XQuery.
-
- Revision 1.7 2002/03/13 15:45:05 sboag
- Don changes (XPathXQuery.xml, introduction.xml, fragment.xml):
- I have attempted to update these files with the latest terminology
- (mainly changing "simple value" to "atomic value" and related changes.)
-
- Grammar changes:
- Moral equal of Philip Wadler's structural changes of 02/05/2002.
- Make lookahead(2) so that ElementNameOrFunctionCall can be broken up
- without using long tokens.
- Integrated Robie's SequenceType productions.
- Added Add Validate Production.
- Reviewed and tweaked changes against Named Typing proposal.
- Fixed Dana's bug about ContentElementConstructor and
- ContentAttributeConstructor in ElementContent.
- Allow multiple variable binding for some/every.
- Lift restrictions of "." and "..".
- add XmlComment and XmlProcessingInstruction and also CdataSection to the
- Constructor production.
- Remove The Ref and Colon tokens.
- Made multiply & star one token for XQuery, in spite of the fact that this
causes
- ambiguity.
- Remove XQUERY_COMMENT state that is never entered.
- Add QNAME lexical state for qnames following explicit axes, i.e.
child::div.
- BUG: child::text() will fail in XQuery.
- BUG: Validate does not work so well for XPath.
-
- Revision 1.6 2002/03/06 12:40:55 sboag
- Tweak to make it possible to have prefix productions with optional
suffixes.
-
- Revision 1.5 2001/12/09 22:07:16 sboag
- Fixed problem with comments from previous checkin.
-
- -sb 10/29/01 Make parser productions extensible by an importing
stylesheet.
- ============== END CHANGE LOG ============== -->
-
-<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:g="http://www.w3.org/2001/03/XPath/grammar">
-
- <xsl:param name="spec" select="'xquery'"/>
-
- <xsl:strip-space elements="*"/>
- <!-- workaround for Xalan bug. -->
- <xsl:preserve-space elements="g:char"/>
-
- <xsl:output method="text" encoding="iso-8859-1"/>
-
- <xsl:key name="ref" match="g:token[not(@if) or contains(@if,$spec)]
- |g:production[not(@if) or contains(@if,$spec)]"
- use="@name"/>
-
-
- <!-- empty template to help screen out those elements that do not
- match the given spec. -->
- <xsl:template match="g:[EMAIL PROTECTED] and not(contains(@if,$spec))]"
- priority="2000"/>
-
- <xsl:template name="parser">
- PARSER_BEGIN(XPath)
-
- public class XPath {
- public static void main(String args[]) throws ParseException {
- XPath parser = new XPath(System.in);
- parser.Input();
- }
- }
-
- PARSER_END(XPath)
- </xsl:template>
-
-<!-- Action templates for overrides from derived stylesheets -->
-
-<xsl:template name="action-production">
-</xsl:template>
-
-<xsl:template name="action-production-end">
-</xsl:template>
-
-<xsl:template name="action-exprProduction">
-</xsl:template>
-
-<xsl:template name="action-exprProduction-label">
-</xsl:template>
-
-<xsl:template name="action-exprProduction-end">
-</xsl:template>
-
-<xsl:template name="action-level">
-</xsl:template>
-
-<xsl:template name="action-level-jjtree-label"></xsl:template>
-<xsl:template name="binary-action-level-jjtree-label"></xsl:template>
-
-<xsl:template name="action-level-start">
-</xsl:template>
-
-<xsl:template name="action-level-end">
-</xsl:template>
-
-<xsl:template name="action-token-ref">
-</xsl:template>
-
-<xsl:template name="javacc-options">
- STATIC = false;
- LOOKAHEAD = 1;
-</xsl:template>
-
-<xsl:template name="input">
- void Input() :
- {}
- {
- <xsl:value-of select="g:start[not(@if) or
contains(@if,$spec)]/@name"/>()<EOF>
- }
-</xsl:template>
-
-<xsl:template match="g:grammar">options {
-<xsl:call-template name="javacc-options"/>
-}
-
-<xsl:call-template name="parser"/>
-
-// jwr: why doesn't this use java.util.Stack() instead of java.util.Vector()?
-
-TOKEN_MGR_DECLS : {
- private Stack stateStack = new Stack();
- static final int PARENMARKER = 2000;
-
- /**
- * Push the current state onto the state stack.
- */
- private void pushState()
- {
- stateStack.addElement(new Integer(curLexState));
- }
-
- /**
- * Push the given state onto the state stack.
- * @param state Must be a valid state.
- */
- private void pushState(int state)
- {
- stateStack.push(new Integer(state));
- }
-
- /**
- * Pop the state on the state stack, and switch to that state.
- */
- private void popState()
- {
- if (stateStack.size() == 0)
- {
- printLinePos();
- }
-
- int nextState = ((Integer) stateStack.pop()).intValue();
- if(nextState == PARENMARKER)
- printLinePos();
- SwitchTo(nextState);
- }
-
- /**
- * Push a parenthesis state. This pushes, in addition to the
- * lexical state value, a special marker that lets
- * resetParenStateOrSwitch(int state)
- * know if it should pop and switch. Used for the comma operator.
- */
- private void pushParenState(int commaState, int rparState)
- {
- stateStack.push(new Integer(rparState));
- stateStack.push(new Integer(commaState));
- stateStack.push(new Integer(PARENMARKER));
- SwitchTo(commaState);
- }
-
-
-// /**
-// * Push a parenthesis state. This pushes, in addition to the
-// * lexical state value, a special marker that lets
-// * resetParenStateOrSwitch(int state)
-// * know if it should pop and switch. Used for the comma operator.
-// */
-// private void pushParenState()
-// {
-// stateStack.push(new Integer(curLexState));
-// stateStack.push(new Integer(PARENMARKER));
-// }
-
- /**
- * If a PARENMARKER is on the stack, switch the state to
- * the state underneath the marker. Leave the stack in
- * the same state. If the stack is zero, do nothing.
- * @param state The state to switch to if the PARENMARKER is not found.
- */
- private void resetParenStateOrSwitch(int state)
- {
- if (stateStack.size() == 0)
- {
- SwitchTo(state);
- return;
- }
-
- int nextState = ((Integer) stateStack.peek()).intValue();
- if (PARENMARKER == nextState)
- {
- // Wait for right paren to do the pop!
- Integer intObj = (Integer) stateStack.elementAt(stateStack.size() - 2);
- nextState = intObj.intValue();
- SwitchTo(nextState);
- }
- else
- SwitchTo(state);
- }
-
-// /**
-// * Pop the lexical state stack two elements.
-// */
-// private void popParenState()
-// {
-// if (stateStack.size() == 0)
-// return;
-//
-// int nextState = ((Integer) stateStack.peek()).intValue();
-// if (PARENMARKER == nextState)
-// {
-// stateStack.pop();
-// stateStack.pop();
-// }
-// }
-
- /**
- * Pop the lexical state stack two elements.
- */
- private void popParenState()
- {
- if (stateStack.size() == 0)
- return;
-
- int nextState = ((Integer) stateStack.peek()).intValue();
- if (PARENMARKER == nextState)
- {
- stateStack.pop();
- stateStack.pop();
- int rparState = ((Integer) stateStack.peek()).intValue();
- SwitchTo(rparState);
- stateStack.pop();
- }
- }
-
- /**
- * Print the current line position.
- */
- public void printLinePos()
- {
- System.err.println("Line: " + input_stream.getEndLine());
- }
-}
-
-<xsl:call-template name="input"/>
-
-<xsl:apply-templates select="*"/>
-</xsl:template>
-
-<xsl:template match="g:state-list"/>
-
-<!-- END SB CHANGE: Make parser productions extensible by an importing
stylesheet -->
-
-
-<xsl:template match="g:token|g:special">
- <xsl:if test="not(@if) or contains(@if,$spec)">
- <xsl:variable name="lexStateTransitions"
select="/g:grammar/g:lexical-state-transitions[not(@if) or
contains(@if,$spec)]"/>
- <xsl:variable name="lexState"
- select="$lexStateTransitions/g:transition[not(@if) or
contains(@if,$spec)][starts-with(concat(@refs, ' '), concat(current()/@name, '
'))
- or contains(concat(@refs, ' '), concat(' ',current()/@name, '
'))]"/>
- <xsl:variable name="defaultLexState"
- select="$lexStateTransitions/g:transition-default[not(@if) or
contains(@if,$spec)][not($lexState)]"/>
-
- <xsl:if test="$defaultLexState">
- <xsl:message>
- <xsl:text>Default transition: </xsl:text><xsl:value-of
select="@name"/>
- </xsl:message>
- </xsl:if>
-
- <xsl:variable name="recognizeLexState" select="$lexState/@recognize |
$defaultLexState/@recognize"/>
-
- <!-- This is a good line to debug the recognize states. -->
- <!-- xsl:message>rec: <xsl:value-of select="@name"/>: <xsl:value-of
select="$recognizeLexState"/></xsl:message -->
- <xsl:if test="$recognizeLexState">
- <xsl:text><</xsl:text>
- <xsl:call-template name="replace-char">
- <xsl:with-param name="string">
- <xsl:value-of select="$recognizeLexState"/>
- </xsl:with-param>
- <xsl:with-param name="from" select="' '"/>
- <xsl:with-param name="to" select="', '"/>
- </xsl:call-template>
- <xsl:text>>
-</xsl:text>
- </xsl:if>
- <xsl:if test="@special='yes'">
- <xsl:text>SPECIAL_</xsl:text>
- </xsl:if>
- <xsl:text>TOKEN :
-{
- < </xsl:text>
- <xsl:if test="not($recognizeLexState)">#</xsl:if>
- <xsl:value-of select="@name"/> : <xsl:call-template name="space"/>
- <xsl:text> ></xsl:text>
- <xsl:choose>
- <xsl:when test="contains($lexState/@action, '(')">
- <xsl:text> { </xsl:text>
- <xsl:value-of select="$lexState/@action"/>
- <xsl:text>; }</xsl:text>
- </xsl:when>
- <xsl:when test="$lexState/@action">
- <xsl:text> { </xsl:text>
- <xsl:value-of select="$lexState/@action"/>
- <xsl:text>(); }</xsl:text>
- </xsl:when>
- </xsl:choose>
-
- <xsl:variable name="nextLexState" select="$lexState/@nextState |
$defaultLexState/@nextState"/>
- <!-- This is a good line to debug the next states. -->
- <!-- xsl:message>nex: <xsl:value-of select="@name"/>: <xsl:value-of
select="$nextLexState"/></xsl:message -->
- <xsl:if test="$nextLexState">
- <xsl:text> : </xsl:text>
- <xsl:value-of select="$nextLexState"/>
- </xsl:if>
-}
-
-</xsl:if>
-</xsl:template>
-
-<xsl:template match="g:skip">
- <xsl:if test="not(@if) or contains(@if,$spec)">
- <xsl:if test="@recognize">
- <xsl:text><</xsl:text>
- <xsl:call-template name="replace-char">
- <xsl:with-param name="string" select="@recognize"/>
- <xsl:with-param name="from" select="' '"/>
- <xsl:with-param name="to" select="', '"/>
- </xsl:call-template>
- <xsl:text>></xsl:text>
- </xsl:if>
-SKIP:
-{
- <<skip_>>
-}
-
-TOKEN :
-{
- < #skip_ : <xsl:call-template name="space"/> >
-}
-
-</xsl:if>
-</xsl:template>
-
-<xsl:template match="g:char|g:string">
- <xsl:if test="@complement='yes'">
- <xsl:text>~</xsl:text>
- </xsl:if>
- <xsl:text>"</xsl:text>
- <xsl:call-template name="replace-char">
- <xsl:with-param name="string" select="."/>
- <xsl:with-param name="from" select="'"'"/>
- <xsl:with-param name="to" select="'\"'"/>
- </xsl:call-template>
- <xsl:text>"</xsl:text>
-</xsl:template>
-
-<!-- For some reason, the JavaCC generated lexer produces a lexical error
for a "]" if
-we use ]]> as a single token. -->
-<xsl:template match="g:string[.=']]>']">
- <xsl:text>("]" "]" ">")</xsl:text>
-</xsl:template>
-
-<xsl:template match="g:[EMAIL PROTECTED]">
- <xsl:text>(</xsl:text>
- <xsl:call-template name="ignore-case">
- <xsl:with-param name="string" select="."/>
- </xsl:call-template>
- <xsl:text>)</xsl:text>
-</xsl:template>
-
-<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
-<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
-
-<xsl:template name="ignore-case">
- <xsl:param name="string" select="''"/>
- <xsl:if test="$string">
- <xsl:variable name="c" select="substring($string,1,1)"/>
- <xsl:variable name="uc" select="translate($c,$lower,$upper)"/>
- <xsl:variable name="lc" select="translate($c,$upper,$lower)"/>
- <xsl:choose>
- <xsl:when test="$lc=$uc">
- <xsl:text>"</xsl:text>
- <xsl:value-of select="$c"/>
- <xsl:text>"</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>["</xsl:text>
- <xsl:value-of select="$uc"/>
- <xsl:text>", "</xsl:text>
- <xsl:value-of select="$lc"/>
- <xsl:text>"]</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="substring($string,2)">
- <xsl:text xml:space="preserve"> </xsl:text>
- </xsl:if>
- <xsl:call-template name="ignore-case">
- <xsl:with-param name="string" select="substring($string,2)"/>
- </xsl:call-template>
- </xsl:if>
-</xsl:template>
-
-<xsl:template match="g:eof"><EOF></xsl:template>
-
-<xsl:template match="g:charCode">
- <xsl:text>"</xsl:text>
- <xsl:choose>
- <xsl:when test="@value='000A'">
- <xsl:text>\n</xsl:text>
- </xsl:when>
- <xsl:when test="@value='000D'">
- <xsl:text>\r</xsl:text>
- </xsl:when>
- <xsl:when test="@value='0009'">
- <xsl:text>\t</xsl:text>
- </xsl:when>
- <xsl:when test="@value='0020'">
- <xsl:text xml:space="preserve"> </xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>\u</xsl:text>
- <xsl:value-of select="@value"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>"</xsl:text>
-</xsl:template>
-
-<xsl:template match="g:charClass">
- <xsl:text>[</xsl:text>
- <xsl:for-each select="*">
- <xsl:if test="position()!=1">
- <xsl:text>, </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="."/>
- </xsl:for-each>
- <xsl:text>]</xsl:text>
-</xsl:template>
-
-<xsl:template match="g:charRange">
- <xsl:text>"</xsl:text>
- <xsl:value-of select="@minChar"/>
- <xsl:text>" - "</xsl:text>
- <xsl:value-of select="@maxChar"/>
- <xsl:text>"</xsl:text>
-</xsl:template>
-
-<xsl:template match="g:charCodeRange">
- <xsl:text>"\u</xsl:text>
- <xsl:value-of select="@minValue"/>
- <xsl:text>" - "\u</xsl:text>
- <xsl:value-of select="@maxValue"/>
- <xsl:text>"</xsl:text>
-</xsl:template>
-
-<xsl:template match="g:complement">~<xsl:apply-templates/></xsl:template>
-
-<xsl:template match="g:production">
- <xsl:if test="not(@if) or contains(@if,$spec)">void <xsl:value-of
select="@name"/>
- <xsl:text>() </xsl:text>
- <xsl:choose>
- <xsl:when test="@is-binary='yes'">
- <xsl:call-template name="action-level-jjtree-label"/>
- </xsl:when>
- <xsl:when test="@node-type">
- <xsl:call-template name="action-level-jjtree-label">
- <xsl:with-param name="label" select="@node-type"/>
- <xsl:with-param name="condition" select="@condition"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
-<xsl:text> :</xsl:text>
-{<xsl:call-template name="action-production"/>}
-{
- <xsl:call-template name="space"/>
- <xsl:call-template name="action-production-end"/>
-}
-
-</xsl:if>
-</xsl:template>
-
-<xsl:template match="g:exprProduction">
-<xsl:if test="not(@if) or contains(@if,$spec)">
-<xsl:variable name="name"
- select="@name"/>void <xsl:value-of select="$name"/>()
<xsl:call-template name="action-exprProduction-label"/> :
-{<xsl:call-template name="action-exprProduction"/>}
-{
- <xsl:variable name="levels" select="g:level[*[not(@if) or
contains(@if,$spec)]]"/>
- <xsl:variable name="nextProd" select="concat($levels[1]/*/@name,'()')"/>
- <xsl:value-of select="$nextProd"/>
- <xsl:call-template name="action-exprProduction-end"/>
-}
-
-<xsl:for-each select="g:level[*[not(@if) or contains(@if,$spec)]]">
- <!-- xsl:variable name="thisProd"
select="concat($name,'_',position(),'()')"/>
- <xsl:variable name="nextProd" select="concat($name,'_',position()+1,'()')"
-/ -->
-<xsl:variable name="thisProd" select="concat(*/@name,'()')"/>
-<xsl:variable name="levels" select="../g:level[*[not(@if) or
contains(@if,$spec)]]"/>
-<xsl:variable name="position" select="position()"/>
-
-<xsl:variable name="nextProd"
select="concat($levels[$position+1]/*/@name,'()')"
-/>void <xsl:value-of select="$thisProd"/>
- <xsl:call-template name="action-level-jjtree-label">
- <xsl:with-param name="label">
- <xsl:choose>
- <xsl:when test="@node-type">
- <xsl:value-of select="@node-type"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:choose>
- <!-- <xsl:when test="not(g:binary) and */g:sequence"> SMPG
-->
- <xsl:when test="g:binary or */g:sequence">
- <xsl:value-of select="*/@name"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>void</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
-
- <!-- Begin SMPG -->
- <xsl:with-param name="condition">
- <xsl:choose>
- <xsl:when test="g:binary or
*/g:sequence">
- <xsl:value-of
select="*/@condition"/>
- </xsl:when>
- <xsl:otherwise/>
- </xsl:choose>
- </xsl:with-param>
- <!-- End SMPG -->
-
- <xsl:with-param name="thisProd" select="$thisProd"/>
- <xsl:with-param name="nextProd" select="$nextProd"/>
- </xsl:call-template> :
-{<xsl:call-template name="action-level">
- <xsl:with-param name="thisProd" select="$thisProd"/>
- <xsl:with-param name="nextProd" select="$nextProd"/>
- </xsl:call-template>}
-{
- <xsl:call-template name="action-level-start"/>
- <xsl:choose>
- <xsl:when test="g:binary and g:postfix">
- <xsl:value-of select="$nextProd"/>
- <xsl:text> ((</xsl:text>
-
- <xsl:call-template name="outputChoices">
- <xsl:with-param name="choices"
- select="g:binary[not(@if) or contains(@if,$spec)]"/>
- <xsl:with-param name="lookahead"
select="ancestor-or-self::*/@lookahead"/>
- </xsl:call-template>
- <xsl:text xml:space="preserve"> </xsl:text>
- <xsl:value-of select="$nextProd"/>
- <!-- xsl:value-of select="concat($name,'_1')"/><xsl:text>()</xsl:text
-->
-
- <xsl:call-template name="binary-action-level-jjtree-label">
- <xsl:with-param name="label" select="*/@name"/>
- <xsl:with-param name="which" select="1"/>
- </xsl:call-template>
-
- <xsl:text>) | </xsl:text>
-
- <xsl:call-template name="outputChoices">
- <xsl:with-param name="choices"
- select="g:postfix[not(@if) or contains(@if,$spec)]"/>
- <xsl:with-param name="lookahead"
select="ancestor-or-self::*/@lookahead"/>
- </xsl:call-template>
- <xsl:text>)*</xsl:text>
- </xsl:when>
-
- <xsl:when test="g:binary">
- <xsl:value-of select="$nextProd"/>
- <xsl:text> (</xsl:text>
- <xsl:call-template name="outputChoices">
- <xsl:with-param name="choices"
- select="g:binary[not(@if) or contains(@if,$spec)]"/>
- <xsl:with-param name="lookahead"
select="ancestor-or-self::*/@lookahead"/>
- </xsl:call-template>
-
- <xsl:text xml:space="preserve"> </xsl:text>
-
- <xsl:value-of select="$nextProd"/>
- <xsl:call-template name="binary-action-level-jjtree-label">
- <xsl:with-param name="label" select="*/@name"/>
- <xsl:with-param name="which" select="2"/>
- </xsl:call-template>
- <!-- xsl:value-of select="concat($name,'_1')"/><xsl:text>()</xsl:text
-->
-
- <!--
- <xsl:variable name="thisName" select="g:binary/@name"/>
- <xsl:text>(</xsl:text>
- <xsl:for-each select="../g:level[*[not(@if) or contains(@if,$spec)]]">
- <xsl:variable name="theExprName"
select="concat($name,'_',position(),'()')"/>
- <xsl:if test="not(*/@name = $thisName)">
- <xsl:value-of select="$theExprName"/>
- <xsl:if test="not(last()=position())"> | </xsl:if>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>)</xsl:text>
- -->
-
- <xsl:text>)</xsl:text>
- <xsl:choose>
- <xsl:when test="g:binary[not(@if) or
contains(@if,$spec)]/@prefix-seq-type">
- <xsl:value-of select="g:binary/@prefix-seq-type"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>*</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:when>
- <xsl:when test="g:postfix">
- <xsl:if test="following-sibling::g:level">
- <xsl:value-of select="$nextProd"/>
- </xsl:if>
- <xsl:text xml:space="preserve"> </xsl:text>
- <xsl:call-template name="outputChoices">
- <xsl:with-param name="choices"
- select="g:postfix[not(@if) or contains(@if,$spec)]"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="g:postfix/@prefix-seq-type">
- <xsl:value-of select="g:postfix/@prefix-seq-type"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>*</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-
- </xsl:when>
- <xsl:when test="g:prefix">
- <xsl:choose>
- <xsl:when test="g:prefix/@suffix-optional='yes'">
- <xsl:text>(</xsl:text>
- <xsl:call-template name="outputChoices">
- <xsl:with-param name="choices"
- select="g:prefix[not(@if) or contains(@if,$spec)]"/>
- </xsl:call-template>
- <xsl:text>(</xsl:text>
- <xsl:value-of select="$nextProd"/>
- <xsl:text>)</xsl:text>
- <xsl:text>? </xsl:text>
- <xsl:value-of select="$nextProd"/>
- <xsl:text>)</xsl:text>
-
- <xsl:text> | </xsl:text>
- <xsl:if test="not(g:prefix//g:next)">
- <xsl:value-of select="$nextProd"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="outputChoices">
- <xsl:with-param name="choices"
- select="g:prefix[not(@if) or contains(@if,$spec)]"/>
- </xsl:call-template>
- <xsl:choose>
- <xsl:when test="g:prefix/@prefix-seq-type">
- <xsl:value-of select="g:prefix/@prefix-seq-type"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>*</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text> </xsl:text>
- <xsl:if test="not(g:prefix//g:next)">
- <xsl:value-of select="$nextProd"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:when test="g:primary">
- <xsl:call-template name="outputChoices">
- <xsl:with-param name="choices"
- select="g:primary[not(@if) or contains(@if,$spec)]"/>
- </xsl:call-template>
- <xsl:if test="g:primary/following-sibling::g:level |
following-sibling::g:level">
- <xsl:text> | </xsl:text>
- <xsl:value-of select="$nextProd"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="action-level-end"/>
-}
-
-</xsl:for-each>
-</xsl:if>
-</xsl:template>
-
-<xsl:template name="outputChoices">
- <xsl:param name="choices" select="/.."/>
- <xsl:param name="lookahead" select="ancestor-or-self::*/@lookahead"/>
-
- <xsl:if test="count($choices)>1">(</xsl:if>
- <xsl:for-each select="$choices">
- <xsl:if test="position()!=1"> | </xsl:if>
- <xsl:if test="count(*)>1">(</xsl:if>
- <xsl:for-each select="*">
- <xsl:if test="position()!=1" xml:space="preserve"> </xsl:if>
- <xsl:apply-templates select="."><xsl:with-param name="lookahead"
select="$lookahead"/></xsl:apply-templates>
- </xsl:for-each>
- <xsl:if test="count(*)>1">)</xsl:if>
- </xsl:for-each>
- <xsl:if test="count($choices)>1">)</xsl:if>
-</xsl:template>
-
-<xsl:template match="g:optional">[<xsl:call-template name="lookahead"/>
-<xsl:call-template name="space"/>]</xsl:template>
-
-<xsl:template match="g:token//g:optional">(<xsl:call-template
name="space"/>)?</xsl:template>
-<xsl:template match="g:zeroOrMore">(<xsl:call-template name="lookahead"/>
-<xsl:call-template name="space"/>)*</xsl:template>
-
-<xsl:template match="g:oneOrMore">(<xsl:call-template name="lookahead"/>
-<xsl:call-template name="space"/>)+ </xsl:template>
-
-<xsl:template match="g:sequence">(<xsl:call-template name="lookahead"/>
-<xsl:call-template name="space"/>)</xsl:template>
-
-<xsl:template match="g:ref">
- <xsl:choose>
- <xsl:when test="key('ref',@name)/self::g:token">
- <xsl:text><</xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>></xsl:text>
- <!-- show when a token match is a success. -sb -->
- <xsl:if test="ancestor::g:level | ancestor::g:production">
- <xsl:call-template name="action-token-ref"/>
- <xsl:if test="ancestor::g:binary">
- <!-- xsl:value-of select="$nextProd"/ -->
-
- <!-- Awww... it's not so bad... -sb -->
- <xsl:if test="false()">
- <xsl:variable name="levels"
select="ancestor::g:exprProduction/g:level[*[not(@if) or
contains(@if,$spec)]]"/>
- <xsl:variable name="position"
select="count(ancestor::g:level/preceding-sibling::g:level[*[not(@if) or
contains(@if,$spec)]])+1"/>
- <xsl:variable name="nextProd"
select="concat($levels[$position+1]/*/@name,'()')"/>
-
- <!-- xsl:variable name="nextProd"
select="concat(ancestor::g:exprProduction/@name,
- '_',
count(ancestor::g:level/preceding-sibling::g:level[*[not(@if) or
contains(@if,$spec)]])+2,'()')"/ -->
-
- <!-- xsl:value-of
select="concat(ancestor::g:exprProduction/@name,'_1')"/ -->
- <!-- xsl:text>()</xsl:text -->
- <xsl:value-of select="$nextProd"/>
-
- <xsl:call-template
name="binary-action-level-jjtree-label">
- <xsl:with-param name="which" select="3"/>
- </xsl:call-template>
- <xsl:text>
-</xsl:text>
- </xsl:if>
- </xsl:if>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@name"/>
- <xsl:text>()</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
-</xsl:template>
-
-<xsl:template match="g:next">
- <!-- The assumption is this we're in a exprProduction,
- in a prefix, primary, etc., and want to call the next level. -->
- <xsl:variable name="levels"
select="ancestor::g:exprProduction[1]/g:level[*[not(@if) or
contains(@if,$spec)]]"/>
- <xsl:variable name="position">
- <xsl:variable name="uniqueIdOfThisLevel"
select="generate-id(ancestor::g:level[1])"/>
- <xsl:for-each select="$levels">
- <xsl:if test="generate-id(.) = $uniqueIdOfThisLevel">
- <xsl:value-of select="position()"/>
- </xsl:if>
- </xsl:for-each>
- </xsl:variable>
- <xsl:variable name="nextProd"
select="concat($levels[$position+1]/*/@name,'()')"/>
- <xsl:value-of select="$nextProd"/>
- <!-- xsl:text>()</xsl:text -->
-</xsl:template>
-
-<xsl:template match="g:choice[not(@if) or contains(@if,$spec)]">
- <xsl:variable name="lookahead" select="ancestor-or-self::*/@lookahead"/>
- <xsl:if test="$lookahead > 0">LOOKAHEAD(<xsl:value-of
select="$lookahead"/>) </xsl:if>
- <xsl:text>(</xsl:text>
- <xsl:for-each select="*[not(@if) or contains(@if,$spec)]">
- <xsl:if test="position()!=1">
- <xsl:text> | </xsl:text>
- </xsl:if>
- <xsl:apply-templates select=".">
- <xsl:with-param name="lookahead" select="$lookahead"/>
- </xsl:apply-templates>
-
- </xsl:for-each>
- <xsl:text>)</xsl:text>
-</xsl:template>
-
-<!-- xsl:template match="g:choice" mode="binary">
- <xsl:param name="name"/>
- <xsl:text>(</xsl:text>
- <xsl:for-each select="*">
- <xsl:if test="position()!=1">
- <xsl:text> | </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="."/>
- <xsl:value-of select="$name"/><xsl:text>()</xsl:text>
- </xsl:for-each>
- <xsl:text>)</xsl:text>
-</xsl:template -->
-
-<xsl:template match="g:requiredSkip">
- <xsl:text>(<skip_>)+</xsl:text>
-</xsl:template>
-
-<xsl:template match="g:optionalSkip">
- <xsl:text>(<skip_>)*</xsl:text>
-</xsl:template>
-
-<xsl:template name="lookahead" match="lookahead">
- <xsl:if test="@lookahead">
- <xsl:text>LOOKAHEAD(</xsl:text>
- <xsl:value-of select="@lookahead"/>
- <xsl:text>) </xsl:text>
- </xsl:if>
-</xsl:template>
-
-<xsl:template name="space">
- <xsl:for-each select="*">
- <xsl:if test="position()!=1">
- <xsl:text> </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="."/>
- </xsl:for-each>
-</xsl:template>
+ Revision 1.1.2.3 2003/02/05 16:09:45 santiagopg
-<xsl:template name="replace-char">
- <xsl:param name="from" select="''"/>
- <xsl:param name="to" select="''"/>
- <xsl:param name="string" select="''"/>
- <xsl:if test="$string">
- <xsl:choose>
- <xsl:when test="substring($string,1,1)=$from">
- <!-- Added this to avoid empty commas in sequences of
- spaces. -sb -->
- <xsl:if test="substring($string,2,1)!=$from">
- <xsl:value-of select="$to"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($string,1,1)"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:call-template name="replace-char">
- <xsl:with-param name="string" select="substring($string, 2)"/>
- <xsl:with-param name="to" select="$to"/>
- <xsl:with-param name="from" select="$from"/>
- </xsl:call-template>
- </xsl:if>
-</xsl:template>
+ Committing latest update from Lionel Villard ([EMAIL PROTECTED]) for
+ XPath API. This update consists of:
-</xsl:stylesheet>
+ - the addition of an external AST node factory: applications can now
+ provide their own AST node implementation (but need to inherit the basic
+ implementation)
+ - the overall improvement of the documentation
+
+ Known problems:
+ - parentherized expressions are not correctly reduced
+ - the implementation is still partial
+
+ Revision 1.1.2.1.2.1 2002/11/13 05:27:33 sboag
+ Integrated new grammar from Nov. 15th draft, with a small tweak to allow
multiple
+ comparison expressions (to allow success of xpath1 parsing).
+
+ Revision 1.14 2002/11/06 07:42:25 sboag
+ 1) I did some work on BNF production numbering. At least it is consecutive
+ now in regards to the defined tokens.
+
+ 2) (XQuery only) I added URL Literal to the main list of literals, and
added a
+ short note that it is defined equivalently to string literal. URL Literal
has to
+ exist right now for relatively esoteric purposes for transitioning the
lexical
+ state (to DEFAULT rather than OPERATOR as StringLiteral does). It is
+ used in DefaultCollationDecl, NamespaceDecl, SubNamespaceDecl, and
+ DefaultNamespaceDecl. To be clear, URL Literal was already in the August
+ draft, I just added it to the list of literals in the main doc.
+
+ Revision 1.13 2002/10/22 16:51:08 sboag
+ New Grammar Issues List. New productions:
+ OrderBy, ComputedTextConstructor, PositionVar, Castable, As (TypeDecl).
+ Removed:
+ unordered, SortExpr
+ Fixed reserved word bugs with:
+ empty, stable
+ Other minor "fixes":
+ Change precedence of UnaryExpr to be looser binding than UnionExpr
+ Change RangeExpr to only allow one "to".
+
+ Revision 1.12 2002/07/28 19:54:13 sboag
+ Fixed problems with import, '*', '?', and ',', reported by Jonathan and
Dana.
+
+ Revision 1.11 2002/07/18 01:17:39 sboag
+ Fixed some bugs.
+
+ Revision 1.10 2002/07/15 07:25:47 sboag
+ Bug fixes, added match patterns, and responses to
+ Don's email
http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2002Jul/0156.html.
+
+ Revision 1.9 2002/06/28 09:02:07 sboag
+ Merged Don's latest work with new grammar proposal. Changes too numerous
+ to detail.
+
+ Revision 1.8 2002/03/17 21:31:08 sboag
+ Made new grammar element, <next/> for use in primary or prefix expressions,
+ to control when the next element is going to be called. Somewhat
experemental.
+
+ Changed javacc stylesheet and bnf stylesheets to handle g:next.
+
+ Fixed bugs with child::text(), by adding text, comment, etc., tokens to
after forward
+ or reverse axis. (note: have to do the same to names after @). This is
yet
+ another bad hack.
+
+ Fixed bug with @type, by adding At token to lexical stateswitch into QNAME
state
+ for XQuery.
+
+ Revision 1.7 2002/03/13 15:45:05 sboag
+ Don changes (XPathXQuery.xml, introduction.xml, fragment.xml):
+ I have attempted to update these files with the latest terminology
+ (mainly changing "simple value" to "atomic value" and related changes.)
+
+ Grammar changes:
+ Moral equal of Philip Wadler's structural changes of 02/05/2002.
+ Make lookahead(2) so that ElementNameOrFunctionCall can be broken up
+ without using long tokens.
+ Integrated Robie's SequenceType productions.
+ Added Add Validate Production.
+ Reviewed and tweaked changes against Named Typing proposal.
+ Fixed Dana's bug about ContentElementConstructor and
+ ContentAttributeConstructor in ElementContent.
+ Allow multiple variable binding for some/every.
+ Lift restrictions of "." and "..".
+ add XmlComment and XmlProcessingInstruction and also CdataSection to the
+ Constructor production.
+ Remove The Ref and Colon tokens.
+ Made multiply & star one token for XQuery, in spite of the fact that this
causes
+ ambiguity.
+ Remove XQUERY_COMMENT state that is never entered.
+ Add QNAME lexical state for qnames following explicit axes, i.e.
child::div.
+ BUG: child::text() will fail in XQuery.
+ BUG: Validate does not work so well for XPath.
+
+ Revision 1.6 2002/03/06 12:40:55 sboag
+ Tweak to make it possible to have prefix productions with optional
suffixes.
+
+ Revision 1.5 2001/12/09 22:07:16 sboag
+ Fixed problem with comments from previous checkin.
+
+ -sb 10/29/01 Make parser productions extensible by an importing
stylesheet.
+ ============== END CHANGE LOG ============== -->
+
+<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:g="http://www.w3.org/2001/03/XPath/grammar">
+
+ <xsl:param name="spec" select="'xquery'"/>
+
+ <xsl:strip-space elements="*"/>
+ <!-- workaround for Xalan bug. -->
+ <xsl:preserve-space elements="g:char"/>
+
+ <xsl:output method="text" encoding="iso-8859-1"/>
+
+ <xsl:key name="ref" match="g:token[not(@if) or contains(@if,$spec)]
+ |g:production[not(@if) or contains(@if,$spec)]"
+ use="@name"/>
+
+
+ <!-- empty template to help screen out those elements that do not
+ match the given spec. -->
+ <xsl:template match="g:[EMAIL PROTECTED] and not(contains(@if,$spec))]"
+ priority="2000"/>
+
+ <xsl:template name="parser">
+ PARSER_BEGIN(XPath)
+
+ public class XPath {
+ public static void main(String args[]) throws ParseException {
+ XPath parser = new XPath(System.in);
+ parser.Input();
+ }
+ }
+
+ PARSER_END(XPath)
+ </xsl:template>
+
+<!-- Action templates for overrides from derived stylesheets -->
+
+<xsl:template name="action-production">
+</xsl:template>
+
+<xsl:template name="action-production-end">
+</xsl:template>
+
+<xsl:template name="action-exprProduction">
+</xsl:template>
+
+<xsl:template name="action-exprProduction-label">
+</xsl:template>
+
+<xsl:template name="action-exprProduction-end">
+</xsl:template>
+
+<xsl:template name="action-level">
+</xsl:template>
+
+<xsl:template name="action-level-jjtree-label"></xsl:template>
+<xsl:template name="binary-action-level-jjtree-label"></xsl:template>
+
+<xsl:template name="action-level-start">
+</xsl:template>
+
+<xsl:template name="action-level-end">
+</xsl:template>
+
+<xsl:template name="action-token-ref">
+</xsl:template>
+
+<xsl:template name="javacc-options">
+ STATIC = false;
+ LOOKAHEAD = 1;
+</xsl:template>
+
+<xsl:template name="input">
+ void Input() :
+ {}
+ {
+ <xsl:value-of select="g:start[not(@if) or
contains(@if,$spec)]/@name"/>()<EOF>
+ }
+</xsl:template>
+
+<xsl:template match="g:grammar">options {
+<xsl:call-template name="javacc-options"/>
+}
+
+<xsl:call-template name="parser"/>
+
+// jwr: why doesn't this use java.util.Stack() instead of java.util.Vector()?
+
+TOKEN_MGR_DECLS : {
+ private Stack stateStack = new Stack();
+ static final int PARENMARKER = 2000;
+
+ /**
+ * Push the current state onto the state stack.
+ */
+ private void pushState()
+ {
+ stateStack.addElement(new Integer(curLexState));
+ }
+
+ /**
+ * Push the given state onto the state stack.
+ * @param state Must be a valid state.
+ */
+ private void pushState(int state)
+ {
+ stateStack.push(new Integer(state));
+ }
+
+ /**
+ * Pop the state on the state stack, and switch to that state.
+ */
+ private void popState()
+ {
+ if (stateStack.size() == 0)
+ {
+ printLinePos();
+ }
+
+ int nextState = ((Integer) stateStack.pop()).intValue();
+ if(nextState == PARENMARKER)
+ printLinePos();
+ SwitchTo(nextState);
+ }
+
+ /**
+ * Push a parenthesis state. This pushes, in addition to the
+ * lexical state value, a special marker that lets
+ * resetParenStateOrSwitch(int state)
+ * know if it should pop and switch. Used for the comma operator.
+ */
+ private void pushParenState(int commaState, int rparState)
+ {
+ stateStack.push(new Integer(rparState));
+ stateStack.push(new Integer(commaState));
+ stateStack.push(new Integer(PARENMARKER));
+ SwitchTo(commaState);
+ }
+
+
+// /**
+// * Push a parenthesis state. This pushes, in addition to the
+// * lexical state value, a special marker that lets
+// * resetParenStateOrSwitch(int state)
+// * know if it should pop and switch. Used for the comma operator.
+// */
+// private void pushParenState()
+// {
+// stateStack.push(new Integer(curLexState));
+// stateStack.push(new Integer(PARENMARKER));
+// }
+
+ /**
+ * If a PARENMARKER is on the stack, switch the state to
+ * the state underneath the marker. Leave the stack in
+ * the same state. If the stack is zero, do nothing.
+ * @param state The state to switch to if the PARENMARKER is not found.
+ */
+ private void resetParenStateOrSwitch(int state)
+ {
+ if (stateStack.size() == 0)
+ {
+ SwitchTo(state);
+ return;
+ }
+
+ int nextState = ((Integer) stateStack.peek()).intValue();
+ if (PARENMARKER == nextState)
+ {
+ // Wait for right paren to do the pop!
+ Integer intObj = (Integer) stateStack.elementAt(stateStack.size() - 2);
+ nextState = intObj.intValue();
+ SwitchTo(nextState);
+ }
+ else
+ SwitchTo(state);
+ }
+
+// /**
+// * Pop the lexical state stack two elements.
+// */
+// private void popParenState()
+// {
+// if (stateStack.size() == 0)
+// return;
+//
+// int nextState = ((Integer) stateStack.peek()).intValue();
+// if (PARENMARKER == nextState)
+// {
+// stateStack.pop();
+// stateStack.pop();
+// }
+// }
+
+ /**
+ * Pop the lexical state stack two elements.
+ */
+ private void popParenState()
+ {
+ if (stateStack.size() == 0)
+ return;
+
+ int nextState = ((Integer) stateStack.peek()).intValue();
+ if (PARENMARKER == nextState)
+ {
+ stateStack.pop();
+ stateStack.pop();
+ int rparState = ((Integer) stateStack.peek()).intValue();
+ SwitchTo(rparState);
+ stateStack.pop();
+ }
+ }
+
+ /**
+ * Print the current line position.
+ */
+ public void printLinePos()
+ {
+ System.err.println("Line: " + input_stream.getEndLine());
+ }
+}
+
+<xsl:call-template name="input"/>
+
+<xsl:apply-templates select="*"/>
+</xsl:template>
+
+<xsl:template match="g:state-list"/>
+
+<!-- END SB CHANGE: Make parser productions extensible by an importing
stylesheet -->
+
+
+<xsl:template match="g:token|g:special">
+ <xsl:if test="not(@if) or contains(@if,$spec)">
+ <xsl:variable name="lexStateTransitions"
select="/g:grammar/g:lexical-state-transitions[not(@if) or
contains(@if,$spec)]"/>
+ <xsl:variable name="lexState"
+ select="$lexStateTransitions/g:transition[not(@if) or
contains(@if,$spec)][starts-with(concat(@refs, ' '), concat(current()/@name, '
'))
+ or contains(concat(@refs, ' '), concat(' ',current()/@name, '
'))]"/>
+ <xsl:variable name="defaultLexState"
+ select="$lexStateTransitions/g:transition-default[not(@if) or
contains(@if,$spec)][not($lexState)]"/>
+
+ <xsl:if test="$defaultLexState">
+ <xsl:message>
+ <xsl:text>Default transition: </xsl:text><xsl:value-of
select="@name"/>
+ </xsl:message>
+ </xsl:if>
+
+ <xsl:variable name="recognizeLexState" select="$lexState/@recognize |
$defaultLexState/@recognize"/>
+
+ <!-- This is a good line to debug the recognize states. -->
+ <!-- xsl:message>rec: <xsl:value-of select="@name"/>: <xsl:value-of
select="$recognizeLexState"/></xsl:message -->
+ <xsl:if test="$recognizeLexState">
+ <xsl:text><</xsl:text>
+ <xsl:call-template name="replace-char">
+ <xsl:with-param name="string">
+ <xsl:value-of select="$recognizeLexState"/>
+ </xsl:with-param>
+ <xsl:with-param name="from" select="' '"/>
+ <xsl:with-param name="to" select="', '"/>
+ </xsl:call-template>
+ <xsl:text>>
+</xsl:text>
+ </xsl:if>
+ <xsl:if test="@special='yes'">
+ <xsl:text>SPECIAL_</xsl:text>
+ </xsl:if>
+ <xsl:text>TOKEN :
+{
+ < </xsl:text>
+ <xsl:if test="not($recognizeLexState)">#</xsl:if>
+ <xsl:value-of select="@name"/> : <xsl:call-template name="space"/>
+ <xsl:text> ></xsl:text>
+ <xsl:choose>
+ <xsl:when test="contains($lexState/@action, '(')">
+ <xsl:text> { </xsl:text>
+ <xsl:value-of select="$lexState/@action"/>
+ <xsl:text>; }</xsl:text>
+ </xsl:when>
+ <xsl:when test="$lexState/@action">
+ <xsl:text> { </xsl:text>
+ <xsl:value-of select="$lexState/@action"/>
+ <xsl:text>(); }</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+
+ <xsl:variable name="nextLexState" select="$lexState/@nextState |
$defaultLexState/@nextState"/>
+ <!-- This is a good line to debug the next states. -->
+ <!-- xsl:message>nex: <xsl:value-of select="@name"/>: <xsl:value-of
select="$nextLexState"/></xsl:message -->
+ <xsl:if test="$nextLexState">
+ <xsl:text> : </xsl:text>
+ <xsl:value-of select="$nextLexState"/>
+ </xsl:if>
+}
+
+</xsl:if>
+</xsl:template>
+
+<xsl:template match="g:skip">
+ <xsl:if test="not(@if) or contains(@if,$spec)">
+ <xsl:if test="@recognize">
+ <xsl:text><</xsl:text>
+ <xsl:call-template name="replace-char">
+ <xsl:with-param name="string" select="@recognize"/>
+ <xsl:with-param name="from" select="' '"/>
+ <xsl:with-param name="to" select="', '"/>
+ </xsl:call-template>
+ <xsl:text>></xsl:text>
+ </xsl:if>
+SKIP:
+{
+ <<skip_>>
+}
+
+TOKEN :
+{
+ < #skip_ : <xsl:call-template name="space"/> >
+}
+
+</xsl:if>
+</xsl:template>
+
+<xsl:template match="g:char|g:string">
+ <xsl:if test="@complement='yes'">
+ <xsl:text>~</xsl:text>
+ </xsl:if>
+ <xsl:text>"</xsl:text>
+ <xsl:call-template name="replace-char">
+ <xsl:with-param name="string" select="."/>
+ <xsl:with-param name="from" select="'"'"/>
+ <xsl:with-param name="to" select="'\"'"/>
+ </xsl:call-template>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
+<!-- For some reason, the JavaCC generated lexer produces a lexical error
for a "]" if
+we use ]]> as a single token. -->
+<xsl:template match="g:string[.=']]>']">
+ <xsl:text>("]" "]" ">")</xsl:text>
+</xsl:template>
+
+<xsl:template match="g:[EMAIL PROTECTED]">
+ <xsl:text>(</xsl:text>
+ <xsl:call-template name="ignore-case">
+ <xsl:with-param name="string" select="."/>
+ </xsl:call-template>
+ <xsl:text>)</xsl:text>
+</xsl:template>
+
+<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
+<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
+
+<xsl:template name="ignore-case">
+ <xsl:param name="string" select="''"/>
+ <xsl:if test="$string">
+ <xsl:variable name="c" select="substring($string,1,1)"/>
+ <xsl:variable name="uc" select="translate($c,$lower,$upper)"/>
+ <xsl:variable name="lc" select="translate($c,$upper,$lower)"/>
+ <xsl:choose>
+ <xsl:when test="$lc=$uc">
+ <xsl:text>"</xsl:text>
+ <xsl:value-of select="$c"/>
+ <xsl:text>"</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>["</xsl:text>
+ <xsl:value-of select="$uc"/>
+ <xsl:text>", "</xsl:text>
+ <xsl:value-of select="$lc"/>
+ <xsl:text>"]</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:if test="substring($string,2)">
+ <xsl:text xml:space="preserve"> </xsl:text>
+ </xsl:if>
+ <xsl:call-template name="ignore-case">
+ <xsl:with-param name="string" select="substring($string,2)"/>
+ </xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template match="g:eof"><EOF></xsl:template>
+
+<xsl:template match="g:charCode">
+ <xsl:text>"</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@value='000A'">
+ <xsl:text>\n</xsl:text>
+ </xsl:when>
+ <xsl:when test="@value='000D'">
+ <xsl:text>\r</xsl:text>
+ </xsl:when>
+ <xsl:when test="@value='0009'">
+ <xsl:text>\t</xsl:text>
+ </xsl:when>
+ <xsl:when test="@value='0020'">
+ <xsl:text xml:space="preserve"> </xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>\u</xsl:text>
+ <xsl:value-of select="@value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
+<xsl:template match="g:charClass">
+ <xsl:text>[</xsl:text>
+ <xsl:for-each select="*">
+ <xsl:if test="position()!=1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
+ <xsl:text>]</xsl:text>
+</xsl:template>
+
+<xsl:template match="g:charRange">
+ <xsl:text>"</xsl:text>
+ <xsl:value-of select="@minChar"/>
+ <xsl:text>" - "</xsl:text>
+ <xsl:value-of select="@maxChar"/>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
+<xsl:template match="g:charCodeRange">
+ <xsl:text>"\u</xsl:text>
+ <xsl:value-of select="@minValue"/>
+ <xsl:text>" - "\u</xsl:text>
+ <xsl:value-of select="@maxValue"/>
+ <xsl:text>"</xsl:text>
+</xsl:template>
+
+<xsl:template match="g:complement">~<xsl:apply-templates/></xsl:template>
+
+<xsl:template match="g:production">
+ <xsl:if test="not(@if) or contains(@if,$spec)">void <xsl:value-of
select="@name"/>
+ <xsl:text>() </xsl:text>
+ <xsl:choose>
+ <xsl:when test="@is-binary='yes'">
+ <xsl:call-template name="action-level-jjtree-label"/>
+ </xsl:when>
+ <xsl:when test="@node-type">
+ <xsl:call-template name="action-level-jjtree-label">
+ <xsl:with-param name="label" select="@node-type"/>
+ <xsl:with-param name="condition" select="@condition"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+<xsl:text> :</xsl:text>
+{<xsl:call-template name="action-production"/>}
+{
+ <xsl:call-template name="space"/>
+ <xsl:call-template name="action-production-end"/>
+}
+
+</xsl:if>
+</xsl:template>
+
+<xsl:template match="g:exprProduction">
+<xsl:if test="not(@if) or contains(@if,$spec)">
+<xsl:variable name="name"
+ select="@name"/>void <xsl:value-of select="$name"/>()
<xsl:call-template name="action-exprProduction-label"/> :
+{<xsl:call-template name="action-exprProduction"/>}
+{
+ <xsl:variable name="levels" select="g:level[*[not(@if) or
contains(@if,$spec)]]"/>
+ <xsl:variable name="nextProd" select="concat($levels[1]/*/@name,'()')"/>
+ <xsl:value-of select="$nextProd"/>
+ <xsl:call-template name="action-exprProduction-end"/>
+}
+
+<xsl:for-each select="g:level[*[not(@if) or contains(@if,$spec)]]">
+ <!-- xsl:variable name="thisProd"
select="concat($name,'_',position(),'()')"/>
+ <xsl:variable name="nextProd" select="concat($name,'_',position()+1,'()')"
+/ -->
+<xsl:variable name="thisProd" select="concat(*/@name,'()')"/>
+<xsl:variable name="levels" select="../g:level[*[not(@if) or
contains(@if,$spec)]]"/>
+<xsl:variable name="position" select="position()"/>
+
+<xsl:variable name="nextProd"
select="concat($levels[$position+1]/*/@name,'()')"
+/>void <xsl:value-of select="$thisProd"/>
+ <xsl:call-template name="action-level-jjtree-label">
+ <xsl:with-param name="label">
+ <xsl:choose>
+ <xsl:when test="@node-type">
+ <xsl:value-of select="@node-type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:choose>
+ <!-- <xsl:when test="not(g:binary) and */g:sequence"> SMPG
-->
+ <xsl:when test="g:binary or */g:sequence">
+ <xsl:value-of select="*/@name"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>void</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:with-param>
+
+ <!-- Begin SMPG -->
+ <xsl:with-param name="condition">
+ <xsl:choose>
+ <xsl:when test="g:binary or
*/g:sequence">
+ <xsl:value-of
select="*/@condition"/>
+ </xsl:when>
+ <xsl:otherwise/>
+ </xsl:choose>
+ </xsl:with-param>
+ <!-- End SMPG -->
+
+ <xsl:with-param name="thisProd" select="$thisProd"/>
+ <xsl:with-param name="nextProd" select="$nextProd"/>
+ </xsl:call-template> :
+{<xsl:call-template name="action-level">
+ <xsl:with-param name="thisProd" select="$thisProd"/>
+ <xsl:with-param name="nextProd" select="$nextProd"/>
+ </xsl:call-template>}
+{
+ <xsl:call-template name="action-level-start"/>
+ <xsl:choose>
+ <xsl:when test="g:binary and g:postfix">
+ <xsl:value-of select="$nextProd"/>
+ <xsl:text> ((</xsl:text>
+
+ <xsl:call-template name="outputChoices">
+ <xsl:with-param name="choices"
+ select="g:binary[not(@if) or contains(@if,$spec)]"/>
+ <xsl:with-param name="lookahead"
select="ancestor-or-self::*/@lookahead"/>
+ </xsl:call-template>
+ <xsl:text xml:space="preserve"> </xsl:text>
+ <xsl:value-of select="$nextProd"/>
+ <!-- xsl:value-of select="concat($name,'_1')"/><xsl:text>()</xsl:text
-->
+
+ <xsl:call-template name="binary-action-level-jjtree-label">
+ <xsl:with-param name="label" select="*/@name"/>
+ <xsl:with-param name="which" select="1"/>
+ </xsl:call-template>
+
+ <xsl:text>) | </xsl:text>
+
+ <xsl:call-template name="outputChoices">
+ <xsl:with-param name="choices"
+ select="g:postfix[not(@if) or contains(@if,$spec)]"/>
+ <xsl:with-param name="lookahead"
select="ancestor-or-self::*/@lookahead"/>
+ </xsl:call-template>
+ <xsl:text>)*</xsl:text>
+ </xsl:when>
+
+ <xsl:when test="g:binary">
+ <xsl:value-of select="$nextProd"/>
+ <xsl:text> (</xsl:text>
+ <xsl:call-template name="outputChoices">
+ <xsl:with-param name="choices"
+ select="g:binary[not(@if) or contains(@if,$spec)]"/>
+ <xsl:with-param name="lookahead"
select="ancestor-or-self::*/@lookahead"/>
+ </xsl:call-template>
+
+ <xsl:text xml:space="preserve"> </xsl:text>
+
+ <xsl:value-of select="$nextProd"/>
+ <xsl:call-template name="binary-action-level-jjtree-label">
+ <xsl:with-param name="label" select="*/@name"/>
+ <xsl:with-param name="which" select="2"/>
+ </xsl:call-template>
+ <!-- xsl:value-of select="concat($name,'_1')"/><xsl:text>()</xsl:text
-->
+
+ <!--
+ <xsl:variable name="thisName" select="g:binary/@name"/>
+ <xsl:text>(</xsl:text>
+ <xsl:for-each select="../g:level[*[not(@if) or contains(@if,$spec)]]">
+ <xsl:variable name="theExprName"
select="concat($name,'_',position(),'()')"/>
+ <xsl:if test="not(*/@name = $thisName)">
+ <xsl:value-of select="$theExprName"/>
+ <xsl:if test="not(last()=position())"> | </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text>)</xsl:text>
+ -->
+
+ <xsl:text>)</xsl:text>
+ <xsl:choose>
+ <xsl:when test="g:binary[not(@if) or
contains(@if,$spec)]/@prefix-seq-type">
+ <xsl:value-of select="g:binary/@prefix-seq-type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>*</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:when>
+ <xsl:when test="g:postfix">
+ <xsl:if test="following-sibling::g:level">
+ <xsl:value-of select="$nextProd"/>
+ </xsl:if>
+ <xsl:text xml:space="preserve"> </xsl:text>
+ <xsl:call-template name="outputChoices">
+ <xsl:with-param name="choices"
+ select="g:postfix[not(@if) or contains(@if,$spec)]"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="g:postfix/@prefix-seq-type">
+ <xsl:value-of select="g:postfix/@prefix-seq-type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>*</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+
+ </xsl:when>
+ <xsl:when test="g:prefix">
+ <xsl:choose>
+ <xsl:when test="g:prefix/@suffix-optional='yes'">
+ <xsl:text>(</xsl:text>
+ <xsl:call-template name="outputChoices">
+ <xsl:with-param name="choices"
+ select="g:prefix[not(@if) or contains(@if,$spec)]"/>
+ </xsl:call-template>
+ <xsl:text>(</xsl:text>
+ <xsl:value-of select="$nextProd"/>
+ <xsl:text>)</xsl:text>
+ <xsl:text>? </xsl:text>
+ <xsl:value-of select="$nextProd"/>
+ <xsl:text>)</xsl:text>
+
+ <xsl:text> | </xsl:text>
+ <xsl:if test="not(g:prefix//g:next)">
+ <xsl:value-of select="$nextProd"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="outputChoices">
+ <xsl:with-param name="choices"
+ select="g:prefix[not(@if) or contains(@if,$spec)]"/>
+ </xsl:call-template>
+ <xsl:choose>
+ <xsl:when test="g:prefix/@prefix-seq-type">
+ <xsl:value-of select="g:prefix/@prefix-seq-type"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>*</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:if test="not(g:prefix//g:next)">
+ <xsl:value-of select="$nextProd"/>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:when test="g:primary">
+ <xsl:call-template name="outputChoices">
+ <xsl:with-param name="choices"
+ select="g:primary[not(@if) or contains(@if,$spec)]"/>
+ </xsl:call-template>
+ <xsl:if test="g:primary/following-sibling::g:level |
following-sibling::g:level">
+ <xsl:text> | </xsl:text>
+ <xsl:value-of select="$nextProd"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="action-level-end"/>
+}
+
+</xsl:for-each>
+</xsl:if>
+</xsl:template>
+
+<xsl:template name="outputChoices">
+ <xsl:param name="choices" select="/.."/>
+ <xsl:param name="lookahead" select="ancestor-or-self::*/@lookahead"/>
+
+ <xsl:if test="count($choices)>1">(</xsl:if>
+ <xsl:for-each select="$choices">
+ <xsl:if test="position()!=1"> | </xsl:if>
+ <xsl:if test="count(*)>1">(</xsl:if>
+ <xsl:for-each select="*">
+ <xsl:if test="position()!=1" xml:space="preserve"> </xsl:if>
+ <xsl:apply-templates select="."><xsl:with-param name="lookahead"
select="$lookahead"/></xsl:apply-templates>
+ </xsl:for-each>
+ <xsl:if test="count(*)>1">)</xsl:if>
+ </xsl:for-each>
+ <xsl:if test="count($choices)>1">)</xsl:if>
+</xsl:template>
+
+<xsl:template match="g:optional">[<xsl:call-template name="lookahead"/>
+<xsl:call-template name="space"/>]</xsl:template>
+
+<xsl:template match="g:token//g:optional">(<xsl:call-template
name="space"/>)?</xsl:template>
+<xsl:template match="g:zeroOrMore">(<xsl:call-template name="lookahead"/>
+<xsl:call-template name="space"/>)*</xsl:template>
+
+<xsl:template match="g:oneOrMore">(<xsl:call-template name="lookahead"/>
+<xsl:call-template name="space"/>)+ </xsl:template>
+
+<xsl:template match="g:sequence">(<xsl:call-template name="lookahead"/>
+<xsl:call-template name="space"/>)</xsl:template>
+
+<xsl:template match="g:ref">
+ <xsl:choose>
+ <xsl:when test="key('ref',@name)/self::g:token">
+ <xsl:text><</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>></xsl:text>
+ <!-- show when a token match is a success. -sb -->
+ <xsl:if test="ancestor::g:level | ancestor::g:production">
+ <xsl:call-template name="action-token-ref"/>
+ <xsl:if test="ancestor::g:binary">
+ <!-- xsl:value-of select="$nextProd"/ -->
+
+ <!-- Awww... it's not so bad... -sb -->
+ <xsl:if test="false()">
+ <xsl:variable name="levels"
select="ancestor::g:exprProduction/g:level[*[not(@if) or
contains(@if,$spec)]]"/>
+ <xsl:variable name="position"
select="count(ancestor::g:level/preceding-sibling::g:level[*[not(@if) or
contains(@if,$spec)]])+1"/>
+ <xsl:variable name="nextProd"
select="concat($levels[$position+1]/*/@name,'()')"/>
+
+ <!-- xsl:variable name="nextProd"
select="concat(ancestor::g:exprProduction/@name,
+ '_',
count(ancestor::g:level/preceding-sibling::g:level[*[not(@if) or
contains(@if,$spec)]])+2,'()')"/ -->
+
+ <!-- xsl:value-of
select="concat(ancestor::g:exprProduction/@name,'_1')"/ -->
+ <!-- xsl:text>()</xsl:text -->
+ <xsl:value-of select="$nextProd"/>
+
+ <xsl:call-template
name="binary-action-level-jjtree-label">
+ <xsl:with-param name="which" select="3"/>
+ </xsl:call-template>
+ <xsl:text>
+</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@name"/>
+ <xsl:text>()</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="g:next">
+ <!-- The assumption is this we're in a exprProduction,
+ in a prefix, primary, etc., and want to call the next level. -->
+ <xsl:variable name="levels"
select="ancestor::g:exprProduction[1]/g:level[*[not(@if) or
contains(@if,$spec)]]"/>
+ <xsl:variable name="position">
+ <xsl:variable name="uniqueIdOfThisLevel"
select="generate-id(ancestor::g:level[1])"/>
+ <xsl:for-each select="$levels">
+ <xsl:if test="generate-id(.) = $uniqueIdOfThisLevel">
+ <xsl:value-of select="position()"/>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:variable>
+ <xsl:variable name="nextProd"
select="concat($levels[$position+1]/*/@name,'()')"/>
+ <xsl:value-of select="$nextProd"/>
+ <!-- xsl:text>()</xsl:text -->
+</xsl:template>
+
+<xsl:template match="g:choice[not(@if) or contains(@if,$spec)]">
+ <xsl:variable name="lookahead" select="ancestor-or-self::*/@lookahead"/>
+ <xsl:if test="$lookahead > 0">LOOKAHEAD(<xsl:value-of
select="$lookahead"/>) </xsl:if>
+ <xsl:text>(</xsl:text>
+ <xsl:for-each select="*[not(@if) or contains(@if,$spec)]">
+ <xsl:if test="position()!=1">
+ <xsl:text> | </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates select=".">
+ <xsl:with-param name="lookahead" select="$lookahead"/>
+ </xsl:apply-templates>
+
+ </xsl:for-each>
+ <xsl:text>)</xsl:text>
+</xsl:template>
+
+<!-- xsl:template match="g:choice" mode="binary">
+ <xsl:param name="name"/>
+ <xsl:text>(</xsl:text>
+ <xsl:for-each select="*">
+ <xsl:if test="position()!=1">
+ <xsl:text> | </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates select="."/>
+ <xsl:value-of select="$name"/><xsl:text>()</xsl:text>
+ </xsl:for-each>
+ <xsl:text>)</xsl:text>
+</xsl:template -->
+
+<xsl:template match="g:requiredSkip">
+ <xsl:text>(<skip_>)+</xsl:text>
+</xsl:template>
+
+<xsl:template match="g:optionalSkip">
+ <xsl:text>(<skip_>)*</xsl:text>
+</xsl:template>
+
+<xsl:template name="lookahead" match="lookahead">
+ <xsl:if test="@lookahead">
+ <xsl:text>LOOKAHEAD(</xsl:text>
+ <xsl:value-of select="@lookahead"/>
+ <xsl:text>) </xsl:text>
+ </xsl:if>
+</xsl:template>
+
+<xsl:template name="space">
+ <xsl:for-each select="*">
+ <xsl:if test="position()!=1">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:apply-templates select="."/>
+ </xsl:for-each>
+</xsl:template>
+
+<xsl:template name="replace-char">
+ <xsl:param name="from" select="''"/>
+ <xsl:param name="to" select="''"/>
+ <xsl:param name="string" select="''"/>
+ <xsl:if test="$string">
+ <xsl:choose>
+ <xsl:when test="substring($string,1,1)=$from">
+ <!-- Added this to avoid empty commas in sequences of
+ spaces. -sb -->
+ <xsl:if test="substring($string,2,1)!=$from">
+ <xsl:value-of select="$to"/>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="substring($string,1,1)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:call-template name="replace-char">
+ <xsl:with-param name="string" select="substring($string, 2)"/>
+ <xsl:with-param name="to" select="$to"/>
+ <xsl:with-param name="from" select="$from"/>
+ </xsl:call-template>
+ </xsl:if>
+</xsl:template>
+
+</xsl:stylesheet>
1.1.2.3 +331 -324 xml-xalan/java/xpath_rwapi/grammar/Attic/jjtree.xsl
Index: jjtree.xsl
===================================================================
RCS file: /home/cvs/xml-xalan/java/xpath_rwapi/grammar/Attic/jjtree.xsl,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- jjtree.xsl 23 Jan 2003 19:36:46 -0000 1.1.2.2
+++ jjtree.xsl 5 Feb 2003 16:09:45 -0000 1.1.2.3
@@ -1,324 +1,331 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
- * Copyright (c) 2002 World Wide Web Consortium,
- * (Massachusetts Institute of Technology, Institut National de
- * Recherche en Informatique et en Automatique, Keio University). All
- * Rights Reserved. This program is distributed under the W3C's Software
- * Intellectual Property License. This program is distributed in the
- * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
- * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
- * PURPOSE.
- * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
--->
-
-<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
-
xmlns:g="http://www.w3.org/2001/03/XPath/grammar">
- <xsl:import href="javacc.xsl"/>
-
- <xsl:template name="javacc-options">
- <!-- xsl:apply-imports/ -->
- STATIC = false;
- MULTI=false;
- VISITOR=true ; // invokes the JJTree Visitor support
- NODE_SCOPE_HOOK=false;
- NODE_USES_PARSER=true;
- </xsl:template>
-
- <xsl:template name="input">
- SimpleNode <xsl:choose>
- <xsl:when test="$spec='xquery'">XPath2</xsl:when>
- <xsl:when test="$spec='xpath'">XPath2</xsl:when>
- <xsl:when test="$spec='pathx1'">XPath2</xsl:when>
- <xsl:otherwise>XPath2</xsl:otherwise>
- </xsl:choose>() :
- {}
- {
- <xsl:value-of select="g:start[not(@if) or
contains(@if,$spec)]/@name"/>()<EOF>
- { return jjtThis ; }
- }
- <xsl:if test="$spec='xpath' or $spec='pathx1'">
- SimpleNode <xsl:choose>
- <xsl:when test="$spec='xpath'">MatchPattern</xsl:when>
- <xsl:when test="$spec='pathx1'">MatchPattern</xsl:when>
- <xsl:otherwise>MatchPattern</xsl:otherwise>
- </xsl:choose>() :
- {m_isMatchPattern = true;}
- {
- <xsl:value-of
select="g:start[contains(@if,'match')]/@name"/>()<EOF>
- { return jjtThis ; }
- }
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="extra-parser-code"/>
-
- <xsl:template name="parser">
- <xsl:variable name="parser-class">
- <xsl:choose>
- <xsl:when test="$spec='xpath'">XPath</xsl:when>
- <xsl:when test="$spec='pathx1'">XPath</xsl:when>
- <xsl:otherwise>XPath</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- PARSER_BEGIN(<xsl:value-of select="$parser-class"/>)
-
-<xsl:call-template name="set-parser-package"/>
-
-import java.util.Stack;
-
-public class <xsl:value-of select="$parser-class"/> {
- <xsl:call-template name="extra-parser-code"/>
-
- boolean m_isMatchPattern = false;
-
- Stack binaryTokenStack = new Stack();
- public static void main(String args[])
- throws Exception
- {
- int numberArgsLeft = args.length;
- int argsStart = 0;
- boolean isMatchParser = false;
- if(numberArgsLeft > 0)
- {
- if(args[argsStart].equals("-match"))
- {
- isMatchParser = true;
- System.out.println("Match Pattern Parser");
- argsStart++;
- numberArgsLeft--;
- }
- }
- if(numberArgsLeft > 0)
- {
- try
- {
- for(int i = argsStart; i < args.length; i++)
- {
- System.out.println();
- System.out.println("Test["+i+"]:
"+args[i]);
- XPath parser = new XPath(new
java.io.StringBufferInputStream(args[i]));
- SimpleNode tree;
- if(isMatchParser)
- {
- tree = parser.<xsl:choose>
- <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
- <xsl:when
test="$spec='xpath'">MatchPattern</xsl:when>
- <xsl:when
test="$spec='pathx1'">MatchPattern</xsl:when>
- <xsl:otherwise>XPath2</xsl:otherwise>
- </xsl:choose>();
- }
- else
- {
- tree = parser.<xsl:choose>
- <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
- <xsl:when
test="$spec='xpath'">XPath2</xsl:when>
- <xsl:when
test="$spec='pathx1'">XPath2</xsl:when>
- <xsl:otherwise>XPath2</xsl:otherwise>
- </xsl:choose>();
- }
-
((SimpleNode)tree.jjtGetChild(0)).dump("|") ;
- }
- System.out.println("Success!!!!");
- }
- catch(ParseException pe)
- {
- System.err.println(pe.getMessage());
- }
- return;
- }
- java.io.DataInputStream dinput = new
java.io.DataInputStream(System.in);
- while(true)
- {
- try
- {
- System.err.println("Type Expression: ");
- String input = dinput.readLine();
- if(null == input || input.trim().length() == 0)
- break;
- XPath parser = new XPath(new
java.io.StringBufferInputStream(input));
- SimpleNode tree;
- if(isMatchParser)
- {
- tree = parser.<xsl:choose>
- <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
- <xsl:when
test="$spec='xpath'">MatchPattern</xsl:when>
- <xsl:when
test="$spec='pathx1'">MatchPattern</xsl:when>
- <xsl:otherwise>XPath2</xsl:otherwise>
- </xsl:choose>();
- }
- else
- {
- tree = parser.<xsl:choose>
- <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
- <xsl:when
test="$spec='xpath'">XPath2</xsl:when>
- <xsl:when
test="$spec='pathx1'">XPath2</xsl:when>
- <xsl:otherwise>XPath2</xsl:otherwise>
- </xsl:choose>();
- }
- ((SimpleNode)tree.jjtGetChild(0)).dump("|") ;
- }
- catch(ParseException pe)
- {
- System.err.println(pe.getMessage());
- }
- catch(Exception e)
- {
- System.err.println(e.getMessage());
- }
- }
- }
- }
-
- PARSER_END(<xsl:value-of select="$parser-class"/>)
-
- </xsl:template>
-
- <xsl:template name="action-production">
- </xsl:template>
-
- <xsl:template name="action-production-end">
- </xsl:template>
-
- <xsl:template name="action-exprProduction-label">
- <xsl:if test="@node-type='void'">
- <xsl:text> #void </xsl:text>
- </xsl:if>
- </xsl:template>
-
-
- <xsl:template name="action-exprProduction">
- </xsl:template>
-
- <xsl:template name="action-exprProduction-end">
- </xsl:template>
-
- <xsl:template name="action-level">
- <xsl:param name="thisProd"/>
- <xsl:param name="nextProd"/>
-
- <!-- xsl:text>
-printIndent(); System.err.println("</xsl:text>
- <xsl:value-of select="$thisProd"/>
- <xsl:text>");
-</xsl:text -->
- </xsl:template>
-
- <xsl:template name="action-level-jjtree-label">
- <xsl:param name="label">
- <xsl:text>void</xsl:text>
- </xsl:param>
- <!-- Begin SMPG -->
- <xsl:param name="condition"></xsl:param>
- <!-- End SMPG -->
-
- <xsl:text> #</xsl:text>
- <xsl:value-of select="$label"/>
-
- <!-- Begin SMPG -->
- <xsl:if test="$condition != ''">
- <xsl:text>(</xsl:text>
- <xsl:value-of select="$condition"/>
- <xsl:text>)</xsl:text>
- </xsl:if>
- <!-- End SMPG -->
- </xsl:template>
-
- <xsl:template name="binary-action-level-jjtree-label">
- <xsl:param name="label"/>
- <xsl:param name="which" select="'unknown'"/>
- <!-- xsl:message>
- <xsl:text>In binary-action-level-jjtree-label: </xsl:text>
- <xsl:value-of select="name(.)"/>
- <xsl:text> (</xsl:text>
- <xsl:value-of select="$which"/>
- <xsl:text>)</xsl:text>
- </xsl:message -->
- <xsl:if test="ancestor-or-self::g:binary or self::g:level/g:binary">
- <xsl:text>
- {
- try
- {
- jjtThis.processToken((Token)binaryTokenStack.pop());
- }
- catch(java.util.EmptyStackException e)
- {
- token_source.printLinePos();
- e.printStackTrace();
- throw e;
- }
- }
- </xsl:text>
- <xsl:text> #</xsl:text><xsl:value-of
select="$label"/><xsl:text>(2)</xsl:text>
- </xsl:if>
- </xsl:template>
-
- <xsl:template name="set-parser-package">
- </xsl:template>
-
- <xsl:template name="action-level-start">
- </xsl:template>
-
- <xsl:template name="action-level-end">
- </xsl:template>
-
- <xsl:template name="action-token-ref">
- <!-- xsl:if test="ancestor::g:binary">
- <xsl:text> #</xsl:text><xsl:value-of select="@name"/>
- </xsl:if -->
- <xsl:choose>
- <xsl:when test="not(ancestor::g:binary or
ancestor-or-self::g:*/@is-binary='yes')">
- <xsl:choose>
- <xsl:when test="key('ref',@name)/self::g:token/@node-type='void'">
- <!-- Don't produce a node. #void doesn't seem to work here, for
some reason. -->
- </xsl:when>
- <xsl:when test="@node-type='void'">
- <!-- Don't produce a node. #void doesn't seem to work here, for
some reason. -->
- </xsl:when>
- <xsl:when test="key('ref',@name)/self::g:token/@node-type">
- <xsl:text>
- {jjtThis.processToken(token);}
- </xsl:text>
- <xsl:text> #</xsl:text>
- <xsl:value-of
select="key('ref',@name)/self::g:token/@node-type"/>
- <!-- See JTree doc for why I do the following... -->
- <xsl:if test="true() or
following-sibling::*[1][self::g:zeroOrMore or self::g:oneOrMore]">
- <xsl:text>(true)</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:when test="@node-type">
- <xsl:text>
- {jjtThis.processToken(token);}
- </xsl:text>
- <xsl:text> #</xsl:text>
- <xsl:value-of select="@node-type"/>
- <!-- See JTree doc for why I do the following... -->
- <xsl:if test="true() or
following-sibling::*[1][self::g:zeroOrMore or self::g:oneOrMore]">
- <xsl:text>(true)</xsl:text>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>
- {jjtThis.processToken(token);}
- </xsl:text>
- <xsl:text> #</xsl:text>
- <xsl:value-of select="@name"/>
- <!-- See JTree doc for why I do the following... -->
- <xsl:if test="true() or
following-sibling::*[1][self::g:zeroOrMore or self::g:oneOrMore]">
- <xsl:text>(true)</xsl:text>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
-
-
- </xsl:when>
- <xsl:otherwise>
- <!-- xsl:message>
- <xsl:text>In binary-action-level-jjtree-label: </xsl:text>
- <xsl:value-of select="name(.)"/>
- </xsl:message -->
- {binaryTokenStack.push(token);}
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
-</xsl:stylesheet>
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ * Copyright (c) 2002 World Wide Web Consortium,
+ * (Massachusetts Institute of Technology, Institut National de
+ * Recherche en Informatique et en Automatique, Keio University). All
+ * Rights Reserved. This program is distributed under the W3C's Software
+ * Intellectual Property License. This program is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY; without even
+ * the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE.
+ * See W3C License http://www.w3.org/Consortium/Legal/ for more details.
+-->
+
+<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
+
xmlns:g="http://www.w3.org/2001/03/XPath/grammar">
+ <xsl:import href="javacc.xsl"/>
+
+ <xsl:template name="javacc-options">
+ <!-- xsl:apply-imports/ -->
+ STATIC = false;
+ MULTI=false;
+ VISITOR=true ; // invokes the JJTree Visitor support
+ NODE_SCOPE_HOOK=false;
+ NODE_USES_PARSER=true;
+ </xsl:template>
+
+ <xsl:template name="input">
+ SimpleNode <xsl:choose>
+ <xsl:when test="$spec='xquery'">XPath2</xsl:when>
+ <xsl:when test="$spec='xpath'">XPath2</xsl:when>
+ <xsl:when test="$spec='pathx1'">XPath2</xsl:when>
+ <xsl:otherwise>XPath2</xsl:otherwise>
+ </xsl:choose>() :
+ {}
+ {
+ <xsl:value-of select="g:start[not(@if) or
contains(@if,$spec)]/@name"/>()<EOF>
+ { return jjtThis ; }
+ }
+ <xsl:if test="$spec='xpath' or $spec='pathx1'">
+ SimpleNode <xsl:choose>
+ <xsl:when test="$spec='xpath'">MatchPattern</xsl:when>
+ <xsl:when test="$spec='pathx1'">MatchPattern</xsl:when>
+ <xsl:otherwise>MatchPattern</xsl:otherwise>
+ </xsl:choose>() :
+ {m_isMatchPattern = true;}
+ {
+ <xsl:value-of
select="g:start[contains(@if,'match')]/@name"/>()<EOF>
+ { return jjtThis ; }
+ }
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="extra-parser-code"/>
+
+ <xsl:template name="parser">
+ <xsl:variable name="parser-class">
+ <xsl:choose>
+ <xsl:when test="$spec='xpath'">XPath</xsl:when>
+ <xsl:when test="$spec='pathx1'">XPath</xsl:when>
+ <xsl:otherwise>XPath</xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ PARSER_BEGIN(<xsl:value-of select="$parser-class"/>)
+
+<xsl:call-template name="set-parser-package"/>
+
+import java.util.Stack;
+
+public class <xsl:value-of select="$parser-class"/> implements NodeFactory {
+ <xsl:call-template name="extra-parser-code"/>
+
+ boolean m_isMatchPattern = false;
+
+ Stack binaryTokenStack = new Stack();
+
+ public Node createNode(int id) {
+ return null;
+ }
+
+
+
+ public static void main(String args[])
+ throws Exception
+ {
+ int numberArgsLeft = args.length;
+ int argsStart = 0;
+ boolean isMatchParser = false;
+ if(numberArgsLeft > 0)
+ {
+ if(args[argsStart].equals("-match"))
+ {
+ isMatchParser = true;
+ System.out.println("Match Pattern Parser");
+ argsStart++;
+ numberArgsLeft--;
+ }
+ }
+ if(numberArgsLeft > 0)
+ {
+ try
+ {
+ for(int i = argsStart; i < args.length; i++)
+ {
+ System.out.println();
+ System.out.println("Test["+i+"]:
"+args[i]);
+ XPath parser = new XPath(new
java.io.StringBufferInputStream(args[i]));
+ SimpleNode tree;
+ if(isMatchParser)
+ {
+ tree = parser.<xsl:choose>
+ <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
+ <xsl:when
test="$spec='xpath'">MatchPattern</xsl:when>
+ <xsl:when
test="$spec='pathx1'">MatchPattern</xsl:when>
+ <xsl:otherwise>XPath2</xsl:otherwise>
+ </xsl:choose>();
+ }
+ else
+ {
+ tree = parser.<xsl:choose>
+ <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
+ <xsl:when
test="$spec='xpath'">XPath2</xsl:when>
+ <xsl:when
test="$spec='pathx1'">XPath2</xsl:when>
+ <xsl:otherwise>XPath2</xsl:otherwise>
+ </xsl:choose>();
+ }
+
((SimpleNode)tree.jjtGetChild(0)).dump("|") ;
+ }
+ System.out.println("Success!!!!");
+ }
+ catch(ParseException pe)
+ {
+ System.err.println(pe.getMessage());
+ }
+ return;
+ }
+ java.io.DataInputStream dinput = new
java.io.DataInputStream(System.in);
+ while(true)
+ {
+ try
+ {
+ System.err.println("Type Expression: ");
+ String input = dinput.readLine();
+ if(null == input || input.trim().length() == 0)
+ break;
+ XPath parser = new XPath(new
java.io.StringBufferInputStream(input));
+ SimpleNode tree;
+ if(isMatchParser)
+ {
+ tree = parser.<xsl:choose>
+ <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
+ <xsl:when
test="$spec='xpath'">MatchPattern</xsl:when>
+ <xsl:when
test="$spec='pathx1'">MatchPattern</xsl:when>
+ <xsl:otherwise>XPath2</xsl:otherwise>
+ </xsl:choose>();
+ }
+ else
+ {
+ tree = parser.<xsl:choose>
+ <xsl:when
test="$spec='xquery'">XPath2</xsl:when>
+ <xsl:when
test="$spec='xpath'">XPath2</xsl:when>
+ <xsl:when
test="$spec='pathx1'">XPath2</xsl:when>
+ <xsl:otherwise>XPath2</xsl:otherwise>
+ </xsl:choose>();
+ }
+ ((SimpleNode)tree.jjtGetChild(0)).dump("|") ;
+ }
+ catch(ParseException pe)
+ {
+ System.err.println(pe.getMessage());
+ }
+ catch(Exception e)
+ {
+ System.err.println(e.getMessage());
+ }
+ }
+ }
+ }
+
+ PARSER_END(<xsl:value-of select="$parser-class"/>)
+
+ </xsl:template>
+
+ <xsl:template name="action-production">
+ </xsl:template>
+
+ <xsl:template name="action-production-end">
+ </xsl:template>
+
+ <xsl:template name="action-exprProduction-label">
+ <xsl:if test="@node-type='void'">
+ <xsl:text> #void </xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+
+ <xsl:template name="action-exprProduction">
+ </xsl:template>
+
+ <xsl:template name="action-exprProduction-end">
+ </xsl:template>
+
+ <xsl:template name="action-level">
+ <xsl:param name="thisProd"/>
+ <xsl:param name="nextProd"/>
+
+ <!-- xsl:text>
+printIndent(); System.err.println("</xsl:text>
+ <xsl:value-of select="$thisProd"/>
+ <xsl:text>");
+</xsl:text -->
+ </xsl:template>
+
+ <xsl:template name="action-level-jjtree-label">
+ <xsl:param name="label">
+ <xsl:text>void</xsl:text>
+ </xsl:param>
+ <!-- Begin SMPG -->
+ <xsl:param name="condition"></xsl:param>
+ <!-- End SMPG -->
+
+ <xsl:text> #</xsl:text>
+ <xsl:value-of select="$label"/>
+
+ <!-- Begin SMPG -->
+ <xsl:if test="$condition != ''">
+ <xsl:text>(</xsl:text>
+ <xsl:value-of select="$condition"/>
+ <xsl:text>)</xsl:text>
+ </xsl:if>
+ <!-- End SMPG -->
+ </xsl:template>
+
+ <xsl:template name="binary-action-level-jjtree-label">
+ <xsl:param name="label"/>
+ <xsl:param name="which" select="'unknown'"/>
+ <!-- xsl:message>
+ <xsl:text>In binary-action-level-jjtree-label: </xsl:text>
+ <xsl:value-of select="name(.)"/>
+ <xsl:text> (</xsl:text>
+ <xsl:value-of select="$which"/>
+ <xsl:text>)</xsl:text>
+ </xsl:message -->
+ <xsl:if test="ancestor-or-self::g:binary or self::g:level/g:binary">
+ <xsl:text>
+ {
+ try
+ {
+ jjtThis.processToken((Token)binaryTokenStack.pop());
+ }
+ catch(java.util.EmptyStackException e)
+ {
+ token_source.printLinePos();
+ e.printStackTrace();
+ throw e;
+ }
+ }
+ </xsl:text>
+ <xsl:text> #</xsl:text><xsl:value-of
select="$label"/><xsl:text>(2)</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="set-parser-package">
+ </xsl:template>
+
+ <xsl:template name="action-level-start">
+ </xsl:template>
+
+ <xsl:template name="action-level-end">
+ </xsl:template>
+
+ <xsl:template name="action-token-ref">
+ <!-- xsl:if test="ancestor::g:binary">
+ <xsl:text> #</xsl:text><xsl:value-of select="@name"/>
+ </xsl:if -->
+ <xsl:choose>
+ <xsl:when test="not(ancestor::g:binary or
ancestor-or-self::g:*/@is-binary='yes')">
+ <xsl:choose>
+ <xsl:when test="key('ref',@name)/self::g:token/@node-type='void'">
+ <!-- Don't produce a node. #void doesn't seem to work here, for
some reason. -->
+ </xsl:when>
+ <xsl:when test="@node-type='void'">
+ <!-- Don't produce a node. #void doesn't seem to work here, for
some reason. -->
+ </xsl:when>
+ <xsl:when test="key('ref',@name)/self::g:token/@node-type">
+ <xsl:text>
+ {jjtThis.processToken(token);}
+ </xsl:text>
+ <xsl:text> #</xsl:text>
+ <xsl:value-of
select="key('ref',@name)/self::g:token/@node-type"/>
+ <!-- See JTree doc for why I do the following... -->
+ <xsl:if test="true() or
following-sibling::*[1][self::g:zeroOrMore or self::g:oneOrMore]">
+ <xsl:text>(true)</xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="@node-type">
+ <xsl:text>
+ {jjtThis.processToken(token);}
+ </xsl:text>
+ <xsl:text> #</xsl:text>
+ <xsl:value-of select="@node-type"/>
+ <!-- See JTree doc for why I do the following... -->
+ <xsl:if test="true() or
following-sibling::*[1][self::g:zeroOrMore or self::g:oneOrMore]">
+ <xsl:text>(true)</xsl:text>
+ </xsl:if>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>
+ {jjtThis.processToken(token);}
+ </xsl:text>
+ <xsl:text> #</xsl:text>
+ <xsl:value-of select="@name"/>
+ <!-- See JTree doc for why I do the following... -->
+ <xsl:if test="true() or
following-sibling::*[1][self::g:zeroOrMore or self::g:oneOrMore]">
+ <xsl:text>(true)</xsl:text>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- xsl:message>
+ <xsl:text>In binary-action-level-jjtree-label: </xsl:text>
+ <xsl:value-of select="name(.)"/>
+ </xsl:message -->
+ {binaryTokenStack.push(token);}
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+</xsl:stylesheet>
1.1.2.3 +3207
-3207xml-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.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- xpath-grammar.xml 23 Jan 2003 19:36:46 -0000 1.1.2.2
+++ xpath-grammar.xml 5 Feb 2003 16:09:45 -0000 1.1.2.3
@@ -1,3207 +1,3207 @@
-<?xml version="1.0"?>
-<!-- DOCTYPE grammar SYSTEM "grammar.dtd" -->
-
-<!--
-Copyright (c) 2002 W3C(r) (http://www.w3.org/) (MIT
(http://www.lcs.mit.edu/),
-INRIA (http://www.inria.fr/), Keio (http://www.keio.ac.jp/)),
-All Rights Reserved.
-See http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Copyright.
-W3C liability
-(http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Legal_Disclaimer),
-trademark
-(http://www.w3.org/Consortium/Legal/ipr-notice-20000612#W3C_Trademarks),
-document use
-(http://www.w3.org/Consortium/Legal/copyright-documents-19990405),
-and software licensing rules
-(http://www.w3.org/Consortium/Legal/copyright-software-19980720)
-apply.
--->
-
-<grammar xmlns="http://www.w3.org/2001/03/XPath/grammar">
- <language id="xpath" display-name="XPath 2.0"/>
- <language id="pathx1" display-name="XPath 1.0"/>
- <language id="xquery" display-name="XQuery 1.0"/>
- <language id="core"
- display-name="XML Processing Formal Semantics Core Language 1.0"/>
- <language id="match" display-name="XSLT 2.0 Match Patterns"/>
-
- <start name="Expr" state="DEFAULT" if="pathx1"/>
- <start name="XPath" state="DEFAULT" if="xpath"/>
- <start name="QueryList" state="DEFAULT" if="core"/>
- <start name="QueryList" state="DEFAULT" if="xquery"/>
- <start name="Pattern" state="DEFAULT" if="match"/>
-
- <token name="XmlCommentStart" if="xquery core">
- <string><!--</string>
- </token>
-
- <token name="XmlCommentEnd" if="xquery core">
- <string>--></string>
- </token>
-
- <token name="IntegerLiteral" inline="false" value-type="number"
type="literal">
- <ref name="Digits"/>
- </token>
-
- <token name="DecimalLiteral" inline="false" value-type="number"
type="literal">
- <choice>
- <sequence>
- <string>.</string>
- <ref name="Digits"/>
- </sequence>
- <sequence>
- <ref name="Digits"/>
- <string>.</string>
- <zeroOrMore>
- <charClass>
- <charRange minChar="0"
maxChar="9"/>
- </charClass>
- </zeroOrMore>
- </sequence>
- </choice>
- </token>
-
- <token name="DoubleLiteral" inline="false" value-type="number"
type="literal">
- <choice>
- <sequence>
- <string>.</string>
- <ref name="Digits"/>
- </sequence>
- <sequence>
- <ref name="Digits"/>
- <optional>
- <string>.</string>
- <zeroOrMore>
- <charClass>
- <charRange minChar="0" maxChar="9"/>
- </charClass>
- </zeroOrMore>
- </optional>
- </sequence>
- </choice>
- <charClass>
- <char>e</char>
- <char>E</char>
- </charClass>
- <optional>
- <charClass>
- <char>+</char>
- <char>-</char>
- </charClass>
- </optional>
- <ref name="Digits"/>
- </token>
-
- <token name="StringLiteral" inline="false" value-type="string"
type="literal" whitespace-spec="significant">
- <choice>
- <sequence>
- <string>"</string>
- <zeroOrMore>
- <choice>
- <sequence>
- <char>"</char>
- <char>"</char>
- </sequence>
- <complement>
- <charClass>
- <char>"</char>
- </charClass>
- </complement>
- </choice>
- </zeroOrMore>
- <string>"</string>
- </sequence>
- <sequence>
- <string>'</string>
- <zeroOrMore>
- <choice>
- <sequence>
- <char>'</char>
- <char>'</char>
- </sequence>
- <complement>
- <charClass>
- <char>'</char>
- </charClass>
- </complement>
- </choice>
- </zeroOrMore>
- <string>'</string>
- </sequence>
- </choice>
- </token>
-
- <token name="AtStringLiteral" if="xquery core">
- <string>at</string>
- <optionalSkip/>
- <ref name="StringLiteral"/>
- </token>
-
- <token name="URLLiteral" inline="false" value-type="string" if="xquery
core" type="literal" whitespace-spec="significant">
- <choice>
- <sequence>
- <string>"</string>
- <zeroOrMore>
- <choice>
- <sequence>
- <char>"</char>
- <char>"</char>
- </sequence>
- <complement>
- <charClass>
- <char>"</char>
- </charClass>
- </complement>
- </choice>
- </zeroOrMore>
- <string>"</string>
- </sequence>
- <sequence>
- <string>'</string>
- <zeroOrMore>
- <choice>
- <sequence>
- <char>'</char>
- <char>'</char>
- </sequence>
- <complement>
- <charClass>
- <char>'</char>
- </charClass>
- </complement>
- </choice>
- </zeroOrMore>
- <string>'</string>
- </sequence>
- </choice>
- </token>
-
- <token name="ExprComment" if="xquery core xpath" special="yes"
inline="false">
- <string>{--</string>
- <zeroOrMore>
- <complement>
- <charClass>
- <char>}</char>
- </charClass>
- </complement>
- </zeroOrMore>
- <string>--}</string>
- </token>
-
- <skip recognize="DEFAULT OPERATOR QNAME NAMESPACEDECL XMLSPACE_DECL
ITEMTYPE NAMESPACEKEYWORD VARNAME" if="xquery core xpath">
- <oneOrMore>
- <choice>
- <ref name="WhitespaceChar"/>
- <ref name="ExprComment"/>
- </choice>
- </oneOrMore>
- </skip>
-
- <skip recognize="DEFAULT OPERATOR QNAME" if="pathx1">
- <oneOrMore>
- <ref name="WhitespaceChar"/>
- </oneOrMore>
- </skip>
-
- <token name="S" inline="false">
- <oneOrMore>
- <ref name="WhitespaceChar"/>
- </oneOrMore>
- </token>
-
- <token name="ProcessingInstructionStart" if="xquery core">
- <string><?</string>
- </token>
-
- <token name="ProcessingInstructionEnd" if="xquery core">
- <string>?></string>
- </token>
-
- <token name="AxisChild" value-type="string">
- <string>child</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisDescendant" value-type="string">
- <string >descendant</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisParent" value-type="string">
- <string >parent</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisAttribute" value-type="string">
- <string >attribute</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisSelf" value-type="string">
- <string >self</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisDescendantOrSelf" value-type="string">
- <string >descendant-or-self</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisAncestor" value-type="string" if="xpath pathx1 core">
- <string >ancestor</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisFollowingSibling" value-type="string" if="xpath pathx1
core">
- <string >following-sibling</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisPrecedingSibling" value-type="string" if="xpath pathx1
core">
- <string >preceding-sibling</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisFollowing" value-type="string" if="xpath pathx1 core">
- <string >following</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisPreceding" value-type="string" if="xpath pathx1 core">
- <string >preceding</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisNamespace" value-type="string" if="xpath pathx1 core">
- <string >namespace</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="AxisAncestorOrSelf" value-type="string" if="xpath pathx1
core">
- <string >ancestor-or-self</string>
- <optionalSkip/>
- <string>::</string>
- </token>
-
- <token name="DefineElement" if="core">
- <string >define</string>
- <requiredSkip show="no"/>
- <string >element</string>
- </token>
-
- <token name="DefineAttribute" if="core">
- <string >define</string>
- <requiredSkip show="no"/>
- <string >attribute</string>
- </token>
-
- <token name="DefineType" if="core">
- <string >define</string>
- <requiredSkip show="no"/>
- <string >type</string>
- </token>
-
- <token name="DefineFunction" if="xquery core">
- <string >define</string>
- <requiredSkip show="no"/>
- <string >function</string>
- </token>
-
- <token name="Or">
- <string >or</string>
- </token>
-
- <token name="And">
- <string >and</string>
- </token>
-
- <!-- token name="AtKeyword">
- <string >at</string>
- </token -->
-
- <token name="Div">
- <string >div</string>
- </token>
-
- <token name="Idiv">
- <string >idiv</string>
- </token>
-
- <token name="Mod">
- <string >mod</string>
- </token>
-
- <token name="Multiply">
- <string>*</string>
- </token>
-
- <token name="In" if="xpath xquery core">
- <string >in</string>
- </token>
-
- <token name="InContext" if="xpath xquery core">
- <string >context</string>
- </token>
-
- <token name="Satisfies" value-type="id">
- <string >satisfies</string>
- </token>
-
- <token name="Return">
- <string >return</string>
- </token>
-
- <token name="Then">
- <string >then</string>
- </token>
-
- <token name="Else">
- <string >else</string>
- </token>
-
- <token name="Default" if="xquery core">
- <string >default</string>
- </token>
-
- <token name="DeclareXMLSpace" if="xquery core">
- <string >declare</string>
- <requiredSkip show="no"/>
- <string>xmlspace</string>
- </token>
-
- <token name="XMLSpacePreserve" if="xquery core">
- <string >preserve</string>
- </token>
-
- <token name="XMLSpaceStrip" if="xquery core">
- <string >strip</string>
- </token>
-
- <token name="Namespace" if="xquery core">
- <string >namespace</string>
- </token>
-
- <token name="DeclareNamespace" if="xquery core">
- <string >declare</string>
- <requiredSkip show="no"/>
- <string>namespace</string>
- </token>
-
- <token name="DeclareResult" if="xquery core">
- <string >declare</string>
- <requiredSkip show="no"/>
- <string>result</string>
- </token>
-
- <token name="To">
- <string >to</string>
- </token>
-
- <token name="Where" if="xquery core">
- <string >where</string>
- </token>
-
- <token name="Collation" if="xquery core">
- <string >collation</string>
- </token>
-
- <token name="Intersect">
- <string >intersect</string>
- </token>
-
- <token name="Union">
- <string >union</string>
- </token>
-
- <token name="Except">
- <string >except</string>
- </token>
-
- <!-- token name="Before" if="xquery core" value-type="id">
- <string >before</string>
- </token>
-
- <token name="After" if="xquery core" value-type="id">
- <string >after</string>
- </token -->
-
- <token name="As" if="xquery core">
- <string >as</string>
- </token>
-
- <token name="AtWord" if="xquery core">
- <string >at</string>
- </token>
-
- <token name="Case" if="xquery core">
- <string >case</string>
- </token>
-
- <token name="Instanceof">
- <string >instance</string>
- <requiredSkip show="no"/>
- <string >of</string>
- </token>
-
- <token name="Castable">
- <string>castable</string>
- <requiredSkip show="no"/>
- <string >as</string> </token>
-
- <!-- see
http://lists.w3.org/Archives/Member/w3c-xsl-query/2002Mar/0154.html -->
- <!-- token name="Only" value-type="id">
- <string >only</string>
- </token -->
-
- <!-- token name="Returns" if="xquery core">
- <string >returns</string>
- </token -->
-
- <token name="RparAs" if="xquery core">
- <string >)</string>
- <optionalSkip/>
- <string >as</string>
- </token>
-
- <!-- token name="Function" value-type="id" if="xquery core">
- <string >function</string>
- </token -->
-
- <token name="Item" value-type="id">
- <string >item</string>
- </token>
-
- <token name="ElementType" value-type="id">
- <string >element</string>
- </token>
-
- <token name="AttributeType" value-type="id">
- <string >attribute</string>
- </token>
-
- <!-- token name="Element" value-type="id">
- <string >element</string>
- </token -->
-
- <token name="ElementQNameLbrace" value-type="id">
- <string >element</string>
- <requiredSkip show="no"/>
- <ref name="QName"/>
- <optionalSkip/>
- <string>{</string>
- </token>
-
- <token name="AttributeQNameLbrace" value-type="id">
- <string >attribute</string>
- <requiredSkip show="no"/>
- <ref name="QName"/>
- <optionalSkip/>
- <string>{</string>
- </token>
-
- <token name="ElementLbrace" value-type="id">
- <string >element</string>
- <optionalSkip/>
- <string>{</string>
- </token>
-
- <token name="AttributeLbrace" value-type="id">
- <string >attribute</string>
- <optionalSkip/>
- <string>{</string>
- </token>
-
- <token name="TextLbrace" value-type="id" if="xquery core">
- <string >text</string>
- <optionalSkip/>
- <string>{</string>
- </token>
-
- <!-- token name="Attribute" value-type="id">
- <string >attribute</string>
- </token -->
-
- <token name="DefaultCollationEquals" if="xpath xquery core">
- <string >default</string>
- <requiredSkip show="no"/>
- <string >collation</string>
- <requiredSkip show="no"/>
- <string >=</string>
- </token>
-
- <token name="DefaultElement" if="xpath xquery core">
- <string >default</string>
- <requiredSkip show="no"/>
- <string >element</string>
- </token>
-
- <token name="DefaultFunction" if="xpath xquery core">
- <string >default</string>
- <requiredSkip show="no"/>
- <string >function</string>
- </token>
-
- <token name="OfType" value-type="id">
- <string >of</string>
- <requiredSkip show="no"/>
- <string >type</string>
- </token>
-
- <token name="AtomicValue" value-type="id">
- <string >atomic</string>
- <requiredSkip show="no"/>
- <string >value</string>
- </token>
-
- <token name="Type" if="core" value-type="id">
- <string >type</string>
- </token>
-
- <token name="TypeQName" if="xpath xquery core">
- <string >type</string>
- <requiredSkip show="no"/>
- <ref name="QName"/>
- </token>
-
- <token name="Node" if="xquery core xpath" value-type="id">
- <string >node</string>
- </token>
-
- <token name="Empty" if="xquery core xpath" value-type="id">
- <string >empty</string>
- </token>
-
-
- <token name="None" if="core">
- <string >none</string>
- </token>
-
- <!-- token name="Ref" if="xquery core" value-type="id">
- <string >ref</string>
- </token -->
-
- <!-- Schema and Module need to be above QName in order for it
- to work with flex. Of course, this means that these
- are reserved words. I suspect they can be stateful to
- avoid this. -->
- <!-- token name="Schema" if="xquery core">
- <string >schema</string>
- </token -->
-
- <token name="ImportSchemaToken" if="xquery core">
- <string >import</string>
- <requiredSkip show="no"/>
- <string>schema</string>
- </token>
-
- <!-- token name="Module" if="xquery core">
- <string >module</string>
- </token -->
-
- <!--
- <token name="Minoccurs" if="core">
- <string >minoccurs</string>
- </token>
- <token name="Maxoccurs" if="core">
- <string >maxoccurs</string>
- </token>
- -->
-
- <token name="Nmstart" inline="false">
- <choice>
- <ref name="Letter"/>
- <string>_</string>
- </choice>
- </token>
-
- <token name="Nmchar" inline="false">
- <choice>
- <ref name="Letter"/>
- <ref name="CombiningChar"/>
- <ref name="Extender"/>
- <ref name="Digit"/>
- <string>.</string>
- <string>-</string>
- <string>_</string>
- </choice>
- </token>
-
- <token name="Star" value-type="string">
- <string>*</string>
- </token>
-
- <token name="NCNameColonStar" value-type="string">
- <ref name="NCName"/>
- <string>:</string>
- <string>*</string>
- </token>
-
- <token name="StarColonNCName" value-type="string">
- <string>*</string>
- <string>:</string>
- <ref name="NCName"/>
- </token>
-
- <token name="Root" value-type="id">
- <string>/</string>
- </token>
-
- <token name="RootDescendants" value-type="id">
- <string>//</string>
- </token>
-
- <token name="Slash">
- <string>/</string>
- </token>
-
- <token name="SlashSlash">
- <string>//</string>
- </token>
-
- <token name="Equals">
- <string>=</string>
- </token>
-
- <token name="AssignEquals" if="xquery core">
- <string>=</string>
- </token>
-
- <token name="XMLSpaceEquals" if="xquery core">
- <string>=</string>
- </token>
-
- <token name="Is">
- <string>is</string>
- </token>
-
- <token name="NotEquals">
- <string>!=</string>
- </token>
-
- <token name="IsNot">
- <string>isnot</string>
- </token>
-
- <token name="LtEquals">
- <string><=</string>
- </token>
-
- <token name="LtLt" >
- <string><<</string>
- </token>
-
- <token name="GtEquals">
- <string>>=</string>
- </token>
-
- <token name="GtGt" >
- <string>>></string>
- </token>
-
- <token name="FortranEq" >
- <string>eq</string>
- </token>
-
- <token name="FortranNe" >
- <string>ne</string>
- </token>
-
- <token name="FortranGt" >
- <string>gt</string>
- </token>
-
- <token name="FortranGe" >
- <string>ge</string>
- </token>
-
- <token name="FortranLt" >
- <string>lt</string>
- </token>
-
- <token name="FortranLe" >
- <string>le</string>
- </token>
-
- <token name="ColonEquals" if="xquery core">
- <string>:=</string>
- </token>
-
- <token name="Lt">
- <string><</string>
- </token>
-
- <token name="Gt">
- <string>></string>
- </token>
-
- <token name="Minus" value-type="id">
- <string>-</string>
- </token>
-
- <token name="Plus" value-type="id">
- <string>+</string>
- </token>
-
- <token name="QMark" if="xquery core xpath">
- <string>?</string>
- </token>
-
- <!-- Decision from Oracle F2F to remove -->
- <!-- token name="Arrow" value-type="id">
- <string>=></string>
- </token -->
-
- <token name="Vbar">
- <string>|</string>
- </token>
-
- <token name="Lpar" node-type="void">
- <string>(</string>
- </token>
-
- <token name="At">
- <string>@</string>
- </token>
-
- <token name="Lbrack">
- <string>[</string>
- </token>
-
- <token name="Rbrack">
- <string>]</string>
- </token>
-
- <token name="Rpar" node-type="void">
- <string>)</string>
- </token>
-
- <token name="Some" value-type="id">
- <string >some</string>
- <optionalSkip/>
- <ref name="VariableIndicator"/>
- </token>
-
- <token name="Every" value-type="id">
- <string >every</string>
- <optionalSkip/>
- <ref name="VariableIndicator"/>
- </token>
-
- <!-- Added for XPath with no reserved words. -sb -->
- <token name="ForVariable" override="true"
- if="xpath pathx1 xquery core" node-type="void">
- <string >for</string>
- <optionalSkip/>
- <ref name="VariableIndicator"/>
- </token>
-
- <token name="LetVariable" if="xquery core">
- <string >let</string>
- <optionalSkip/>
- <ref name="VariableIndicator"/>
- </token>
-
- <token name="CastAs">
- <string >cast</string>
- <requiredSkip show="no"/>
- <string >as</string>
- </token>
-
- <!-- token name="AssertAs">
- <string >assert</string>
- <requiredSkip show="no"/>
- <string >as</string>
- </token -->
-
- <token name="TreatAs">
- <string >treat</string>
- <requiredSkip show="no"/>
- <string >as</string>
- </token>
-
- <token name="ValidateLbrace" if="xpath xquery core">
- <string >validate</string>
- <optionalSkip/>
- <string>{</string>
- </token>
-
- <token name="ValidateContext" if="xpath xquery core">
- <string >validate</string>
- <requiredSkip show="no"/>
- <string>context</string>
- </token>
-
- <token name="Digits" inline="false">
- <oneOrMore>
- <charClass>
- <charRange minChar="0" maxChar="9"/>
- </charClass>
- </oneOrMore>
- </token>
-
- <token name="Comment" override="true" if="xquery core xpath"
value-type="id">
- <string >comment</string>
- </token>
-
- <token name="Document" override="true" if="xquery core xpath"
value-type="id">
- <string >document</string>
- </token>
-
- <token name="DocumentLbrace" override="true" if="xquery core xpath"
value-type="id">
- <string >document</string>
- <optionalSkip/>
- <string>{</string>
- </token>
-
- <token name="Text" override="true" if="xquery core xpath" value-type="id">
- <string >text</string >
- </token>
-
- <token name="Untyped" override="true" if="xquery core xpath"
value-type="id">
- <string>untyped</string>
- </token>
-
- <!-- token name="Unordered" if="xquery core" value-type="id">
- <string>unordered</string>
- </token -->
-
-
- <token name="ProcessingInstruction" override="true" if="xquery core xpath"
value-type="id">
- <string >processing-instruction</string>
- </token>
-
- <token name="NodeLpar" if="xquery core xpath pathx1" node-type="void">
- <string >node</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="CommentLpar" override="true"
- if="xquery core xpath pathx1" node-type="void">
- <string >comment</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="TextLpar" override="true" if="xquery core xpath pathx1"
- node-type="void">
- <string >text</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="ProcessingInstructionLpar" override="true"
- if="xquery core xpath pathx1" node-type="void">
- <string >processing-instruction</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <!-- Added for XPath with no reserved words. -sb -->
- <token name="IfLpar" override="true" if="xquery core xpath">
- <string >if</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="TypeswitchLpar" override="true" if="xquery core">
- <string >typeswitch</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="Comma" node-type="void">
- <string>,</string>
- </token>
-
- <token name="SemiColon" if="xquery core" show="no" node-type="void">
- <string>;</string>
- </token>
-
- <!-- token name="Colon" if="xquery core">
- <string>:</string>
- </token -->
-
- <!-- Should only be recognized in attribute content. -->
- <token name="EscapeQuot" inline="false" override="true" if="xquery">
- <sequence>
- <char>"</char>
- <char>"</char>
- </sequence>
- </token>
-
- <!-- OpenQuot and CloseQuote need to be before StringLiteral in
- order for them to be matched by flex. -->
- <token name="OpenQuot" if="xquery core">
- <string>"</string>
- </token>
-
- <token name="CloseQuot" if="xquery core">
- <string>"</string>
- </token>
-
- <token name="Dot" value-type="id">
- <string>.</string>
- </token>
-
- <token name="DotDot" value-type="id">
- <string>..</string>
- </token>
-
- <!-- token name="SortbyLpar" if="xquery core">
- <string >sort</string>
- <requiredSkip show="no"/>
- <string >by</string>
- <optionalSkip/>
- <string>(</string>
- </token -->
-
- <token name="OrderBy" if="xquery core">
- <string >order</string>
- <requiredSkip show="no"/>
- <string >by</string>
- </token>
-
- <token name="OrderByStable" if="xquery core">
- <string >stable</string>
- <requiredSkip show="no"/>
- <string >order</string>
- <requiredSkip show="no"/>
- <string >by</string>
- </token>
-
- <token name="Ascending" if="xquery core" value-type="id">
- <string >ascending</string>
- </token>
-
- <token name="Descending" if="xquery core" value-type="id">
- <string >descending</string>
- </token>
-
- <token name="EmptyGreatest" if="xquery core" value-type="id">
- <string >empty</string>
- <requiredSkip show="no"/>
- <string >greatest</string>
- </token>
-
- <token name="EmptyLeast" if="xquery core" value-type="id">
- <string >empty</string>
- <requiredSkip show="no"/>
- <string >least</string>
- </token>
-
- <!--
- <token name="Sequence" if="xquery">
- <string >sequence</string>
- </token>
- -->
-
- <token name="PITarget" inline="false" if="xquery core" value-type="string">
- <ref name="NCName"/>
- </token>
-
- <token name="NCName" inline="false" value-type="string" is-xml="yes">
- <ref name="Nmstart"/>
- <zeroOrMore>
- <ref name="Nmchar"/>
- </zeroOrMore>
- </token>
-
- <token name="Prefix" value-type="string" visible="false" is-xml="yes">
- <ref name="NCName"/>
- </token>
-
- <token name="LocalPart" value-type="string" visible="false" is-xml="yes">
- <ref name="NCName"/>
- </token>
-
- <token name="VariableIndicator" inline="true" node-type="void">
- <string>$</string>
- </token>
-
- <token name="VarName" inline="false" value-type="string">
- <ref name="QName"/>
- </token>
-
- <!-- token name="Variable" inline="true" value-type="string">
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- </token -->
-
- <token name="QName" inline="false" value-type="string" is-xml="yes">
- <optional>
- <ref name="Prefix"/>
- <string>:</string>
- </optional>
- <ref name="LocalPart"/>
- </token>
-
- <token name="QNameLpar" value-type="string">
- <ref name="QName"/>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="IDLpar" value-type="string" if="match">
- <string>id</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="KeyLpar" value-type="string" if="match">
- <string>key</string>
- <optionalSkip/>
- <string>(</string>
- </token>
-
- <token name="NCNameForPrefix" inline="false" value-type="string"
if="xquery core">
- <ref name="Nmstart"/>
- <zeroOrMore>
- <ref name="Nmchar"/>
- </zeroOrMore>
- </token>
-
- <state-list if="xquery core xpath pathx1">
- <state name="#ANY">This state is for patterns that can be recognized in
any state.</state>
- <state name="DEFAULT">This state is for patterns that occur at the
beginning of an expression.</state>
- <state name="OPERATOR">This state is for patterns that are defined for
operators.</state>
- <state name="QNAME">When a qualified name is expected, and it is
required to remove ambiguity from patterns that look like keywords, this state
is used.</state>
- <state name="NAMESPACEDECL" if="xquery core">This state occurs inside of
a namespace declaration, and is needed to recognize a NCName that is to be used
as the prefix, as opposed to allowing a QName to occur. (Otherwise, the
difference between NCName and QName are ambiguous.)</state>
- <state name="NAMESPACEKEYWORD" if="xquery core">This state occurs at
places where the keyword "namespace" is expected, which would otherwise be
ambiguous compared to a QName. QNames can not occur in this state.</state>
- <state name="XMLSPACE_DECL" if="xquery core">This state occurs at places
where the keywords "preserve" and "strip" is expected to support "declare
xmlspace". QNames can not occur in this state.</state>
- <state name="ITEMTYPE">This state distinguishes tokens that can occur
only inside the ItemType production.</state>
- <!-- state name="FUNCDEF" if="xquery core">This state is defined to
recognise a FuncName, which then transitions to an ITEMTYPE state after the
opening left bracket, in order to recognize SequenceType productions.</state -->
- <state name="VARNAME">This state differentiates variable names from
qualified names. This allows only the pattern of a QName to be recognized when
otherwise ambiguities could occur.</state>
- <state name="START_TAG" if="xquery core">This state allows attributes in
the native XML syntax, and marks the beginning of an element construction.
Element constructors also push the current state, popping it at the conclusion
of an end tag. In the START_TAG state, the string ">" is recognized as a token
which is associated with the transition to the original state.</state>
- <state name="ELEMENT_CONTENT" if="xquery core">This state allows
XML-like content, without these characters being misinterpreted as expressions.
The character "{" marks a transition to the DEFAULT state, i.e. the start of an
embedded expression, and the "}" character pops back to the ELEMENT_CONTENT
state. To allow curly braces to be used as character content, a double left or
right curly brace is interpreted as a single curly brace character. The string
"</" is interpreted as the beginning of an end tag, which is associated with
a transition to the END_TAG state.</state>
- <state name="END_TAG" if="xquery core">When the end tag is terminated,
the state is popped to the state that was pushed at the start of the
corresponding start tag.</state>
- <state name="XML_COMMENT" if="xquery core">The "<--" token marks the
beginning of an XML Comment, and the "-->" token marks the end. This allows no
special interpretation of other characters in this state.</state>
- <state name="PROCESSING_INSTRUCTION" if="xquery core">In this state,
only lexemes that are legal in a processing instruction name are
recognized.</state>
- <state name="PROCESSING_INSTRUCTION_CONTENT" if="xquery core">In this
state, only characters are that are legal in processing instruction content are
recognized.</state>
- <state name="CDATA_SECTION" if="xquery core">In this state, only lexemes
that are legal in a CDATA section are recognized.</state>
- <state name="QUOT_ATTRIBUTE_CONTENT" if="xquery core">This state allows
content legal for attributes. The character "{" marks a transition to the
DEFAULT state, i.e. the start of an embedded expression, and the "}" character
pops back to the original state. To allow curly braces to be used as character
content, a double left or right curly brace is interpreted as a single curly
brace character. This state is the same as QUOT_ATTRIBUTE_CONTENT, except that
apostrophes are allowed without escaping, and an unescaped quote marks the end
of the state.</state>
- <state name="APOS_ATTRIBUTE_CONTENT" if="xquery core">This state is the
same as QUOT_ATTRIBUTE_CONTENT, except that quotes are allowed, and an
unescaped apostrophe marks the end of the state.</state>
- </state-list>
-
- <lexical-state-transitions if="xquery core xpath pathx1">
- <transition refs="WhitespaceChar Nmstart NCName Nmchar Prefix
LocalPart
- Digits Letter BaseChar Ideographic CombiningChar
- Digit Extender HexDigits"/>
-
- <transition-default recognize="DEFAULT OPERATOR" nextState="OPERATOR"/>
- <transition refs="Rbrack IntegerLiteral DecimalLiteral DoubleLiteral
TypeswitchLpar OrderByStable" recognize="DEFAULT OPERATOR"
nextState="OPERATOR"/>
-
- <transition refs="S" recognize="DEFAULT OPERATOR QNAME
START_TAG NAMESPACEDECL ITEMTYPE
- NAMESPACEKEYWORD END_TAG"/>
- <!-- ==== NEXT=>DEFAULT ==== -->
- <transition refs="URLLiteral" recognize="NAMESPACEDECL"
nextState="DEFAULT"/>
- <transition refs="Slash SlashSlash Div Idiv Mod And Or
- Multiply Return Then Else To
- Union Intersect Except
- Equals Is NotEquals
- IsNot LtEquals GtEquals
- Lt Gt Vbar
- LtLt GtGt
- FortranEq FortranNe FortranGt
- FortranGe FortranLt FortranLe
- Type In InContext
- Where OrderBy Satisfies AtWord ColonEquals"
- recognize="OPERATOR" nextState="DEFAULT"/>
-
- <transition refs="TypeQName" recognize="DEFAULT" nextState="OPERATOR"/>
-
- <transition refs="Collation" recognize="OPERATOR" nextState="OPERATOR"/>
-
- <transition refs="QMark"
- recognize="DEFAULT OPERATOR" nextState="DEFAULT"/>
-
- <!-- nextState="DEFAULT" -->
- <transition refs="Comma" recognize="OPERATOR DEFAULT QNAME"
- action="resetParenStateOrSwitch(DEFAULT)"/>
-
- <transition refs="AttributeType ElementType Node Document Comment Text
- ProcessingInstruction Item Untyped AtomicValue AtomicType
Empty"
- recognize="ITEMTYPE" nextState="DEFAULT"/>
-
- <transition refs="Lbrack Plus Minus"
- recognize="DEFAULT OPERATOR" nextState="DEFAULT"/>
-
- <transition refs="Lpar"
- recognize="DEFAULT OPERATOR QNAME" nextState="DEFAULT"/>
- <transition refs="TextLpar CommentLpar NodeLpar
ProcessingInstructionLpar"
- recognize="QNAME DEFAULT" nextState="DEFAULT"/>
- <transition refs="DefaultCollationEquals" recognize="DEFAULT OPERATOR"
- nextState="NAMESPACEDECL"/>
- <!-- Not sure that this is right for SemiColon, but SemiColon is a
- strange character anyhow. -sb -->
- <transition refs="SemiColon"
- recognize="QNAME DEFAULT OPERATOR" nextState="DEFAULT"/>
- <!-- transition refs="Returns" recognize="OPERATOR" nextState="DEFAULT"/
-->
- <transition refs="Type"
- recognize="DEFAULT" nextState="DEFAULT"/>
-
- <transition refs="IfLpar"
- recognize="DEFAULT" nextState="DEFAULT"/>
-
- <transition refs="QNameLpar"
- recognize="DEFAULT" nextState="DEFAULT"/>
-
- <transition refs="AtStringLiteral"
- recognize="DEFAULT OPERATOR" nextState="DEFAULT"/>
- <transition refs="Item Node Document Comment Text"
- recognize="OPERATOR" nextState="DEFAULT"/>
- <transition refs="LbraceExprEnclosure ValidateLbrace" recognize="DEFAULT
OPERATOR ITEMTYPE"
- nextState="DEFAULT" action="pushState(DEFAULT)"/>
- <transition refs="AttributeQNameLbrace ElementQNameLbrace ElementLbrace
DocumentLbrace AttributeLbrace TextLbrace" recognize="DEFAULT"
- nextState="DEFAULT" action="pushState(DEFAULT)"/>
- <transition refs="ValidateContext"
- recognize="DEFAULT" nextState="DEFAULT"/>
-
- <transition refs="Lbrace" recognize="START_TAG END_TAG ELEMENT_CONTENT
- QUOT_ATTRIBUTE_CONTENT
- APOS_ATTRIBUTE_CONTENT"
- nextState="DEFAULT" action="pushState"/>
- <!-- ==== NEXT=>OPERATOR ==== -->
- <transition refs="VarName" recognize="VARNAME" nextState="OPERATOR"/>
- <transition refs="Star" recognize="DEFAULT QNAME" nextState="OPERATOR"/>
- <transition refs="QName NCNameColonStar StarColonNCName Dot DotDot"
- recognize="ITEMTYPE QNAME DEFAULT OPERATOR"
- nextState="OPERATOR"/>
-
- <transition refs="Rpar" recognize="DEFAULT OPERATOR ITEMTYPE QNAME"
- nextState="OPERATOR"/>
-
- <transition refs="Ascending Descending EmptyGreatest EmptyLeast"
- recognize="OPERATOR" nextState="OPERATOR"/>
- <transition refs="StringLiteral" recognize="DEFAULT OPERATOR
NAMESPACEKEYWORD" nextState="OPERATOR"/>
- <transition refs="Default" recognize="OPERATOR" nextState="OPERATOR"/>
- <!-- ==== NEXT=>VARNAME ==== -->
- <transition refs="VariableIndicator" recognize="DEFAULT OPERATOR
ITEMTYPE QNAME" nextState="VARNAME"/>
- <!-- transition refs="Unordered" recognize="DEFAULT OPERATOR" if="xquery
core"/ -->
- <!-- transition refs="ForVariable LetVariable Some Every"
- recognize="DEFAULT OPERATOR" nextState="ITEMTYPE" if="xquery
core"/ -->
- <transition refs="ForVariable LetVariable Some Every"
- recognize="DEFAULT OPERATOR" nextState="VARNAME"/>
- <!-- ==== NEXT=>NAMESPACEKEYWORD ==== -->
- <transition refs="DefaultElement DefaultFunction ImportSchemaToken"
recognize="DEFAULT OPERATOR" nextState="NAMESPACEKEYWORD"/>
- <!-- ==== NEXT=>NAMESPACEDECL ==== -->
- <transition refs="Namespace" recognize="NAMESPACEKEYWORD"
nextState="NAMESPACEDECL"/>
- <transition refs="DeclareNamespace" recognize="DEFAULT OPERATOR"
nextState="NAMESPACEDECL"/>
- <transition refs="AssignEquals NCNameForPrefix"
recognize="NAMESPACEDECL" nextState="NAMESPACEDECL"/>
- <!-- ==== NEXT=>ITEMTYPE ==== -->
- <transition refs="Instanceof Castable Case As" recognize="OPERATOR"
nextState="ITEMTYPE"/>
- <transition refs="CastAs TreatAs" recognize="DEFAULT"
nextState="ITEMTYPE"/>
- <transition refs="DeclareResult" recognize="DEFAULT OPERATOR"
nextState="ITEMTYPE"/>
- <!-- transition refs="FuncName" recognize="FUNCDEF"/ -->
- <!-- transition refs="FuncPListOpen" recognize="FUNCDEF"
- action="pushParenState(DEFAULT, ITEMTYPE)"/ -->
-
- <!-- Both nextState and action here on purpose -->
- <transition refs="RparAs" recognize="DEFAULT OPERATOR ITEMTYPE QNAME"
- nextState="ITEMTYPE"/>
-
- <!-- ==== NEXT=>FUNCDEF ==== -->
- <transition refs="DefineFunction" recognize="DEFAULT OPERATOR"
nextState="DEFAULT"/>
- <!-- ==== NEXT=>QNAME ==== -->
- <transition refs="OfType" recognize="DEFAULT OPERATOR"
nextState="QNAME"/>
- <transition refs="Root RootDescendants
- AxisChild AxisDescendant AxisParent AxisAttribute
- AxisSelf AxisDescendantOrSelf AxisAncestor AxisFollowingSibling
- AxisPrecedingSibling AxisFollowing AxisPreceding AxisNamespace
- AxisAncestorOrSelf"
- recognize="DEFAULT QNAME" nextState="QNAME"/>
- <transition refs="At" recognize="DEFAULT QNAME" nextState="QNAME"/>
- <!-- ==== NEXT=>XML_COMMENT ==== -->
- <transition refs="XmlCommentStart"
- recognize="DEFAULT ELEMENT_CONTENT" nextState="XML_COMMENT"
- action="pushState"/>
- <!-- ==== NEXT=>PROCESSING_INSTRUCTION ==== -->
- <transition refs="ProcessingInstructionStart"
- recognize="DEFAULT ELEMENT_CONTENT"
nextState="PROCESSING_INSTRUCTION" action="pushState"/>
- <!-- ==== NEXT=>CDATA_SECTION ==== -->
- <transition refs="CdataSectionStart" recognize="ELEMENT_CONTENT DEFAULT"
nextState="CDATA_SECTION" action="pushState"/>
- <!-- ==== NEXT=>ELEMENT_CONTENT ==== -->
- <transition refs="CdataSectionEnd"
- recognize="ELEMENT_CONTENT CDATA_SECTION" action="popState"/>
- <transition refs="StartTagClose" recognize="START_TAG"
- nextState="ELEMENT_CONTENT"/>
- <!-- ==== NEXT=>START_TAG ==== -->
- <transition refs="StartTagOpen" recognize="ELEMENT_CONTENT"
- nextState="START_TAG" action="pushState"/>
- <transition refs="StartTagOpenRoot" recognize="DEFAULT"
- nextState="START_TAG" action="pushState(OPERATOR)"/>
- <transition refs="CloseQuot" recognize="QUOT_ATTRIBUTE_CONTENT"
- nextState="START_TAG"/>
- <!-- ==== NEXT=>END_TAG ==== -->
- <transition refs="EndTagOpen" recognize="ELEMENT_CONTENT"
- nextState="END_TAG"/>
- <transition refs="CloseApos" recognize="APOS_ATTRIBUTE_CONTENT"
- nextState="START_TAG"/>
- <!-- ==== NEXT=>QUOT_ATTRIBUTE_CONTENT ==== -->
- <transition refs="OpenQuot" recognize="START_TAG"
- nextState="QUOT_ATTRIBUTE_CONTENT"/>
- <transition refs="EscapeQuot" recognize="QUOT_ATTRIBUTE_CONTENT"
- nextState="QUOT_ATTRIBUTE_CONTENT"/>
- <!-- ==== NEXT=>APOS_ATTRIBUTE_CONTENT ==== -->
- <transition refs="OpenApos" recognize="START_TAG"
- nextState="APOS_ATTRIBUTE_CONTENT"/>
- <transition refs="EscapeApos" recognize="APOS_ATTRIBUTE_CONTENT"
- nextState="APOS_ATTRIBUTE_CONTENT"/>
- <!-- ==== NEXT=>XMLSPACE_DECL ==== -->
- <transition refs="DeclareXMLSpace" recognize="DEFAULT OPERATOR"
nextState="XMLSPACE_DECL"/>
- <transition refs="XMLSpaceEquals" recognize="XMLSPACE_DECL"/>
- <transition refs="XMLSpacePreserve XMLSpaceStrip"
- recognize="XMLSPACE_DECL"
- nextState="DEFAULT"/>
- <!-- ==== NEXT=>(SAME) ==== -->
- <transition refs="ExprComment" recognize="DEFAULT OPERATOR QNAME
NAMESPACEDECL XMLSPACE_DECL
- ITEMTYPE NAMESPACEKEYWORD
VARNAME ELEMENT_CONTENT"/>
- <transition refs="PITarget" recognize="PROCESSING_INSTRUCTION"
nextState="PROCESSING_INSTRUCTION_CONTENT"/>
- <transition refs="PredefinedEntityRef CharRef"
- recognize="ELEMENT_CONTENT QUOT_ATTRIBUTE_CONTENT
APOS_ATTRIBUTE_CONTENT"/>
- <transition refs="TagQName" recognize="START_TAG END_TAG"/>
- <transition refs="ValueIndicator" recognize="START_TAG"/>
- <transition refs="LCurlyBraceEscape RCurlyBraceEscape"
recognize="ELEMENT_CONTENT QUOT_ATTRIBUTE_CONTENT
- APOS_ATTRIBUTE_CONTENT"/>
- <transition refs="Char" recognize="ELEMENT_CONTENT CDATA_SECTION
- QUOT_ATTRIBUTE_CONTENT
- APOS_ATTRIBUTE_CONTENT
- PROCESSING_INSTRUCTION_CONTENT XML_COMMENT
- XQUERY_COMMENT"/>
- <!-- ==== NEXT=>pop ==== -->
-
- <transition refs="XmlCommentEnd" recognize="XML_COMMENT"
- action="popState"/>
- <transition refs="ProcessingInstructionEnd"
- recognize="PROCESSING_INSTRUCTION_CONTENT" action="popState"/>
- <transition refs="EmptyTagClose" recognize="START_TAG"
- action="popState"/>
- <transition refs="EndTagClose" recognize="END_TAG" action="popState"/>
- <transition refs="Rbrace" recognize="QUOT_ATTRIBUTE_CONTENT OPERATOR
DEFAULT" action="popState"/>
-
- </lexical-state-transitions>
- <!-- ====================== End Lexical States ==================== -sb -->
-
- <!-- The QueryList production is not in the official grammar,
- and is not shown in the bnf. It is here only for the purpose
- of testing a series of queries.
- -->
- <production name="QueryList" if="xquery core" show="no">
- <ref name="Query"/>
- <zeroOrMore>
- <ref name="SemiColon"/>
- <ref name="Query"/>
- </zeroOrMore>
- </production>
-
- <!-- ### Use the name="" names instead of Expr_1() for generated .jj code
-->
- <production name="Query" if="xquery core">
- <ref name="QueryProlog"/>
- <ref name="QueryBody"/>
- </production>
-
- <production name="QueryProlog" if="xquery core">
- <zeroOrMore>
- <choice break="true">
- <ref name="NamespaceDecl"/>
- <ref name="XMLSpaceDecl"/>
- <ref name="DefaultNamespaceDecl"/>
- <ref name="DefaultCollationDecl"/>
- <ref name="SchemaImport"/>
- </choice>
- </zeroOrMore>
- <zeroOrMore>
- <ref name="FunctionDefn"/>
- </zeroOrMore>
- </production>
-
- <production name="XPath" if="xpath">
- <optional>
- <ref name="ExprSequence"/>
- </optional>
- </production>
-
- <production name="QueryBody" if="xquery core">
- <optional>
- <ref name="ExprSequence"/>
- </optional>
- </production>
-
-
- <production name="ExprSequence">
- <ref name="Expr"/>
- <zeroOrMore name="CommaExpr">
- <ref name="Comma"/>
- <ref name="Expr"/>
- </zeroOrMore>
- </production>
-
- <production name="Pattern" if="xpath pathx1" sub-spec="xslt-patterns">
- <ref name="PathPattern"/>
- <optional>
- <choice>
- <ref name="Union" if="xquery xpath"
node-type="void"/>
- <ref name="Vbar" node-type="void"/>
- </choice>
- <ref name="Pattern"/>
- </optional>
- </production>
-
- <production name="PathPattern" if="xpath pathx1" sub-spec="xslt-patterns">
- <choice break="true">
- <sequence>
- <ref name="Root"/>
- <optional>
- <ref name="RelativePathPattern"/>
- </optional>
- </sequence>
- <sequence>
- <ref name="RootDescendants"/>
- <ref name="RelativePathPattern"/>
- </sequence>
- <sequence>
- <ref name="IdKeyPattern"/>
- <optional>
- <choice>
- <ref name="Slash"/>
- <ref name="SlashSlash"/>
- </choice>
- <ref name="RelativePathPattern"/>
- </optional>
- </sequence>
- <ref name="RelativePathPattern"/>
- </choice>
- </production>
-
- <production name="RelativePathPattern" if="xpath pathx1" node-type="void"
- sub-spec="xslt-patterns">
- <ref name="PatternStep"/>
- <optional>
- <choice>
- <ref name="Slash"/>
- <ref name="SlashSlash"/>
- </choice>
- <ref name="RelativePathPattern"/>
- </optional>
- </production>
-
- <production name="PatternStep" if="xpath pathx1"
- sub-spec="xslt-patterns">
- <optional>
- <ref name="PatternAxis"/>
- </optional>
- <ref name="NodeTest"/>
- <ref name="Predicates"/>
- </production>
-
- <production name="PatternAxis" if="xpath pathx1" node-type="void"
- sub-spec="xslt-patterns">
- <choice break="true">
- <ref name="AxisChild"/>
- <ref name="AxisAttribute"/>
- <ref name="At"/>
- </choice>
- </production>
-
- <production name="IdKeyPattern" if="xpath pathx1"
- sub-spec="xslt-patterns">
- <ref name="QNameLpar"/>
- <ref name="IdKeyValue"/>
- <optional>
- <ref name="Comma"/>
- <ref name="IdKeyValue"/>
- </optional>
- <ref name="Rpar"/>
- </production>
-
-
- <production name="IdKeyPattern" if="match"
- sub-spec="xslt-patterns">
- <choice>
- <sequence>
- <ref name="IDLpar"/>
- <ref name="IdKeyValue"/>
- <ref name="Rpar"/>
- </sequence>
- <sequence>
- <ref name="KeyLpar"/>
- <ref name="StringLiteral"/>
- <ref name="Comma"/>
- <ref name="IdKeyValue"/>
- <ref name="Rpar"/>
- </sequence>
- </choice>
- </production>
-
- <production name="IdKeyValue" if="xpath pathx1" node-type="void"
- sub-spec="xslt-patterns">
- <choice>
- <ref name="StringLiteral"/>
- <sequence>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- </sequence>
- </choice>
- </production>
-
- <exprProduction name="Expr" node-type="void">
- <level>
- <binary name="OrExpr" if="xpath xquery pathx1"
condition="> 1">
- <ref name="Or"/>
- </binary>
- </level>
- <level>
- <binary name="AndExpr" if="xpath xquery pathx1"
condition="> 1">
- <ref name="And"/>
- </binary>
- </level>
- <!-- level if="xquery core">
- <prefix name="UnorderedExpr" if="xquery core" prefix-seq-type="?">
- <choice>
- <ref name="Unordered" if="xquery core"/>
- </choice>
- </prefix>
- </level -->
- <level>
- <prefix name="FLWRExpr" if="xquery core"
prefix-seq-type="*">
- <sequence>
- <oneOrMore if="xquery">
- <choice>
- <ref name="ForClause"/>
- <ref name="LetClause"/>
- </choice>
- </oneOrMore>
- <choice if="core">
- <ref name="ForClause"/>
- <ref name="LetClause"/>
- </choice>
- <optional if="xquery">
- <ref name="WhereClause"/>
- </optional>
- <optional if="xquery core">
- <ref name="OrderByClause"
if="xquery core"/>
- </optional>
- <ref name="Return"/>
- </sequence>
- </prefix>
-
- <prefix name="ForExpr" if="xpath" condition="> 1">
- <sequence>
- <ref name="SimpleForClause"/>
- <ref name="Return"/>
- </sequence>
- </prefix>
- </level>
- <level>
- <prefix name="QuantifiedExpr" if="xquery xpath"
condition="> 1">
- <sequence>
- <choice>
- <ref name="Some"/>
- <ref name="Every"/>
- </choice>
- <!-- ref name="VariableIndicator"
if="xquery core"/ -->
- <ref name="VarName"/>
- <optional if="xquery core">
- <ref name="TypeDeclaration"
if="xquery core"/>
- </optional>
- <ref name="In"/>
- <ref name="Expr"/>
- <zeroOrMore>
- <ref name="Comma"/>
- <sequence>
- <ref
name="VariableIndicator"/>
- <ref name="VarName"/>
- <optional if="xquery core">
- <ref name="TypeDeclaration"
if="xquery core"/>
- </optional>
- </sequence>
- <ref name="In"/>
- <ref name="Expr"/>
- </zeroOrMore>
- <ref name="Satisfies"/>
- </sequence>
- </prefix>
- </level>
- <level>
- <prefix name="TypeswitchExpr" if="xquery core">
- <sequence>
- <ref name="TypeswitchLpar"/>
- <ref name="Expr"/>
- <ref name="Rpar"/>
- <oneOrMore>
- <ref name="CaseClause"/>
- </oneOrMore>
- <ref name="Default"/>
- <optional>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- </optional>
- <ref name="Return"/>
- </sequence>
- </prefix>
- </level>
- <level>
- <prefix name="IfExpr" if="xpath core xquery"
condition="> 1">
- <sequence>
- <ref name="IfLpar"/>
- <ref name="Expr"/>
- <ref name="Rpar"/>
- <!-- XPath TF decision to remove, Oct 16, 2002 -->
- <ref name="Then"/>
- <ref name="Expr"/>
- <ref name="Else"/>
- </sequence>
- </prefix>
- </level>
- <level>
- <postfix name="InstanceofExpr" if="xquery xpath" prefix-seq-type="?"
condition="> 1">
- <sequence>
- <ref name="Instanceof"/>
- <ref name="SequenceType"/>
- </sequence>
- </postfix>
- </level>
- <level>
- <postfix name="CastableExpr" if="xquery xpath" prefix-seq-type="?"
condition="> 1">
- <sequence>
- <ref name="Castable"/>
- <ref name="SingleType"/>
- </sequence>
- </postfix>
- </level>
- <level>
- <binary name="ComparisonExpr" prefix-seq-type="*" if="xpath xquery
core" condition="> 1">
- <choice break="true">
- <ref name="ValueComp"/>
- <ref name="GeneralComp"/>
- <ref name="NodeComp"/>
- <ref name="OrderComp"/>
- </choice>
- </binary>
- <binary name="ComparisonExpr" if="pathx1">
- <ref name="GeneralComp"/>
- </binary>
- </level>
- <level>
- <binary name="RangeExpr" if="xquery xpath" prefix-seq-type="?"
condition="> 1">
- <ref name="To"/>
- </binary>
- </level>
- <level>
- <binary name="AdditiveExpr" condition="> 1">
- <choice>
- <ref name="Plus"/>
- <ref name="Minus"/>
- </choice>
- </binary>
- </level>
- <level>
- <binary name="MultiplicativeExpr" condition="> 1">
- <choice>
- <ref name="Multiply"/>
- <ref name="Div"/>
- <ref name="Idiv"/>
- <ref name="Mod"/>
- </choice>
- </binary>
- </level>
- <level node-type="UnaryExpr">
- <prefix name="UnaryExpr" if="xquery xpath pathx1">
- <choice>
- <ref name="Minus"/>
- <ref name="Plus" if="xquery xpath core"/>
- </choice>
- </prefix>
- </level>
- <level>
- <binary name="UnionExpr" if="xquery xpath pathx1"
condition="> 1">
- <choice>
- <ref name="Union" if="xquery xpath"/>
- <ref name="Vbar"/>
- </choice>
- </binary>
- </level>
- <level>
- <binary name="IntersectExceptExpr" if="xquery xpath"
condition="> 1">
- <choice>
- <ref name="Intersect"/>
- <ref name="Except"/>
- </choice>
- </binary>
- </level>
- <level>
- <primary name="ValueExpr">
- <choice>
- <ref name="ValidateExpr" if="xquery
core xpath"/>
- <ref name="CastExpr" if="xquery core
xpath"/>
- <ref name="TreatExpr" if="xquery core
xpath"/>
- <ref name="Constructor" if="xquery
core"/>
- <ref name="PathExpr"/>
- </choice>
- </primary>
- </level>
- </exprProduction>
-
- <production name="PathExpr">
- <choice>
- <sequence>
- <ref name="Root"/>
- <optional>
- <ref name="RelativePathExpr"/>
- </optional>
- </sequence>
- <sequence>
- <ref name="RootDescendants"/>
- <ref name="RelativePathExpr"/>
- </sequence>
- <sequence if="pathx1">
- <ref name="RHSPrimaryExpr" if="pathx1"/>
- <optional if="pathx1">
- <choice if="pathx1">
- <ref name="Slash" if="pathx1"/>
- <ref name="SlashSlash" if="pathx1"/>
- </choice>
- <ref name="RelativePathExpr" if="pathx1"/>
- </optional>
- </sequence>
- <ref name="RelativePathExpr" if="xquery xpath core"/>
- </choice>
- </production>
-
- <production name="RelativePathExpr" node-type="void"> <!-- I don't know
why keep this node (LV) -->
- <!--production name="RelativePathExpr" node-type="RelativePathExpr"
condition="> 1"-->
- <ref name="StepExpr"/>
- <zeroOrMore>
- <choice>
- <ref name="Slash"/>
- <ref name="SlashSlash"/>
- </choice>
- <ref name="StepExpr"/>
- </zeroOrMore>
- </production>
-
- <production name="StepExpr" node-type="StepExpr" condition="> 1">
- <choice>
- <ref name="ForwardStep"/>
- <ref name="ReverseStep"/>
- <ref name="PrimaryExpr" if="xpath xquery core"/>
- </choice>
- <ref name="Predicates"/>
- </production>
-
- <!-- ForClause is slightly different now for XQuery vs. XPath. -sb -->
- <production name="ForClause" if="xquery core">
- <ref name="ForVariable"/>
- <!-- ref name="VariableIndicator" if="xquery core"/ -->
- <ref name="VarName"/>
- <optional if="xquery core">
- <ref name="TypeDeclaration" if="xquery core"/>
- </optional>
- <optional if="xquery core">
- <ref name="PositionalVar" if="xquery core"/>
- </optional>
- <ref name="In"/>
- <ref name="Expr"/>
- <zeroOrMore if="xquery">
- <ref name="Comma"/>
- <sequence>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- <optional if="xquery core">
- <ref name="TypeDeclaration" if="xquery
core"/>
- </optional>
- <optional if="xquery core">
- <ref name="PositionalVar" if="xquery core"/>
- </optional>
- </sequence>
- <ref name="In"/>
- <ref name="Expr"/>
- </zeroOrMore>
- </production>
-
- <!-- SimpleForClause is slightly different now for XQuery vs. XPath. -sb
-->
- <production name="SimpleForClause" if="xpath">
- <ref name="ForVariable"/>
- <ref name="VarName"/>
- <ref name="In"/>
- <ref name="Expr"/>
- <zeroOrMore>
- <ref name="Comma"/>
- <sequence>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- </sequence>
- <ref name="In"/>
- <ref name="Expr"/>
- </zeroOrMore>
- </production>
-
- <production name="LetClause" if="xquery core">
- <ref name="LetVariable"/>
- <!-- ref name="VariableIndicator" if="xquery core"/ -->
- <ref name="VarName"/>
- <optional if="xquery core">
- <ref name="TypeDeclaration" if="xquery core"/>
- </optional>
- <ref name="ColonEquals"/>
- <ref name="Expr"/>
- <zeroOrMore if="xquery">
- <ref name="Comma"/>
- <sequence>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- <optional if="xquery core">
- <ref name="TypeDeclaration" if="xquery
core"/>
- </optional>
- </sequence>
- <ref name="ColonEquals"/>
- <ref name="Expr"/>
- </zeroOrMore>
- </production>
-
- <production name="WhereClause" if="xquery">
- <ref name="Where"/>
- <ref name="Expr"/>
- </production>
-
- <production name="PositionalVar" if="core xquery">
- <ref name="AtWord"/>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- </production>
-
- <production name="ValidateExpr" if="xpath core xquery">
- <choice>
- <ref name="ValidateLbrace"/>
- <sequence>
- <ref name="ValidateContext"/>
- <ref name="SchemaGlobalContext"/>
- <zeroOrMore>
- <ref name="Slash"/>
- <ref name="SchemaContextStep"/>
- </zeroOrMore>
- <ref name="LbraceExprEnclosure"/>
- </sequence>
- </choice>
- <ref name="Expr"/>
- <ref name="Rbrace"/>
- </production>
-
- <production name="CastExpr" if="xpath core xquery">
- <sequence>
- <ref name="CastAs"/>
- <ref name="SingleType"/>
- </sequence>
- <ref name="ParenthesizedExpr"/>
-
- <!-- ref name="Lpar"/>
- <ref name="Expr"/>
- <optional>
- <ref name="Comma"/>
- <ref name="Expr"/>
- </optional>
- <ref name="Rpar"/ -->
-
- </production>
-
- <production name="TreatExpr" if="xpath core xquery">
- <sequence>
- <ref name="TreatAs" if="xpath xquery"/>
- <ref name="SequenceType"/>
- </sequence>
- <ref name="ParenthesizedExpr"/>
- </production>
-
- <production name="Constructor" if="xquery core">
- <choice break="true">
- <ref name="ElementConstructor" if="xquery"/>
- <ref name="XmlComment"/>
- <ref name="XmlProcessingInstruction"/>
- <ref name="CdataSection"/>
- <ref name="ComputedDocumentConstructor" if="xquery
core"/>
- <ref name="ComputedElementConstructor" if="xquery
core"/>
- <ref name="ComputedAttributeConstructor" if="xquery
core"/>
- <ref name="ComputedTextConstructor" if="xquery core"/>
- </choice>
- </production>
-
- <production name="GeneralComp" if="xpath xquery pathx1" is-binary="yes">
- <choice break="false">
- <ref name="Equals"/>
- <ref name="NotEquals"/>
- <ref name="Lt"/>
- <ref name="LtEquals"/>
- <ref name="Gt"/>
- <ref name="GtEquals"/>
- </choice>
- </production>
-
- <production name="ValueComp" if="xpath xquery pathx1" is-binary="yes">
- <choice break="false">
- <ref name="FortranEq"/>
- <ref name="FortranNe"/>
- <ref name="FortranLt"/>
- <ref name="FortranLe"/>
- <ref name="FortranGt"/>
- <ref name="FortranGe"/>
- </choice>
- </production>
-
- <production name="NodeComp" if="xpath xquery pathx1" is-binary="yes">
- <choice break="false">
- <ref name="Is"/>
- <ref name="IsNot"/>
- </choice>
- </production>
-
- <production name="OrderComp" if="xpath xquery" is-binary="yes">
- <choice break="false">
- <ref name="LtLt"/>
- <ref name="GtGt"/>
- </choice>
- </production>
-
- <production name="OrderByClause" if="xquery core">
- <choice break="false">
- <ref name="OrderBy"/>
- <ref name="OrderByStable"/>
- </choice>
- <ref name="OrderSpecList"/>
- </production>
-
- <production name="OrderSpecList" if="xquery core">
- <ref name="OrderSpec"/>
- <zeroOrMore>
- <ref name="Comma"/>
- <ref name="OrderSpec"/>
- </zeroOrMore>
- </production>
-
- <production name="OrderSpec" if="xquery core">
- <ref name="Expr"/>
- <ref name="OrderModifier"/>
- </production>
-
- <production name="OrderModifier" if="xquery core">
- <optional>
- <choice>
- <ref name="Ascending"/>
- <ref name="Descending"/>
- </choice>
- </optional>
- <optional>
- <choice>
- <ref name="EmptyGreatest"/>
- <ref name="EmptyLeast"/>
- </choice>
- </optional>
- <optional>
- <ref name="Collation"/>
- <ref name="StringLiteral"/>
- </optional>
- </production>
-
- <production name="CaseClause" if="xquery core">
- <ref name="Case"/>
- <optional>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- <ref name="As"/>
- </optional>
- <ref name="SequenceType"/>
- <ref name="Return"/>
- <ref name="Expr"/>
- </production>
-
- <!-- production name="DefaultClause" if="xquery core">
- <ref name="Default"/>
- <optional>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- </optional>
- <ref name="Default"/>
- <ref name="Expr"/>
- </production -->
-
- <production name="PrimaryExpr" node-type="void">
- <choice>
- <ref name="Literal"/>
- <ref name="FunctionCall"/>
- <sequence>
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- </sequence>
- <ref name="ParenthesizedExpr"/>
- </choice>
- </production>
-
- <production name="ForwardAxis" node-type="void">
- <choice break="true">
- <ref name="AxisChild"/>
- <ref name="AxisDescendant"/>
- <ref name="AxisAttribute"/>
- <ref name="AxisSelf"/>
- <ref name="AxisDescendantOrSelf"/>
-
- <ref name="AxisFollowingSibling" if="xpath pathx1 core"/>
- <ref name="AxisFollowing" if="xpath pathx1 core"/>
- <ref name="AxisNamespace" if="xpath pathx1 core"/>
-
- </choice>
- </production>
-
- <production name="ReverseAxis" node-type="void">
- <choice break="true">
- <ref name="AxisParent"/>
-
- <ref name="AxisAncestor" if="xpath pathx1 core"/>
- <ref name="AxisPrecedingSibling" if="xpath pathx1 core"/>
- <ref name="AxisPreceding" if="xpath pathx1 core"/>
- <ref name="AxisAncestorOrSelf" if="xpath pathx1 core"/>
- </choice>
- </production>
-
- <!-- production name="Axis">
- <choice break="false">
- <ref name="ForwardAxis"/>
- <ref name="ReverseAxis"/>
- </choice>
- </production -->
-
- <production name="NodeTest">
- <choice>
- <ref name="KindTest"/>
- <ref name="NameTest"/>
- </choice>
- </production>
-
- <production name="NameTest">
- <choice>
- <ref name="QName"/>
- <ref name="Wildcard"/>
- </choice>
- </production>
-
- <production name="Wildcard" node-type="void">
- <choice>
- <ref name="Star"/>
- <ref name="NCNameColonStar"/>
- <ref name="StarColonNCName" if="xquery core xpath"/>
- </choice>
- </production>
-
- <production name="KindTest">
- <choice break="true">
- <ref name="ProcessingInstructionTest"/>
- <ref name="CommentTest"/>
- <ref name="TextTest"/>
- <!-- jwr: xDataTest was a KindTest in the grammar, but I don't know
why,
- since this is a function.
- <ref name="DataTest"/> -->
- <ref name="AnyKindTest"/>
- </choice>
- </production>
-
- <!-- NodeLpar CommentLpar TextLpar ProcessingInstructionLpar -->
- <production name="ProcessingInstructionTest">
- <ref name="ProcessingInstructionLpar"/>
- <optional>
- <ref name="StringLiteral"/>
- </optional>
- <ref name="Rpar"/>
- </production>
-
- <production name="CommentTest">
- <ref name="CommentLpar"/>
- <ref name="Rpar"/>
- </production>
-
- <production name="TextTest">
- <ref name="TextLpar"/>
- <ref name="Rpar"/>
- </production>
-
- <!-- <production name="DataTest" if="xquery xpath">
- <ref name="Data"/>
- <ref name="Lpar"/>
- <ref name="Rpar"/>
- </production>
-
--->
- <production name="AnyKindTest">
- <ref name="NodeLpar"/>
- <ref name="Rpar"/>
- </production>
-
- <production name="ForwardStep" node-type="void">
- <choice>
- <sequence>
- <ref name="ForwardAxis"/>
- <choice>
- <ref name="NodeTest"/>
- <!-- ref name="Text" if="xquery core"/>
- <ref name="Comment" if="xquery core"/>
- <ref name="Node" if="xquery core"/>
- <ref name="ProcessingInstruction" if="xquery core"/ -->
- <!-- ref name="Data" if="xquery core" -->
- </choice>
- </sequence>
- <ref name="AbbreviatedForwardStep" if="xpath pathx1 xquery"/>
- </choice>
- </production>
-
- <production name="ReverseStep" node-type="void">
- <choice>
- <sequence>
- <ref name="ReverseAxis"/>
- <choice>
- <ref name="NodeTest"/>
- <!-- ref name="Text" if="xquery core"/>
- <ref name="Comment" if="xquery core"/>
- <ref name="Node" if="xquery core"/>
- <ref name="ProcessingInstruction" if="xquery core"/ -->
- <!-- ref name="Data" if="xquery core" -->
- </choice>
- </sequence>
- <ref name="AbbreviatedReverseStep" if="xpath pathx1 xquery"/>
- </choice>
- </production>
-
- <production name="AbbreviatedForwardStep" if="xquery xpath pathx1">
- <choice>
- <ref name="Dot"/>
- <sequence>
- <ref name="At"/>
- <ref name="NameTest"/>
- </sequence>
- <ref name="NodeTest"/> <!-- child axis -->
- </choice>
- </production>
-
- <production name="AbbreviatedReverseStep" if="xquery xpath pathx1"
- node-type="void">
- <ref name="DotDot"/>
- </production>
-
- <production name="Predicates" if="xquery xpath pathx1 core" condition=">
1">
- <zeroOrMore name="PredicatesList">
- <choice>
- <sequence>
- <ref name="Lbrack"/>
- <ref name="Expr"/>
- <ref name="Rbrack"/>
- </sequence>
- <!-- Decision of Oracle F2F to remove -->
- <!-- sequence if="xpath xquery core">
- <ref name="Arrow"/>
- <ref name="NameTest"/>
- </sequence -->
- </choice>
- </zeroOrMore>
- </production>
-
- <production name="NumericLiteral" node-type="void">
- <choice>
- <ref name="IntegerLiteral"/>
- <ref name="DecimalLiteral"/>
- <ref name="DoubleLiteral"/>
- </choice>
- </production>
-
- <production name="Literal" node-type="void">
- <choice>
- <ref name="NumericLiteral"/>
- <ref name="StringLiteral"/>
- </choice>
- </production>
-
- <production name="ParenthesizedExpr" node-type="void">
- <ref name="Lpar"/>
- <optional if="xquery core xpath">
- <ref name="ExprSequence"/>
- </optional>
- <ref name="Expr" if="pathx1"/>
- <ref name="Rpar"/>
- </production>
-
- <production name="ElementName" if="pathx1">
- <ref name="QName"/>
- </production>
-
- <production name="FunctionCall" if="xpath pathx1 xquery core">
- <ref name="QNameLpar"/>
- <optional>
- <ref name="Expr"/>
- <zeroOrMore>
- <ref name="Comma"/>
- <ref name="Expr"/>
- </zeroOrMore>
- </optional>
- <ref name="Rpar"/>
- </production>
-
- <production name="Param" if="xquery core">
- <ref name="VariableIndicator"/>
- <ref name="VarName"/>
- <optional>
- <ref name="TypeDeclaration"/>
- </optional>
- </production>
-
- <production name="SchemaContext" if="xpath xquery core">
- <ref name="InContext"/>
- <ref name="SchemaGlobalContext"/>
- <zeroOrMore>
- <ref name="Slash"/>
- <ref name="SchemaContextStep"/>
- </zeroOrMore>
- </production>
-
- <production name="SchemaGlobalContext" if="xpath xquery core">
- <choice>
- <ref name="QName"/>
- <ref name="TypeQName"/>
- </choice>
- </production>
-
- <production name="SchemaContextStep" if="xpath xquery core">
- <ref name="QName"/>
- </production>
-
- <production name="TypeDeclaration" if="xquery core">
- <ref name="As"/>
- <ref name="SequenceType"/>
- </production>
-
- <production name="SingleType" if="xquery core xpath">
- <ref name="AtomicType"/>
- <optional>
- <ref name="QMark"/>
- </optional>
- </production>
-
- <production name="SequenceType" if="xquery core xpath">
- <choice>
- <sequence>
- <ref name="ItemType"/>
- <ref name="OccurrenceIndicator"/>
- </sequence>
- <ref name="Empty"/>
- </choice>
- </production>
-
- <production name="ItemType" if="xquery core xpath">
- <choice break="true">
- <sequence>
- <choice>
- <ref name="ElementType"/>
- <ref name="AttributeType"/>
- </choice>
- <optional>
- <ref name="ElemOrAttrType"/>
- </optional>
- </sequence>
-
- <ref name="Node"/>
- <ref name="ProcessingInstruction"/>
- <ref name="Comment"/>
- <ref name="Text"/>
- <sequence>
- <ref name="Document"/>
- <!-- April 16 taskforce decided to remove...
- <optional>
- <ref name="DocumentElement"/>
- </optional -->
- </sequence>
-
- <ref name="Item"/>
-
- <ref name="AtomicType"/>
- <ref name="Untyped"/>
- <ref name="AtomicValue"/>
-
-
- </choice>
-
- </production>
-
- <production name="ElemOrAttrType" if="xquery core xpath">
- <choice>
- <sequence>
- <ref name="QName"/>
- <choice>
- <ref name="SchemaType"/>
- <optional>
- <ref name="SchemaContext"/>
- </optional>
- </choice>
- </sequence>
- <ref name="SchemaType"/>
- </choice>
- </production>
-
- <production name="SchemaType" if="xquery core xpath">
- <ref name="OfType"/>
- <ref name="QName"/>
- </production>
-
- <!-- jwr: proposed but not yet accepted -->
- <production name="AtomicType" if="xquery core xpath">
- <ref name="QName"/>
- </production>
-
- <production name="OccurrenceIndicator" if="xquery core xpath">
- <optional>
- <choice>
- <ref name="Star" if="xpath xquery core" show="no"/>
- <ref name="Multiply" if="xpath xquery core"/>
- <ref name="Plus"/>
- <ref name="QMark"/>
- </choice>
- </optional>
- </production>
-
- <token name="CdataSectionStart" if="xquery core">
- <string><![CDATA[</string>
- </token>
-
- <!-- Recognizing it in content disallows ]]> in content same as XML. -->
- <token name="CdataSectionEnd" if="xquery core">
- <string>]]></string>
- </token>
-
- <!-- This effectively disallows in element content and attribute
- values ampersands that are not part of entity or character
- references. -->
- <token name="Amp" override="true" if="core">
- <string>&</string>
- </token>
-
- <token name="PredefinedEntityRef" if="xquery" inline="false">
- <string>&</string>
- <choice>
- <string>lt</string>
- <string>gt</string>
- <string>amp</string>
- <string>quot</string>
- <string>apos</string>
- </choice>
- <string>;</string>
- </token>
-
- <token name="HexDigits" inline="false" if="xquery">
- <oneOrMore>
- <charClass>
- <charRange minChar="0" maxChar="9"/>
- <charRange minChar="a" maxChar="f"/>
- <charRange minChar="A" maxChar="F"/>
- </charClass>
- </oneOrMore>
- </token>
-
- <token name="CharRef" if="xquery" inline="false">
- <string>&#</string>
- <choice>
- <ref name="Digits"/>
- <sequence>
- <string>x</string>
- <ref name="HexDigits"/>
- </sequence>
- </choice>
- <string>;</string>
- </token>
-
- <token name="StartTagOpen" override="true" if="xquery">
- <string><</string>
- </token>
-
- <token name="StartTagOpenRoot" override="true" if="xquery">
- <string><</string>
- </token>
-
- <token name="StartTagClose" if="xquery">
- <string>></string>
- </token>
-
- <token name="EmptyTagClose" if="xquery">
- <string>/></string>
- </token>
-
- <token name="EndTagOpen" if="xquery">
- <string></</string>
- </token>
-
- <token name="EndTagClose" if="xquery">
- <string>></string>
- </token>
-
- <token name="ValueIndicator" recognize="START_TAG" if="xquery">
- <string>=</string>
- </token>
-
- <token name="TagQName" recognize="START_TAG END_TAG" if="xquery">
- <ref name="QName"/>
- </token>
-
- <!-- Recognize in OPERATOR state for function definitions. -->
- <!-- These should be query only, once we get the validate issue fixed! -->
- <token name="Lbrace" if="xquery core xpath" override="true">
- <string>{</string>
- </token>
-
- <token name="LbraceExprEnclosure" if="xquery core xpath" override="true">
- <string>{</string>
- </token>
-
- <token name="Rbrace" if="xquery core xpath" override="true">
- <string>}</string>
- </token>
-
- <token name="LCurlyBraceEscape" if="xquery core" override="true">
- <string>{{</string>
- </token>
-
- <token name="RCurlyBraceEscape" if="xquery core" override="true">
- <string>}}</string>
- </token>
-
- <token name="EscapeApos" inline="false" if="xquery">
- <string>''</string>
- </token>
-
- <token name="OpenApos" if="xquery">
- <string>'</string>
- </token>
-
- <token name="CloseApos" override="true" if="xquery">
- <string>'</string>
- </token>
-
- <!-- This needs to come after the rules for special characters. -->
- <token name="Char" if="xquery core xpath" inline="false"
value-type="string">
- <charClass>
- <charCode value="0009"/>
- <charCode value="000D"/>
- <charCode value="000A"/>
- <!-- This isn't quite right, but JavaCC doesn't understand surrogates.
-->
- <charCodeRange minValue="0020" maxValue="FFFD"/>
- </charClass>
- </token>
-
- <!-- It would be nice to not take character content runs one character
- at a time. However, it seems difficult to say, "all these characters
- but these three", at least in JavaCC. -->
- <!-- token name="CharData" if="xquery" inline="true" value-type="string">
- <oneOrMore>
- <complement>
- <charClass>
- <char><</char>
- <char>&</char>
- <char>{</char>
- </charClass>
- </complement>
- </oneOrMore>
- </token -->
-
- <production name="ElementConstructor" if="xquery"
whitespace-spec="explicit">
- <choice name="TagOpenStart">
- <ref name="StartTagOpenRoot" show="no"/>
- <ref name="StartTagOpen"/>
- </choice>
- <ref name= "TagQName"/>
- <ref name="AttributeList"/>
- <choice name="TagClose">
- <ref name="EmptyTagClose"/>
- <sequence name="TagContent">
- <ref name="StartTagClose"/>
- <zeroOrMore>
- <ref name="ElementContent"/>
- </zeroOrMore>
- <ref name="EndTagOpen"/>
- <ref name="TagQName"/>
- <optional>
- <ref name="S"/>
- </optional>
- <ref name="EndTagClose"/>
- </sequence>
- </choice>
- </production>
-
- <production name="ComputedDocumentConstructor" if="xquery core">
- <sequence>
- <ref name="DocumentLbrace"/>
- <ref name="ExprSequence"/>
- <ref name="Rbrace"/>
- </sequence>
- </production>
-
- <production name="ComputedElementConstructor" if="xquery core">
- <choice>
- <ref name="ElementQNameLbrace"/>
- <sequence>
- <ref name="ElementLbrace"/>
- <ref name="Expr"/>
- <ref name="Rbrace"/>
- <ref name="LbraceExprEnclosure"/>
- </sequence>
- </choice>
- <optional>
- <ref name="ExprSequence"/>
- </optional>
- <ref name="Rbrace"/>
- </production>
-
- <production name="ComputedAttributeConstructor" if="xquery core">
- <choice>
- <ref name="AttributeQNameLbrace"/>
- <sequence>
- <ref name="AttributeLbrace"/>
- <ref name="Expr"/>
- <ref name="Rbrace"/>
- <ref name="LbraceExprEnclosure"/>
- </sequence>
- </choice>
- <optional>
- <ref name="ExprSequence"/>
- </optional>
- <ref name="Rbrace"/>
- </production>
-
- <production name="ComputedTextConstructor" if="xquery core">
- <ref name="TextLbrace"/>
- <optional>
- <ref name="ExprSequence"/>
- </optional>
- <ref name="Rbrace"/>
- </production>
-
- <production name="CdataSection" if="xquery core"
whitespace-spec="significant">
- <ref name="CdataSectionStart"/>
- <zeroOrMore>
- <ref name="Char"/>
- </zeroOrMore>
- <ref name="CdataSectionEnd"/>
- </production>
-
- <production name="XmlProcessingInstruction" if="xquery core"
whitespace-spec="significant">
- <ref name="ProcessingInstructionStart"/>
- <ref name="PITarget"/>
- <zeroOrMore>
- <ref name="Char"/>
- </zeroOrMore>
- <ref name="ProcessingInstructionEnd"/>
- </production>
-
- <production name="XmlComment" if="xquery core"
whitespace-spec="significant">
- <ref name="XmlCommentStart"/>
- <zeroOrMore>
- <ref name="Char"/>
- </zeroOrMore>
- <ref name="XmlCommentEnd"/>
- </production>
-
- <production name="ElementContent" if="xquery"
whitespace-spec="significant">
- <choice break="true">
- <ref name="Char"/>
- <ref name="LCurlyBraceEscape"/>
- <ref name="RCurlyBraceEscape"/>
- <ref name="ElementConstructor"/>
- <ref name="EnclosedExpr"/>
- <ref name="CdataSection"/>
- <ref name="CharRef"/>
- <ref name="PredefinedEntityRef"/>
- <ref name="XmlComment"/>
- <ref name="XmlProcessingInstruction"/>
- </choice>
- </production>
-
- <production name="AttributeList" if="xquery" whitespace-spec="explicit">
- <zeroOrMore name="optionalAttribute">
- <ref name="S"/>
- <optional>
- <ref name="TagQName"/>
- <optional>
- <ref name="S"/>
- </optional>
- <ref name="ValueIndicator"/>
- <optional>
- <ref name="S"/>
- </optional>
- <ref name="AttributeValue"/>
- </optional>
- </zeroOrMore>
- </production>
-
- <production name="AttributeValue" if="xquery"
whitespace-spec="significant">
- <choice break="true">
- <sequence>
- <ref name="OpenQuot"/>
- <zeroOrMore>
- <choice>
- <ref name="EscapeQuot"/>
- <ref name="AttributeValueContent"/>
- </choice>
- </zeroOrMore>
- <ref name="CloseQuot"/>
- </sequence>
- <sequence>
- <ref name="OpenApos"/>
- <zeroOrMore>
- <choice>
- <ref name="EscapeApos"/>
- <ref name="AttributeValueContent"/>
- </choice>
- </zeroOrMore>
- <ref name="CloseApos"/>
- </sequence>
- </choice>
- </production>
-
- <production name="AttributeValueContent" if="xquery"
whitespace-spec="significant">
- <choice break="true">
- <ref name="Char"/>
- <ref name="CharRef"/>
- <ref name="LCurlyBraceEscape"/>
- <ref name="RCurlyBraceEscape"/>
- <ref name="EnclosedExpr"/>
- <!-- not in Dana's grammar -->
- <ref name="PredefinedEntityRef"/>
- </choice>
- </production>
-
- <production name="EnclosedExpr" if="xquery core">
- <choice>
- <ref name="Lbrace" show="no"/>
- <ref name="LbraceExprEnclosure"/>
- </choice>
- <ref name="ExprSequence"/>
- <ref name="Rbrace"/>
- </production>
-
- <production name="XMLSpaceDecl" if="xquery core">
- <ref name="DeclareXMLSpace"/>
- <ref name="XMLSpaceEquals"/>
- <choice>
- <ref name="XMLSpacePreserve"/>
- <ref name="XMLSpaceStrip"/>
- </choice>
- </production>
-
- <production name="DefaultCollationDecl" if="xquery core">
- <ref name="DefaultCollationEquals"/>
- <!-- ref name="StringLiteral"/ -->
- <ref name="URLLiteral"/>
- </production>
-
- <production name="NamespaceDecl" if="xquery core">
- <ref name="DeclareNamespace"/>
- <ref name="NCNameForPrefix"/>
- <ref name="AssignEquals"/>
- <ref name="URLLiteral"/>
- </production>
-
- <production name="SubNamespaceDecl" if="xquery core">
- <ref name="Namespace"/>
- <ref name="NCNameForPrefix"/>
- <ref name="AssignEquals"/>
- <ref name="URLLiteral"/>
- </production>
-
- <production name="DefaultNamespaceDecl" if="xquery core">
- <choice>
- <ref name="DefaultElement"/>
- <ref name="DefaultFunction"/>
- </choice>
- <ref name="Namespace"/>
- <ref name="AssignEquals"/>
- <ref name="URLLiteral"/>
- </production>
-
- <!-- production name="ContextDecl" if="xquery core">
- <choice break="true">
- <ref name="NamespaceDecl"/>
- <ref name="DefaultNamespaceDecl"/>
- <ref name="SchemaImport"/>
- </choice>
- </production -->
-
- <production name="FunctionDefn" if="xquery core">
- <ref name="DefineFunction"/>
- <ref name="QNameLpar"/>
- <!-- ref name="FuncPListOpen"/ -->
- <optional>
- <ref name="ParamList"/>
- </optional>
- <choice>
- <ref name="Rpar"/>
- <sequence if="xquery core">
- <ref name="RparAs"/>
- <!-- Was Datatype -->
- <ref name="SequenceType"/>
- </sequence>
- </choice>
- <ref name="EnclosedExpr"/>
- </production>
-
- <production name="ParamList" if="xquery core">
- <ref name="Param"/>
- <zeroOrMore>
- <ref name="Comma"/>
- <ref name="Param"/>
- </zeroOrMore>
- </production>
-
- <production name="SchemaImport" if="xquery core">
- <ref name="ImportSchemaToken"/>
- <!-- See
http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2002Jan/0181.html -->
- <choice>
- <ref name="StringLiteral"/>
- <ref name="SubNamespaceDecl"/>
- <ref name="DefaultNamespaceDecl"/>
- </choice>
- <optional>
- <ref name="AtStringLiteral"/>
- </optional>
- </production>
-
- <!-- Type declaration stuff follows -->
- <production name="TypeDeclaration" if="core">
- <choice break="true">
- <sequence>
- <ref name="DefineElement"/>
- <ref name="QName"/>
- <ref name="Lbrace"/>
- <optional>
- <ref name="TypeDefn"/>
- </optional>
- <ref name="Rbrace"/>
- </sequence>
- <sequence>
- <ref name="DefineAttribute"/>
- <ref name="QName"/>
- <ref name="Lbrace"/>
- <optional>
- <ref name="TypeDefn"/>
- </optional>
- <ref name="Rbrace"/>
- </sequence>
- <sequence>
- <ref name="DefineType"/>
- <ref name="QName"/>
- <ref name="Lbrace"/>
- <optional>
- <ref name="TypeDefn"/>
- </optional>
- <ref name="Rbrace"/>
- </sequence>
- </choice>
- </production>
-
- <exprProduction name="TypeDefn" if="core">
- <level>
- <binary name="TypeUnion" if="core">
- <ref name="Vbar"/>
- </binary>
- </level>
- <level>
- <binary name="TypeBoth" if="core">
- <ref name="Amp"/>
- </binary>
- <binary name="TypeSequence" if="core">
- <ref name="Comma"/>
- </binary>
- </level>
- <level>
- <primary name="TypeSimpleType" if="core">
- <ref name="QName"/>
- <ref name="OccurrenceIndicator"/>
- </primary>
- <primary name="TypeAttributeRef" if="core">
- <ref name="Attribute"/>
- <ref name="NameTest"/>
- <optional>
- <ref name="Lbrace"/>
- <optional>
- <ref name="TypeDefn"/>
- </optional>
- <ref name="Rbrace"/>
- </optional>
- <ref name="OccurrenceIndicator"/>
- </primary>
- <primary name="TypeElementRef" if="core">
- <ref name="Element"/>
- <ref name="NameTest"/>
- <optional>
- <ref name="Lbrace"/>
- <optional>
- <ref name="TypeDefn"/>
- </optional>
- <ref name="Rbrace"/>
- </optional>
- <ref name="OccurrenceIndicator"/>
- </primary>
- <primary name="TypeTypeRef" if="core">
- <ref name="Type"/>
- <ref name="NameTest"/>
- <ref name="OccurrenceIndicator"/>
- </primary>
- <primary name="TypeParenthesized" if="core">
- <ref name="Lpar"/>
- <optional>
- <ref name="TypeDefn"/>
- </optional>
- <ref name="Rpar"/>
- <ref name="OccurrenceIndicator"/>
- </primary>
- <!-- primary name="TypeEmptySequence" if="core">
- <ref name="Lpar"/>
- <ref name="Rpar"/>
- </primary -->
- <primary name="TypeNone" if="core">
- <ref name="None"/>
- </primary>
- </level>
- </exprProduction>
-
- <!-- This is never referenced from anywhere. -sb -->
- <!-- production name="ModuleImport" if="xquery core">
- <ref name="Module"/>
- <ref name="StringLiteral"/>
- </production -->
-
- <!-- ==================== XPath 1.0 =========================-->
- <!-- production name="RHSStepExpr" if="pathx1">
- <choice>
- <ref name="AxisStep"/>
- <ref name="RHSGeneralStepExpr"/>
- </choice>
- </production -->
-
- <!-- production name="RHSGeneralStepExpr" if="pathx1">
- <ref name="RHSPrimaryExpr"/>
- <ref name="RHSStepQualifiers"/>
- </production -->
-
- <!-- production name="RHSStepQualifiers" if="pathx1">
- <zeroOrMore>
- <choice>
- <sequence>
- <ref name="Lbrack"/>
- <ref name="Expr"/>
- <ref name="Rbrack"/>
- </sequence>
- </choice>
- </zeroOrMore>
- </production -->
-
- <production name="RHSPrimaryExpr" if="pathx1">
- <choice break="true">
- <ref name="StepExpr" if="pathx1"/>
- <sequence>
- <ref name="PrimaryExpr" if="pathx1"/>
- <ref name="Predicates"/>
- </sequence>
- </choice>
- </production>
-
- <token name="WhitespaceChar" inline="false">
- <charClass>
- <charCode value="0009"/>
- <charCode value="000D"/>
- <charCode value="000A"/>
- <!-- char xml:space="preserve"> </char -->
- <!-- SGML mode in EMacs doesn't like xml:space, so
- we avoid it for now. -->
- <charCode value="0020"/>
- </charClass>
- </token>
-
- <token name="Letter" inline="false" is-macro="yes" is-xml="yes">
- <choice>
- <ref name="BaseChar"/>
- <ref name="Ideographic"/>
- </choice>
- </token>
-
- <token name="BaseChar" inline="false" is-macro="yes" is-xml="yes">
- <charClass>
- <charCodeRange minValue="0041" maxValue="005a"/>
- <charCodeRange minValue="0061" maxValue="007a"/>
- <charCodeRange minValue="00c0" maxValue="00d6"/>
- <charCodeRange minValue="00d8" maxValue="00f6"/>
- <charCodeRange minValue="00f8" maxValue="00ff"/>
- <charCodeRange minValue="0100" maxValue="0131"/>
- <charCodeRange minValue="0134" maxValue="013e"/>
- <charCodeRange minValue="0141" maxValue="0148"/>
- <charCodeRange minValue="014a" maxValue="017e"/>
- <charCodeRange minValue="0180" maxValue="01c3"/>
- <charCodeRange minValue="01cd" maxValue="01f0"/>
- <charCodeRange minValue="01f4" maxValue="01f5"/>
- <charCodeRange minValue="01fa" maxValue="0217"/>
- <charCodeRange minValue="0250" maxValue="02a8"/>
- <charCodeRange minValue="02bb" maxValue="02c1"/>
- <charCode value="0386"/>
- <charCodeRange minValue="0388" maxValue="038a"/>
- <charCode value="038c"/>
- <charCodeRange minValue="038e" maxValue="03a1"/>
- <charCodeRange minValue="03a3" maxValue="03ce"/>
- <charCodeRange minValue="03d0" maxValue="03d6"/>
- <charCode value="03da"/>
- <charCode value="03dc"/>
- <charCode value="03de"/>
- <charCode value="03e0"/>
- <charCodeRange minValue="03e2" maxValue="03f3"/>
- <charCodeRange minValue="0401" maxValue="040c"/>
- <charCodeRange minValue="040e" maxValue="044f"/>
- <charCodeRange minValue="0451" maxValue="045c"/>
- <charCodeRange minValue="045e" maxValue="0481"/>
- <charCodeRange minValue="0490" maxValue="04c4"/>
- <charCodeRange minValue="04c7" maxValue="04c8"/>
- <charCodeRange minValue="04cb" maxValue="04cc"/>
- <charCodeRange minValue="04d0" maxValue="04eb"/>
- <charCodeRange minValue="04ee" maxValue="04f5"/>
- <charCodeRange minValue="04f8" maxValue="04f9"/>
- <charCodeRange minValue="0531" maxValue="0556"/>
- <charCode value="0559"/>
- <charCodeRange minValue="0561" maxValue="0586"/>
- <charCodeRange minValue="05d0" maxValue="05ea"/>
- <charCodeRange minValue="05f0" maxValue="05f2"/>
- <charCodeRange minValue="0621" maxValue="063a"/>
- <charCodeRange minValue="0641" maxValue="064a"/>
- <charCodeRange minValue="0671" maxValue="06b7"/>
- <charCodeRange minValue="06ba" maxValue="06be"/>
- <charCodeRange minValue="06c0" maxValue="06ce"/>
- <charCodeRange minValue="06d0" maxValue="06d3"/>
- <charCode value="06d5"/>
- <charCodeRange minValue="06e5" maxValue="06e6"/>
- <charCodeRange minValue="0905" maxValue="0939"/>
- <charCode value="093d"/>
- <charCodeRange minValue="0958" maxValue="0961"/>
- <charCodeRange minValue="0985" maxValue="098c"/>
- <charCodeRange minValue="098f" maxValue="0990"/>
- <charCodeRange minValue="0993" maxValue="09a8"/>
- <charCodeRange minValue="09aa" maxValue="09b0"/>
- <charCode value="09b2"/>
- <charCodeRange minValue="09b6" maxValue="09b9"/>
- <charCodeRange minValue="09dc" maxValue="09dd"/>
- <charCodeRange minValue="09df" maxValue="09e1"/>
- <charCodeRange minValue="09f0" maxValue="09f1"/>
- <charCodeRange minValue="0a05" maxValue="0a0a"/>
- <charCodeRange minValue="0a0f" maxValue="0a10"/>
- <charCodeRange minValue="0a13" maxValue="0a28"/>
- <charCodeRange minValue="0a2a" maxValue="0a30"/>
- <charCodeRange minValue="0a32" maxValue="0a33"/>
- <charCodeRange minValue="0a35" maxValue="0a36"/>
- <charCodeRange minValue="0a38" maxValue="0a39"/>
- <charCodeRange minValue="0a59" maxValue="0a5c"/>
- <charCode value="0a5e"/>
- <charCodeRange minValue="0a72" maxValue="0a74"/>
- <charCodeRange minValue="0a85" maxValue="0a8b"/>
- <charCode value="0a8d"/>
- <charCodeRange minValue="0a8f" maxValue="0a91"/>
- <charCodeRange minValue="0a93" maxValue="0aa8"/>
- <charCodeRange minValue="0aaa" maxValue="0ab0"/>
- <charCodeRange minValue="0ab2" maxValue="0ab3"/>
- <charCodeRange minValue="0ab5" maxValue="0ab9"/>
- <charCode value="0abd"/>
- <charCode value="0ae0"/>
- <charCodeRange minValue="0b05" maxValue="0b0c"/>
- <charCodeRange minValue="0b0f" maxValue="0b10"/>
- <charCodeRange minValue="0b13" maxValue="0b28"/>
- <charCodeRange minValue="0b2a" maxValue="0b30"/>
- <charCodeRange minValue="0b32" maxValue="0b33"/>
- <charCodeRange minValue="0b36" maxValue="0b39"/>
- <charCode value="0b3d"/>
- <charCodeRange minValue="0b5c" maxValue="0b5d"/>
- <charCodeRange minValue="0b5f" maxValue="0b61"/>
- <charCodeRange minValue="0b85" maxValue="0b8a"/>
- <charCodeRange minValue="0b8e" maxValue="0b90"/>
- <charCodeRange minValue="0b92" maxValue="0b95"/>
- <charCodeRange minValue="0b99" maxValue="0b9a"/>
- <charCode value="0b9c"/>
- <charCodeRange minValue="0b9e" maxValue="0b9f"/>
- <charCodeRange minValue="0ba3" maxValue="0ba4"/>
- <charCodeRange minValue="0ba8" maxValue="0baa"/>
- <charCodeRange minValue="0bae" maxValue="0bb5"/>
- <charCodeRange minValue="0bb7" maxValue="0bb9"/>
- <charCodeRange minValue="0c05" maxValue="0c0c"/>
- <charCodeRange minValue="0c0e" maxValue="0c10"/>
- <charCodeRange minValue="0c12" maxValue="0c28"/>
- <charCodeRange minValue="0c2a" maxValue="0c33"/>
- <charCodeRange minValue="0c35" maxValue="0c39"/>
- <charCodeRange minValue="0c60" maxValue="0c61"/>
- <charCodeRange minValue="0c85" maxValue="0c8c"/>
- <charCodeRange minValue="0c8e" maxValue="0c90"/>
- <charCodeRange minValue="0c92" maxValue="0ca8"/>
- <charCodeRange minValue="0caa" maxValue="0cb3"/>
- <charCodeRange minValue="0cb5" maxValue="0cb9"/>
- <charCode value="0cde"/>
- <charCodeRange minValue="0ce0" maxValue="0ce1"/>
- <charCodeRange minValue="0d05" maxValue="0d0c"/>
- <charCodeRange minValue="0d0e" maxValue="0d10"/>
- <charCodeRange minValue="0d12" maxValue="0d28"/>
- <charCodeRange minValue="0d2a" maxValue="0d39"/>
- <charCodeRange minValue="0d60" maxValue="0d61"/>
- <charCodeRange minValue="0e01" maxValue="0e2e"/>
- <charCode value="0e30"/>
- <charCodeRange minValue="0e32" maxValue="0e33"/>
- <charCodeRange minValue="0e40" maxValue="0e45"/>
- <charCodeRange minValue="0e81" maxValue="0e82"/>
- <charCode value="0e84"/>
- <charCodeRange minValue="0e87" maxValue="0e88"/>
- <charCode value="0e8a"/>
- <charCode value="0e8d"/>
- <charCodeRange minValue="0e94" maxValue="0e97"/>
- <charCodeRange minValue="0e99" maxValue="0e9f"/>
- <charCodeRange minValue="0ea1" maxValue="0ea3"/>
- <charCode value="0ea5"/>
- <charCode value="0ea7"/>
- <charCodeRange minValue="0eaa" maxValue="0eab"/>
- <charCodeRange minValue="0ead" maxValue="0eae"/>
- <charCode value="0eb0"/>
- <charCodeRange minValue="0eb2" maxValue="0eb3"/>
- <charCode value="0ebd"/>
- <charCodeRange minValue="0ec0" maxValue="0ec4"/>
- <charCodeRange minValue="0f40" maxValue="0f47"/>
- <charCodeRange minValue="0f49" maxValue="0f69"/>
- <charCodeRange minValue="10a0" maxValue="10c5"/>
- <charCodeRange minValue="10d0" maxValue="10f6"/>
- <charCode value="1100"/>
- <charCodeRange minValue="1102" maxValue="1103"/>
- <charCodeRange minValue="1105" maxValue="1107"/>
- <charCode value="1109"/>
- <charCodeRange minValue="110b" maxValue="110c"/>
- <charCodeRange minValue="110e" maxValue="1112"/>
- <charCode value="113c"/>
- <charCode value="113e"/>
- <charCode value="1140"/>
- <charCode value="114c"/>
- <charCode value="114e"/>
- <charCode value="1150"/>
- <charCodeRange minValue="1154" maxValue="1155"/>
- <charCode value="1159"/>
- <charCodeRange minValue="115f" maxValue="1161"/>
- <charCode value="1163"/>
- <charCode value="1165"/>
- <charCode value="1167"/>
- <charCode value="1169"/>
- <charCodeRange minValue="116d" maxValue="116e"/>
- <charCodeRange minValue="1172" maxValue="1173"/>
- <charCode value="1175"/>
- <charCode value="119e"/>
- <charCode value="11a8"/>
- <charCode value="11ab"/>
- <charCodeRange minValue="11ae" maxValue="11af"/>
- <charCodeRange minValue="11b7" maxValue="11b8"/>
- <charCode value="11ba"/>
- <charCodeRange minValue="11bc" maxValue="11c2"/>
- <charCode value="11eb"/>
- <charCode value="11f0"/>
- <charCode value="11f9"/>
- <charCodeRange minValue="1e00" maxValue="1e9b"/>
- <charCodeRange minValue="1ea0" maxValue="1ef9"/>
- <charCodeRange minValue="1f00" maxValue="1f15"/>
- <charCodeRange minValue="1f18" maxValue="1f1d"/>
- <charCodeRange minValue="1f20" maxValue="1f45"/>
- <charCodeRange minValue="1f48" maxValue="1f4d"/>
- <charCodeRange minValue="1f50" maxValue="1f57"/>
- <charCode value="1f59"/>
- <charCode value="1f5b"/>
- <charCode value="1f5d"/>
- <charCodeRange minValue="1f5f" maxValue="1f7d"/>
- <charCodeRange minValue="1f80" maxValue="1fb4"/>
- <charCodeRange minValue="1fb6" maxValue="1fbc"/>
- <charCode value="1fbe"/>
- <charCodeRange minValue="1fc2" maxValue="1fc4"/>
- <charCodeRange minValue="1fc6" maxValue="1fcc"/>
- <charCodeRange minValue="1fd0" maxValue="1fd3"/>
- <charCodeRange minValue="1fd6" maxValue="1fdb"/>
- <charCodeRange minValue="1fe0" maxValue="1fec"/>
- <charCodeRange minValue="1ff2" maxValue="1ff4"/>
- <charCodeRange minValue="1ff6" maxValue="1ffc"/>
- <charCode value="2126"/>
- <charCodeRange minValue="212a" maxValue="212b"/>
- <charCode value="212e"/>
- <charCodeRange minValue="2180" maxValue="2182"/>
- <charCodeRange minValue="3041" maxValue="3094"/>
- <charCodeRange minValue="30a1" maxValue="30fa"/>
- <charCodeRange minValue="3105" maxValue="312c"/>
- <charCodeRange minValue="ac00" maxValue="d7a3"/>
- </charClass>
- </token>
-
- <token name="Ideographic" inline="false" is-macro="yes" is-xml="yes">
- <charClass>
- <charCodeRange minValue="4e00" maxValue="9fa5"/>
- <charCode value="3007"/>
- <charCodeRange minValue="3021" maxValue="3029"/>
- </charClass>
- </token>
-
- <token name="CombiningChar" inline="false" is-macro="yes" is-xml="yes">
- <charClass>
- <charCodeRange minValue="0300" maxValue="0345"/>
- <charCodeRange minValue="0360" maxValue="0361"/>
- <charCodeRange minValue="0483" maxValue="0486"/>
- <charCodeRange minValue="0591" maxValue="05a1"/>
- <charCodeRange minValue="05a3" maxValue="05b9"/>
- <charCodeRange minValue="05bb" maxValue="05bd"/>
- <charCode value="05bf"/>
- <charCodeRange minValue="05c1" maxValue="05c2"/>
- <charCode value="05c4"/>
- <charCodeRange minValue="064b" maxValue="0652"/>
- <charCode value="0670"/>
- <charCodeRange minValue="06d6" maxValue="06dc"/>
- <charCodeRange minValue="06dd" maxValue="06df"/>
- <charCodeRange minValue="06e0" maxValue="06e4"/>
- <charCodeRange minValue="06e7" maxValue="06e8"/>
- <charCodeRange minValue="06ea" maxValue="06ed"/>
- <charCodeRange minValue="0901" maxValue="0903"/>
- <charCode value="093c"/>
- <charCodeRange minValue="093e" maxValue="094c"/>
- <charCode value="094d"/>
- <charCodeRange minValue="0951" maxValue="0954"/>
- <charCodeRange minValue="0962" maxValue="0963"/>
- <charCodeRange minValue="0981" maxValue="0983"/>
- <charCode value="09bc"/>
- <charCode value="09be"/>
- <charCode value="09bf"/>
- <charCodeRange minValue="09c0" maxValue="09c4"/>
- <charCodeRange minValue="09c7" maxValue="09c8"/>
- <charCodeRange minValue="09cb" maxValue="09cd"/>
- <charCode value="09d7"/>
- <charCodeRange minValue="09e2" maxValue="09e3"/>
- <charCode value="0a02"/>
- <charCode value="0a3c"/>
- <charCode value="0a3e"/>
- <charCode value="0a3f"/>
- <charCodeRange minValue="0a40" maxValue="0a42"/>
- <charCodeRange minValue="0a47" maxValue="0a48"/>
- <charCodeRange minValue="0a4b" maxValue="0a4d"/>
- <charCodeRange minValue="0a70" maxValue="0a71"/>
- <charCodeRange minValue="0a81" maxValue="0a83"/>
- <charCode value="0abc"/>
- <charCodeRange minValue="0abe" maxValue="0ac5"/>
- <charCodeRange minValue="0ac7" maxValue="0ac9"/>
- <charCodeRange minValue="0acb" maxValue="0acd"/>
- <charCodeRange minValue="0b01" maxValue="0b03"/>
- <charCode value="0b3c"/>
- <charCodeRange minValue="0b3e" maxValue="0b43"/>
- <charCodeRange minValue="0b47" maxValue="0b48"/>
- <charCodeRange minValue="0b4b" maxValue="0b4d"/>
- <charCodeRange minValue="0b56" maxValue="0b57"/>
- <charCodeRange minValue="0b82" maxValue="0b83"/>
- <charCodeRange minValue="0bbe" maxValue="0bc2"/>
- <charCodeRange minValue="0bc6" maxValue="0bc8"/>
- <charCodeRange minValue="0bca" maxValue="0bcd"/>
- <charCode value="0bd7"/>
- <charCodeRange minValue="0c01" maxValue="0c03"/>
- <charCodeRange minValue="0c3e" maxValue="0c44"/>
- <charCodeRange minValue="0c46" maxValue="0c48"/>
- <charCodeRange minValue="0c4a" maxValue="0c4d"/>
- <charCodeRange minValue="0c55" maxValue="0c56"/>
- <charCodeRange minValue="0c82" maxValue="0c83"/>
- <charCodeRange minValue="0cbe" maxValue="0cc4"/>
- <charCodeRange minValue="0cc6" maxValue="0cc8"/>
- <charCodeRange minValue="0cca" maxValue="0ccd"/>
- <charCodeRange minValue="0cd5" maxValue="0cd6"/>
- <charCodeRange minValue="0d02" maxValue="0d03"/>
- <charCodeRange minValue="0d3e" maxValue="0d43"/>
- <charCodeRange minValue="0d46" maxValue="0d48"/>
- <charCodeRange minValue="0d4a" maxValue="0d4d"/>
- <charCode value="0d57"/>
- <charCode value="0e31"/>
- <charCodeRange minValue="0e34" maxValue="0e3a"/>
- <charCodeRange minValue="0e47" maxValue="0e4e"/>
- <charCode value="0eb1"/>
- <charCodeRange minValue="0eb4" maxValue="0eb9"/>
- <charCodeRange minValue="0ebb" maxValue="0ebc"/>
- <charCodeRange minValue="0ec8" maxValue="0ecd"/>
- <charCodeRange minValue="0f18" maxValue="0f19"/>
- <charCode value="0f35"/>
- <charCode value="0f37"/>
- <charCode value="0f39"/>
- <charCode value="0f3e"/>
- <charCode value="0f3f"/>
- <charCodeRange minValue="0f71" maxValue="0f84"/>
- <charCodeRange minValue="0f86" maxValue="0f8b"/>
- <charCodeRange minValue="0f90" maxValue="0f95"/>
- <charCode value="0f97"/>
- <charCodeRange minValue="0f99" maxValue="0fad"/>
- <charCodeRange minValue="0fb1" maxValue="0fb7"/>
- <charCode value="0fb9"/>
- <charCodeRange minValue="20d0" maxValue="20dc"/>
- <charCode value="20e1"/>
- <charCodeRange minValue="302a" maxValue="302f"/>
- <charCode value="3099"/>
- <charCode value="309a"/>
- </charClass>
- </token>
-
- <token name="Digit" inline="false" is-macro="yes" is-xml="yes">
- <charClass>
- <charCodeRange minValue="0030" maxValue="0039"/>
- <charCodeRange minValue="0660" maxValue="0669"/>
- <charCodeRange minValue="06f0" maxValue="06f9"/>
- <charCodeRange minValue="0966" maxValue="096f"/>
- <charCodeRange minValue="09e6" maxValue="09ef"/>
- <charCodeRange minValue="0a66" maxValue="0a6f"/>
- <charCodeRange minValue="0ae6" maxValue="0aef"/>
- <charCodeRange minValue="0b66" maxValue="0b6f"/>
- <charCodeRange minValue="0be7" maxValue="0bef"/>
- <charCodeRange minValue="0c66" maxValue="0c6f"/>
- <charCodeRange minValue="0ce6" maxValue="0cef"/>
- <charCodeRange minValue="0d66" maxValue="0d6f"/>
- <charCodeRange minValue="0e50" maxValue="0e59"/>
- <charCodeRange minValue="0ed0" maxValue="0ed9"/>
- <charCodeRange minValue="0f20" maxValue="0f29"/>
- </charClass>
- </token>
-
- <token name="Extender" inline="false" is-macro="yes" is-xml="yes">
- <charClass>
- <charCode value="00b7"/>
- <charCode value="02d0"/>
- <charCode value="02d1"/>
- <charCode value="0387"/>
- <charCode value="0640"/>
- <charCode value="0e46"/>
- <charCode value="0ec6"/>
- <charCode value="3005"/>
- <charCodeRange minValue="3031" maxValue="3035"/>
- <charCodeRange minValue="309d" maxValue="309e"/>
- <charCodeRange minValue="30fc" maxValue="30fe"/>
- </charClass>
- </token>
-
-
-</grammar>
-<!-- Keep this comment at the end of the file
-Local variables:
-mode: sgml
-sgml-omittag:nil
-sgml-shorttag:nil
-sgml-namecase-general:nil
-sgml-general-insert-case:lower
-sgml-minimize-attributes:nil
-sgml-always-quote-attributes:t
-sgml-indent-step:2
-sgml-indent-data:nil
-sgml-parent-document:nil
-sgml-exposed-tags:nil
-sgml-local-catalogs:nil
-sgml-local-ecat-files:nil
-End:
--->
+<?xml version="1.0"?>
+<!-- DOCTYPE grammar SYSTEM "grammar.dtd" -->
+
+<!--
+Copyright (c) 2002 W3C(r) (http://www.w3.org/) (MIT
(http://www.lcs.mit.edu/),
+INRIA (http://www.inria.fr/), Keio (http://www.keio.ac.jp/)),
+All Rights Reserved.
+See http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Copyright.
+W3C liability
+(http://www.w3.org/Consortium/Legal/ipr-notice-20000612#Legal_Disclaimer),
+trademark
+(http://www.w3.org/Consortium/Legal/ipr-notice-20000612#W3C_Trademarks),
+document use
+(http://www.w3.org/Consortium/Legal/copyright-documents-19990405),
+and software licensing rules
+(http://www.w3.org/Consortium/Legal/copyright-software-19980720)
+apply.
+-->
+
+<grammar xmlns="http://www.w3.org/2001/03/XPath/grammar">
+ <language id="xpath" display-name="XPath 2.0"/>
+ <language id="pathx1" display-name="XPath 1.0"/>
+ <language id="xquery" display-name="XQuery 1.0"/>
+ <language id="core"
+ display-name="XML Processing Formal Semantics Core Language 1.0"/>
+ <language id="match" display-name="XSLT 2.0 Match Patterns"/>
+
+ <start name="Expr" state="DEFAULT" if="pathx1"/>
+ <start name="XPath" state="DEFAULT" if="xpath"/>
+ <start name="QueryList" state="DEFAULT" if="core"/>
+ <start name="QueryList" state="DEFAULT" if="xquery"/>
+ <start name="Pattern" state="DEFAULT" if="match"/>
+
+ <token name="XmlCommentStart" if="xquery core">
+ <string><!--</string>
+ </token>
+
+ <token name="XmlCommentEnd" if="xquery core">
+ <string>--></string>
+ </token>
+
+ <token name="IntegerLiteral" inline="false" value-type="number"
type="literal">
+ <ref name="Digits"/>
+ </token>
+
+ <token name="DecimalLiteral" inline="false" value-type="number"
type="literal">
+ <choice>
+ <sequence>
+ <string>.</string>
+ <ref name="Digits"/>
+ </sequence>
+ <sequence>
+ <ref name="Digits"/>
+ <string>.</string>
+ <zeroOrMore>
+ <charClass>
+ <charRange minChar="0"
maxChar="9"/>
+ </charClass>
+ </zeroOrMore>
+ </sequence>
+ </choice>
+ </token>
+
+ <token name="DoubleLiteral" inline="false" value-type="number"
type="literal">
+ <choice>
+ <sequence>
+ <string>.</string>
+ <ref name="Digits"/>
+ </sequence>
+ <sequence>
+ <ref name="Digits"/>
+ <optional>
+ <string>.</string>
+ <zeroOrMore>
+ <charClass>
+ <charRange minChar="0" maxChar="9"/>
+ </charClass>
+ </zeroOrMore>
+ </optional>
+ </sequence>
+ </choice>
+ <charClass>
+ <char>e</char>
+ <char>E</char>
+ </charClass>
+ <optional>
+ <charClass>
+ <char>+</char>
+ <char>-</char>
+ </charClass>
+ </optional>
+ <ref name="Digits"/>
+ </token>
+
+ <token name="StringLiteral" inline="false" value-type="string"
type="literal" whitespace-spec="significant">
+ <choice>
+ <sequence>
+ <string>"</string>
+ <zeroOrMore>
+ <choice>
+ <sequence>
+ <char>"</char>
+ <char>"</char>
+ </sequence>
+ <complement>
+ <charClass>
+ <char>"</char>
+ </charClass>
+ </complement>
+ </choice>
+ </zeroOrMore>
+ <string>"</string>
+ </sequence>
+ <sequence>
+ <string>'</string>
+ <zeroOrMore>
+ <choice>
+ <sequence>
+ <char>'</char>
+ <char>'</char>
+ </sequence>
+ <complement>
+ <charClass>
+ <char>'</char>
+ </charClass>
+ </complement>
+ </choice>
+ </zeroOrMore>
+ <string>'</string>
+ </sequence>
+ </choice>
+ </token>
+
+ <token name="AtStringLiteral" if="xquery core">
+ <string>at</string>
+ <optionalSkip/>
+ <ref name="StringLiteral"/>
+ </token>
+
+ <token name="URLLiteral" inline="false" value-type="string" if="xquery
core" type="literal" whitespace-spec="significant">
+ <choice>
+ <sequence>
+ <string>"</string>
+ <zeroOrMore>
+ <choice>
+ <sequence>
+ <char>"</char>
+ <char>"</char>
+ </sequence>
+ <complement>
+ <charClass>
+ <char>"</char>
+ </charClass>
+ </complement>
+ </choice>
+ </zeroOrMore>
+ <string>"</string>
+ </sequence>
+ <sequence>
+ <string>'</string>
+ <zeroOrMore>
+ <choice>
+ <sequence>
+ <char>'</char>
+ <char>'</char>
+ </sequence>
+ <complement>
+ <charClass>
+ <char>'</char>
+ </charClass>
+ </complement>
+ </choice>
+ </zeroOrMore>
+ <string>'</string>
+ </sequence>
+ </choice>
+ </token>
+
+ <token name="ExprComment" if="xquery core xpath" special="yes"
inline="false">
+ <string>{--</string>
+ <zeroOrMore>
+ <complement>
+ <charClass>
+ <char>}</char>
+ </charClass>
+ </complement>
+ </zeroOrMore>
+ <string>--}</string>
+ </token>
+
+ <skip recognize="DEFAULT OPERATOR QNAME NAMESPACEDECL XMLSPACE_DECL
ITEMTYPE NAMESPACEKEYWORD VARNAME" if="xquery core xpath">
+ <oneOrMore>
+ <choice>
+ <ref name="WhitespaceChar"/>
+ <ref name="ExprComment"/>
+ </choice>
+ </oneOrMore>
+ </skip>
+
+ <skip recognize="DEFAULT OPERATOR QNAME" if="pathx1">
+ <oneOrMore>
+ <ref name="WhitespaceChar"/>
+ </oneOrMore>
+ </skip>
+
+ <token name="S" inline="false">
+ <oneOrMore>
+ <ref name="WhitespaceChar"/>
+ </oneOrMore>
+ </token>
+
+ <token name="ProcessingInstructionStart" if="xquery core">
+ <string><?</string>
+ </token>
+
+ <token name="ProcessingInstructionEnd" if="xquery core">
+ <string>?></string>
+ </token>
+
+ <token name="AxisChild" value-type="string">
+ <string>child</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisDescendant" value-type="string">
+ <string >descendant</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisParent" value-type="string">
+ <string >parent</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisAttribute" value-type="string">
+ <string >attribute</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisSelf" value-type="string">
+ <string >self</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisDescendantOrSelf" value-type="string">
+ <string >descendant-or-self</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisAncestor" value-type="string" if="xpath pathx1 core">
+ <string >ancestor</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisFollowingSibling" value-type="string" if="xpath pathx1
core">
+ <string >following-sibling</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisPrecedingSibling" value-type="string" if="xpath pathx1
core">
+ <string >preceding-sibling</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisFollowing" value-type="string" if="xpath pathx1 core">
+ <string >following</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisPreceding" value-type="string" if="xpath pathx1 core">
+ <string >preceding</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisNamespace" value-type="string" if="xpath pathx1 core">
+ <string >namespace</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="AxisAncestorOrSelf" value-type="string" if="xpath pathx1
core">
+ <string >ancestor-or-self</string>
+ <optionalSkip/>
+ <string>::</string>
+ </token>
+
+ <token name="DefineElement" if="core">
+ <string >define</string>
+ <requiredSkip show="no"/>
+ <string >element</string>
+ </token>
+
+ <token name="DefineAttribute" if="core">
+ <string >define</string>
+ <requiredSkip show="no"/>
+ <string >attribute</string>
+ </token>
+
+ <token name="DefineType" if="core">
+ <string >define</string>
+ <requiredSkip show="no"/>
+ <string >type</string>
+ </token>
+
+ <token name="DefineFunction" if="xquery core">
+ <string >define</string>
+ <requiredSkip show="no"/>
+ <string >function</string>
+ </token>
+
+ <token name="Or">
+ <string >or</string>
+ </token>
+
+ <token name="And">
+ <string >and</string>
+ </token>
+
+ <!-- token name="AtKeyword">
+ <string >at</string>
+ </token -->
+
+ <token name="Div">
+ <string >div</string>
+ </token>
+
+ <token name="Idiv">
+ <string >idiv</string>
+ </token>
+
+ <token name="Mod">
+ <string >mod</string>
+ </token>
+
+ <token name="Multiply">
+ <string>*</string>
+ </token>
+
+ <token name="In" if="xpath xquery core">
+ <string >in</string>
+ </token>
+
+ <token name="InContext" if="xpath xquery core">
+ <string >context</string>
+ </token>
+
+ <token name="Satisfies" value-type="id">
+ <string >satisfies</string>
+ </token>
+
+ <token name="Return">
+ <string >return</string>
+ </token>
+
+ <token name="Then">
+ <string >then</string>
+ </token>
+
+ <token name="Else">
+ <string >else</string>
+ </token>
+
+ <token name="Default" if="xquery core">
+ <string >default</string>
+ </token>
+
+ <token name="DeclareXMLSpace" if="xquery core">
+ <string >declare</string>
+ <requiredSkip show="no"/>
+ <string>xmlspace</string>
+ </token>
+
+ <token name="XMLSpacePreserve" if="xquery core">
+ <string >preserve</string>
+ </token>
+
+ <token name="XMLSpaceStrip" if="xquery core">
+ <string >strip</string>
+ </token>
+
+ <token name="Namespace" if="xquery core">
+ <string >namespace</string>
+ </token>
+
+ <token name="DeclareNamespace" if="xquery core">
+ <string >declare</string>
+ <requiredSkip show="no"/>
+ <string>namespace</string>
+ </token>
+
+ <token name="DeclareResult" if="xquery core">
+ <string >declare</string>
+ <requiredSkip show="no"/>
+ <string>result</string>
+ </token>
+
+ <token name="To">
+ <string >to</string>
+ </token>
+
+ <token name="Where" if="xquery core">
+ <string >where</string>
+ </token>
+
+ <token name="Collation" if="xquery core">
+ <string >collation</string>
+ </token>
+
+ <token name="Intersect">
+ <string >intersect</string>
+ </token>
+
+ <token name="Union">
+ <string >union</string>
+ </token>
+
+ <token name="Except">
+ <string >except</string>
+ </token>
+
+ <!-- token name="Before" if="xquery core" value-type="id">
+ <string >before</string>
+ </token>
+
+ <token name="After" if="xquery core" value-type="id">
+ <string >after</string>
+ </token -->
+
+ <token name="As" if="xquery core">
+ <string >as</string>
+ </token>
+
+ <token name="AtWord" if="xquery core">
+ <string >at</string>
+ </token>
+
+ <token name="Case" if="xquery core">
+ <string >case</string>
+ </token>
+
+ <token name="Instanceof">
+ <string >instance</string>
+ <requiredSkip show="no"/>
+ <string >of</string>
+ </token>
+
+ <token name="Castable">
+ <string>castable</string>
+ <requiredSkip show="no"/>
+ <string >as</string> </token>
+
+ <!-- see
http://lists.w3.org/Archives/Member/w3c-xsl-query/2002Mar/0154.html -->
+ <!-- token name="Only" value-type="id">
+ <string >only</string>
+ </token -->
+
+ <!-- token name="Returns" if="xquery core">
+ <string >returns</string>
+ </token -->
+
+ <token name="RparAs" if="xquery core">
+ <string >)</string>
+ <optionalSkip/>
+ <string >as</string>
+ </token>
+
+ <!-- token name="Function" value-type="id" if="xquery core">
+ <string >function</string>
+ </token -->
+
+ <token name="Item" value-type="id">
+ <string >item</string>
+ </token>
+
+ <token name="ElementType" value-type="id">
+ <string >element</string>
+ </token>
+
+ <token name="AttributeType" value-type="id">
+ <string >attribute</string>
+ </token>
+
+ <!-- token name="Element" value-type="id">
+ <string >element</string>
+ </token -->
+
+ <token name="ElementQNameLbrace" value-type="id">
+ <string >element</string>
+ <requiredSkip show="no"/>
+ <ref name="QName"/>
+ <optionalSkip/>
+ <string>{</string>
+ </token>
+
+ <token name="AttributeQNameLbrace" value-type="id">
+ <string >attribute</string>
+ <requiredSkip show="no"/>
+ <ref name="QName"/>
+ <optionalSkip/>
+ <string>{</string>
+ </token>
+
+ <token name="ElementLbrace" value-type="id">
+ <string >element</string>
+ <optionalSkip/>
+ <string>{</string>
+ </token>
+
+ <token name="AttributeLbrace" value-type="id">
+ <string >attribute</string>
+ <optionalSkip/>
+ <string>{</string>
+ </token>
+
+ <token name="TextLbrace" value-type="id" if="xquery core">
+ <string >text</string>
+ <optionalSkip/>
+ <string>{</string>
+ </token>
+
+ <!-- token name="Attribute" value-type="id">
+ <string >attribute</string>
+ </token -->
+
+ <token name="DefaultCollationEquals" if="xpath xquery core">
+ <string >default</string>
+ <requiredSkip show="no"/>
+ <string >collation</string>
+ <requiredSkip show="no"/>
+ <string >=</string>
+ </token>
+
+ <token name="DefaultElement" if="xpath xquery core">
+ <string >default</string>
+ <requiredSkip show="no"/>
+ <string >element</string>
+ </token>
+
+ <token name="DefaultFunction" if="xpath xquery core">
+ <string >default</string>
+ <requiredSkip show="no"/>
+ <string >function</string>
+ </token>
+
+ <token name="OfType" value-type="id">
+ <string >of</string>
+ <requiredSkip show="no"/>
+ <string >type</string>
+ </token>
+
+ <token name="AtomicValue" value-type="id">
+ <string >atomic</string>
+ <requiredSkip show="no"/>
+ <string >value</string>
+ </token>
+
+ <token name="Type" if="core" value-type="id">
+ <string >type</string>
+ </token>
+
+ <token name="TypeQName" if="xpath xquery core">
+ <string >type</string>
+ <requiredSkip show="no"/>
+ <ref name="QName"/>
+ </token>
+
+ <token name="Node" if="xquery core xpath" value-type="id">
+ <string >node</string>
+ </token>
+
+ <token name="Empty" if="xquery core xpath" value-type="id">
+ <string >empty</string>
+ </token>
+
+
+ <token name="None" if="core">
+ <string >none</string>
+ </token>
+
+ <!-- token name="Ref" if="xquery core" value-type="id">
+ <string >ref</string>
+ </token -->
+
+ <!-- Schema and Module need to be above QName in order for it
+ to work with flex. Of course, this means that these
+ are reserved words. I suspect they can be stateful to
+ avoid this. -->
+ <!-- token name="Schema" if="xquery core">
+ <string >schema</string>
+ </token -->
+
+ <token name="ImportSchemaToken" if="xquery core">
+ <string >import</string>
+ <requiredSkip show="no"/>
+ <string>schema</string>
+ </token>
+
+ <!-- token name="Module" if="xquery core">
+ <string >module</string>
+ </token -->
+
+ <!--
+ <token name="Minoccurs" if="core">
+ <string >minoccurs</string>
+ </token>
+ <token name="Maxoccurs" if="core">
+ <string >maxoccurs</string>
+ </token>
+ -->
+
+ <token name="Nmstart" inline="false">
+ <choice>
+ <ref name="Letter"/>
+ <string>_</string>
+ </choice>
+ </token>
+
+ <token name="Nmchar" inline="false">
+ <choice>
+ <ref name="Letter"/>
+ <ref name="CombiningChar"/>
+ <ref name="Extender"/>
+ <ref name="Digit"/>
+ <string>.</string>
+ <string>-</string>
+ <string>_</string>
+ </choice>
+ </token>
+
+ <token name="Star" value-type="string">
+ <string>*</string>
+ </token>
+
+ <token name="NCNameColonStar" value-type="string">
+ <ref name="NCName"/>
+ <string>:</string>
+ <string>*</string>
+ </token>
+
+ <token name="StarColonNCName" value-type="string">
+ <string>*</string>
+ <string>:</string>
+ <ref name="NCName"/>
+ </token>
+
+ <token name="Root" value-type="id">
+ <string>/</string>
+ </token>
+
+ <token name="RootDescendants" value-type="id">
+ <string>//</string>
+ </token>
+
+ <token name="Slash">
+ <string>/</string>
+ </token>
+
+ <token name="SlashSlash">
+ <string>//</string>
+ </token>
+
+ <token name="Equals">
+ <string>=</string>
+ </token>
+
+ <token name="AssignEquals" if="xquery core">
+ <string>=</string>
+ </token>
+
+ <token name="XMLSpaceEquals" if="xquery core">
+ <string>=</string>
+ </token>
+
+ <token name="Is">
+ <string>is</string>
+ </token>
+
+ <token name="NotEquals">
+ <string>!=</string>
+ </token>
+
+ <token name="IsNot">
+ <string>isnot</string>
+ </token>
+
+ <token name="LtEquals">
+ <string><=</string>
+ </token>
+
+ <token name="LtLt" >
+ <string><<</string>
+ </token>
+
+ <token name="GtEquals">
+ <string>>=</string>
+ </token>
+
+ <token name="GtGt" >
+ <string>>></string>
+ </token>
+
+ <token name="FortranEq" >
+ <string>eq</string>
+ </token>
+
+ <token name="FortranNe" >
+ <string>ne</string>
+ </token>
+
+ <token name="FortranGt" >
+ <string>gt</string>
+ </token>
+
+ <token name="FortranGe" >
+ <string>ge</string>
+ </token>
+
+ <token name="FortranLt" >
+ <string>lt</string>
+ </token>
+
+ <token name="FortranLe" >
+ <string>le</string>
+ </token>
+
+ <token name="ColonEquals" if="xquery core">
+ <string>:=</string>
+ </token>
+
+ <token name="Lt">
+ <string><</string>
+ </token>
+
+ <token name="Gt">
+ <string>></string>
+ </token>
+
+ <token name="Minus" value-type="id">
+ <string>-</string>
+ </token>
+
+ <token name="Plus" value-type="id">
+ <string>+</string>
+ </token>
+
+ <token name="QMark" if="xquery core xpath">
+ <string>?</string>
+ </token>
+
+ <!-- Decision from Oracle F2F to remove -->
+ <!-- token name="Arrow" value-type="id">
+ <string>=></string>
+ </token -->
+
+ <token name="Vbar">
+ <string>|</string>
+ </token>
+
+ <token name="Lpar" node-type="void">
+ <string>(</string>
+ </token>
+
+ <token name="At">
+ <string>@</string>
+ </token>
+
+ <token name="Lbrack">
+ <string>[</string>
+ </token>
+
+ <token name="Rbrack">
+ <string>]</string>
+ </token>
+
+ <token name="Rpar" node-type="void">
+ <string>)</string>
+ </token>
+
+ <token name="Some" value-type="id">
+ <string >some</string>
+ <optionalSkip/>
+ <ref name="VariableIndicator"/>
+ </token>
+
+ <token name="Every" value-type="id">
+ <string >every</string>
+ <optionalSkip/>
+ <ref name="VariableIndicator"/>
+ </token>
+
+ <!-- Added for XPath with no reserved words. -sb -->
+ <token name="ForVariable" override="true"
+ if="xpath pathx1 xquery core" node-type="void">
+ <string >for</string>
+ <optionalSkip/>
+ <ref name="VariableIndicator"/>
+ </token>
+
+ <token name="LetVariable" if="xquery core">
+ <string >let</string>
+ <optionalSkip/>
+ <ref name="VariableIndicator"/>
+ </token>
+
+ <token name="CastAs">
+ <string >cast</string>
+ <requiredSkip show="no"/>
+ <string >as</string>
+ </token>
+
+ <!-- token name="AssertAs">
+ <string >assert</string>
+ <requiredSkip show="no"/>
+ <string >as</string>
+ </token -->
+
+ <token name="TreatAs">
+ <string >treat</string>
+ <requiredSkip show="no"/>
+ <string >as</string>
+ </token>
+
+ <token name="ValidateLbrace" if="xpath xquery core">
+ <string >validate</string>
+ <optionalSkip/>
+ <string>{</string>
+ </token>
+
+ <token name="ValidateContext" if="xpath xquery core">
+ <string >validate</string>
+ <requiredSkip show="no"/>
+ <string>context</string>
+ </token>
+
+ <token name="Digits" inline="false">
+ <oneOrMore>
+ <charClass>
+ <charRange minChar="0" maxChar="9"/>
+ </charClass>
+ </oneOrMore>
+ </token>
+
+ <token name="Comment" override="true" if="xquery core xpath"
value-type="id">
+ <string >comment</string>
+ </token>
+
+ <token name="Document" override="true" if="xquery core xpath"
value-type="id">
+ <string >document</string>
+ </token>
+
+ <token name="DocumentLbrace" override="true" if="xquery core xpath"
value-type="id">
+ <string >document</string>
+ <optionalSkip/>
+ <string>{</string>
+ </token>
+
+ <token name="Text" override="true" if="xquery core xpath" value-type="id">
+ <string >text</string >
+ </token>
+
+ <token name="Untyped" override="true" if="xquery core xpath"
value-type="id">
+ <string>untyped</string>
+ </token>
+
+ <!-- token name="Unordered" if="xquery core" value-type="id">
+ <string>unordered</string>
+ </token -->
+
+
+ <token name="ProcessingInstruction" override="true" if="xquery core xpath"
value-type="id">
+ <string >processing-instruction</string>
+ </token>
+
+ <token name="NodeLpar" if="xquery core xpath pathx1" node-type="void">
+ <string >node</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="CommentLpar" override="true"
+ if="xquery core xpath pathx1" node-type="void">
+ <string >comment</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="TextLpar" override="true" if="xquery core xpath pathx1"
+ node-type="void">
+ <string >text</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="ProcessingInstructionLpar" override="true"
+ if="xquery core xpath pathx1" node-type="void">
+ <string >processing-instruction</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <!-- Added for XPath with no reserved words. -sb -->
+ <token name="IfLpar" override="true" if="xquery core xpath">
+ <string >if</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="TypeswitchLpar" override="true" if="xquery core">
+ <string >typeswitch</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="Comma" node-type="void">
+ <string>,</string>
+ </token>
+
+ <token name="SemiColon" if="xquery core" show="no" node-type="void">
+ <string>;</string>
+ </token>
+
+ <!-- token name="Colon" if="xquery core">
+ <string>:</string>
+ </token -->
+
+ <!-- Should only be recognized in attribute content. -->
+ <token name="EscapeQuot" inline="false" override="true" if="xquery">
+ <sequence>
+ <char>"</char>
+ <char>"</char>
+ </sequence>
+ </token>
+
+ <!-- OpenQuot and CloseQuote need to be before StringLiteral in
+ order for them to be matched by flex. -->
+ <token name="OpenQuot" if="xquery core">
+ <string>"</string>
+ </token>
+
+ <token name="CloseQuot" if="xquery core">
+ <string>"</string>
+ </token>
+
+ <token name="Dot" value-type="id">
+ <string>.</string>
+ </token>
+
+ <token name="DotDot" value-type="id">
+ <string>..</string>
+ </token>
+
+ <!-- token name="SortbyLpar" if="xquery core">
+ <string >sort</string>
+ <requiredSkip show="no"/>
+ <string >by</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token -->
+
+ <token name="OrderBy" if="xquery core">
+ <string >order</string>
+ <requiredSkip show="no"/>
+ <string >by</string>
+ </token>
+
+ <token name="OrderByStable" if="xquery core">
+ <string >stable</string>
+ <requiredSkip show="no"/>
+ <string >order</string>
+ <requiredSkip show="no"/>
+ <string >by</string>
+ </token>
+
+ <token name="Ascending" if="xquery core" value-type="id">
+ <string >ascending</string>
+ </token>
+
+ <token name="Descending" if="xquery core" value-type="id">
+ <string >descending</string>
+ </token>
+
+ <token name="EmptyGreatest" if="xquery core" value-type="id">
+ <string >empty</string>
+ <requiredSkip show="no"/>
+ <string >greatest</string>
+ </token>
+
+ <token name="EmptyLeast" if="xquery core" value-type="id">
+ <string >empty</string>
+ <requiredSkip show="no"/>
+ <string >least</string>
+ </token>
+
+ <!--
+ <token name="Sequence" if="xquery">
+ <string >sequence</string>
+ </token>
+ -->
+
+ <token name="PITarget" inline="false" if="xquery core" value-type="string">
+ <ref name="NCName"/>
+ </token>
+
+ <token name="NCName" inline="false" value-type="string" is-xml="yes">
+ <ref name="Nmstart"/>
+ <zeroOrMore>
+ <ref name="Nmchar"/>
+ </zeroOrMore>
+ </token>
+
+ <token name="Prefix" value-type="string" visible="false" is-xml="yes">
+ <ref name="NCName"/>
+ </token>
+
+ <token name="LocalPart" value-type="string" visible="false" is-xml="yes">
+ <ref name="NCName"/>
+ </token>
+
+ <token name="VariableIndicator" inline="true" node-type="void">
+ <string>$</string>
+ </token>
+
+ <token name="VarName" inline="false" value-type="string">
+ <ref name="QName"/>
+ </token>
+
+ <!-- token name="Variable" inline="true" value-type="string">
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ </token -->
+
+ <token name="QName" inline="false" value-type="string" is-xml="yes">
+ <optional>
+ <ref name="Prefix"/>
+ <string>:</string>
+ </optional>
+ <ref name="LocalPart"/>
+ </token>
+
+ <token name="QNameLpar" value-type="string">
+ <ref name="QName"/>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="IDLpar" value-type="string" if="match">
+ <string>id</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="KeyLpar" value-type="string" if="match">
+ <string>key</string>
+ <optionalSkip/>
+ <string>(</string>
+ </token>
+
+ <token name="NCNameForPrefix" inline="false" value-type="string"
if="xquery core">
+ <ref name="Nmstart"/>
+ <zeroOrMore>
+ <ref name="Nmchar"/>
+ </zeroOrMore>
+ </token>
+
+ <state-list if="xquery core xpath pathx1">
+ <state name="#ANY">This state is for patterns that can be recognized in
any state.</state>
+ <state name="DEFAULT">This state is for patterns that occur at the
beginning of an expression.</state>
+ <state name="OPERATOR">This state is for patterns that are defined for
operators.</state>
+ <state name="QNAME">When a qualified name is expected, and it is
required to remove ambiguity from patterns that look like keywords, this state
is used.</state>
+ <state name="NAMESPACEDECL" if="xquery core">This state occurs inside of
a namespace declaration, and is needed to recognize a NCName that is to be used
as the prefix, as opposed to allowing a QName to occur. (Otherwise, the
difference between NCName and QName are ambiguous.)</state>
+ <state name="NAMESPACEKEYWORD" if="xquery core">This state occurs at
places where the keyword "namespace" is expected, which would otherwise be
ambiguous compared to a QName. QNames can not occur in this state.</state>
+ <state name="XMLSPACE_DECL" if="xquery core">This state occurs at places
where the keywords "preserve" and "strip" is expected to support "declare
xmlspace". QNames can not occur in this state.</state>
+ <state name="ITEMTYPE">This state distinguishes tokens that can occur
only inside the ItemType production.</state>
+ <!-- state name="FUNCDEF" if="xquery core">This state is defined to
recognise a FuncName, which then transitions to an ITEMTYPE state after the
opening left bracket, in order to recognize SequenceType productions.</state -->
+ <state name="VARNAME">This state differentiates variable names from
qualified names. This allows only the pattern of a QName to be recognized when
otherwise ambiguities could occur.</state>
+ <state name="START_TAG" if="xquery core">This state allows attributes in
the native XML syntax, and marks the beginning of an element construction.
Element constructors also push the current state, popping it at the conclusion
of an end tag. In the START_TAG state, the string ">" is recognized as a token
which is associated with the transition to the original state.</state>
+ <state name="ELEMENT_CONTENT" if="xquery core">This state allows
XML-like content, without these characters being misinterpreted as expressions.
The character "{" marks a transition to the DEFAULT state, i.e. the start of an
embedded expression, and the "}" character pops back to the ELEMENT_CONTENT
state. To allow curly braces to be used as character content, a double left or
right curly brace is interpreted as a single curly brace character. The string
"</" is interpreted as the beginning of an end tag, which is associated with
a transition to the END_TAG state.</state>
+ <state name="END_TAG" if="xquery core">When the end tag is terminated,
the state is popped to the state that was pushed at the start of the
corresponding start tag.</state>
+ <state name="XML_COMMENT" if="xquery core">The "<--" token marks the
beginning of an XML Comment, and the "-->" token marks the end. This allows no
special interpretation of other characters in this state.</state>
+ <state name="PROCESSING_INSTRUCTION" if="xquery core">In this state,
only lexemes that are legal in a processing instruction name are
recognized.</state>
+ <state name="PROCESSING_INSTRUCTION_CONTENT" if="xquery core">In this
state, only characters are that are legal in processing instruction content are
recognized.</state>
+ <state name="CDATA_SECTION" if="xquery core">In this state, only lexemes
that are legal in a CDATA section are recognized.</state>
+ <state name="QUOT_ATTRIBUTE_CONTENT" if="xquery core">This state allows
content legal for attributes. The character "{" marks a transition to the
DEFAULT state, i.e. the start of an embedded expression, and the "}" character
pops back to the original state. To allow curly braces to be used as character
content, a double left or right curly brace is interpreted as a single curly
brace character. This state is the same as QUOT_ATTRIBUTE_CONTENT, except that
apostrophes are allowed without escaping, and an unescaped quote marks the end
of the state.</state>
+ <state name="APOS_ATTRIBUTE_CONTENT" if="xquery core">This state is the
same as QUOT_ATTRIBUTE_CONTENT, except that quotes are allowed, and an
unescaped apostrophe marks the end of the state.</state>
+ </state-list>
+
+ <lexical-state-transitions if="xquery core xpath pathx1">
+ <transition refs="WhitespaceChar Nmstart NCName Nmchar Prefix
LocalPart
+ Digits Letter BaseChar Ideographic CombiningChar
+ Digit Extender HexDigits"/>
+
+ <transition-default recognize="DEFAULT OPERATOR" nextState="OPERATOR"/>
+ <transition refs="Rbrack IntegerLiteral DecimalLiteral DoubleLiteral
TypeswitchLpar OrderByStable" recognize="DEFAULT OPERATOR"
nextState="OPERATOR"/>
+
+ <transition refs="S" recognize="DEFAULT OPERATOR QNAME
START_TAG NAMESPACEDECL ITEMTYPE
+ NAMESPACEKEYWORD END_TAG"/>
+ <!-- ==== NEXT=>DEFAULT ==== -->
+ <transition refs="URLLiteral" recognize="NAMESPACEDECL"
nextState="DEFAULT"/>
+ <transition refs="Slash SlashSlash Div Idiv Mod And Or
+ Multiply Return Then Else To
+ Union Intersect Except
+ Equals Is NotEquals
+ IsNot LtEquals GtEquals
+ Lt Gt Vbar
+ LtLt GtGt
+ FortranEq FortranNe FortranGt
+ FortranGe FortranLt FortranLe
+ Type In InContext
+ Where OrderBy Satisfies AtWord ColonEquals"
+ recognize="OPERATOR" nextState="DEFAULT"/>
+
+ <transition refs="TypeQName" recognize="DEFAULT" nextState="OPERATOR"/>
+
+ <transition refs="Collation" recognize="OPERATOR" nextState="OPERATOR"/>
+
+ <transition refs="QMark"
+ recognize="DEFAULT OPERATOR" nextState="DEFAULT"/>
+
+ <!-- nextState="DEFAULT" -->
+ <transition refs="Comma" recognize="OPERATOR DEFAULT QNAME"
+ action="resetParenStateOrSwitch(DEFAULT)"/>
+
+ <transition refs="AttributeType ElementType Node Document Comment Text
+ ProcessingInstruction Item Untyped AtomicValue AtomicType
Empty"
+ recognize="ITEMTYPE" nextState="DEFAULT"/>
+
+ <transition refs="Lbrack Plus Minus"
+ recognize="DEFAULT OPERATOR" nextState="DEFAULT"/>
+
+ <transition refs="Lpar"
+ recognize="DEFAULT OPERATOR QNAME" nextState="DEFAULT"/>
+ <transition refs="TextLpar CommentLpar NodeLpar
ProcessingInstructionLpar"
+ recognize="QNAME DEFAULT" nextState="DEFAULT"/>
+ <transition refs="DefaultCollationEquals" recognize="DEFAULT OPERATOR"
+ nextState="NAMESPACEDECL"/>
+ <!-- Not sure that this is right for SemiColon, but SemiColon is a
+ strange character anyhow. -sb -->
+ <transition refs="SemiColon"
+ recognize="QNAME DEFAULT OPERATOR" nextState="DEFAULT"/>
+ <!-- transition refs="Returns" recognize="OPERATOR" nextState="DEFAULT"/
-->
+ <transition refs="Type"
+ recognize="DEFAULT" nextState="DEFAULT"/>
+
+ <transition refs="IfLpar"
+ recognize="DEFAULT" nextState="DEFAULT"/>
+
+ <transition refs="QNameLpar"
+ recognize="DEFAULT" nextState="DEFAULT"/>
+
+ <transition refs="AtStringLiteral"
+ recognize="DEFAULT OPERATOR" nextState="DEFAULT"/>
+ <transition refs="Item Node Document Comment Text"
+ recognize="OPERATOR" nextState="DEFAULT"/>
+ <transition refs="LbraceExprEnclosure ValidateLbrace" recognize="DEFAULT
OPERATOR ITEMTYPE"
+ nextState="DEFAULT" action="pushState(DEFAULT)"/>
+ <transition refs="AttributeQNameLbrace ElementQNameLbrace ElementLbrace
DocumentLbrace AttributeLbrace TextLbrace" recognize="DEFAULT"
+ nextState="DEFAULT" action="pushState(DEFAULT)"/>
+ <transition refs="ValidateContext"
+ recognize="DEFAULT" nextState="DEFAULT"/>
+
+ <transition refs="Lbrace" recognize="START_TAG END_TAG ELEMENT_CONTENT
+ QUOT_ATTRIBUTE_CONTENT
+ APOS_ATTRIBUTE_CONTENT"
+ nextState="DEFAULT" action="pushState"/>
+ <!-- ==== NEXT=>OPERATOR ==== -->
+ <transition refs="VarName" recognize="VARNAME" nextState="OPERATOR"/>
+ <transition refs="Star" recognize="DEFAULT QNAME" nextState="OPERATOR"/>
+ <transition refs="QName NCNameColonStar StarColonNCName Dot DotDot"
+ recognize="ITEMTYPE QNAME DEFAULT OPERATOR"
+ nextState="OPERATOR"/>
+
+ <transition refs="Rpar" recognize="DEFAULT OPERATOR ITEMTYPE QNAME"
+ nextState="OPERATOR"/>
+
+ <transition refs="Ascending Descending EmptyGreatest EmptyLeast"
+ recognize="OPERATOR" nextState="OPERATOR"/>
+ <transition refs="StringLiteral" recognize="DEFAULT OPERATOR
NAMESPACEKEYWORD" nextState="OPERATOR"/>
+ <transition refs="Default" recognize="OPERATOR" nextState="OPERATOR"/>
+ <!-- ==== NEXT=>VARNAME ==== -->
+ <transition refs="VariableIndicator" recognize="DEFAULT OPERATOR
ITEMTYPE QNAME" nextState="VARNAME"/>
+ <!-- transition refs="Unordered" recognize="DEFAULT OPERATOR" if="xquery
core"/ -->
+ <!-- transition refs="ForVariable LetVariable Some Every"
+ recognize="DEFAULT OPERATOR" nextState="ITEMTYPE" if="xquery
core"/ -->
+ <transition refs="ForVariable LetVariable Some Every"
+ recognize="DEFAULT OPERATOR" nextState="VARNAME"/>
+ <!-- ==== NEXT=>NAMESPACEKEYWORD ==== -->
+ <transition refs="DefaultElement DefaultFunction ImportSchemaToken"
recognize="DEFAULT OPERATOR" nextState="NAMESPACEKEYWORD"/>
+ <!-- ==== NEXT=>NAMESPACEDECL ==== -->
+ <transition refs="Namespace" recognize="NAMESPACEKEYWORD"
nextState="NAMESPACEDECL"/>
+ <transition refs="DeclareNamespace" recognize="DEFAULT OPERATOR"
nextState="NAMESPACEDECL"/>
+ <transition refs="AssignEquals NCNameForPrefix"
recognize="NAMESPACEDECL" nextState="NAMESPACEDECL"/>
+ <!-- ==== NEXT=>ITEMTYPE ==== -->
+ <transition refs="Instanceof Castable Case As" recognize="OPERATOR"
nextState="ITEMTYPE"/>
+ <transition refs="CastAs TreatAs" recognize="DEFAULT"
nextState="ITEMTYPE"/>
+ <transition refs="DeclareResult" recognize="DEFAULT OPERATOR"
nextState="ITEMTYPE"/>
+ <!-- transition refs="FuncName" recognize="FUNCDEF"/ -->
+ <!-- transition refs="FuncPListOpen" recognize="FUNCDEF"
+ action="pushParenState(DEFAULT, ITEMTYPE)"/ -->
+
+ <!-- Both nextState and action here on purpose -->
+ <transition refs="RparAs" recognize="DEFAULT OPERATOR ITEMTYPE QNAME"
+ nextState="ITEMTYPE"/>
+
+ <!-- ==== NEXT=>FUNCDEF ==== -->
+ <transition refs="DefineFunction" recognize="DEFAULT OPERATOR"
nextState="DEFAULT"/>
+ <!-- ==== NEXT=>QNAME ==== -->
+ <transition refs="OfType" recognize="DEFAULT OPERATOR"
nextState="QNAME"/>
+ <transition refs="Root RootDescendants
+ AxisChild AxisDescendant AxisParent AxisAttribute
+ AxisSelf AxisDescendantOrSelf AxisAncestor AxisFollowingSibling
+ AxisPrecedingSibling AxisFollowing AxisPreceding AxisNamespace
+ AxisAncestorOrSelf"
+ recognize="DEFAULT QNAME" nextState="QNAME"/>
+ <transition refs="At" recognize="DEFAULT QNAME" nextState="QNAME"/>
+ <!-- ==== NEXT=>XML_COMMENT ==== -->
+ <transition refs="XmlCommentStart"
+ recognize="DEFAULT ELEMENT_CONTENT" nextState="XML_COMMENT"
+ action="pushState"/>
+ <!-- ==== NEXT=>PROCESSING_INSTRUCTION ==== -->
+ <transition refs="ProcessingInstructionStart"
+ recognize="DEFAULT ELEMENT_CONTENT"
nextState="PROCESSING_INSTRUCTION" action="pushState"/>
+ <!-- ==== NEXT=>CDATA_SECTION ==== -->
+ <transition refs="CdataSectionStart" recognize="ELEMENT_CONTENT DEFAULT"
nextState="CDATA_SECTION" action="pushState"/>
+ <!-- ==== NEXT=>ELEMENT_CONTENT ==== -->
+ <transition refs="CdataSectionEnd"
+ recognize="ELEMENT_CONTENT CDATA_SECTION" action="popState"/>
+ <transition refs="StartTagClose" recognize="START_TAG"
+ nextState="ELEMENT_CONTENT"/>
+ <!-- ==== NEXT=>START_TAG ==== -->
+ <transition refs="StartTagOpen" recognize="ELEMENT_CONTENT"
+ nextState="START_TAG" action="pushState"/>
+ <transition refs="StartTagOpenRoot" recognize="DEFAULT"
+ nextState="START_TAG" action="pushState(OPERATOR)"/>
+ <transition refs="CloseQuot" recognize="QUOT_ATTRIBUTE_CONTENT"
+ nextState="START_TAG"/>
+ <!-- ==== NEXT=>END_TAG ==== -->
+ <transition refs="EndTagOpen" recognize="ELEMENT_CONTENT"
+ nextState="END_TAG"/>
+ <transition refs="CloseApos" recognize="APOS_ATTRIBUTE_CONTENT"
+ nextState="START_TAG"/>
+ <!-- ==== NEXT=>QUOT_ATTRIBUTE_CONTENT ==== -->
+ <transition refs="OpenQuot" recognize="START_TAG"
+ nextState="QUOT_ATTRIBUTE_CONTENT"/>
+ <transition refs="EscapeQuot" recognize="QUOT_ATTRIBUTE_CONTENT"
+ nextState="QUOT_ATTRIBUTE_CONTENT"/>
+ <!-- ==== NEXT=>APOS_ATTRIBUTE_CONTENT ==== -->
+ <transition refs="OpenApos" recognize="START_TAG"
+ nextState="APOS_ATTRIBUTE_CONTENT"/>
+ <transition refs="EscapeApos" recognize="APOS_ATTRIBUTE_CONTENT"
+ nextState="APOS_ATTRIBUTE_CONTENT"/>
+ <!-- ==== NEXT=>XMLSPACE_DECL ==== -->
+ <transition refs="DeclareXMLSpace" recognize="DEFAULT OPERATOR"
nextState="XMLSPACE_DECL"/>
+ <transition refs="XMLSpaceEquals" recognize="XMLSPACE_DECL"/>
+ <transition refs="XMLSpacePreserve XMLSpaceStrip"
+ recognize="XMLSPACE_DECL"
+ nextState="DEFAULT"/>
+ <!-- ==== NEXT=>(SAME) ==== -->
+ <transition refs="ExprComment" recognize="DEFAULT OPERATOR QNAME
NAMESPACEDECL XMLSPACE_DECL
+ ITEMTYPE NAMESPACEKEYWORD
VARNAME ELEMENT_CONTENT"/>
+ <transition refs="PITarget" recognize="PROCESSING_INSTRUCTION"
nextState="PROCESSING_INSTRUCTION_CONTENT"/>
+ <transition refs="PredefinedEntityRef CharRef"
+ recognize="ELEMENT_CONTENT QUOT_ATTRIBUTE_CONTENT
APOS_ATTRIBUTE_CONTENT"/>
+ <transition refs="TagQName" recognize="START_TAG END_TAG"/>
+ <transition refs="ValueIndicator" recognize="START_TAG"/>
+ <transition refs="LCurlyBraceEscape RCurlyBraceEscape"
recognize="ELEMENT_CONTENT QUOT_ATTRIBUTE_CONTENT
+ APOS_ATTRIBUTE_CONTENT"/>
+ <transition refs="Char" recognize="ELEMENT_CONTENT CDATA_SECTION
+ QUOT_ATTRIBUTE_CONTENT
+ APOS_ATTRIBUTE_CONTENT
+ PROCESSING_INSTRUCTION_CONTENT XML_COMMENT
+ XQUERY_COMMENT"/>
+ <!-- ==== NEXT=>pop ==== -->
+
+ <transition refs="XmlCommentEnd" recognize="XML_COMMENT"
+ action="popState"/>
+ <transition refs="ProcessingInstructionEnd"
+ recognize="PROCESSING_INSTRUCTION_CONTENT" action="popState"/>
+ <transition refs="EmptyTagClose" recognize="START_TAG"
+ action="popState"/>
+ <transition refs="EndTagClose" recognize="END_TAG" action="popState"/>
+ <transition refs="Rbrace" recognize="QUOT_ATTRIBUTE_CONTENT OPERATOR
DEFAULT" action="popState"/>
+
+ </lexical-state-transitions>
+ <!-- ====================== End Lexical States ==================== -sb -->
+
+ <!-- The QueryList production is not in the official grammar,
+ and is not shown in the bnf. It is here only for the purpose
+ of testing a series of queries.
+ -->
+ <production name="QueryList" if="xquery core" show="no">
+ <ref name="Query"/>
+ <zeroOrMore>
+ <ref name="SemiColon"/>
+ <ref name="Query"/>
+ </zeroOrMore>
+ </production>
+
+ <!-- ### Use the name="" names instead of Expr_1() for generated .jj code
-->
+ <production name="Query" if="xquery core">
+ <ref name="QueryProlog"/>
+ <ref name="QueryBody"/>
+ </production>
+
+ <production name="QueryProlog" if="xquery core">
+ <zeroOrMore>
+ <choice break="true">
+ <ref name="NamespaceDecl"/>
+ <ref name="XMLSpaceDecl"/>
+ <ref name="DefaultNamespaceDecl"/>
+ <ref name="DefaultCollationDecl"/>
+ <ref name="SchemaImport"/>
+ </choice>
+ </zeroOrMore>
+ <zeroOrMore>
+ <ref name="FunctionDefn"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="XPath" if="xpath">
+ <optional>
+ <ref name="ExprSequence"/>
+ </optional>
+ </production>
+
+ <production name="QueryBody" if="xquery core">
+ <optional>
+ <ref name="ExprSequence"/>
+ </optional>
+ </production>
+
+
+ <production name="ExprSequence">
+ <ref name="Expr"/>
+ <zeroOrMore name="CommaExpr">
+ <ref name="Comma"/>
+ <ref name="Expr"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="Pattern" if="xpath pathx1" sub-spec="xslt-patterns">
+ <ref name="PathPattern"/>
+ <optional>
+ <choice>
+ <ref name="Union" if="xquery xpath"
node-type="void"/>
+ <ref name="Vbar" node-type="void"/>
+ </choice>
+ <ref name="Pattern"/>
+ </optional>
+ </production>
+
+ <production name="PathPattern" if="xpath pathx1" sub-spec="xslt-patterns">
+ <choice break="true">
+ <sequence>
+ <ref name="Root"/>
+ <optional>
+ <ref name="RelativePathPattern"/>
+ </optional>
+ </sequence>
+ <sequence>
+ <ref name="RootDescendants"/>
+ <ref name="RelativePathPattern"/>
+ </sequence>
+ <sequence>
+ <ref name="IdKeyPattern"/>
+ <optional>
+ <choice>
+ <ref name="Slash"/>
+ <ref name="SlashSlash"/>
+ </choice>
+ <ref name="RelativePathPattern"/>
+ </optional>
+ </sequence>
+ <ref name="RelativePathPattern"/>
+ </choice>
+ </production>
+
+ <production name="RelativePathPattern" if="xpath pathx1" node-type="void"
+ sub-spec="xslt-patterns">
+ <ref name="PatternStep"/>
+ <optional>
+ <choice>
+ <ref name="Slash"/>
+ <ref name="SlashSlash"/>
+ </choice>
+ <ref name="RelativePathPattern"/>
+ </optional>
+ </production>
+
+ <production name="PatternStep" if="xpath pathx1"
+ sub-spec="xslt-patterns">
+ <optional>
+ <ref name="PatternAxis"/>
+ </optional>
+ <ref name="NodeTest"/>
+ <ref name="Predicates"/>
+ </production>
+
+ <production name="PatternAxis" if="xpath pathx1" node-type="void"
+ sub-spec="xslt-patterns">
+ <choice break="true">
+ <ref name="AxisChild"/>
+ <ref name="AxisAttribute"/>
+ <ref name="At"/>
+ </choice>
+ </production>
+
+ <production name="IdKeyPattern" if="xpath pathx1"
+ sub-spec="xslt-patterns">
+ <ref name="QNameLpar"/>
+ <ref name="IdKeyValue"/>
+ <optional>
+ <ref name="Comma"/>
+ <ref name="IdKeyValue"/>
+ </optional>
+ <ref name="Rpar"/>
+ </production>
+
+
+ <production name="IdKeyPattern" if="match"
+ sub-spec="xslt-patterns">
+ <choice>
+ <sequence>
+ <ref name="IDLpar"/>
+ <ref name="IdKeyValue"/>
+ <ref name="Rpar"/>
+ </sequence>
+ <sequence>
+ <ref name="KeyLpar"/>
+ <ref name="StringLiteral"/>
+ <ref name="Comma"/>
+ <ref name="IdKeyValue"/>
+ <ref name="Rpar"/>
+ </sequence>
+ </choice>
+ </production>
+
+ <production name="IdKeyValue" if="xpath pathx1" node-type="void"
+ sub-spec="xslt-patterns">
+ <choice>
+ <ref name="StringLiteral"/>
+ <sequence>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ </sequence>
+ </choice>
+ </production>
+
+ <exprProduction name="Expr" node-type="void">
+ <level>
+ <binary name="OrExpr" if="xpath xquery pathx1"
condition="> 1">
+ <ref name="Or"/>
+ </binary>
+ </level>
+ <level>
+ <binary name="AndExpr" if="xpath xquery pathx1"
condition="> 1">
+ <ref name="And"/>
+ </binary>
+ </level>
+ <!-- level if="xquery core">
+ <prefix name="UnorderedExpr" if="xquery core" prefix-seq-type="?">
+ <choice>
+ <ref name="Unordered" if="xquery core"/>
+ </choice>
+ </prefix>
+ </level -->
+ <level>
+ <prefix name="FLWRExpr" if="xquery core"
prefix-seq-type="*">
+ <sequence>
+ <oneOrMore if="xquery">
+ <choice>
+ <ref name="ForClause"/>
+ <ref name="LetClause"/>
+ </choice>
+ </oneOrMore>
+ <choice if="core">
+ <ref name="ForClause"/>
+ <ref name="LetClause"/>
+ </choice>
+ <optional if="xquery">
+ <ref name="WhereClause"/>
+ </optional>
+ <optional if="xquery core">
+ <ref name="OrderByClause"
if="xquery core"/>
+ </optional>
+ <ref name="Return"/>
+ </sequence>
+ </prefix>
+
+ <prefix name="ForExpr" if="xpath" condition="> 1">
+ <sequence>
+ <ref name="SimpleForClause"/>
+ <ref name="Return"/>
+ </sequence>
+ </prefix>
+ </level>
+ <level>
+ <prefix name="QuantifiedExpr" if="xquery xpath"
condition="> 1">
+ <sequence>
+ <choice>
+ <ref name="Some"/>
+ <ref name="Every"/>
+ </choice>
+ <!-- ref name="VariableIndicator"
if="xquery core"/ -->
+ <ref name="VarName"/>
+ <optional if="xquery core">
+ <ref name="TypeDeclaration"
if="xquery core"/>
+ </optional>
+ <ref name="In"/>
+ <ref name="Expr"/>
+ <zeroOrMore>
+ <ref name="Comma"/>
+ <sequence>
+ <ref
name="VariableIndicator"/>
+ <ref name="VarName"/>
+ <optional if="xquery core">
+ <ref name="TypeDeclaration"
if="xquery core"/>
+ </optional>
+ </sequence>
+ <ref name="In"/>
+ <ref name="Expr"/>
+ </zeroOrMore>
+ <ref name="Satisfies"/>
+ </sequence>
+ </prefix>
+ </level>
+ <level>
+ <prefix name="TypeswitchExpr" if="xquery core">
+ <sequence>
+ <ref name="TypeswitchLpar"/>
+ <ref name="Expr"/>
+ <ref name="Rpar"/>
+ <oneOrMore>
+ <ref name="CaseClause"/>
+ </oneOrMore>
+ <ref name="Default"/>
+ <optional>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ </optional>
+ <ref name="Return"/>
+ </sequence>
+ </prefix>
+ </level>
+ <level>
+ <prefix name="IfExpr" if="xpath core xquery"
condition="> 1">
+ <sequence>
+ <ref name="IfLpar"/>
+ <ref name="Expr"/>
+ <ref name="Rpar"/>
+ <!-- XPath TF decision to remove, Oct 16, 2002 -->
+ <ref name="Then"/>
+ <ref name="Expr"/>
+ <ref name="Else"/>
+ </sequence>
+ </prefix>
+ </level>
+ <level>
+ <postfix name="InstanceofExpr" if="xquery xpath" prefix-seq-type="?"
condition="> 1">
+ <sequence>
+ <ref name="Instanceof"/>
+ <ref name="SequenceType"/>
+ </sequence>
+ </postfix>
+ </level>
+ <level>
+ <postfix name="CastableExpr" if="xquery xpath" prefix-seq-type="?"
condition="> 1">
+ <sequence>
+ <ref name="Castable"/>
+ <ref name="SingleType"/>
+ </sequence>
+ </postfix>
+ </level>
+ <level>
+ <binary name="ComparisonExpr" prefix-seq-type="*" if="xpath xquery
core" condition="> 1">
+ <choice break="true">
+ <ref name="ValueComp"/>
+ <ref name="GeneralComp"/>
+ <ref name="NodeComp"/>
+ <ref name="OrderComp"/>
+ </choice>
+ </binary>
+ <binary name="ComparisonExpr" if="pathx1">
+ <ref name="GeneralComp"/>
+ </binary>
+ </level>
+ <level>
+ <binary name="RangeExpr" if="xquery xpath" prefix-seq-type="?"
condition="> 1">
+ <ref name="To"/>
+ </binary>
+ </level>
+ <level>
+ <binary name="AdditiveExpr" condition="> 1">
+ <choice>
+ <ref name="Plus"/>
+ <ref name="Minus"/>
+ </choice>
+ </binary>
+ </level>
+ <level>
+ <binary name="MultiplicativeExpr" condition="> 1">
+ <choice>
+ <ref name="Multiply"/>
+ <ref name="Div"/>
+ <ref name="Idiv"/>
+ <ref name="Mod"/>
+ </choice>
+ </binary>
+ </level>
+ <level node-type="UnaryExpr">
+ <prefix name="UnaryExpr" if="xquery xpath pathx1">
+ <choice>
+ <ref name="Minus"/>
+ <ref name="Plus" if="xquery xpath core"/>
+ </choice>
+ </prefix>
+ </level>
+ <level>
+ <binary name="UnionExpr" if="xquery xpath pathx1"
condition="> 1">
+ <choice>
+ <ref name="Union" if="xquery xpath"/>
+ <ref name="Vbar"/>
+ </choice>
+ </binary>
+ </level>
+ <level>
+ <binary name="IntersectExceptExpr" if="xquery xpath"
condition="> 1">
+ <choice>
+ <ref name="Intersect"/>
+ <ref name="Except"/>
+ </choice>
+ </binary>
+ </level>
+ <level>
+ <primary name="ValueExpr">
+ <choice>
+ <ref name="ValidateExpr" if="xquery
core xpath"/>
+ <ref name="CastExpr" if="xquery core
xpath"/>
+ <ref name="TreatExpr" if="xquery core
xpath"/>
+ <ref name="Constructor" if="xquery
core"/>
+ <ref name="PathExpr"/>
+ </choice>
+ </primary>
+ </level>
+ </exprProduction>
+
+ <production name="PathExpr">
+ <choice>
+ <sequence>
+ <ref name="Root"/>
+ <optional>
+ <ref name="RelativePathExpr"/>
+ </optional>
+ </sequence>
+ <sequence>
+ <ref name="RootDescendants"/>
+ <ref name="RelativePathExpr"/>
+ </sequence>
+ <sequence if="pathx1">
+ <ref name="RHSPrimaryExpr" if="pathx1"/>
+ <optional if="pathx1">
+ <choice if="pathx1">
+ <ref name="Slash" if="pathx1"/>
+ <ref name="SlashSlash" if="pathx1"/>
+ </choice>
+ <ref name="RelativePathExpr" if="pathx1"/>
+ </optional>
+ </sequence>
+ <ref name="RelativePathExpr" if="xquery xpath core"/>
+ </choice>
+ </production>
+
+ <production name="RelativePathExpr" node-type="void"> <!-- I don't know
why keep this node (LV) -->
+ <!--production name="RelativePathExpr" node-type="RelativePathExpr"
condition="> 1"-->
+ <ref name="StepExpr"/>
+ <zeroOrMore>
+ <choice>
+ <ref name="Slash"/>
+ <ref name="SlashSlash"/>
+ </choice>
+ <ref name="StepExpr"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="StepExpr" node-type="StepExpr" condition="> 1">
+ <choice>
+ <ref name="ForwardStep"/>
+ <ref name="ReverseStep"/>
+ <ref name="PrimaryExpr" if="xpath xquery core"/>
+ </choice>
+ <ref name="Predicates"/>
+ </production>
+
+ <!-- ForClause is slightly different now for XQuery vs. XPath. -sb -->
+ <production name="ForClause" if="xquery core">
+ <ref name="ForVariable"/>
+ <!-- ref name="VariableIndicator" if="xquery core"/ -->
+ <ref name="VarName"/>
+ <optional if="xquery core">
+ <ref name="TypeDeclaration" if="xquery core"/>
+ </optional>
+ <optional if="xquery core">
+ <ref name="PositionalVar" if="xquery core"/>
+ </optional>
+ <ref name="In"/>
+ <ref name="Expr"/>
+ <zeroOrMore if="xquery">
+ <ref name="Comma"/>
+ <sequence>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ <optional if="xquery core">
+ <ref name="TypeDeclaration" if="xquery
core"/>
+ </optional>
+ <optional if="xquery core">
+ <ref name="PositionalVar" if="xquery core"/>
+ </optional>
+ </sequence>
+ <ref name="In"/>
+ <ref name="Expr"/>
+ </zeroOrMore>
+ </production>
+
+ <!-- SimpleForClause is slightly different now for XQuery vs. XPath. -sb
-->
+ <production name="SimpleForClause" if="xpath">
+ <ref name="ForVariable"/>
+ <ref name="VarName"/>
+ <ref name="In"/>
+ <ref name="Expr"/>
+ <zeroOrMore>
+ <ref name="Comma"/>
+ <sequence>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ </sequence>
+ <ref name="In"/>
+ <ref name="Expr"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="LetClause" if="xquery core">
+ <ref name="LetVariable"/>
+ <!-- ref name="VariableIndicator" if="xquery core"/ -->
+ <ref name="VarName"/>
+ <optional if="xquery core">
+ <ref name="TypeDeclaration" if="xquery core"/>
+ </optional>
+ <ref name="ColonEquals"/>
+ <ref name="Expr"/>
+ <zeroOrMore if="xquery">
+ <ref name="Comma"/>
+ <sequence>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ <optional if="xquery core">
+ <ref name="TypeDeclaration" if="xquery
core"/>
+ </optional>
+ </sequence>
+ <ref name="ColonEquals"/>
+ <ref name="Expr"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="WhereClause" if="xquery">
+ <ref name="Where"/>
+ <ref name="Expr"/>
+ </production>
+
+ <production name="PositionalVar" if="core xquery">
+ <ref name="AtWord"/>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ </production>
+
+ <production name="ValidateExpr" if="xpath core xquery">
+ <choice>
+ <ref name="ValidateLbrace"/>
+ <sequence>
+ <ref name="ValidateContext"/>
+ <ref name="SchemaGlobalContext"/>
+ <zeroOrMore>
+ <ref name="Slash"/>
+ <ref name="SchemaContextStep"/>
+ </zeroOrMore>
+ <ref name="LbraceExprEnclosure"/>
+ </sequence>
+ </choice>
+ <ref name="Expr"/>
+ <ref name="Rbrace"/>
+ </production>
+
+ <production name="CastExpr" if="xpath core xquery">
+ <sequence>
+ <ref name="CastAs"/>
+ <ref name="SingleType"/>
+ </sequence>
+ <ref name="ParenthesizedExpr"/>
+
+ <!-- ref name="Lpar"/>
+ <ref name="Expr"/>
+ <optional>
+ <ref name="Comma"/>
+ <ref name="Expr"/>
+ </optional>
+ <ref name="Rpar"/ -->
+
+ </production>
+
+ <production name="TreatExpr" if="xpath core xquery">
+ <sequence>
+ <ref name="TreatAs" if="xpath xquery"/>
+ <ref name="SequenceType"/>
+ </sequence>
+ <ref name="ParenthesizedExpr"/>
+ </production>
+
+ <production name="Constructor" if="xquery core">
+ <choice break="true">
+ <ref name="ElementConstructor" if="xquery"/>
+ <ref name="XmlComment"/>
+ <ref name="XmlProcessingInstruction"/>
+ <ref name="CdataSection"/>
+ <ref name="ComputedDocumentConstructor" if="xquery
core"/>
+ <ref name="ComputedElementConstructor" if="xquery
core"/>
+ <ref name="ComputedAttributeConstructor" if="xquery
core"/>
+ <ref name="ComputedTextConstructor" if="xquery core"/>
+ </choice>
+ </production>
+
+ <production name="GeneralComp" if="xpath xquery pathx1" is-binary="yes">
+ <choice break="false">
+ <ref name="Equals"/>
+ <ref name="NotEquals"/>
+ <ref name="Lt"/>
+ <ref name="LtEquals"/>
+ <ref name="Gt"/>
+ <ref name="GtEquals"/>
+ </choice>
+ </production>
+
+ <production name="ValueComp" if="xpath xquery pathx1" is-binary="yes">
+ <choice break="false">
+ <ref name="FortranEq"/>
+ <ref name="FortranNe"/>
+ <ref name="FortranLt"/>
+ <ref name="FortranLe"/>
+ <ref name="FortranGt"/>
+ <ref name="FortranGe"/>
+ </choice>
+ </production>
+
+ <production name="NodeComp" if="xpath xquery pathx1" is-binary="yes">
+ <choice break="false">
+ <ref name="Is"/>
+ <ref name="IsNot"/>
+ </choice>
+ </production>
+
+ <production name="OrderComp" if="xpath xquery" is-binary="yes">
+ <choice break="false">
+ <ref name="LtLt"/>
+ <ref name="GtGt"/>
+ </choice>
+ </production>
+
+ <production name="OrderByClause" if="xquery core">
+ <choice break="false">
+ <ref name="OrderBy"/>
+ <ref name="OrderByStable"/>
+ </choice>
+ <ref name="OrderSpecList"/>
+ </production>
+
+ <production name="OrderSpecList" if="xquery core">
+ <ref name="OrderSpec"/>
+ <zeroOrMore>
+ <ref name="Comma"/>
+ <ref name="OrderSpec"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="OrderSpec" if="xquery core">
+ <ref name="Expr"/>
+ <ref name="OrderModifier"/>
+ </production>
+
+ <production name="OrderModifier" if="xquery core">
+ <optional>
+ <choice>
+ <ref name="Ascending"/>
+ <ref name="Descending"/>
+ </choice>
+ </optional>
+ <optional>
+ <choice>
+ <ref name="EmptyGreatest"/>
+ <ref name="EmptyLeast"/>
+ </choice>
+ </optional>
+ <optional>
+ <ref name="Collation"/>
+ <ref name="StringLiteral"/>
+ </optional>
+ </production>
+
+ <production name="CaseClause" if="xquery core">
+ <ref name="Case"/>
+ <optional>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ <ref name="As"/>
+ </optional>
+ <ref name="SequenceType"/>
+ <ref name="Return"/>
+ <ref name="Expr"/>
+ </production>
+
+ <!-- production name="DefaultClause" if="xquery core">
+ <ref name="Default"/>
+ <optional>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ </optional>
+ <ref name="Default"/>
+ <ref name="Expr"/>
+ </production -->
+
+ <production name="PrimaryExpr" node-type="void">
+ <choice>
+ <ref name="Literal"/>
+ <ref name="FunctionCall"/>
+ <sequence>
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ </sequence>
+ <ref name="ParenthesizedExpr"/>
+ </choice>
+ </production>
+
+ <production name="ForwardAxis" node-type="void">
+ <choice break="true">
+ <ref name="AxisChild"/>
+ <ref name="AxisDescendant"/>
+ <ref name="AxisAttribute"/>
+ <ref name="AxisSelf"/>
+ <ref name="AxisDescendantOrSelf"/>
+
+ <ref name="AxisFollowingSibling" if="xpath pathx1 core"/>
+ <ref name="AxisFollowing" if="xpath pathx1 core"/>
+ <ref name="AxisNamespace" if="xpath pathx1 core"/>
+
+ </choice>
+ </production>
+
+ <production name="ReverseAxis" node-type="void">
+ <choice break="true">
+ <ref name="AxisParent"/>
+
+ <ref name="AxisAncestor" if="xpath pathx1 core"/>
+ <ref name="AxisPrecedingSibling" if="xpath pathx1 core"/>
+ <ref name="AxisPreceding" if="xpath pathx1 core"/>
+ <ref name="AxisAncestorOrSelf" if="xpath pathx1 core"/>
+ </choice>
+ </production>
+
+ <!-- production name="Axis">
+ <choice break="false">
+ <ref name="ForwardAxis"/>
+ <ref name="ReverseAxis"/>
+ </choice>
+ </production -->
+
+ <production name="NodeTest">
+ <choice>
+ <ref name="KindTest"/>
+ <ref name="NameTest"/>
+ </choice>
+ </production>
+
+ <production name="NameTest">
+ <choice>
+ <ref name="QName"/>
+ <ref name="Wildcard"/>
+ </choice>
+ </production>
+
+ <production name="Wildcard" node-type="void">
+ <choice>
+ <ref name="Star"/>
+ <ref name="NCNameColonStar"/>
+ <ref name="StarColonNCName" if="xquery core xpath"/>
+ </choice>
+ </production>
+
+ <production name="KindTest">
+ <choice break="true">
+ <ref name="ProcessingInstructionTest"/>
+ <ref name="CommentTest"/>
+ <ref name="TextTest"/>
+ <!-- jwr: xDataTest was a KindTest in the grammar, but I don't know
why,
+ since this is a function.
+ <ref name="DataTest"/> -->
+ <ref name="AnyKindTest"/>
+ </choice>
+ </production>
+
+ <!-- NodeLpar CommentLpar TextLpar ProcessingInstructionLpar -->
+ <production name="ProcessingInstructionTest">
+ <ref name="ProcessingInstructionLpar"/>
+ <optional>
+ <ref name="StringLiteral"/>
+ </optional>
+ <ref name="Rpar"/>
+ </production>
+
+ <production name="CommentTest">
+ <ref name="CommentLpar"/>
+ <ref name="Rpar"/>
+ </production>
+
+ <production name="TextTest">
+ <ref name="TextLpar"/>
+ <ref name="Rpar"/>
+ </production>
+
+ <!-- <production name="DataTest" if="xquery xpath">
+ <ref name="Data"/>
+ <ref name="Lpar"/>
+ <ref name="Rpar"/>
+ </production>
+
+-->
+ <production name="AnyKindTest">
+ <ref name="NodeLpar"/>
+ <ref name="Rpar"/>
+ </production>
+
+ <production name="ForwardStep" node-type="void">
+ <choice>
+ <sequence>
+ <ref name="ForwardAxis"/>
+ <choice>
+ <ref name="NodeTest"/>
+ <!-- ref name="Text" if="xquery core"/>
+ <ref name="Comment" if="xquery core"/>
+ <ref name="Node" if="xquery core"/>
+ <ref name="ProcessingInstruction" if="xquery core"/ -->
+ <!-- ref name="Data" if="xquery core" -->
+ </choice>
+ </sequence>
+ <ref name="AbbreviatedForwardStep" if="xpath pathx1 xquery"/>
+ </choice>
+ </production>
+
+ <production name="ReverseStep" node-type="void">
+ <choice>
+ <sequence>
+ <ref name="ReverseAxis"/>
+ <choice>
+ <ref name="NodeTest"/>
+ <!-- ref name="Text" if="xquery core"/>
+ <ref name="Comment" if="xquery core"/>
+ <ref name="Node" if="xquery core"/>
+ <ref name="ProcessingInstruction" if="xquery core"/ -->
+ <!-- ref name="Data" if="xquery core" -->
+ </choice>
+ </sequence>
+ <ref name="AbbreviatedReverseStep" if="xpath pathx1 xquery"/>
+ </choice>
+ </production>
+
+ <production name="AbbreviatedForwardStep" if="xquery xpath pathx1">
+ <choice>
+ <ref name="Dot"/>
+ <sequence>
+ <ref name="At"/>
+ <ref name="NameTest"/>
+ </sequence>
+ <ref name="NodeTest"/> <!-- child axis -->
+ </choice>
+ </production>
+
+ <production name="AbbreviatedReverseStep" if="xquery xpath pathx1"
+ node-type="void">
+ <ref name="DotDot"/>
+ </production>
+
+ <production name="Predicates" if="xquery xpath pathx1 core" condition=">
1">
+ <zeroOrMore name="PredicatesList">
+ <choice>
+ <sequence>
+ <ref name="Lbrack"/>
+ <ref name="Expr"/>
+ <ref name="Rbrack"/>
+ </sequence>
+ <!-- Decision of Oracle F2F to remove -->
+ <!-- sequence if="xpath xquery core">
+ <ref name="Arrow"/>
+ <ref name="NameTest"/>
+ </sequence -->
+ </choice>
+ </zeroOrMore>
+ </production>
+
+ <production name="NumericLiteral" node-type="void">
+ <choice>
+ <ref name="IntegerLiteral"/>
+ <ref name="DecimalLiteral"/>
+ <ref name="DoubleLiteral"/>
+ </choice>
+ </production>
+
+ <production name="Literal" node-type="void">
+ <choice>
+ <ref name="NumericLiteral"/>
+ <ref name="StringLiteral"/>
+ </choice>
+ </production>
+
+ <production name="ParenthesizedExpr" node-type="void">
+ <ref name="Lpar"/>
+ <optional if="xquery core xpath">
+ <ref name="ExprSequence"/>
+ </optional>
+ <ref name="Expr" if="pathx1"/>
+ <ref name="Rpar"/>
+ </production>
+
+ <production name="ElementName" if="pathx1">
+ <ref name="QName"/>
+ </production>
+
+ <production name="FunctionCall" if="xpath pathx1 xquery core">
+ <ref name="QNameLpar"/>
+ <optional>
+ <ref name="Expr"/>
+ <zeroOrMore>
+ <ref name="Comma"/>
+ <ref name="Expr"/>
+ </zeroOrMore>
+ </optional>
+ <ref name="Rpar"/>
+ </production>
+
+ <production name="Param" if="xquery core">
+ <ref name="VariableIndicator"/>
+ <ref name="VarName"/>
+ <optional>
+ <ref name="TypeDeclaration"/>
+ </optional>
+ </production>
+
+ <production name="SchemaContext" if="xpath xquery core">
+ <ref name="InContext"/>
+ <ref name="SchemaGlobalContext"/>
+ <zeroOrMore>
+ <ref name="Slash"/>
+ <ref name="SchemaContextStep"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="SchemaGlobalContext" if="xpath xquery core">
+ <choice>
+ <ref name="QName"/>
+ <ref name="TypeQName"/>
+ </choice>
+ </production>
+
+ <production name="SchemaContextStep" if="xpath xquery core">
+ <ref name="QName"/>
+ </production>
+
+ <production name="TypeDeclaration" if="xquery core">
+ <ref name="As"/>
+ <ref name="SequenceType"/>
+ </production>
+
+ <production name="SingleType" if="xquery core xpath">
+ <ref name="AtomicType"/>
+ <optional>
+ <ref name="QMark"/>
+ </optional>
+ </production>
+
+ <production name="SequenceType" if="xquery core xpath">
+ <choice>
+ <sequence>
+ <ref name="ItemType"/>
+ <ref name="OccurrenceIndicator"/>
+ </sequence>
+ <ref name="Empty"/>
+ </choice>
+ </production>
+
+ <production name="ItemType" if="xquery core xpath">
+ <choice break="true">
+ <sequence>
+ <choice>
+ <ref name="ElementType"/>
+ <ref name="AttributeType"/>
+ </choice>
+ <optional>
+ <ref name="ElemOrAttrType"/>
+ </optional>
+ </sequence>
+
+ <ref name="Node"/>
+ <ref name="ProcessingInstruction"/>
+ <ref name="Comment"/>
+ <ref name="Text"/>
+ <sequence>
+ <ref name="Document"/>
+ <!-- April 16 taskforce decided to remove...
+ <optional>
+ <ref name="DocumentElement"/>
+ </optional -->
+ </sequence>
+
+ <ref name="Item"/>
+
+ <ref name="AtomicType"/>
+ <ref name="Untyped"/>
+ <ref name="AtomicValue"/>
+
+
+ </choice>
+
+ </production>
+
+ <production name="ElemOrAttrType" if="xquery core xpath">
+ <choice>
+ <sequence>
+ <ref name="QName"/>
+ <choice>
+ <ref name="SchemaType"/>
+ <optional>
+ <ref name="SchemaContext"/>
+ </optional>
+ </choice>
+ </sequence>
+ <ref name="SchemaType"/>
+ </choice>
+ </production>
+
+ <production name="SchemaType" if="xquery core xpath">
+ <ref name="OfType"/>
+ <ref name="QName"/>
+ </production>
+
+ <!-- jwr: proposed but not yet accepted -->
+ <production name="AtomicType" if="xquery core xpath">
+ <ref name="QName"/>
+ </production>
+
+ <production name="OccurrenceIndicator" if="xquery core xpath">
+ <optional>
+ <choice>
+ <ref name="Star" if="xpath xquery core" show="no"/>
+ <ref name="Multiply" if="xpath xquery core"/>
+ <ref name="Plus"/>
+ <ref name="QMark"/>
+ </choice>
+ </optional>
+ </production>
+
+ <token name="CdataSectionStart" if="xquery core">
+ <string><![CDATA[</string>
+ </token>
+
+ <!-- Recognizing it in content disallows ]]> in content same as XML. -->
+ <token name="CdataSectionEnd" if="xquery core">
+ <string>]]></string>
+ </token>
+
+ <!-- This effectively disallows in element content and attribute
+ values ampersands that are not part of entity or character
+ references. -->
+ <token name="Amp" override="true" if="core">
+ <string>&</string>
+ </token>
+
+ <token name="PredefinedEntityRef" if="xquery" inline="false">
+ <string>&</string>
+ <choice>
+ <string>lt</string>
+ <string>gt</string>
+ <string>amp</string>
+ <string>quot</string>
+ <string>apos</string>
+ </choice>
+ <string>;</string>
+ </token>
+
+ <token name="HexDigits" inline="false" if="xquery">
+ <oneOrMore>
+ <charClass>
+ <charRange minChar="0" maxChar="9"/>
+ <charRange minChar="a" maxChar="f"/>
+ <charRange minChar="A" maxChar="F"/>
+ </charClass>
+ </oneOrMore>
+ </token>
+
+ <token name="CharRef" if="xquery" inline="false">
+ <string>&#</string>
+ <choice>
+ <ref name="Digits"/>
+ <sequence>
+ <string>x</string>
+ <ref name="HexDigits"/>
+ </sequence>
+ </choice>
+ <string>;</string>
+ </token>
+
+ <token name="StartTagOpen" override="true" if="xquery">
+ <string><</string>
+ </token>
+
+ <token name="StartTagOpenRoot" override="true" if="xquery">
+ <string><</string>
+ </token>
+
+ <token name="StartTagClose" if="xquery">
+ <string>></string>
+ </token>
+
+ <token name="EmptyTagClose" if="xquery">
+ <string>/></string>
+ </token>
+
+ <token name="EndTagOpen" if="xquery">
+ <string></</string>
+ </token>
+
+ <token name="EndTagClose" if="xquery">
+ <string>></string>
+ </token>
+
+ <token name="ValueIndicator" recognize="START_TAG" if="xquery">
+ <string>=</string>
+ </token>
+
+ <token name="TagQName" recognize="START_TAG END_TAG" if="xquery">
+ <ref name="QName"/>
+ </token>
+
+ <!-- Recognize in OPERATOR state for function definitions. -->
+ <!-- These should be query only, once we get the validate issue fixed! -->
+ <token name="Lbrace" if="xquery core xpath" override="true">
+ <string>{</string>
+ </token>
+
+ <token name="LbraceExprEnclosure" if="xquery core xpath" override="true">
+ <string>{</string>
+ </token>
+
+ <token name="Rbrace" if="xquery core xpath" override="true">
+ <string>}</string>
+ </token>
+
+ <token name="LCurlyBraceEscape" if="xquery core" override="true">
+ <string>{{</string>
+ </token>
+
+ <token name="RCurlyBraceEscape" if="xquery core" override="true">
+ <string>}}</string>
+ </token>
+
+ <token name="EscapeApos" inline="false" if="xquery">
+ <string>''</string>
+ </token>
+
+ <token name="OpenApos" if="xquery">
+ <string>'</string>
+ </token>
+
+ <token name="CloseApos" override="true" if="xquery">
+ <string>'</string>
+ </token>
+
+ <!-- This needs to come after the rules for special characters. -->
+ <token name="Char" if="xquery core xpath" inline="false"
value-type="string">
+ <charClass>
+ <charCode value="0009"/>
+ <charCode value="000D"/>
+ <charCode value="000A"/>
+ <!-- This isn't quite right, but JavaCC doesn't understand surrogates.
-->
+ <charCodeRange minValue="0020" maxValue="FFFD"/>
+ </charClass>
+ </token>
+
+ <!-- It would be nice to not take character content runs one character
+ at a time. However, it seems difficult to say, "all these characters
+ but these three", at least in JavaCC. -->
+ <!-- token name="CharData" if="xquery" inline="true" value-type="string">
+ <oneOrMore>
+ <complement>
+ <charClass>
+ <char><</char>
+ <char>&</char>
+ <char>{</char>
+ </charClass>
+ </complement>
+ </oneOrMore>
+ </token -->
+
+ <production name="ElementConstructor" if="xquery"
whitespace-spec="explicit">
+ <choice name="TagOpenStart">
+ <ref name="StartTagOpenRoot" show="no"/>
+ <ref name="StartTagOpen"/>
+ </choice>
+ <ref name= "TagQName"/>
+ <ref name="AttributeList"/>
+ <choice name="TagClose">
+ <ref name="EmptyTagClose"/>
+ <sequence name="TagContent">
+ <ref name="StartTagClose"/>
+ <zeroOrMore>
+ <ref name="ElementContent"/>
+ </zeroOrMore>
+ <ref name="EndTagOpen"/>
+ <ref name="TagQName"/>
+ <optional>
+ <ref name="S"/>
+ </optional>
+ <ref name="EndTagClose"/>
+ </sequence>
+ </choice>
+ </production>
+
+ <production name="ComputedDocumentConstructor" if="xquery core">
+ <sequence>
+ <ref name="DocumentLbrace"/>
+ <ref name="ExprSequence"/>
+ <ref name="Rbrace"/>
+ </sequence>
+ </production>
+
+ <production name="ComputedElementConstructor" if="xquery core">
+ <choice>
+ <ref name="ElementQNameLbrace"/>
+ <sequence>
+ <ref name="ElementLbrace"/>
+ <ref name="Expr"/>
+ <ref name="Rbrace"/>
+ <ref name="LbraceExprEnclosure"/>
+ </sequence>
+ </choice>
+ <optional>
+ <ref name="ExprSequence"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </production>
+
+ <production name="ComputedAttributeConstructor" if="xquery core">
+ <choice>
+ <ref name="AttributeQNameLbrace"/>
+ <sequence>
+ <ref name="AttributeLbrace"/>
+ <ref name="Expr"/>
+ <ref name="Rbrace"/>
+ <ref name="LbraceExprEnclosure"/>
+ </sequence>
+ </choice>
+ <optional>
+ <ref name="ExprSequence"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </production>
+
+ <production name="ComputedTextConstructor" if="xquery core">
+ <ref name="TextLbrace"/>
+ <optional>
+ <ref name="ExprSequence"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </production>
+
+ <production name="CdataSection" if="xquery core"
whitespace-spec="significant">
+ <ref name="CdataSectionStart"/>
+ <zeroOrMore>
+ <ref name="Char"/>
+ </zeroOrMore>
+ <ref name="CdataSectionEnd"/>
+ </production>
+
+ <production name="XmlProcessingInstruction" if="xquery core"
whitespace-spec="significant">
+ <ref name="ProcessingInstructionStart"/>
+ <ref name="PITarget"/>
+ <zeroOrMore>
+ <ref name="Char"/>
+ </zeroOrMore>
+ <ref name="ProcessingInstructionEnd"/>
+ </production>
+
+ <production name="XmlComment" if="xquery core"
whitespace-spec="significant">
+ <ref name="XmlCommentStart"/>
+ <zeroOrMore>
+ <ref name="Char"/>
+ </zeroOrMore>
+ <ref name="XmlCommentEnd"/>
+ </production>
+
+ <production name="ElementContent" if="xquery"
whitespace-spec="significant">
+ <choice break="true">
+ <ref name="Char"/>
+ <ref name="LCurlyBraceEscape"/>
+ <ref name="RCurlyBraceEscape"/>
+ <ref name="ElementConstructor"/>
+ <ref name="EnclosedExpr"/>
+ <ref name="CdataSection"/>
+ <ref name="CharRef"/>
+ <ref name="PredefinedEntityRef"/>
+ <ref name="XmlComment"/>
+ <ref name="XmlProcessingInstruction"/>
+ </choice>
+ </production>
+
+ <production name="AttributeList" if="xquery" whitespace-spec="explicit">
+ <zeroOrMore name="optionalAttribute">
+ <ref name="S"/>
+ <optional>
+ <ref name="TagQName"/>
+ <optional>
+ <ref name="S"/>
+ </optional>
+ <ref name="ValueIndicator"/>
+ <optional>
+ <ref name="S"/>
+ </optional>
+ <ref name="AttributeValue"/>
+ </optional>
+ </zeroOrMore>
+ </production>
+
+ <production name="AttributeValue" if="xquery"
whitespace-spec="significant">
+ <choice break="true">
+ <sequence>
+ <ref name="OpenQuot"/>
+ <zeroOrMore>
+ <choice>
+ <ref name="EscapeQuot"/>
+ <ref name="AttributeValueContent"/>
+ </choice>
+ </zeroOrMore>
+ <ref name="CloseQuot"/>
+ </sequence>
+ <sequence>
+ <ref name="OpenApos"/>
+ <zeroOrMore>
+ <choice>
+ <ref name="EscapeApos"/>
+ <ref name="AttributeValueContent"/>
+ </choice>
+ </zeroOrMore>
+ <ref name="CloseApos"/>
+ </sequence>
+ </choice>
+ </production>
+
+ <production name="AttributeValueContent" if="xquery"
whitespace-spec="significant">
+ <choice break="true">
+ <ref name="Char"/>
+ <ref name="CharRef"/>
+ <ref name="LCurlyBraceEscape"/>
+ <ref name="RCurlyBraceEscape"/>
+ <ref name="EnclosedExpr"/>
+ <!-- not in Dana's grammar -->
+ <ref name="PredefinedEntityRef"/>
+ </choice>
+ </production>
+
+ <production name="EnclosedExpr" if="xquery core">
+ <choice>
+ <ref name="Lbrace" show="no"/>
+ <ref name="LbraceExprEnclosure"/>
+ </choice>
+ <ref name="ExprSequence"/>
+ <ref name="Rbrace"/>
+ </production>
+
+ <production name="XMLSpaceDecl" if="xquery core">
+ <ref name="DeclareXMLSpace"/>
+ <ref name="XMLSpaceEquals"/>
+ <choice>
+ <ref name="XMLSpacePreserve"/>
+ <ref name="XMLSpaceStrip"/>
+ </choice>
+ </production>
+
+ <production name="DefaultCollationDecl" if="xquery core">
+ <ref name="DefaultCollationEquals"/>
+ <!-- ref name="StringLiteral"/ -->
+ <ref name="URLLiteral"/>
+ </production>
+
+ <production name="NamespaceDecl" if="xquery core">
+ <ref name="DeclareNamespace"/>
+ <ref name="NCNameForPrefix"/>
+ <ref name="AssignEquals"/>
+ <ref name="URLLiteral"/>
+ </production>
+
+ <production name="SubNamespaceDecl" if="xquery core">
+ <ref name="Namespace"/>
+ <ref name="NCNameForPrefix"/>
+ <ref name="AssignEquals"/>
+ <ref name="URLLiteral"/>
+ </production>
+
+ <production name="DefaultNamespaceDecl" if="xquery core">
+ <choice>
+ <ref name="DefaultElement"/>
+ <ref name="DefaultFunction"/>
+ </choice>
+ <ref name="Namespace"/>
+ <ref name="AssignEquals"/>
+ <ref name="URLLiteral"/>
+ </production>
+
+ <!-- production name="ContextDecl" if="xquery core">
+ <choice break="true">
+ <ref name="NamespaceDecl"/>
+ <ref name="DefaultNamespaceDecl"/>
+ <ref name="SchemaImport"/>
+ </choice>
+ </production -->
+
+ <production name="FunctionDefn" if="xquery core">
+ <ref name="DefineFunction"/>
+ <ref name="QNameLpar"/>
+ <!-- ref name="FuncPListOpen"/ -->
+ <optional>
+ <ref name="ParamList"/>
+ </optional>
+ <choice>
+ <ref name="Rpar"/>
+ <sequence if="xquery core">
+ <ref name="RparAs"/>
+ <!-- Was Datatype -->
+ <ref name="SequenceType"/>
+ </sequence>
+ </choice>
+ <ref name="EnclosedExpr"/>
+ </production>
+
+ <production name="ParamList" if="xquery core">
+ <ref name="Param"/>
+ <zeroOrMore>
+ <ref name="Comma"/>
+ <ref name="Param"/>
+ </zeroOrMore>
+ </production>
+
+ <production name="SchemaImport" if="xquery core">
+ <ref name="ImportSchemaToken"/>
+ <!-- See
http://lists.w3.org/Archives/Member/w3c-xml-query-wg/2002Jan/0181.html -->
+ <choice>
+ <ref name="StringLiteral"/>
+ <ref name="SubNamespaceDecl"/>
+ <ref name="DefaultNamespaceDecl"/>
+ </choice>
+ <optional>
+ <ref name="AtStringLiteral"/>
+ </optional>
+ </production>
+
+ <!-- Type declaration stuff follows -->
+ <production name="TypeDeclaration" if="core">
+ <choice break="true">
+ <sequence>
+ <ref name="DefineElement"/>
+ <ref name="QName"/>
+ <ref name="Lbrace"/>
+ <optional>
+ <ref name="TypeDefn"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </sequence>
+ <sequence>
+ <ref name="DefineAttribute"/>
+ <ref name="QName"/>
+ <ref name="Lbrace"/>
+ <optional>
+ <ref name="TypeDefn"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </sequence>
+ <sequence>
+ <ref name="DefineType"/>
+ <ref name="QName"/>
+ <ref name="Lbrace"/>
+ <optional>
+ <ref name="TypeDefn"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </sequence>
+ </choice>
+ </production>
+
+ <exprProduction name="TypeDefn" if="core">
+ <level>
+ <binary name="TypeUnion" if="core">
+ <ref name="Vbar"/>
+ </binary>
+ </level>
+ <level>
+ <binary name="TypeBoth" if="core">
+ <ref name="Amp"/>
+ </binary>
+ <binary name="TypeSequence" if="core">
+ <ref name="Comma"/>
+ </binary>
+ </level>
+ <level>
+ <primary name="TypeSimpleType" if="core">
+ <ref name="QName"/>
+ <ref name="OccurrenceIndicator"/>
+ </primary>
+ <primary name="TypeAttributeRef" if="core">
+ <ref name="Attribute"/>
+ <ref name="NameTest"/>
+ <optional>
+ <ref name="Lbrace"/>
+ <optional>
+ <ref name="TypeDefn"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </optional>
+ <ref name="OccurrenceIndicator"/>
+ </primary>
+ <primary name="TypeElementRef" if="core">
+ <ref name="Element"/>
+ <ref name="NameTest"/>
+ <optional>
+ <ref name="Lbrace"/>
+ <optional>
+ <ref name="TypeDefn"/>
+ </optional>
+ <ref name="Rbrace"/>
+ </optional>
+ <ref name="OccurrenceIndicator"/>
+ </primary>
+ <primary name="TypeTypeRef" if="core">
+ <ref name="Type"/>
+ <ref name="NameTest"/>
+ <ref name="OccurrenceIndicator"/>
+ </primary>
+ <primary name="TypeParenthesized" if="core">
+ <ref name="Lpar"/>
+ <optional>
+ <ref name="TypeDefn"/>
+ </optional>
+ <ref name="Rpar"/>
+ <ref name="OccurrenceIndicator"/>
+ </primary>
+ <!-- primary name="TypeEmptySequence" if="core">
+ <ref name="Lpar"/>
+ <ref name="Rpar"/>
+ </primary -->
+ <primary name="TypeNone" if="core">
+ <ref name="None"/>
+ </primary>
+ </level>
+ </exprProduction>
+
+ <!-- This is never referenced from anywhere. -sb -->
+ <!-- production name="ModuleImport" if="xquery core">
+ <ref name="Module"/>
+ <ref name="StringLiteral"/>
+ </production -->
+
+ <!-- ==================== XPath 1.0 =========================-->
+ <!-- production name="RHSStepExpr" if="pathx1">
+ <choice>
+ <ref name="AxisStep"/>
+ <ref name="RHSGeneralStepExpr"/>
+ </choice>
+ </production -->
+
+ <!-- production name="RHSGeneralStepExpr" if="pathx1">
+ <ref name="RHSPrimaryExpr"/>
+ <ref name="RHSStepQualifiers"/>
+ </production -->
+
+ <!-- production name="RHSStepQualifiers" if="pathx1">
+ <zeroOrMore>
+ <choice>
+ <sequence>
+ <ref name="Lbrack"/>
+ <ref name="Expr"/>
+ <ref name="Rbrack"/>
+ </sequence>
+ </choice>
+ </zeroOrMore>
+ </production -->
+
+ <production name="RHSPrimaryExpr" if="pathx1">
+ <choice break="true">
+ <ref name="StepExpr" if="pathx1"/>
+ <sequence>
+ <ref name="PrimaryExpr" if="pathx1"/>
+ <ref name="Predicates"/>
+ </sequence>
+ </choice>
+ </production>
+
+ <token name="WhitespaceChar" inline="false">
+ <charClass>
+ <charCode value="0009"/>
+ <charCode value="000D"/>
+ <charCode value="000A"/>
+ <!-- char xml:space="preserve"> </char -->
+ <!-- SGML mode in EMacs doesn't like xml:space, so
+ we avoid it for now. -->
+ <charCode value="0020"/>
+ </charClass>
+ </token>
+
+ <token name="Letter" inline="false" is-macro="yes" is-xml="yes">
+ <choice>
+ <ref name="BaseChar"/>
+ <ref name="Ideographic"/>
+ </choice>
+ </token>
+
+ <token name="BaseChar" inline="false" is-macro="yes" is-xml="yes">
+ <charClass>
+ <charCodeRange minValue="0041" maxValue="005a"/>
+ <charCodeRange minValue="0061" maxValue="007a"/>
+ <charCodeRange minValue="00c0" maxValue="00d6"/>
+ <charCodeRange minValue="00d8" maxValue="00f6"/>
+ <charCodeRange minValue="00f8" maxValue="00ff"/>
+ <charCodeRange minValue="0100" maxValue="0131"/>
+ <charCodeRange minValue="0134" maxValue="013e"/>
+ <charCodeRange minValue="0141" maxValue="0148"/>
+ <charCodeRange minValue="014a" maxValue="017e"/>
+ <charCodeRange minValue="0180" maxValue="01c3"/>
+ <charCodeRange minValue="01cd" maxValue="01f0"/>
+ <charCodeRange minValue="01f4" maxValue="01f5"/>
+ <charCodeRange minValue="01fa" maxValue="0217"/>
+ <charCodeRange minValue="0250" maxValue="02a8"/>
+ <charCodeRange minValue="02bb" maxValue="02c1"/>
+ <charCode value="0386"/>
+ <charCodeRange minValue="0388" maxValue="038a"/>
+ <charCode value="038c"/>
+ <charCodeRange minValue="038e" maxValue="03a1"/>
+ <charCodeRange minValue="03a3" maxValue="03ce"/>
+ <charCodeRange minValue="03d0" maxValue="03d6"/>
+ <charCode value="03da"/>
+ <charCode value="03dc"/>
+ <charCode value="03de"/>
+ <charCode value="03e0"/>
+ <charCodeRange minValue="03e2" maxValue="03f3"/>
+ <charCodeRange minValue="0401" maxValue="040c"/>
+ <charCodeRange minValue="040e" maxValue="044f"/>
+ <charCodeRange minValue="0451" maxValue="045c"/>
+ <charCodeRange minValue="045e" maxValue="0481"/>
+ <charCodeRange minValue="0490" maxValue="04c4"/>
+ <charCodeRange minValue="04c7" maxValue="04c8"/>
+ <charCodeRange minValue="04cb" maxValue="04cc"/>
+ <charCodeRange minValue="04d0" maxValue="04eb"/>
+ <charCodeRange minValue="04ee" maxValue="04f5"/>
+ <charCodeRange minValue="04f8" maxValue="04f9"/>
+ <charCodeRange minValue="0531" maxValue="0556"/>
+ <charCode value="0559"/>
+ <charCodeRange minValue="0561" maxValue="0586"/>
+ <charCodeRange minValue="05d0" maxValue="05ea"/>
+ <charCodeRange minValue="05f0" maxValue="05f2"/>
+ <charCodeRange minValue="0621" maxValue="063a"/>
+ <charCodeRange minValue="0641" maxValue="064a"/>
+ <charCodeRange minValue="0671" maxValue="06b7"/>
+ <charCodeRange minValue="06ba" maxValue="06be"/>
+ <charCodeRange minValue="06c0" maxValue="06ce"/>
+ <charCodeRange minValue="06d0" maxValue="06d3"/>
+ <charCode value="06d5"/>
+ <charCodeRange minValue="06e5" maxValue="06e6"/>
+ <charCodeRange minValue="0905" maxValue="0939"/>
+ <charCode value="093d"/>
+ <charCodeRange minValue="0958" maxValue="0961"/>
+ <charCodeRange minValue="0985" maxValue="098c"/>
+ <charCodeRange minValue="098f" maxValue="0990"/>
+ <charCodeRange minValue="0993" maxValue="09a8"/>
+ <charCodeRange minValue="09aa" maxValue="09b0"/>
+ <charCode value="09b2"/>
+ <charCodeRange minValue="09b6" maxValue="09b9"/>
+ <charCodeRange minValue="09dc" maxValue="09dd"/>
+ <charCodeRange minValue="09df" maxValue="09e1"/>
+ <charCodeRange minValue="09f0" maxValue="09f1"/>
+ <charCodeRange minValue="0a05" maxValue="0a0a"/>
+ <charCodeRange minValue="0a0f" maxValue="0a10"/>
+ <charCodeRange minValue="0a13" maxValue="0a28"/>
+ <charCodeRange minValue="0a2a" maxValue="0a30"/>
+ <charCodeRange minValue="0a32" maxValue="0a33"/>
+ <charCodeRange minValue="0a35" maxValue="0a36"/>
+ <charCodeRange minValue="0a38" maxValue="0a39"/>
+ <charCodeRange minValue="0a59" maxValue="0a5c"/>
+ <charCode value="0a5e"/>
+ <charCodeRange minValue="0a72" maxValue="0a74"/>
+ <charCodeRange minValue="0a85" maxValue="0a8b"/>
+ <charCode value="0a8d"/>
+ <charCodeRange minValue="0a8f" maxValue="0a91"/>
+ <charCodeRange minValue="0a93" maxValue="0aa8"/>
+ <charCodeRange minValue="0aaa" maxValue="0ab0"/>
+ <charCodeRange minValue="0ab2" maxValue="0ab3"/>
+ <charCodeRange minValue="0ab5" maxValue="0ab9"/>
+ <charCode value="0abd"/>
+ <charCode value="0ae0"/>
+ <charCodeRange minValue="0b05" maxValue="0b0c"/>
+ <charCodeRange minValue="0b0f" maxValue="0b10"/>
+ <charCodeRange minValue="0b13" maxValue="0b28"/>
+ <charCodeRange minValue="0b2a" maxValue="0b30"/>
+ <charCodeRange minValue="0b32" maxValue="0b33"/>
+ <charCodeRange minValue="0b36" maxValue="0b39"/>
+ <charCode value="0b3d"/>
+ <charCodeRange minValue="0b5c" maxValue="0b5d"/>
+ <charCodeRange minValue="0b5f" maxValue="0b61"/>
+ <charCodeRange minValue="0b85" maxValue="0b8a"/>
+ <charCodeRange minValue="0b8e" maxValue="0b90"/>
+ <charCodeRange minValue="0b92" maxValue="0b95"/>
+ <charCodeRange minValue="0b99" maxValue="0b9a"/>
+ <charCode value="0b9c"/>
+ <charCodeRange minValue="0b9e" maxValue="0b9f"/>
+ <charCodeRange minValue="0ba3" maxValue="0ba4"/>
+ <charCodeRange minValue="0ba8" maxValue="0baa"/>
+ <charCodeRange minValue="0bae" maxValue="0bb5"/>
+ <charCodeRange minValue="0bb7" maxValue="0bb9"/>
+ <charCodeRange minValue="0c05" maxValue="0c0c"/>
+ <charCodeRange minValue="0c0e" maxValue="0c10"/>
+ <charCodeRange minValue="0c12" maxValue="0c28"/>
+ <charCodeRange minValue="0c2a" maxValue="0c33"/>
+ <charCodeRange minValue="0c35" maxValue="0c39"/>
+ <charCodeRange minValue="0c60" maxValue="0c61"/>
+ <charCodeRange minValue="0c85" maxValue="0c8c"/>
+ <charCodeRange minValue="0c8e" maxValue="0c90"/>
+ <charCodeRange minValue="0c92" maxValue="0ca8"/>
+ <charCodeRange minValue="0caa" maxValue="0cb3"/>
+ <charCodeRange minValue="0cb5" maxValue="0cb9"/>
+ <charCode value="0cde"/>
+ <charCodeRange minValue="0ce0" maxValue="0ce1"/>
+ <charCodeRange minValue="0d05" maxValue="0d0c"/>
+ <charCodeRange minValue="0d0e" maxValue="0d10"/>
+ <charCodeRange minValue="0d12" maxValue="0d28"/>
+ <charCodeRange minValue="0d2a" maxValue="0d39"/>
+ <charCodeRange minValue="0d60" maxValue="0d61"/>
+ <charCodeRange minValue="0e01" maxValue="0e2e"/>
+ <charCode value="0e30"/>
+ <charCodeRange minValue="0e32" maxValue="0e33"/>
+ <charCodeRange minValue="0e40" maxValue="0e45"/>
+ <charCodeRange minValue="0e81" maxValue="0e82"/>
+ <charCode value="0e84"/>
+ <charCodeRange minValue="0e87" maxValue="0e88"/>
+ <charCode value="0e8a"/>
+ <charCode value="0e8d"/>
+ <charCodeRange minValue="0e94" maxValue="0e97"/>
+ <charCodeRange minValue="0e99" maxValue="0e9f"/>
+ <charCodeRange minValue="0ea1" maxValue="0ea3"/>
+ <charCode value="0ea5"/>
+ <charCode value="0ea7"/>
+ <charCodeRange minValue="0eaa" maxValue="0eab"/>
+ <charCodeRange minValue="0ead" maxValue="0eae"/>
+ <charCode value="0eb0"/>
+ <charCodeRange minValue="0eb2" maxValue="0eb3"/>
+ <charCode value="0ebd"/>
+ <charCodeRange minValue="0ec0" maxValue="0ec4"/>
+ <charCodeRange minValue="0f40" maxValue="0f47"/>
+ <charCodeRange minValue="0f49" maxValue="0f69"/>
+ <charCodeRange minValue="10a0" maxValue="10c5"/>
+ <charCodeRange minValue="10d0" maxValue="10f6"/>
+ <charCode value="1100"/>
+ <charCodeRange minValue="1102" maxValue="1103"/>
+ <charCodeRange minValue="1105" maxValue="1107"/>
+ <charCode value="1109"/>
+ <charCodeRange minValue="110b" maxValue="110c"/>
+ <charCodeRange minValue="110e" maxValue="1112"/>
+ <charCode value="113c"/>
+ <charCode value="113e"/>
+ <charCode value="1140"/>
+ <charCode value="114c"/>
+ <charCode value="114e"/>
+ <charCode value="1150"/>
+ <charCodeRange minValue="1154" maxValue="1155"/>
+ <charCode value="1159"/>
+ <charCodeRange minValue="115f" maxValue="1161"/>
+ <charCode value="1163"/>
+ <charCode value="1165"/>
+ <charCode value="1167"/>
+ <charCode value="1169"/>
+ <charCodeRange minValue="116d" maxValue="116e"/>
+ <charCodeRange minValue="1172" maxValue="1173"/>
+ <charCode value="1175"/>
+ <charCode value="119e"/>
+ <charCode value="11a8"/>
+ <charCode value="11ab"/>
+ <charCodeRange minValue="11ae" maxValue="11af"/>
+ <charCodeRange minValue="11b7" maxValue="11b8"/>
+ <charCode value="11ba"/>
+ <charCodeRange minValue="11bc" maxValue="11c2"/>
+ <charCode value="11eb"/>
+ <charCode value="11f0"/>
+ <charCode value="11f9"/>
+ <charCodeRange minValue="1e00" maxValue="1e9b"/>
+ <charCodeRange minValue="1ea0" maxValue="1ef9"/>
+ <charCodeRange minValue="1f00" maxValue="1f15"/>
+ <charCodeRange minValue="1f18" maxValue="1f1d"/>
+ <charCodeRange minValue="1f20" maxValue="1f45"/>
+ <charCodeRange minValue="1f48" maxValue="1f4d"/>
+ <charCodeRange minValue="1f50" maxValue="1f57"/>
+ <charCode value="1f59"/>
+ <charCode value="1f5b"/>
+ <charCode value="1f5d"/>
+ <charCodeRange minValue="1f5f" maxValue="1f7d"/>
+ <charCodeRange minValue="1f80" maxValue="1fb4"/>
+ <charCodeRange minValue="1fb6" maxValue="1fbc"/>
+ <charCode value="1fbe"/>
+ <charCodeRange minValue="1fc2" maxValue="1fc4"/>
+ <charCodeRange minValue="1fc6" maxValue="1fcc"/>
+ <charCodeRange minValue="1fd0" maxValue="1fd3"/>
+ <charCodeRange minValue="1fd6" maxValue="1fdb"/>
+ <charCodeRange minValue="1fe0" maxValue="1fec"/>
+ <charCodeRange minValue="1ff2" maxValue="1ff4"/>
+ <charCodeRange minValue="1ff6" maxValue="1ffc"/>
+ <charCode value="2126"/>
+ <charCodeRange minValue="212a" maxValue="212b"/>
+ <charCode value="212e"/>
+ <charCodeRange minValue="2180" maxValue="2182"/>
+ <charCodeRange minValue="3041" maxValue="3094"/>
+ <charCodeRange minValue="30a1" maxValue="30fa"/>
+ <charCodeRange minValue="3105" maxValue="312c"/>
+ <charCodeRange minValue="ac00" maxValue="d7a3"/>
+ </charClass>
+ </token>
+
+ <token name="Ideographic" inline="false" is-macro="yes" is-xml="yes">
+ <charClass>
+ <charCodeRange minValue="4e00" maxValue="9fa5"/>
+ <charCode value="3007"/>
+ <charCodeRange minValue="3021" maxValue="3029"/>
+ </charClass>
+ </token>
+
+ <token name="CombiningChar" inline="false" is-macro="yes" is-xml="yes">
+ <charClass>
+ <charCodeRange minValue="0300" maxValue="0345"/>
+ <charCodeRange minValue="0360" maxValue="0361"/>
+ <charCodeRange minValue="0483" maxValue="0486"/>
+ <charCodeRange minValue="0591" maxValue="05a1"/>
+ <charCodeRange minValue="05a3" maxValue="05b9"/>
+ <charCodeRange minValue="05bb" maxValue="05bd"/>
+ <charCode value="05bf"/>
+ <charCodeRange minValue="05c1" maxValue="05c2"/>
+ <charCode value="05c4"/>
+ <charCodeRange minValue="064b" maxValue="0652"/>
+ <charCode value="0670"/>
+ <charCodeRange minValue="06d6" maxValue="06dc"/>
+ <charCodeRange minValue="06dd" maxValue="06df"/>
+ <charCodeRange minValue="06e0" maxValue="06e4"/>
+ <charCodeRange minValue="06e7" maxValue="06e8"/>
+ <charCodeRange minValue="06ea" maxValue="06ed"/>
+ <charCodeRange minValue="0901" maxValue="0903"/>
+ <charCode value="093c"/>
+ <charCodeRange minValue="093e" maxValue="094c"/>
+ <charCode value="094d"/>
+ <charCodeRange minValue="0951" maxValue="0954"/>
+ <charCodeRange minValue="0962" maxValue="0963"/>
+ <charCodeRange minValue="0981" maxValue="0983"/>
+ <charCode value="09bc"/>
+ <charCode value="09be"/>
+ <charCode value="09bf"/>
+ <charCodeRange minValue="09c0" maxValue="09c4"/>
+ <charCodeRange minValue="09c7" maxValue="09c8"/>
+ <charCodeRange minValue="09cb" maxValue="09cd"/>
+ <charCode value="09d7"/>
+ <charCodeRange minValue="09e2" maxValue="09e3"/>
+ <charCode value="0a02"/>
+ <charCode value="0a3c"/>
+ <charCode value="0a3e"/>
+ <charCode value="0a3f"/>
+ <charCodeRange minValue="0a40" maxValue="0a42"/>
+ <charCodeRange minValue="0a47" maxValue="0a48"/>
+ <charCodeRange minValue="0a4b" maxValue="0a4d"/>
+ <charCodeRange minValue="0a70" maxValue="0a71"/>
+ <charCodeRange minValue="0a81" maxValue="0a83"/>
+ <charCode value="0abc"/>
+ <charCodeRange minValue="0abe" maxValue="0ac5"/>
+ <charCodeRange minValue="0ac7" maxValue="0ac9"/>
+ <charCodeRange minValue="0acb" maxValue="0acd"/>
+ <charCodeRange minValue="0b01" maxValue="0b03"/>
+ <charCode value="0b3c"/>
+ <charCodeRange minValue="0b3e" maxValue="0b43"/>
+ <charCodeRange minValue="0b47" maxValue="0b48"/>
+ <charCodeRange minValue="0b4b" maxValue="0b4d"/>
+ <charCodeRange minValue="0b56" maxValue="0b57"/>
+ <charCodeRange minValue="0b82" maxValue="0b83"/>
+ <charCodeRange minValue="0bbe" maxValue="0bc2"/>
+ <charCodeRange minValue="0bc6" maxValue="0bc8"/>
+ <charCodeRange minValue="0bca" maxValue="0bcd"/>
+ <charCode value="0bd7"/>
+ <charCodeRange minValue="0c01" maxValue="0c03"/>
+ <charCodeRange minValue="0c3e" maxValue="0c44"/>
+ <charCodeRange minValue="0c46" maxValue="0c48"/>
+ <charCodeRange minValue="0c4a" maxValue="0c4d"/>
+ <charCodeRange minValue="0c55" maxValue="0c56"/>
+ <charCodeRange minValue="0c82" maxValue="0c83"/>
+ <charCodeRange minValue="0cbe" maxValue="0cc4"/>
+ <charCodeRange minValue="0cc6" maxValue="0cc8"/>
+ <charCodeRange minValue="0cca" maxValue="0ccd"/>
+ <charCodeRange minValue="0cd5" maxValue="0cd6"/>
+ <charCodeRange minValue="0d02" maxValue="0d03"/>
+ <charCodeRange minValue="0d3e" maxValue="0d43"/>
+ <charCodeRange minValue="0d46" maxValue="0d48"/>
+ <charCodeRange minValue="0d4a" maxValue="0d4d"/>
+ <charCode value="0d57"/>
+ <charCode value="0e31"/>
+ <charCodeRange minValue="0e34" maxValue="0e3a"/>
+ <charCodeRange minValue="0e47" maxValue="0e4e"/>
+ <charCode value="0eb1"/>
+ <charCodeRange minValue="0eb4" maxValue="0eb9"/>
+ <charCodeRange minValue="0ebb" maxValue="0ebc"/>
+ <charCodeRange minValue="0ec8" maxValue="0ecd"/>
+ <charCodeRange minValue="0f18" maxValue="0f19"/>
+ <charCode value="0f35"/>
+ <charCode value="0f37"/>
+ <charCode value="0f39"/>
+ <charCode value="0f3e"/>
+ <charCode value="0f3f"/>
+ <charCodeRange minValue="0f71" maxValue="0f84"/>
+ <charCodeRange minValue="0f86" maxValue="0f8b"/>
+ <charCodeRange minValue="0f90" maxValue="0f95"/>
+ <charCode value="0f97"/>
+ <charCodeRange minValue="0f99" maxValue="0fad"/>
+ <charCodeRange minValue="0fb1" maxValue="0fb7"/>
+ <charCode value="0fb9"/>
+ <charCodeRange minValue="20d0" maxValue="20dc"/>
+ <charCode value="20e1"/>
+ <charCodeRange minValue="302a" maxValue="302f"/>
+ <charCode value="3099"/>
+ <charCode value="309a"/>
+ </charClass>
+ </token>
+
+ <token name="Digit" inline="false" is-macro="yes" is-xml="yes">
+ <charClass>
+ <charCodeRange minValue="0030" maxValue="0039"/>
+ <charCodeRange minValue="0660" maxValue="0669"/>
+ <charCodeRange minValue="06f0" maxValue="06f9"/>
+ <charCodeRange minValue="0966" maxValue="096f"/>
+ <charCodeRange minValue="09e6" maxValue="09ef"/>
+ <charCodeRange minValue="0a66" maxValue="0a6f"/>
+ <charCodeRange minValue="0ae6" maxValue="0aef"/>
+ <charCodeRange minValue="0b66" maxValue="0b6f"/>
+ <charCodeRange minValue="0be7" maxValue="0bef"/>
+ <charCodeRange minValue="0c66" maxValue="0c6f"/>
+ <charCodeRange minValue="0ce6" maxValue="0cef"/>
+ <charCodeRange minValue="0d66" maxValue="0d6f"/>
+ <charCodeRange minValue="0e50" maxValue="0e59"/>
+ <charCodeRange minValue="0ed0" maxValue="0ed9"/>
+ <charCodeRange minValue="0f20" maxValue="0f29"/>
+ </charClass>
+ </token>
+
+ <token name="Extender" inline="false" is-macro="yes" is-xml="yes">
+ <charClass>
+ <charCode value="00b7"/>
+ <charCode value="02d0"/>
+ <charCode value="02d1"/>
+ <charCode value="0387"/>
+ <charCode value="0640"/>
+ <charCode value="0e46"/>
+ <charCode value="0ec6"/>
+ <charCode value="3005"/>
+ <charCodeRange minValue="3031" maxValue="3035"/>
+ <charCodeRange minValue="309d" maxValue="309e"/>
+ <charCodeRange minValue="30fc" maxValue="30fe"/>
+ </charClass>
+ </token>
+
+
+</grammar>
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:nil
+sgml-shorttag:nil
+sgml-namecase-general:nil
+sgml-general-insert-case:lower
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:2
+sgml-indent-data:nil
+sgml-parent-document:nil
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+-->
No revision
No revision
1.1.2.3 +121 -121
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathException.java
Index: XPathException.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathException.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XPathException.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ XPathException.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,121 +1,121 @@
-/*
- * 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;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-/**
- *
- */
-public class XPathException extends Exception {
-
- Exception _e;
-
- public XPathException(Exception e) {
- super();
-
- _e = e;
- }
-
- public XPathException(String msg) {
- super(msg);
- }
-
-
- /**
- * @see java.lang.Throwable#getLocalizedMessage()
- */
- public String getLocalizedMessage() {
- return _e.getLocalizedMessage();
- }
-
- /**
- * @see java.lang.Throwable#getMessage()
- */
- public String getMessage() {
- return _e.getMessage();
- }
-
- /**
- * @see java.lang.Throwable#printStackTrace()
- */
- public void printStackTrace() {
- super.printStackTrace();
- System.out.println("-------------------");
- _e.printStackTrace();
- }
-
- /**
- * @see java.lang.Throwable#printStackTrace(PrintStream)
- */
- public void printStackTrace(PrintStream s) {
- super.printStackTrace(s);
- s.println("----------------");
- _e.printStackTrace(s);
- }
-
- /**
- * @see java.lang.Throwable#printStackTrace(PrintWriter)
- */
- public void printStackTrace(PrintWriter s) {
- super.printStackTrace(s);
- s.println("----------------");
- _e.printStackTrace(s);
- }
-
-}
+/*
+ * 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;
+
+import java.io.PrintStream;
+import java.io.PrintWriter;
+
+/**
+ *
+ */
+public class XPathException extends Exception {
+
+ Exception _e;
+
+ public XPathException(Exception e) {
+ super();
+
+ _e = e;
+ }
+
+ public XPathException(String msg) {
+ super(msg);
+ }
+
+
+ /**
+ * @see java.lang.Throwable#getLocalizedMessage()
+ */
+ public String getLocalizedMessage() {
+ return _e.getLocalizedMessage();
+ }
+
+ /**
+ * @see java.lang.Throwable#getMessage()
+ */
+ public String getMessage() {
+ return _e.getMessage();
+ }
+
+ /**
+ * @see java.lang.Throwable#printStackTrace()
+ */
+ public void printStackTrace() {
+ super.printStackTrace();
+ System.out.println("-------------------");
+ _e.printStackTrace();
+ }
+
+ /**
+ * @see java.lang.Throwable#printStackTrace(PrintStream)
+ */
+ public void printStackTrace(PrintStream s) {
+ super.printStackTrace(s);
+ s.println("----------------");
+ _e.printStackTrace(s);
+ }
+
+ /**
+ * @see java.lang.Throwable#printStackTrace(PrintWriter)
+ */
+ public void printStackTrace(PrintWriter s) {
+ super.printStackTrace(s);
+ s.println("----------------");
+ _e.printStackTrace(s);
+ }
+
+}
1.1.2.3 +112 -112
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathFactory.java
Index: XPathFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/Attic/XPathFactory.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XPathFactory.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ XPathFactory.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,112 +1,112 @@
-/*
- * 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;
-
-import org.apache.xpath.rwapi.datamodel.ItemFactory;
-import org.apache.xpath.rwapi.eval.EvaluatorFactory;
-import org.apache.xpath.rwapi.expression.ExpressionFactory;
-import org.apache.xpath.rwapi.impl.XPathFactoryImpl;
-
-/**
- * Main entrance to XPath expression manipulation.
- * Use <code>newExpressionFactory</code> in order to get a factory for
creating and updating XPath expression.
- * Use <code>newEvaluatorFactory</code> in order to get a factory for
evaluating xpath expression
- */
-public abstract class XPathFactory {
-
- final static public String XPATH_FACTORY_KEY = "xpath.factory";
-
- static public XPathFactory newInstance() {
- // Basic implementation finder: use system properties
- String className = System.getProperty(XPATH_FACTORY_KEY);
-
- if (className != null) {
- try {
- Class factory = Class.forName(className);
-
- return (XPathFactory) factory.newInstance();
- } catch (ClassNotFoundException e) {
- // msg somewhere
- } catch (InstantiationException e) {
- // msg somewhere
-
- } catch (IllegalAccessException e) {
- // msg somewhere +
- }
- }
-
- return new XPathFactoryImpl();
- }
-
- /**
- * Create a new expression factory.
- * @see org.apache.xpath.rwapi.expression.ExpressionFactory
- */
- public abstract ExpressionFactory newExpressionFactory();
-
- /**
- * Create a new data model factory.
- * @see org.apache.xpath.rwapi.datamodel.ItemFactory
- */
- public abstract ItemFactory newItemFactory();
-
- /**
- * Create a new evaluator factory.
- * @see org.apache.xpath.rwapi.eval.EvaluatorFactory
- */
- public abstract EvaluatorFactory newEvaluatorFactory();
-
-}
+/*
+ * 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;
+
+import org.apache.xpath.rwapi.datamodel.ItemFactory;
+import org.apache.xpath.rwapi.eval.EvaluatorFactory;
+import org.apache.xpath.rwapi.expression.ExpressionFactory;
+import org.apache.xpath.rwapi.impl.XPathFactoryImpl;
+
+/**
+ * Main entrance to XPath expression manipulation.
+ * Use <code>newExpressionFactory</code> in order to get a factory for
creating and updating XPath expression.
+ * Use <code>newEvaluatorFactory</code> in order to get a factory for
evaluating xpath expression
+ */
+public abstract class XPathFactory {
+
+ final static public String XPATH_FACTORY_KEY = "xpath.factory";
+
+ static public XPathFactory newInstance() {
+ // Basic implementation finder: use system properties
+ String className = System.getProperty(XPATH_FACTORY_KEY);
+
+ if (className != null) {
+ try {
+ Class factory = Class.forName(className);
+
+ return (XPathFactory) factory.newInstance();
+ } catch (ClassNotFoundException e) {
+ // msg somewhere
+ } catch (InstantiationException e) {
+ // msg somewhere
+
+ } catch (IllegalAccessException e) {
+ // msg somewhere +
+ }
+ }
+
+ return new XPathFactoryImpl();
+ }
+
+ /**
+ * Create a new expression factory.
+ * @see org.apache.xpath.rwapi.expression.ExpressionFactory
+ */
+ public abstract ExpressionFactory newExpressionFactory();
+
+ /**
+ * Create a new data model factory.
+ * @see org.apache.xpath.rwapi.datamodel.ItemFactory
+ */
+ public abstract ItemFactory newItemFactory();
+
+ /**
+ * Create a new evaluator factory.
+ * @see org.apache.xpath.rwapi.eval.EvaluatorFactory
+ */
+ public abstract EvaluatorFactory newEvaluatorFactory();
+
+}
No revision
No revision
1.1.2.3 +64 -64
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/AtomicValue.java
Index: AtomicValue.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/AtomicValue.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- AtomicValue.java 30 Jan 2003 00:45:40 -0000 1.1.2.2
+++ AtomicValue.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,64 +1,64 @@
-/*
- * 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.datamodel;
-
-/**
- * Represents an atomic value
- * @see <a href="http://www.w3.org/TR/query-datamodel/#AtomicValue">XQuery
1.0 and XPath 2.0 Data Model Specification</a>
- */
-public interface AtomicValue {
-
-}
+/*
+ * 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.datamodel;
+
+/**
+ * Represents an atomic value
+ * @see <a href="http://www.w3.org/TR/query-datamodel/#AtomicValue">XQuery
1.0 and XPath 2.0 Data Model Specification</a>
+ */
+public interface AtomicValue {
+
+}
1.1.2.3 +73 -73
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Item.java
Index: Item.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Item.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Item.java 30 Jan 2003 00:45:40 -0000 1.1.2.2
+++ Item.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,73 +1,73 @@
-/*
- * 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.datamodel;
-
-/**
- *
- */
-public interface Item {
-
- /**
- *
- */
- boolean isAtomicValue();
-
- /**
- *
- */
- boolean isNode();
-
-}
+/*
+ * 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.datamodel;
+
+/**
+ *
+ */
+public interface Item {
+
+ /**
+ *
+ */
+ boolean isAtomicValue();
+
+ /**
+ *
+ */
+ boolean isNode();
+
+}
1.1.2.3 +66 -66
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/ItemFactory.java
Index: ItemFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/ItemFactory.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ItemFactory.java 30 Jan 2003 00:45:40 -0000 1.1.2.2
+++ ItemFactory.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,66 +1,66 @@
-/*
- * 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.datamodel;
-
-
-/**
- *
- */
-public abstract class ItemFactory {
-
-
- public abstract Item createNodeItem( Node node );
-}
+/*
+ * 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.datamodel;
+
+
+/**
+ *
+ */
+public abstract class ItemFactory {
+
+
+ public abstract Item createNodeItem( Node node );
+}
1.1.2.3 +76 -76
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Node.java
Index: Node.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Node.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Node.java 30 Jan 2003 00:45:40 -0000 1.1.2.2
+++ Node.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,76 +1,76 @@
-/*
- * 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.datamodel;
-
-/**
- * Represents a tree node.
- * @see <a href="http://www.w3.org/TR/query-datamodel/#Node">XQuery 1.0 and
XPath 2.0 Data Model Specification</a>
- */
-public interface Node {
-
- static String[] NODE_KIND_NAME =
- { null, "element", "attribute", "text", null, null, null,
"processing-instruction", "comment", "document", null, null, null, "namespace",
};
-
- static public final short ELEMENT_NODE = 1;
- static public final short ATTRIBUTE_NODE = 2;
- static public final short TEXT_NODE = 3;
- static public final short PROCESSING_INSTRUCTION_NODE = 7;
- static public final short COMMENT_NODE = 8;
- static public final short DOCUMENT_NODE = 9;
- static public final short NAMESPACE_NODE = 13;
-
- String nodeKind();
-}
+/*
+ * 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.datamodel;
+
+/**
+ * Represents a tree node.
+ * @see <a href="http://www.w3.org/TR/query-datamodel/#Node">XQuery 1.0 and
XPath 2.0 Data Model Specification</a>
+ */
+public interface Node {
+
+ static String[] NODE_KIND_NAME =
+ { null, "element", "attribute", "text", null, null, null,
"processing-instruction", "comment", "document", null, null, null, "namespace",
};
+
+ static public final short ELEMENT_NODE = 1;
+ static public final short ATTRIBUTE_NODE = 2;
+ static public final short TEXT_NODE = 3;
+ static public final short PROCESSING_INSTRUCTION_NODE = 7;
+ static public final short COMMENT_NODE = 8;
+ static public final short DOCUMENT_NODE = 9;
+ static public final short NAMESPACE_NODE = 13;
+
+ String nodeKind();
+}
1.1.2.3 +69 -69
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Sequence.java
Index: Sequence.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/Sequence.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Sequence.java 30 Jan 2003 00:45:40 -0000 1.1.2.2
+++ Sequence.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,69 +1,69 @@
-/*
- * 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.datamodel;
-
-/**
- * Result of the evaluation of an expression.
- * A sequence is an ordered collection of zero or more items
- */
-public interface Sequence {
-
- /**
- *
- */
- Item nextItem();
-
-}
+/*
+ * 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.datamodel;
+
+/**
+ * Result of the evaluation of an expression.
+ * A sequence is an ordered collection of zero or more items
+ */
+public interface Sequence {
+
+ /**
+ *
+ */
+ Item nextItem();
+
+}
1.1.2.3 +63 -63
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SequenceType.java
Index: SequenceType.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SequenceType.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- SequenceType.java 30 Jan 2003 00:45:40 -0000 1.1.2.2
+++ SequenceType.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,63 +1,63 @@
-/*
- * 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.datamodel;
-
-/**
- *
- */
-public interface SequenceType {
-
-}
+/*
+ * 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.datamodel;
+
+/**
+ *
+ */
+public interface SequenceType {
+
+}
1.1.2.3 +63 -63
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SingleType.java
Index: SingleType.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/datamodel/Attic/SingleType.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- SingleType.java 30 Jan 2003 00:45:40 -0000 1.1.2.2
+++ SingleType.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,63 +1,63 @@
-/*
- * 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.datamodel;
-
-/**
- *
- */
-public interface SingleType {
-
-}
+/*
+ * 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.datamodel;
+
+/**
+ *
+ */
+public interface SingleType {
+
+}
No revision
No revision
1.1.2.3 +76 -76
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/DynamicContext.java
Index: DynamicContext.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/DynamicContext.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- DynamicContext.java 30 Jan 2003 00:45:42 -0000 1.1.2.2
+++ DynamicContext.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,76 +1,76 @@
-/*
- * 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.eval;
-
-
-/**
- *
- */
-public interface DynamicContext {
-
- /**
- *
- */
- Object getContextItem();
-
- /**
- *
- */
- void setContextItem( Object item );
-
-
-
-}
+/*
+ * 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.eval;
+
+
+/**
+ *
+ */
+public interface DynamicContext {
+
+ /**
+ *
+ */
+ Object getContextItem();
+
+ /**
+ *
+ */
+ void setContextItem( Object item );
+
+
+
+}
1.1.2.3 +85 -85
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/Evaluator.java
Index: Evaluator.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/Evaluator.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Evaluator.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ Evaluator.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,85 +1,85 @@
-/*
- * 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.eval;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.ExprContext;
-
-/**
- * XPath expression evaluation given an expression context.
- * Two kinds of evaluation are provided: the evaluation of expression within
- * a given context and the match pattern against a <code>Node</code> (as
define in XSLT 2.0).
- */
-public interface Evaluator {
-
- /**
- *
- */
- ExprContext createExprContext();
-
- /**
- *
- */
- Object evaluate( ExprContext ctx, Expr expr ) throws XPathException;
-
- /**
- *
- */
- boolean match( ExprContext ctx, Expr expr, Object node ) 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.eval;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.ExprContext;
+
+/**
+ * XPath expression evaluation given an expression context.
+ * Two kinds of evaluation are provided: the evaluation of expression within
+ * a given context and the match pattern against a <code>Node</code> (as
define in XSLT 2.0).
+ */
+public interface Evaluator {
+
+ /**
+ *
+ */
+ ExprContext createExprContext();
+
+ /**
+ *
+ */
+ Object evaluate( ExprContext ctx, Expr expr ) throws XPathException;
+
+ /**
+ *
+ */
+ boolean match( ExprContext ctx, Expr expr, Object node ) throws
XPathException;
+
+
+}
1.1.2.3 +67 -67
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/EvaluatorFactory.java
Index: EvaluatorFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/EvaluatorFactory.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- EvaluatorFactory.java 30 Jan 2003 00:45:42 -0000 1.1.2.2
+++ EvaluatorFactory.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,67 +1,67 @@
-/*
- * 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.eval;
-
-/**
- *
- */
-public abstract class EvaluatorFactory {
-
- /**
- *
- */
- public abstract Evaluator createEvaluator();
-}
+/*
+ * 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.eval;
+
+/**
+ *
+ */
+public abstract class EvaluatorFactory {
+
+ /**
+ *
+ */
+ public abstract Evaluator createEvaluator();
+}
1.1.2.3 +70 -70
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/NamespaceContext.java
Index: NamespaceContext.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/eval/Attic/NamespaceContext.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- NamespaceContext.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ NamespaceContext.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,70 +1,70 @@
-/*
- * 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.eval;
-
-/**
- * A NamespaceContext provides information used to resolve prefixes
appearing
- * in XPath expressions.
- */
-public interface NamespaceContext {
-
- /**
- * Given a prefix, returns the namespace associated with it.
- */
- public String getNamespaceForPrefix(String prefix);
-}
-
-
+/*
+ * 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.eval;
+
+/**
+ * A NamespaceContext provides information used to resolve prefixes
appearing
+ * in XPath expressions.
+ */
+public interface NamespaceContext {
+
+ /**
+ * Given a prefix, returns the namespace associated with it.
+ */
+ public String getNamespaceForPrefix(String prefix);
+}
+
+
No revision
No revision
1.1.2.3 +76 -76
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastExpr.java
Index: CastExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastExpr.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- CastExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ CastExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,76 +1,76 @@
-/*
- * 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.datamodel.SequenceType;
-
-/**
- *
- */
-public interface CastExpr extends Expr {
-
- /**
- *
- */
- SequenceType getSequenceType();
-
- /**
- *
- */
- OperatorExpr getParenthesizedExpr();
-
-}
-
+/*
+ * 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.datamodel.SequenceType;
+
+/**
+ *
+ */
+public interface CastExpr extends Expr {
+
+ /**
+ *
+ */
+ SequenceType getSequenceType();
+
+ /**
+ *
+ */
+ OperatorExpr getParenthesizedExpr();
+
+}
+
1.1.2.3 +76 -76
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastableExpr.java
Index: CastableExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/CastableExpr.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- CastableExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ CastableExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,76 +1,76 @@
-/*
- * 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.datamodel.SingleType;
-
-/**
- *
- */
-public interface CastableExpr extends Expr {
-
- /**
- *
- */
- SingleType getSingleType();
-
- /**
- *
- */
- Expr getCastableExpr();
-
-
-}
+/*
+ * 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.datamodel.SingleType;
+
+/**
+ *
+ */
+public interface CastableExpr extends Expr {
+
+ /**
+ *
+ */
+ SingleType getSingleType();
+
+ /**
+ *
+ */
+ Expr getCastableExpr();
+
+
+}
1.1.2.3 +79 -79
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ConditionalExpr.java
Index: ConditionalExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ConditionalExpr.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ConditionalExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ ConditionalExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,79 +1,79 @@
-/*
- * 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;
-
-/**
- *
- */
-public interface ConditionalExpr extends Expr {
-
- /**
- *
- */
- Expr getTestExpr();
-
- /**
- *
- */
- Expr getThenExpr();
-
- /**
- *
- */
- Expr getElseExpr();
-
-
-}
+/*
+ * 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;
+
+/**
+ *
+ */
+public interface ConditionalExpr extends Expr {
+
+ /**
+ *
+ */
+ Expr getTestExpr();
+
+ /**
+ *
+ */
+ Expr getThenExpr();
+
+ /**
+ *
+ */
+ Expr getElseExpr();
+
+
+}
1.1.2.4 +211 -211
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Expr.java
Index: Expr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Expr.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Expr.java 30 Jan 2003 00:45:38 -0000 1.1.2.3
+++ Expr.java 5 Feb 2003 16:09:46 -0000 1.1.2.4
@@ -1,211 +1,211 @@
-/*
- * 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;
-
-
-/**
- * This interface represents an XPath Expression.
- * <pre>
- * [1] XPath ::= ExprSequence?
- * [3] Expr ::= OrExpr
- * [7] QuantifiedExpr ::= ((<"some" "$"> | <"every" "$">) VarName
"in" Expr ("," "$" VarName "in" Expr)* "satisfies")* IfExpr
- * [10] ComparisonExpr ::= RangeExpr ( (ValueComp | GeneralComp |
NodeComp | OrderComp) RangeExpr )?
- * [18] PathExpr ::= ("/" RelativePathExpr?) | ("//" RelativePathExpr)
| RelativePathExpr
- * </pre>
- * @see <a
href="http://www.w3.org/TR/2002/WD-xpath20-20020816/#id-expressions">XPath 2.0
Specification</a>
- */
-public interface Expr extends Visitable {
-
- /**
- * Path expression type
- */
- short PATH_EXPR = 0;
-
- /**
- * Logical expression type.
- * Modelise 'or' and 'and' expressions
- */
- short LOGICAL_EXPR = 1;
-
- /**
- * Conditionnal expression type.
- * Modelise 'if' expressions
- */
- short CONDITIONAL_EXPR = 2;
-
- /**
- * Iteration expression type.
- * Modelise 'for' expressions
- */
- short ITERATION_EXPR = 3;
-
- /**
- * Quantified expression type.
- * Modelise 'every' and 'some' expressions
- */
- short QUANTIFIED_EXPR = 4;
-
- /**
- * Comparison expression type. Modelise value comparisons, general
- * comparisons, node comparisons, and order comparisons.
- */
- short COMPARISON_EXPR = 5;
-
- /**
- * Arithmetic expression type.
- * Modelise arithmetic operators for addition, subtraction,
multiplication, division, and modulus
- */
- short ARITHMETIC_EXPR = 6;
-
- /**
- * Sequence of expressions type.
- */
- short SEQUENCE_EXPR = 7;
-
- /**
- * Union and Intersection
- */
- short COMBINE_EXPR = 8;
-
- /**
- *
- */
- short PRIMARY_EXPR = 9;
-
- /**
- *
- */
- short VALIDATE_EXPR = 10;
-
- /**
- *
- */
- short NAMETEST_EXPR = 11;
-
- /**
- *
- */
- short KINDTEST_EXPR = 12;
-
-
- /**
- * Literal primary expression type constant
- */
- short LITERAL_EXPR = 13;
-
- /**
- * Function call primary expression type constant
- */
- short FUNCTION_CALL_EXPR = 14;
-
- /**
- * Variable reference primary expression type constant
- */
- short VARIABLE_REF_EXPR = 15;
-
- /**
- * Range expression type constant
- */
- short RANGE_EXPR = 16;
-
- /**
- * Step
- */
- short STEP = 17;
-
- /**
- * Instance of
- */
- short INSTANCE_OF_EXPR = 18;
-
-
- /**
- * Unary expression
- */
- short UNARY_EXPR = 19;
-
- /**
- * Cast expression
- */
- short CAST_EXPR = 20;
-
- /**
- * Castable expression
- */
- short CASTABLE_EXPR = 21;
-
- /**
- * Gets the expression or expression component type
- * @return The type of this expression: one of the constants define in
this class
- */
- short getExprType();
-
- /**
- * Clone the expression
- * @return A clone of this expression
- */
- Expr cloneExpression();
-
- /**
- * Gets the expression as a string (external form)
- * @param abbreviate Gets the string as an abbreviate form or not
- * @return The external form of this expression
- */
- String getString(boolean abbreviate);
-
-}
-
-
+/*
+ * 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;
+
+
+/**
+ * This interface represents an XPath Expression.
+ * <pre>
+ * [1] XPath ::= ExprSequence?
+ * [3] Expr ::= OrExpr
+ * [7] QuantifiedExpr ::= ((<"some" "$"> | <"every" "$">) VarName
"in" Expr ("," "$" VarName "in" Expr)* "satisfies")* IfExpr
+ * [10] ComparisonExpr ::= RangeExpr ( (ValueComp | GeneralComp |
NodeComp | OrderComp) RangeExpr )?
+ * [18] PathExpr ::= ("/" RelativePathExpr?) | ("//" RelativePathExpr)
| RelativePathExpr
+ * </pre>
+ * @see <a
href="http://www.w3.org/TR/2002/WD-xpath20-20020816/#id-expressions">XPath 2.0
Specification</a>
+ */
+public interface Expr extends Visitable {
+
+ /**
+ * Path expression type
+ */
+ short PATH_EXPR = 0;
+
+ /**
+ * Logical expression type.
+ * Modelise 'or' and 'and' expressions
+ */
+ short LOGICAL_EXPR = 1;
+
+ /**
+ * Conditionnal expression type.
+ * Modelise 'if' expressions
+ */
+ short CONDITIONAL_EXPR = 2;
+
+ /**
+ * Iteration expression type.
+ * Modelise 'for' expressions
+ */
+ short ITERATION_EXPR = 3;
+
+ /**
+ * Quantified expression type.
+ * Modelise 'every' and 'some' expressions
+ */
+ short QUANTIFIED_EXPR = 4;
+
+ /**
+ * Comparison expression type. Modelise value comparisons, general
+ * comparisons, node comparisons, and order comparisons.
+ */
+ short COMPARISON_EXPR = 5;
+
+ /**
+ * Arithmetic expression type.
+ * Modelise arithmetic operators for addition, subtraction,
multiplication, division, and modulus
+ */
+ short ARITHMETIC_EXPR = 6;
+
+ /**
+ * Sequence of expressions type.
+ */
+ short SEQUENCE_EXPR = 7;
+
+ /**
+ * Union and Intersection
+ */
+ short COMBINE_EXPR = 8;
+
+ /**
+ *
+ */
+ short PRIMARY_EXPR = 9;
+
+ /**
+ *
+ */
+ short VALIDATE_EXPR = 10;
+
+ /**
+ *
+ */
+ short NAMETEST_EXPR = 11;
+
+ /**
+ *
+ */
+ short KINDTEST_EXPR = 12;
+
+
+ /**
+ * Literal primary expression type constant
+ */
+ short LITERAL_EXPR = 13;
+
+ /**
+ * Function call primary expression type constant
+ */
+ short FUNCTION_CALL_EXPR = 14;
+
+ /**
+ * Variable reference primary expression type constant
+ */
+ short VARIABLE_REF_EXPR = 15;
+
+ /**
+ * Range expression type constant
+ */
+ short RANGE_EXPR = 16;
+
+ /**
+ * Step
+ */
+ short STEP = 17;
+
+ /**
+ * Instance of
+ */
+ short INSTANCE_OF_EXPR = 18;
+
+ /**
+ * Unary expression
+ */
+ short UNARY_EXPR = 19;
+
+ /**
+ * Cast expression
+ */
+ short CAST_EXPR = 20;
+
+ /**
+ * Castable expression
+ */
+ short CASTABLE_EXPR = 21;
+
+ /**
+ * Gets the expression or expression component type
+ * @return The type of this expression: one of the constants define in
this
+ * interface
+ */
+ short getExprType();
+
+ /**
+ * Clone the expression
+ * @return A clone of this expression
+ */
+ Expr cloneExpression();
+
+ /**
+ * Gets the expression as a string (external form)
+ * @param abbreviate Gets the string as an abbreviate form or not
+ * @return The external form of this expression
+ */
+ String getString(boolean abbreviate);
+
+}
+
+
1.1.2.3 +75 -75
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExprContext.java
Index: ExprContext.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExprContext.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ExprContext.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ ExprContext.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,75 +1,75 @@
-/*
- * 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.eval.DynamicContext;
-
-/**
- *
- */
-public interface ExprContext {
-
- /**
- *
- */
- DynamicContext getDynamicContext();
-
- /**
- *
- */
- StaticContext getStaticContext();
-
-}
+/*
+ * 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.eval.DynamicContext;
+
+/**
+ *
+ */
+public interface ExprContext {
+
+ /**
+ *
+ */
+ DynamicContext getDynamicContext();
+
+ /**
+ *
+ */
+ StaticContext getStaticContext();
+
+}
1.1.2.3 +155 -155
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExpressionFactory.java
Index: ExpressionFactory.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ExpressionFactory.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ExpressionFactory.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ ExpressionFactory.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,155 +1,155 @@
-/*
- * 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;
-import org.apache.xpath.rwapi.datamodel.SequenceType;
-
-
-/**
- * Allows the creation of XPath expressions either from string representation
- * or directly using the object-oriented representation
- */
-public abstract class ExpressionFactory {
-
-
- /**
- * Create a expression from a string representation
- * @throws XPathException whenever the given expression isn't an XPath
expression
- */
- public abstract Expr createExpr(String expr) throws XPathException;
-
- /**
- * Create a relative or absolute path expression
- */
- public abstract PathExpr createPathExpr(boolean isAbsolute);
-
- /**
- * Create a step expression without qualifiers
- */
- public abstract StepExpr createStepExpr(short axisType, NodeTest
nodeTest);
-
- /**
- * Create a name test
- */
- public abstract NodeTest createNameTest(String namespace, String name);
-
- /**
- * Create a predicate qualifier
- * @param expr
- */
- public abstract Expr createPredicate(Expr expr);
-
- /**
- * Create a combining expression
- */
- public abstract OperatorExpr createCombineExpr(short type);
-
- /**
- * Create a quantifier expression of type 'some' with one clause
- */
- public abstract ForAndQuantifiedExpr createSomeExpr(Expr clause);
-
- /**
- * Create a quantifier expression of type 'every' with one clause
- */
- public abstract ForAndQuantifiedExpr createEveryExpr(Expr clause);
-
- /**
- * Create an logical expression of type 'and' with at least two operands
- */
- public abstract OperatorExpr createAndExpr(Expr firstOperand, Expr
secondOperand);
-
- /**
- * Create an logical expression of type 'or' with at least two operands
- */
- public abstract OperatorExpr createOrExpr(Expr firstOperand, Expr
secondOperand);
-
- /**
- *
- */
- public abstract ConditionalExpr createIfExpr(Expr test, Expr thenExpr,
Expr elseExpr);
-
- /**
- *
- */
- public abstract ForAndQuantifiedExpr createForExpr(String varName, Expr
clauseExpr, Expr quantifiedExpr);
-
- /**
- *
- */
- public abstract CastExpr createCastExpr(SequenceType seqType,
OperatorExpr parExpr);
-
- /**
- *
- */
- public abstract Literal createIntegerLiteralExpr(int value);
-
- /**
- *
- */
- public abstract Literal createDecimalLiteralExpr(float value);
-
- /**
- *
- */
- public abstract Literal createStringLiteralExpr(String value);
-
- /**
- *
- */
- public abstract Literal createDoubleLiteralExpr(double value);
-}
+/*
+ * 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;
+import org.apache.xpath.rwapi.datamodel.SequenceType;
+
+
+/**
+ * Allows the creation of XPath expressions either from string representation
+ * or directly using the object-oriented representation
+ */
+public abstract class ExpressionFactory {
+
+
+ /**
+ * Create a expression from a string representation
+ * @throws XPathException whenever the given expression isn't an XPath
expression
+ */
+ public abstract Expr createExpr(String expr) throws XPathException;
+
+ /**
+ * Create a relative or absolute path expression
+ */
+ public abstract PathExpr createPathExpr(boolean isAbsolute);
+
+ /**
+ * Create a step expression without qualifiers
+ */
+ public abstract StepExpr createStepExpr(short axisType, NodeTest
nodeTest);
+
+ /**
+ * Create a name test
+ */
+ public abstract NodeTest createNameTest(String namespace, String name);
+
+ /**
+ * Create a predicate qualifier
+ * @param expr
+ */
+ public abstract Expr createPredicate(Expr expr);
+
+ /**
+ * Create a combining expression
+ */
+ public abstract OperatorExpr createCombineExpr(short type);
+
+ /**
+ * Create a quantifier expression of type 'some' with one clause
+ */
+ public abstract ForAndQuantifiedExpr createSomeExpr(Expr clause);
+
+ /**
+ * Create a quantifier expression of type 'every' with one clause
+ */
+ public abstract ForAndQuantifiedExpr createEveryExpr(Expr clause);
+
+ /**
+ * Create an logical expression of type 'and' with at least two operands
+ */
+ public abstract OperatorExpr createAndExpr(Expr firstOperand, Expr
secondOperand);
+
+ /**
+ * Create an logical expression of type 'or' with at least two operands
+ */
+ public abstract OperatorExpr createOrExpr(Expr firstOperand, Expr
secondOperand);
+
+ /**
+ *
+ */
+ public abstract ConditionalExpr createIfExpr(Expr test, Expr thenExpr,
Expr elseExpr);
+
+ /**
+ *
+ */
+ public abstract ForAndQuantifiedExpr createForExpr(String varName, Expr
clauseExpr, Expr quantifiedExpr);
+
+ /**
+ *
+ */
+ public abstract CastExpr createCastExpr(SequenceType seqType,
OperatorExpr parExpr);
+
+ /**
+ *
+ */
+ public abstract Literal createIntegerLiteralExpr(int value);
+
+ /**
+ *
+ */
+ public abstract Literal createDecimalLiteralExpr(float value);
+
+ /**
+ *
+ */
+ public abstract Literal createStringLiteralExpr(String value);
+
+ /**
+ *
+ */
+ public abstract Literal createDoubleLiteralExpr(double value);
+}
1.1.2.3 +108 -108
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ForAndQuantifiedExpr.java
Index: ForAndQuantifiedExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/ForAndQuantifiedExpr.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ForAndQuantifiedExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ ForAndQuantifiedExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,108 +1,108 @@
-/*
- * 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 for and quantified expressions.
- * <pre>
- * [6] ForExpr ::= (ForClause "return")* QuantifiedExpr
- * [21] ForClause ::= <"for" "$"> VarName "in" Expr ("," "$" VarName
"in" Expr)*
- * [7] QuantifiedExpr ::= ((<"some" "$"> | <"every" "$">) VarName
"in" Expr ("," "$" VarName "in" Expr)* "satisfies")* IfExpr
- * </pre>
- * @see <a
href="http://www.w3.org/TR/xpath20/#id-quantified-expressions">XPath 2.0
Specification</a>
- * @see <a href="http://www.w3.org/TR/xpath20/#id-flwr-expressions">XPath
2.0 Specification</a>
- */
-public interface ForAndQuantifiedExpr extends Expr {
-
- /**
- *
- * @return String
- */
- String getClauseVarName( int i );
-
- /**
- *
- */
- Expr getClauseExpr( int i );
-
- /**
- *
- */
- int getClauseCount();
-
- /**
- * @throws XPathException when expression type isn't a 'for' one.
- */
- Expr getReturnExpr() throws XPathException;
-
- /**
- * @throws XPathException when expression type isn't a quantified one.
- */
- Expr getSatisfyExpr() throws XPathException;
-
- /**
- *
- */
- void addClause( String varName, Expr expr );
-
- /**
- *
- */
- void removeClause( String varName );
-
-}
+/*
+ * 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 for and quantified expressions.
+ * <pre>
+ * [6] ForExpr ::= (ForClause "return")* QuantifiedExpr
+ * [21] ForClause ::= <"for" "$"> VarName "in" Expr ("," "$" VarName
"in" Expr)*
+ * [7] QuantifiedExpr ::= ((<"some" "$"> | <"every" "$">) VarName
"in" Expr ("," "$" VarName "in" Expr)* "satisfies")* IfExpr
+ * </pre>
+ * @see <a
href="http://www.w3.org/TR/xpath20/#id-quantified-expressions">XPath 2.0
Specification</a>
+ * @see <a href="http://www.w3.org/TR/xpath20/#id-flwr-expressions">XPath
2.0 Specification</a>
+ */
+public interface ForAndQuantifiedExpr extends Expr {
+
+ /**
+ *
+ * @return String
+ */
+ String getClauseVarName( int i );
+
+ /**
+ *
+ */
+ Expr getClauseExpr( int i );
+
+ /**
+ *
+ */
+ int getClauseCount();
+
+ /**
+ * @throws XPathException when expression type isn't a 'for' one.
+ */
+ Expr getReturnExpr() throws XPathException;
+
+ /**
+ * @throws XPathException when expression type isn't a quantified one.
+ */
+ Expr getSatisfyExpr() throws XPathException;
+
+ /**
+ *
+ */
+ void addClause( String varName, Expr expr );
+
+ /**
+ *
+ */
+ void removeClause( String varName );
+
+}
1.1.2.3 +76 -76
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/FunctionCall.java
Index: FunctionCall.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/FunctionCall.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- FunctionCall.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ FunctionCall.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,76 +1,76 @@
-/*
- * 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;
-
-
-/**
- * Represents function call.
- * The operands correspond to the function parameters.
- */
-public interface FunctionCall extends OperatorExpr {
-
- /**
- *
- */
- String getFunctionName();
-
- /**
- *
- */
- String getFunctionPrefix();
-
-
-}
+/*
+ * 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;
+
+
+/**
+ * Represents function call.
+ * The operands correspond to the function parameters.
+ */
+public interface FunctionCall extends OperatorExpr {
+
+ /**
+ *
+ */
+ String getFunctionName();
+
+ /**
+ *
+ */
+ String getFunctionPrefix();
+
+
+}
1.1.2.3 +75 -75
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/InstanceOfExpr.java
Index: InstanceOfExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/InstanceOfExpr.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- InstanceOfExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ InstanceOfExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,75 +1,75 @@
-/*
- * 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.datamodel.SequenceType;
-
-/**
- *
- */
-public interface InstanceOfExpr extends Expr {
-
- /**
- *
- */
- SequenceType getSequenceType();
-
- /**
- *
- */
- Expr getTestedExpr();
-
-}
+/*
+ * 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.datamodel.SequenceType;
+
+/**
+ *
+ */
+public interface InstanceOfExpr extends Expr {
+
+ /**
+ *
+ */
+ SequenceType getSequenceType();
+
+ /**
+ *
+ */
+ Expr getTestedExpr();
+
+}
1.1.2.3 +123 -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.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Literal.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ Literal.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,123 +1,123 @@
-/*
- * 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 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;
+
+
+
+}
1.1.2.4 +122 -122
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/NodeTest.java
Index: NodeTest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/NodeTest.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- NodeTest.java 30 Jan 2003 00:45:38 -0000 1.1.2.3
+++ NodeTest.java 5 Feb 2003 16:09:46 -0000 1.1.2.4
@@ -1,122 +1,122 @@
-/*
- * 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.*;
-
-/**
- * Represents a node test
- * <pre>
- * [28] NodeTest ::= KindTest | NameTest
- * [29] NameTest ::= QName | Wildcard
- * [30] Wildcard ::= "*" | ":"? NCName ":" "*" | "*" ":" NCName
- * [31] KindTest ::= ProcessingInstructionTest
- * | CommentTest
- * | TextTest
- * | AnyKindTest
- * [32] ProcessingInstructionTest ::= "processing-instruction" "("
StringLiteral? ")"
- * [33] CommentTest ::= "comment" "(" ")"
- * [34] TextTest ::= "text" "(" ")"
- * [35] AnyKindTest ::= "node" "(" ")"
- * </pre>
- * @see <a href="http://www.w3.org/TR/xpath20/#doc-NodeTest">XPath 2.0
specification</a>
- */
-public interface NodeTest extends Expr {
-
- String WILDCARD = "*";
-
- short PROCESSING_INSTRUCTION_TEST = 0;
- short COMMENT_TEST = 1;
- short ANY_KIND_TEST = 2;
- short TEXT_TEST = 3;
-
- String[] KIND_TEST_NAME = { "processing-instruction()", "comment()",
"node()", "text()" };
-
- /**
- * Return true whenever this node test is a name test
- * @return boolean
- */
- boolean isNameTest();
-
- /**
- * Return true whenever this node test is a kind test
- * @return boolean
- */
- boolean isKindTest();
-
- /**
- * Gets the kind test
- * @return short One of the kind test constant value
- * @throws XPathException whenever this node test isn't a kind test
- */
- short getKindTest() throws XPathException;
-
- /**
- * Gets the local part of the name test
- * @return String The local part of the name test or [EMAIL PROTECTED]
#WILDCARD}
- * @throws XPathException whenever this node test isn't name test
- */
- String getLocalNameTest() throws XPathException;
-
- /**
- * Gets the prefix of the name test
- * @return String The prefix part of the name test or [EMAIL PROTECTED]
#WILDCARD}
- * @throws XPathException whenever this node test isn't a name test
- */
- String getPrefix() 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 org.apache.xpath.rwapi.*;
+
+/**
+ * Represents a node test
+ * <pre>
+ * [28] NodeTest ::= KindTest | NameTest
+ * [29] NameTest ::= QName | Wildcard
+ * [30] Wildcard ::= "*" | ":"? NCName ":" "*" | "*" ":" NCName
+ * [31] KindTest ::= ProcessingInstructionTest
+ * | CommentTest
+ * | TextTest
+ * | AnyKindTest
+ * [32] ProcessingInstructionTest ::= "processing-instruction" "("
StringLiteral? ")"
+ * [33] CommentTest ::= "comment" "(" ")"
+ * [34] TextTest ::= "text" "(" ")"
+ * [35] AnyKindTest ::= "node" "(" ")"
+ * </pre>
+ * @see <a href="http://www.w3.org/TR/xpath20/#doc-NodeTest">XPath 2.0
specification</a>
+ */
+public interface NodeTest extends Expr {
+
+ String WILDCARD = "*";
+
+ short PROCESSING_INSTRUCTION_TEST = 0;
+ short COMMENT_TEST = 1;
+ short ANY_KIND_TEST = 2;
+ short TEXT_TEST = 3;
+
+ String[] KIND_TEST_NAME = { "processing-instruction()", "comment()",
"node()", "text()" };
+
+ /**
+ * Return true whenever this node test is a name test
+ * @return boolean
+ */
+ boolean isNameTest();
+
+ /**
+ * Return true whenever this node test is a kind test
+ * @return boolean
+ */
+ boolean isKindTest();
+
+ /**
+ * Gets the kind test
+ * @return short One of the kind test constant value
+ * @throws XPathException whenever this node test isn't a kind test
+ */
+ short getKindTest() throws XPathException;
+
+ /**
+ * Gets the local part of the name test
+ * @return String The local part of the name test or [EMAIL PROTECTED]
#WILDCARD}
+ * @throws XPathException whenever this node test isn't name test
+ */
+ String getLocalNameTest() throws XPathException;
+
+ /**
+ * Gets the prefix of the name test
+ * @return String The prefix part of the name test or [EMAIL PROTECTED]
#WILDCARD}
+ * @throws XPathException whenever this node test isn't a name test
+ */
+ String getPrefix() throws XPathException;
+}
+
+
1.1.2.3 +287 -287
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/OperatorExpr.java
Index: OperatorExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/OperatorExpr.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- OperatorExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ OperatorExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,287 +1,287 @@
-/*
- * 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 any expressions with one, two or more operands. This includes
the following XPath features:
- * <ul>
- * <li>combining sequences</li>
- * <li>unary and binary arithmetics expressions</li>
- * <li>comparison expressions</li>
- * <li>logical expressions</li>
- * <li>range expressions</li>
- * <li>path expressions (see <code>PathExpr</code>)</li>
- * <li>Parenthesized expression</li>
- * </ul>
- * <pre>
- * [14] UnionExpr ::= IntersectExceptExpr ( ("union" | "|")
IntersectExceptExpr )*
- * [15] IntersectExceptExpr ::= UnaryExpr ( ("intersect" | "except")
UnaryExpr )*
- * [12] AdditiveExpr ::= MultiplicativeExpr ( ("+" | "-")
MultiplicativeExpr )*
- * [13] MultiplicativeExpr ::= UnionExpr ( ("*" | "div" | "idiv" |
"mod") UnionExpr )*
- * [10] ComparisonExpr ::= RangeExpr ( (ValueComp| GeneralComp|
NodeComp| OrderComp) RangeExpr )?
- * [25] ValueComp ::= "eq" | "ne" | "lt" | "le" | "gt" | "ge"
- * [24] GeneralComp ::= "=" | "!=" | "<" | "<=" | ">" | ">="
- * [26] NodeComp ::= "is" | "isnot"
- * [27] OrderComp ::= "<<" | ">>"
- * [4] OrExpr ::= AndExpr ( "or" AndExpr )*
- * [5] AndExpr ::= ForExpr ( "and" ForExpr )*
- * [11] RangeExpr ::= AdditiveExpr ( "to" AdditiveExpr )*
- * [18] PathExpr ::= ("/" RelativePathExpr?) | ("//"
RelativePathExpr) | RelativePathExpr
- * [19] RelativePathExpr ::= StepExpr (("/" | "//") StepExpr)*
- * [46] ParenthesizedExpr ::= "(" ExprSequence? ")"
- * [25] ExprSequence ::= Expr ("," Expr)*
- * </pre>
- * @see <a href="http://www.w3.org/TR/xpath20">XPath 2.0 Specification</href>
- */
-public interface OperatorExpr extends Expr {
-
- /**
- *
- */
- short UNION_COMBINE = 0;
-
- /**
- *
- */
- short INTERSECT_COMBINE = 1;
-
- /**
- *
- */
- short EXCEPT_COMBINE = 2;
-
- /**
- *
- */
- short PLUS_ADDITIVE = 3;
-
- /**
- *
- */
- short MINUS_ADDITIVE = 4;
-
- /**
- *
- */
- short RANGE = 5;
-
- /**
- *
- */
- short EQUAL_VALUE_COMPARISON = 6;
-
- /**
- *
- */
- short NOTEQUAL_VALUE_COMPARISON = 7;
-
- /**
- *
- */
- short LESSTHAN_VALUE_COMPARISON = 8;
-
- /**
- *
- */
- short LESSOREQUALTHAN_VALUE_COMPARISON = 9;
-
- /**
- *
- */
- short GREATTHAN_VALUE_COMPARISON = 10;
-
- /**
- *
- */
- short GREATOREQUALTHAN_VALUE_COMPARISON = 11;
-
- /**
- *
- */
- short EQUAL_GENERAL_COMPARISON = 12;
-
- /**
- *
- */
- short NOTEQUAL_GENERAL_COMPARISON = 13;
-
- /**
- *
- */
- short LESSTHAN_GENERAL_COMPARISON = 14;
-
- /**
- *
- */
- short LESSOREQUALTHAN_GENERAL_COMPARISON = 15;
-
- /**
- *
- */
- short GREATTHAN_GENERAL_COMPARISON = 16;
-
- /**
- *
- */
- short GREATOREQUALTHAN_GENERAL_COMPARISON = 17;
-
- /**
- *
- */
- short IS_NODE_COMPARISON = 18;
-
- /**
- *
- */
- short ISNOT_NODE_COMPARISON = 19;
-
- /**
- *
- */
- short EARLIERTHAN_ORDER_COMPARISON = 20;
-
- /**
- *
- */
- short LATERTHAN_ORDER_COMPARISON = 21;
-
- /**
- *
- */
- short AND_LOGICAL = 22;
-
- /**
- *
- */
- short OR_LOGICAL = 23;
-
- /**
- *
- */
- short PLUS_UNARY = 24;
-
- /**
- *
- */
- short MINUS_UNARY = 25;
-
- /**
- *
- */
- short SLASH_STEP = 26;
-
- /**
- *
- */
- short SLASHSLASH_STEP = 27;
-
- /**
- *
- */
- short COMMA = 28;
-
-
- /**
- *
- */
- short MULT_PRODUCT = 29;
-
-
- /**
- *
- */
- short MULT_DIV = 30;
-
- /**
- *
- */
- short MULT_IDIV = 31;
-
- /**
- *
- */
- short MULT_MOD = 32;
-
-
- /**
- * Gets binary expression type.
- * @return
- */
- short getOperatorType();
-
- /**
- * Gets the operand at the ith position.
- */
- Expr getOperand(int i);
-
- /**
- * Gets the operand count
- */
- int getOperandCount();
-
- /**
- *
- */
- void addOperand(Expr operand) throws XPathException;
-
- /**
- *
- */
- void removeOperand(Expr operand) 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 org.apache.xpath.rwapi.XPathException;
+
+/**
+ * Represents any expressions with one, two or more operands. This includes
the following XPath features:
+ * <ul>
+ * <li>combining sequences</li>
+ * <li>unary and binary arithmetics expressions</li>
+ * <li>comparison expressions</li>
+ * <li>logical expressions</li>
+ * <li>range expressions</li>
+ * <li>path expressions (see <code>PathExpr</code>)</li>
+ * <li>Parenthesized expression</li>
+ * </ul>
+ * <pre>
+ * [14] UnionExpr ::= IntersectExceptExpr ( ("union" | "|")
IntersectExceptExpr )*
+ * [15] IntersectExceptExpr ::= UnaryExpr ( ("intersect" | "except")
UnaryExpr )*
+ * [12] AdditiveExpr ::= MultiplicativeExpr ( ("+" | "-")
MultiplicativeExpr )*
+ * [13] MultiplicativeExpr ::= UnionExpr ( ("*" | "div" | "idiv" |
"mod") UnionExpr )*
+ * [10] ComparisonExpr ::= RangeExpr ( (ValueComp| GeneralComp|
NodeComp| OrderComp) RangeExpr )?
+ * [25] ValueComp ::= "eq" | "ne" | "lt" | "le" | "gt" | "ge"
+ * [24] GeneralComp ::= "=" | "!=" | "<" | "<=" | ">" | ">="
+ * [26] NodeComp ::= "is" | "isnot"
+ * [27] OrderComp ::= "<<" | ">>"
+ * [4] OrExpr ::= AndExpr ( "or" AndExpr )*
+ * [5] AndExpr ::= ForExpr ( "and" ForExpr )*
+ * [11] RangeExpr ::= AdditiveExpr ( "to" AdditiveExpr )*
+ * [18] PathExpr ::= ("/" RelativePathExpr?) | ("//"
RelativePathExpr) | RelativePathExpr
+ * [19] RelativePathExpr ::= StepExpr (("/" | "//") StepExpr)*
+ * [46] ParenthesizedExpr ::= "(" ExprSequence? ")"
+ * [25] ExprSequence ::= Expr ("," Expr)*
+ * </pre>
+ * @see <a href="http://www.w3.org/TR/xpath20">XPath 2.0 Specification</href>
+ */
+public interface OperatorExpr extends Expr {
+
+ /**
+ *
+ */
+ short UNION_COMBINE = 0;
+
+ /**
+ *
+ */
+ short INTERSECT_COMBINE = 1;
+
+ /**
+ *
+ */
+ short EXCEPT_COMBINE = 2;
+
+ /**
+ *
+ */
+ short PLUS_ADDITIVE = 3;
+
+ /**
+ *
+ */
+ short MINUS_ADDITIVE = 4;
+
+ /**
+ *
+ */
+ short RANGE = 5;
+
+ /**
+ *
+ */
+ short EQUAL_VALUE_COMPARISON = 6;
+
+ /**
+ *
+ */
+ short NOTEQUAL_VALUE_COMPARISON = 7;
+
+ /**
+ *
+ */
+ short LESSTHAN_VALUE_COMPARISON = 8;
+
+ /**
+ *
+ */
+ short LESSOREQUALTHAN_VALUE_COMPARISON = 9;
+
+ /**
+ *
+ */
+ short GREATTHAN_VALUE_COMPARISON = 10;
+
+ /**
+ *
+ */
+ short GREATOREQUALTHAN_VALUE_COMPARISON = 11;
+
+ /**
+ *
+ */
+ short EQUAL_GENERAL_COMPARISON = 12;
+
+ /**
+ *
+ */
+ short NOTEQUAL_GENERAL_COMPARISON = 13;
+
+ /**
+ *
+ */
+ short LESSTHAN_GENERAL_COMPARISON = 14;
+
+ /**
+ *
+ */
+ short LESSOREQUALTHAN_GENERAL_COMPARISON = 15;
+
+ /**
+ *
+ */
+ short GREATTHAN_GENERAL_COMPARISON = 16;
+
+ /**
+ *
+ */
+ short GREATOREQUALTHAN_GENERAL_COMPARISON = 17;
+
+ /**
+ *
+ */
+ short IS_NODE_COMPARISON = 18;
+
+ /**
+ *
+ */
+ short ISNOT_NODE_COMPARISON = 19;
+
+ /**
+ *
+ */
+ short EARLIERTHAN_ORDER_COMPARISON = 20;
+
+ /**
+ *
+ */
+ short LATERTHAN_ORDER_COMPARISON = 21;
+
+ /**
+ *
+ */
+ short AND_LOGICAL = 22;
+
+ /**
+ *
+ */
+ short OR_LOGICAL = 23;
+
+ /**
+ *
+ */
+ short PLUS_UNARY = 24;
+
+ /**
+ *
+ */
+ short MINUS_UNARY = 25;
+
+ /**
+ *
+ */
+ short SLASH_STEP = 26;
+
+ /**
+ *
+ */
+ short SLASHSLASH_STEP = 27;
+
+ /**
+ *
+ */
+ short COMMA = 28;
+
+
+ /**
+ *
+ */
+ short MULT_PRODUCT = 29;
+
+
+ /**
+ *
+ */
+ short MULT_DIV = 30;
+
+ /**
+ *
+ */
+ short MULT_IDIV = 31;
+
+ /**
+ *
+ */
+ short MULT_MOD = 32;
+
+
+ /**
+ * Gets binary expression type.
+ * @return
+ */
+ short getOperatorType();
+
+ /**
+ * Gets the operand at the ith position.
+ */
+ Expr getOperand(int i);
+
+ /**
+ * Gets the operand count
+ */
+ int getOperandCount();
+
+ /**
+ *
+ */
+ void addOperand(Expr operand) throws XPathException;
+
+ /**
+ *
+ */
+ void removeOperand(Expr operand) throws XPathException;
+
+}
1.1.2.3 +67 -67
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/PathExpr.java
Index: PathExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/PathExpr.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- PathExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ PathExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,67 +1,67 @@
-/*
- * 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;
-
-/**
- *
- */
-public interface PathExpr extends OperatorExpr {
-
- /**
- *
- */
- boolean isAbsolute();
-}
+/*
+ * 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;
+
+/**
+ *
+ */
+public interface PathExpr extends OperatorExpr {
+
+ /**
+ *
+ */
+ boolean isAbsolute();
+}
1.1.2.3 +120 -120
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StaticContext.java
Index: StaticContext.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StaticContext.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- StaticContext.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ StaticContext.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,121 +1,121 @@
-/*
- * 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.util.Set;
-
-import org.apache.xpath.rwapi.eval.NamespaceContext;
-
-/**
- * Represents the static context of an expression.
- * @see <a href="http://www.w3.org/TR/xpath20/#static_context">XPath 2.0
specification</a>
- */
-public interface StaticContext {
-
- short STRICT_POLICY = 0;
- short FLEXIBLE_POLICY = 1;
-
- /**
- *
- */
- short getExceptionPolicy();
-
- /**
- * In-scope namespaces. This is a set of (prefix, URI) pairs.
- */
- NamespaceContext getNamespaces();
-
- /**
- * Default namespace for element and type names.
- */
- String getDefaultNamepaceForElement();
-
- /**
- * Default namespace for function names.
- */
- String getDefaultNamepaceforFunction();
-
- /**
- * In-scope schema definitions. This is a set of (QName, type
definition) pairs.
- */
- void getSchemaDefs();
-
- /**
- * In-scope variables. This is a set of (QName, type) pairs.
- */
- Set getVariables();
-
- /**
- * In-scope functions. This is a set of (QName, function signature)
pairs.
- */
- void getFunctions();
-
- /**
- * In-scope collations. This is a set of (URI, collation) pairs.
- */
- void getCollations();
-
- /**
- * Default collation.
- */
- void getDefaultCollation();
-
- /**
- * Base URI.
- */
- String getBaseURI();
-}
+/*
+ * 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.util.Set;
+
+import org.apache.xpath.rwapi.eval.NamespaceContext;
+
+/**
+ * Represents the static context of an expression.
+ * @see <a href="http://www.w3.org/TR/xpath20/#static_context">XPath 2.0
specification</a>
+ */
+public interface StaticContext {
+
+ short STRICT_POLICY = 0;
+ short FLEXIBLE_POLICY = 1;
+
+ /**
+ *
+ */
+ short getExceptionPolicy();
+
+ /**
+ * In-scope namespaces. This is a set of (prefix, URI) pairs.
+ */
+ NamespaceContext getNamespaces();
+
+ /**
+ * Default namespace for element and type names.
+ */
+ String getDefaultNamepaceForElement();
+
+ /**
+ * Default namespace for function names.
+ */
+ String getDefaultNamepaceforFunction();
+
+ /**
+ * In-scope schema definitions. This is a set of (QName, type
definition) pairs.
+ */
+ void getSchemaDefs();
+
+ /**
+ * In-scope variables. This is a set of (QName, type) pairs.
+ */
+ Set getVariables();
+
+ /**
+ * In-scope functions. This is a set of (QName, function signature)
pairs.
+ */
+ void getFunctions();
+
+ /**
+ * In-scope collations. This is a set of (URI, collation) pairs.
+ */
+ void getCollations();
+
+ /**
+ * Default collation.
+ */
+ void getDefaultCollation();
+
+ /**
+ * Base URI.
+ */
+ String getBaseURI();
+}
1.1.2.4 +217 -217
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StepExpr.java
Index: StepExpr.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/StepExpr.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- StepExpr.java 30 Jan 2003 00:45:38 -0000 1.1.2.3
+++ StepExpr.java 5 Feb 2003 16:09:46 -0000 1.1.2.4
@@ -1,217 +1,217 @@
-/*
- * 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 a step expression.
- * <pre>
- * [20] StepExpr ::= (ForwardStep | ReverseStep | Literal) Predicates
- * [39] ForwardStep ::= (ForwardAxis NodeTest) |
AbbreviatedForwardStep
- * [40] ReverseStep ::= (ReverseAxis NodeTest) |
AbbreviatedReverseStep
- * </pre>
- * @see <a href="http://www.w3.org/TR/xpath20/#id-axis-steps">XPath 2.0
specification</a>
- */
-public interface StepExpr extends Expr
-{
- String[] FULL_AXIS_NAME =
- {
- "", "child", "descendant", "parent",
- "attribute", "self", "descendant-or-self",
- "ancestor", "following-sibling",
- "preceding-sibling", "following",
"preceding",
- "namespace", "ancestor-or-self"
- };
-
- /**
- * Axis constant
- */
- short AXIS_CHILD = 1;
-
- /**
- * Axis constant
- */
- short AXIS_DESCENDANT = 2;
-
- /**
- * Axis constant
- */
- short AXIS_PARENT = 3;
-
- /**
- * Axis constant
- */
- short AXIS_ATTRIBUTE = 4;
-
- /**
- * Axis constant
- */
- short AXIS_SELF = 5;
-
- /**
- * Axis constant
- */
- short AXIS_DESCENDANT_OR_SELF = 6;
-
- /**
- * Axis constant
- */
- short AXIS_ANCESTOR = 7;
-
- /**
- * Axis constant
- */
- short AXIS_FOLLOWING_SIBLING = 8;
-
- /**
- * Axis constant
- */
- short AXIS_PRECEDING_SIBLING = 9;
-
- /**
- * Axis constant
- */
- short AXIS_FOLLOWING = 10;
-
- /**
- * Axis constant
- */
- short AXIS_PRECEDING = 11;
-
- /**
- * Axis constant
- */
- short AXIS_NAMESPACE = 12;
-
- /**
- * Axis constant
- */
- short AXIS_ANCESTOR_OR_SELF = 13;
-
- /**
- *
- */
- boolean isForwardStep();
-
- /**
- *
- */
- boolean isReversedStep();
-
- /**
- * Tell whether this step is composed of a primary expression.
- */
- boolean isPrimaryExpr();
-
- /**
- * Gets the type of step axis
- * @throws XPathException whenever the step is not a forward or reverse
step.
- */
- short getAxisType() throws XPathException;
-
- /**
- * Sets the type if step axis
- * @throws XPathException whenever the step is not a forward or reverse
step.
- */
- void setAxisType(short newType) throws XPathException;
-
- /**
- * Gets the name of step axis
- * @throws XPathException whenever the step is not a forward or reverse
step.
- */
- String getAxisName() throws XPathException;
-
- /**
- * Gets the node test
- * Note: there is a conflict in xalan implementation so temporaly change
- * the method definition here
- */
- NodeTest getStepNodeTest() throws XPathException;
-
- /**
- * Gets the primary expression that composes this step
- * Note: there is a conflict in xalan implementation so temporaly change
- * the method definition here
- */
- Expr getPrimaryExpr() throws XPathException;
-
- /**
- * Gets the predicate expression at the given position
- */
- Expr getPredicateAt(int i);
-
- /**
- * Gets the number of predicate
- */
- int getPredicateCount();
-
- /**
- * Append a predicate
- */
- void appendPredicate(Expr predicate);
-
- /**
- * Remove the given predicate
- */
- void removePredicate(Expr predicate);
-
- /**
- *
- */
- StepExpr cloneStep();
-}
+/*
+ * 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 a step expression.
+ * <pre>
+ * [20] StepExpr ::= (ForwardStep | ReverseStep | Literal) Predicates
+ * [39] ForwardStep ::= (ForwardAxis NodeTest) |
AbbreviatedForwardStep
+ * [40] ReverseStep ::= (ReverseAxis NodeTest) |
AbbreviatedReverseStep
+ * </pre>
+ * @see <a href="http://www.w3.org/TR/xpath20/#id-axis-steps">XPath 2.0
specification</a>
+ */
+public interface StepExpr extends Expr
+{
+ String[] FULL_AXIS_NAME =
+ {
+ "", "child", "descendant", "parent",
+ "attribute", "self", "descendant-or-self",
+ "ancestor", "following-sibling",
+ "preceding-sibling", "following",
"preceding",
+ "namespace", "ancestor-or-self"
+ };
+
+ /**
+ * Axis constant
+ */
+ short AXIS_CHILD = 1;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_DESCENDANT = 2;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_PARENT = 3;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_ATTRIBUTE = 4;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_SELF = 5;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_DESCENDANT_OR_SELF = 6;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_ANCESTOR = 7;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_FOLLOWING_SIBLING = 8;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_PRECEDING_SIBLING = 9;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_FOLLOWING = 10;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_PRECEDING = 11;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_NAMESPACE = 12;
+
+ /**
+ * Axis constant
+ */
+ short AXIS_ANCESTOR_OR_SELF = 13;
+
+ /**
+ *
+ */
+ boolean isForwardStep();
+
+ /**
+ *
+ */
+ boolean isReversedStep();
+
+ /**
+ * Tell whether this step is composed of a primary expression.
+ */
+ boolean isPrimaryExpr();
+
+ /**
+ * Gets the type of step axis
+ * @throws XPathException whenever the step is not a forward or reverse
step.
+ */
+ short getAxisType() throws XPathException;
+
+ /**
+ * Sets the type if step axis
+ * @throws XPathException whenever the step is not a forward or reverse
step.
+ */
+ void setAxisType(short newType) throws XPathException;
+
+ /**
+ * Gets the name of step axis
+ * @throws XPathException whenever the step is not a forward or reverse
step.
+ */
+ String getAxisName() throws XPathException;
+
+ /**
+ * Gets the node test
+ * Note: there is a conflict in xalan implementation so temporaly change
+ * the method definition here
+ */
+ NodeTest getStepNodeTest() throws XPathException;
+
+ /**
+ * Gets the primary expression that composes this step
+ * Note: there is a conflict in xalan implementation so temporaly change
+ * the method definition here
+ */
+ Expr getPrimaryExpr() throws XPathException;
+
+ /**
+ * Gets the predicate expression at the given position
+ */
+ Expr getPredicateAt(int i);
+
+ /**
+ * Gets the number of predicate
+ */
+ int getPredicateCount();
+
+ /**
+ * Append a predicate
+ */
+ void appendPredicate(Expr predicate);
+
+ /**
+ * Remove the given predicate
+ */
+ void removePredicate(Expr predicate);
+
+ /**
+ *
+ */
+ StepExpr cloneStep();
+}
1.1.2.3 +69 -69
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Variable.java
Index: Variable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Variable.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Variable.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ Variable.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,69 +1,69 @@
-/*
- * 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;
-
-/**
- *
- */
-public interface Variable extends Expr {
-
- /**
- * Gets the name of the variable.
- * @return String
- */
- String getVariableName();
-
-}
+/*
+ * 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;
+
+/**
+ *
+ */
+public interface Variable extends Expr {
+
+ /**
+ * Gets the name of the variable.
+ * @return String
+ */
+ String getVariableName();
+
+}
1.1.2.3 +64 -64
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitable.java
Index: Visitable.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitable.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Visitable.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ Visitable.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,64 +1,64 @@
-/*
- * 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;
-
-/**
- *
- */
-public interface Visitable {
-
- void visit(Visitor visitor);
-}
+/*
+ * 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;
+
+/**
+ *
+ */
+public interface Visitable {
+
+ void visit(Visitor visitor);
+}
1.1.2.3 +105 -106
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitor.java
Index: Visitor.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/expression/Attic/Visitor.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Visitor.java 30 Jan 2003 00:45:38 -0000 1.1.2.2
+++ Visitor.java 5 Feb 2003 16:09:46 -0000 1.1.2.3
@@ -1,106 +1,105 @@
-/*
- * 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;
-
-/**
- * Allows the traversal of XPath expression using the visitor pattern
- */
-public interface Visitor {
-
- /**
- * Visit path expression
- * @param path
- */
- boolean visitPath(PathExpr path);
-
- /**
- * Visit step expression
- * @param
- */
- boolean visitStep(StepExpr step);
-
- /**
- * Visit literal expression
- * @param
- */
- boolean visitLiteral(Literal literal);
-
- /**
- * Visit variable expression
- * @param
- */
- boolean visitVariable(Variable var);
-
-
- /**
- * Visit operator expression
- * @param
- */
- boolean visitOperator(OperatorExpr arithmetic);
-
- /**
- * Visit conditional expression
- * @param
- */
- boolean visitConditional(ConditionalExpr condition);
-
- /**
- * Visit for or quantified expression
- * @param
- */
- boolean visitForOrQuantifiedExpr(ForAndQuantifiedExpr expr);
-
-}
+/*
+ * 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;
+
+/**
+ * Allows the traversal of XPath expression using the visitor pattern
+ */
+public interface Visitor {
+
+ /**
+ * Visit path expression
+ * @param path
+ */
+ boolean visitPath(PathExpr path);
+
+ /**
+ * Visit step expression
+ * @param
+ */
+ boolean visitStep(StepExpr step);
+
+ /**
+ * Visit literal expression
+ * @param
+ */
+ boolean visitLiteral(Literal literal);
+
+ /**
+ * Visit variable expression
+ * @param
+ */
+ boolean visitVariable(Variable var);
+
+ /**
+ * Visit operator expression
+ * @param
+ */
+ boolean visitOperator(OperatorExpr arithmetic);
+
+ /**
+ * Visit conditional expression
+ * @param
+ */
+ boolean visitConditional(ConditionalExpr condition);
+
+ /**
+ * Visit for or quantified expression
+ * @param
+ */
+ boolean visitForOrQuantifiedExpr(ForAndQuantifiedExpr expr);
+
+}
No revision
No revision
1.1.2.3 +144 -144
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastExprImpl.java
Index: CastExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastExprImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- CastExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ CastExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,144 +1,144 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.datamodel.SequenceType;
-import org.apache.xpath.rwapi.expression.CastExpr;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.OperatorExpr;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- *
- */
-public class CastExprImpl extends ExprImpl implements CastExpr {
-
- /**
- * Constructor for CastExprImpl.
- * @param i
- */
- public CastExprImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for CastExprImpl.
- * @param p
- * @param i
- */
- public CastExprImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return CAST_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- return null;
- }
-
-
- /**
- * @see org.apache.xpath.rwapi.expression.CastExpr#getParenthesizedExpr()
- */
- public OperatorExpr getParenthesizedExpr() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.CastExpr#getSequenceType()
- */
- public SequenceType getSequenceType() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), i);
- } else {
- super.jjtAddChild(n, i);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return children.length == 1; // means that there is no SequenceType
(pos=1)
- }
-
-
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.datamodel.SequenceType;
+import org.apache.xpath.rwapi.expression.CastExpr;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.OperatorExpr;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ *
+ */
+public class CastExprImpl extends ExprImpl implements CastExpr {
+
+ /**
+ * Constructor for CastExprImpl.
+ * @param i
+ */
+ public CastExprImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for CastExprImpl.
+ * @param p
+ * @param i
+ */
+ public CastExprImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return CAST_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ return null;
+ }
+
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.CastExpr#getParenthesizedExpr()
+ */
+ public OperatorExpr getParenthesizedExpr() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.CastExpr#getSequenceType()
+ */
+ public SequenceType getSequenceType() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), i);
+ } else {
+ super.jjtAddChild(n, i);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return children.length == 1; // means that there is no SequenceType
(pos=1)
+ }
+
+
+
+}
1.1.2.3 +141 -141
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastableExprImpl.java
Index: CastableExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/CastableExprImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- CastableExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ CastableExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,141 +1,141 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.datamodel.SingleType;
-import org.apache.xpath.rwapi.expression.CastableExpr;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- *
- */
-public class CastableExprImpl extends ExprImpl implements CastableExpr {
-
- /**
- * Constructor for CastableExprImpl.
- * @param i
- */
- public CastableExprImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for CastableExprImpl.
- * @param p
- * @param i
- */
- public CastableExprImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return Expr.CASTABLE_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- return null;
- }
-
-
- /**
- * @see org.apache.xpath.rwapi.expression.CastableExpr#getCastableExpr()
- */
- public Expr getCastableExpr() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.CastableExpr#getSingleType()
- */
- public SingleType getSingleType() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), i);
- } else {
- super.jjtAddChild(n, i);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return children.length == 1; // means that there is no
SingleType (pos=1)
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.datamodel.SingleType;
+import org.apache.xpath.rwapi.expression.CastableExpr;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ *
+ */
+public class CastableExprImpl extends ExprImpl implements CastableExpr {
+
+ /**
+ * Constructor for CastableExprImpl.
+ * @param i
+ */
+ public CastableExprImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for CastableExprImpl.
+ * @param p
+ * @param i
+ */
+ public CastableExprImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return Expr.CASTABLE_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ return null;
+ }
+
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.CastableExpr#getCastableExpr()
+ */
+ public Expr getCastableExpr() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.CastableExpr#getSingleType()
+ */
+ public SingleType getSingleType() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), i);
+ } else {
+ super.jjtAddChild(n, i);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return children.length == 1; // means that there is no
SingleType (pos=1)
+ }
+
+}
1.1.2.3 +155 -155
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ConditionalExprImpl.java
Index: ConditionalExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ConditionalExprImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ConditionalExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ ConditionalExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,155 +1,155 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.expression.ConditionalExpr;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- *
- */
-public class ConditionalExprImpl extends SimpleNode implements
ConditionalExpr {
-
- /**
- * Constructor for ConditionalExprImpl.
- * @param i
- */
- public ConditionalExprImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for ConditionalExprImpl.
- * @param p
- * @param i
- */
- public ConditionalExprImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.ConditionalExpr#getElseExpr()
- */
- public Expr getElseExpr() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.ConditionalExpr#getTestExpr()
- */
- public Expr getTestExpr() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.ConditionalExpr#getThenExpr()
- */
- public Expr getThenExpr() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return CONDITIONAL_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
- */
- public void visit(Visitor visitor) {
- // TODO:
- }
-
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), i);
- } else {
- super.jjtAddChild(n, i);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return children.length == 1; // means that there is no (at least)
then expr (pos=1)
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.expression.ConditionalExpr;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ *
+ */
+public class ConditionalExprImpl extends SimpleNode implements
ConditionalExpr {
+
+ /**
+ * Constructor for ConditionalExprImpl.
+ * @param i
+ */
+ public ConditionalExprImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for ConditionalExprImpl.
+ * @param p
+ * @param i
+ */
+ public ConditionalExprImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.ConditionalExpr#getElseExpr()
+ */
+ public Expr getElseExpr() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.ConditionalExpr#getTestExpr()
+ */
+ public Expr getTestExpr() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.ConditionalExpr#getThenExpr()
+ */
+ public Expr getThenExpr() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return CONDITIONAL_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
+ */
+ public void visit(Visitor visitor) {
+ // TODO:
+ }
+
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), i);
+ } else {
+ super.jjtAddChild(n, i);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return children.length == 1; // means that there is no (at least)
then expr (pos=1)
+ }
+
+}
1.1.2.3 +74 -74
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/EvaluatorFactoryImpl.java
Index: EvaluatorFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/EvaluatorFactoryImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- EvaluatorFactoryImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ EvaluatorFactoryImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,74 +1,74 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.eval.Evaluator;
-import org.apache.xpath.rwapi.eval.EvaluatorFactory;
-import org.apache.xpath.rwapi.impl.xalan.EvaluatorImpl;
-
-/**
- *
- */
-public class EvaluatorFactoryImpl extends EvaluatorFactory {
-
- /**
- * @see org.apache.xpath.rwapi.eval.EvaluatorFactory#createEvaluator()
- */
- public Evaluator createEvaluator() {
- return new EvaluatorImpl(); // Xalan evaluator
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.eval.Evaluator;
+import org.apache.xpath.rwapi.eval.EvaluatorFactory;
+import org.apache.xpath.rwapi.impl.xalan.EvaluatorImpl;
+
+/**
+ *
+ */
+public class EvaluatorFactoryImpl extends EvaluatorFactory {
+
+ /**
+ * @see org.apache.xpath.rwapi.eval.EvaluatorFactory#createEvaluator()
+ */
+ public Evaluator createEvaluator() {
+ return new EvaluatorImpl(); // Xalan evaluator
+ }
+
+}
1.1.2.3 +166 -166
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprContextImpl.java
Index: ExprContextImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprContextImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ExprContextImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ ExprContextImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,166 +1,166 @@
-/*
- * 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.impl;
-
-import java.util.Set;
-
-import org.apache.xpath.rwapi.eval.DynamicContext;
-import org.apache.xpath.rwapi.eval.NamespaceContext;
-import org.apache.xpath.rwapi.expression.ExprContext;
-import org.apache.xpath.rwapi.expression.StaticContext;
-
-/**
- *
- */
-public class ExprContextImpl implements ExprContext, DynamicContext,
StaticContext {
-
- Object m_contextItem;
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExprContext#getDynamicContext()
- */
- public DynamicContext getDynamicContext() {
- return this;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.ExprContext#getStaticContext()
- */
- public StaticContext getStaticContext() {
- return this;
- }
-
- /**
- * @see org.apache.xpath.rwapi.eval.DynamicContext#getContextItem()
- */
- public Object getContextItem() {
- return m_contextItem;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.eval.DynamicContext#setContextItem(Object)
- */
- public void setContextItem(Object item) {
- m_contextItem = item;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.StaticContext#getExceptionPolicy()
- */
- public short getExceptionPolicy() {
- return 0;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StaticContext#getNamespaces()
- */
- public NamespaceContext getNamespaces() {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.StaticContext#getDefaultNamepaceForElement()
- */
- public String getDefaultNamepaceForElement() {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.StaticContext#getDefaultNamepaceforFunction()
- */
- public String getDefaultNamepaceforFunction() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StaticContext#getSchemaDefs()
- */
- public void getSchemaDefs() {
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StaticContext#getVariables()
- */
- public Set getVariables() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StaticContext#getFunctions()
- */
- public void getFunctions() {
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StaticContext#getCollations()
- */
- public void getCollations() {
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.StaticContext#getDefaultCollation()
- */
- public void getDefaultCollation() {
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StaticContext#getBaseURI()
- */
- public String getBaseURI() {
- return null;
- }
-
-}
+/*
+ * 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.impl;
+
+import java.util.Set;
+
+import org.apache.xpath.rwapi.eval.DynamicContext;
+import org.apache.xpath.rwapi.eval.NamespaceContext;
+import org.apache.xpath.rwapi.expression.ExprContext;
+import org.apache.xpath.rwapi.expression.StaticContext;
+
+/**
+ *
+ */
+public class ExprContextImpl implements ExprContext, DynamicContext,
StaticContext {
+
+ Object m_contextItem;
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExprContext#getDynamicContext()
+ */
+ public DynamicContext getDynamicContext() {
+ return this;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.ExprContext#getStaticContext()
+ */
+ public StaticContext getStaticContext() {
+ return this;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.eval.DynamicContext#getContextItem()
+ */
+ public Object getContextItem() {
+ return m_contextItem;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.eval.DynamicContext#setContextItem(Object)
+ */
+ public void setContextItem(Object item) {
+ m_contextItem = item;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.StaticContext#getExceptionPolicy()
+ */
+ public short getExceptionPolicy() {
+ return 0;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StaticContext#getNamespaces()
+ */
+ public NamespaceContext getNamespaces() {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.StaticContext#getDefaultNamepaceForElement()
+ */
+ public String getDefaultNamepaceForElement() {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.StaticContext#getDefaultNamepaceforFunction()
+ */
+ public String getDefaultNamepaceforFunction() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StaticContext#getSchemaDefs()
+ */
+ public void getSchemaDefs() {
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StaticContext#getVariables()
+ */
+ public Set getVariables() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StaticContext#getFunctions()
+ */
+ public void getFunctions() {
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StaticContext#getCollations()
+ */
+ public void getCollations() {
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.StaticContext#getDefaultCollation()
+ */
+ public void getDefaultCollation() {
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StaticContext#getBaseURI()
+ */
+ public String getBaseURI() {
+ return null;
+ }
+
+}
1.1.2.3 +115 -115
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprImpl.java
Index: ExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExprImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ ExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,115 +1,115 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- *
- */
-public abstract class ExprImpl extends SimpleNode implements Expr{
-
- /**
- *
- */
- protected ExprImpl() {
- super();
- }
-
- /**
- * Constructor for ExprImpl.
- * @param i
- */
- public ExprImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for ExprImpl.
- * @param p
- * @param i
- */
- public ExprImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * Gets expression as external string representation
- */
- protected void getString(StringBuffer expr, boolean abbreviate) {
- }
-
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- StringBuffer buf = new StringBuffer();
- getString(buf, abbreviate);
- return buf.toString();
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
- */
- public void visit(Visitor visitor) {
- // by default: nothing
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ *
+ */
+public abstract class ExprImpl extends SimpleNode implements Expr{
+
+ /**
+ *
+ */
+ protected ExprImpl() {
+ super();
+ }
+
+ /**
+ * Constructor for ExprImpl.
+ * @param i
+ */
+ public ExprImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for ExprImpl.
+ * @param p
+ * @param i
+ */
+ public ExprImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * Gets expression as external string representation
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate) {
+ }
+
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ StringBuffer buf = new StringBuffer();
+ getString(buf, abbreviate);
+ return buf.toString();
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
+ */
+ public void visit(Visitor visitor) {
+ // by default: nothing
+ }
+
+}
1.1.2.3 +215 -215
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExpressionFactoryImpl.java
Index: ExpressionFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ExpressionFactoryImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ExpressionFactoryImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ ExpressionFactoryImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,215 +1,215 @@
-/*
- * 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.impl;
-
-import java.io.StringReader;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.datamodel.SequenceType;
-import org.apache.xpath.rwapi.expression.CastExpr;
-import org.apache.xpath.rwapi.expression.ConditionalExpr;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.ExpressionFactory;
-import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
-import org.apache.xpath.rwapi.expression.Literal;
-import org.apache.xpath.rwapi.expression.NodeTest;
-import org.apache.xpath.rwapi.expression.OperatorExpr;
-import org.apache.xpath.rwapi.expression.PathExpr;
-import org.apache.xpath.rwapi.expression.StepExpr;
-import org.apache.xpath.rwapi.impl.parser.ParseException;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- * @author villard
- *
- */
-public class ExpressionFactoryImpl extends ExpressionFactory {
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createExpr(java.lang.String)
- */
- public Expr createExpr(String expr) throws XPathException {
- XPath parser = new XPath(new StringReader(expr));
- try {
- return (Expr) parser.XPath2().jjtGetChild(0);
- } catch (ParseException e) {
- throw new XPathException(e);
- }
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createPathExpr(boolean)
- */
- public PathExpr createPathExpr(boolean isAbsolute) {
- PathExprImpl e = new PathExprImpl();
- e.m_isAbsolute = isAbsolute;
- return e;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createStepExpr(short,
org.apache.xpath.rwapi.expression.NodeTest)
- */
- public StepExpr createStepExpr(short axisType, NodeTest nodeTest) {
- return new StepExprImpl(axisType, nodeTest);
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createNameTest(java.lang.String,
java.lang.String)
- */
- public NodeTest createNameTest(String namespace, String name) {
- return new NameTestImpl(name, namespace);
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createPredicate(org.apache.xpath.rwapi.expression.Expr)
- */
- public Expr createPredicate(Expr expr) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createCombineExpr(short)
- */
- public OperatorExpr createCombineExpr(short type) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createSomeExpr(org.apache.xpath.rwapi.expression.Expr)
- */
- public ForAndQuantifiedExpr createSomeExpr(Expr clause) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createEveryExpr(org.apache.xpath.rwapi.expression.Expr)
- */
- public ForAndQuantifiedExpr createEveryExpr(Expr clause) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createAndExpr(org.apache.xpath.rwapi.expression.Expr,
org.apache.xpath.rwapi.expression.Expr)
- */
- public OperatorExpr createAndExpr(Expr firstOperand, Expr
secondOperand) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createOrExpr(org.apache.xpath.rwapi.expression.Expr,
org.apache.xpath.rwapi.expression.Expr)
- */
- public OperatorExpr createOrExpr(Expr firstOperand, Expr secondOperand)
{
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createIfExpr(org.apache.xpath.rwapi.expression.Expr,
org.apache.xpath.rwapi.expression.Expr, org.apache.xpath.rwapi.expression.Expr)
- */
- public ConditionalExpr createIfExpr(Expr test, Expr thenExpr, Expr
elseExpr) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createForExpr(java.lang.String,
org.apache.xpath.rwapi.expression.Expr, org.apache.xpath.rwapi.expression.Expr)
- */
- public ForAndQuantifiedExpr createForExpr(String varName, Expr
clauseExpr, Expr quantifiedExpr) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createCastExpr(org.apache.xpath.rwapi.datamodel.SequenceType,
org.apache.xpath.rwapi.expression.OperatorExpr)
- */
- public CastExpr createCastExpr(SequenceType seqType, OperatorExpr
parExpr) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createIntegerLiteralExpr(int)
- */
- public Literal createIntegerLiteralExpr(int value) {
- LiteralImpl lit = new LiteralImpl();
- lit.setIntValue(value);
- return lit;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createDecimalLiteralExpr(float)
- */
- public Literal createDecimalLiteralExpr(float value) {
- LiteralImpl lit = new LiteralImpl();
- lit.setDecimalValue(value);
- return lit;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createStringLiteralExpr(java.lang.String)
- */
- public Literal createStringLiteralExpr(String value) {
- LiteralImpl lit = new LiteralImpl();
- lit.setStringValue(value);
- return lit;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createDoubleLiteralExpr(double)
- */
- public Literal createDoubleLiteralExpr(double value) {
- LiteralImpl lit = new LiteralImpl();
- lit.setDoubleValue(value);
- return lit;
- }
-
-}
+/*
+ * 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.impl;
+
+import java.io.StringReader;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.datamodel.SequenceType;
+import org.apache.xpath.rwapi.expression.CastExpr;
+import org.apache.xpath.rwapi.expression.ConditionalExpr;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.ExpressionFactory;
+import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
+import org.apache.xpath.rwapi.expression.Literal;
+import org.apache.xpath.rwapi.expression.NodeTest;
+import org.apache.xpath.rwapi.expression.OperatorExpr;
+import org.apache.xpath.rwapi.expression.PathExpr;
+import org.apache.xpath.rwapi.expression.StepExpr;
+import org.apache.xpath.rwapi.impl.parser.ParseException;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ * @author villard
+ *
+ */
+public class ExpressionFactoryImpl extends ExpressionFactory {
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createExpr(java.lang.String)
+ */
+ public Expr createExpr(String expr) throws XPathException {
+ XPath parser = new XPath(new StringReader(expr));
+ try {
+ return (Expr) parser.XPath2().jjtGetChild(0);
+ } catch (ParseException e) {
+ throw new XPathException(e);
+ }
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createPathExpr(boolean)
+ */
+ public PathExpr createPathExpr(boolean isAbsolute) {
+ PathExprImpl e = new PathExprImpl();
+ e.m_isAbsolute = isAbsolute;
+ return e;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createStepExpr(short,
org.apache.xpath.rwapi.expression.NodeTest)
+ */
+ public StepExpr createStepExpr(short axisType, NodeTest nodeTest) {
+ return new StepExprImpl(axisType, nodeTest);
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createNameTest(java.lang.String,
java.lang.String)
+ */
+ public NodeTest createNameTest(String namespace, String name) {
+ return new NameTestImpl(name, namespace);
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createPredicate(org.apache.xpath.rwapi.expression.Expr)
+ */
+ public Expr createPredicate(Expr expr) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createCombineExpr(short)
+ */
+ public OperatorExpr createCombineExpr(short type) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createSomeExpr(org.apache.xpath.rwapi.expression.Expr)
+ */
+ public ForAndQuantifiedExpr createSomeExpr(Expr clause) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createEveryExpr(org.apache.xpath.rwapi.expression.Expr)
+ */
+ public ForAndQuantifiedExpr createEveryExpr(Expr clause) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createAndExpr(org.apache.xpath.rwapi.expression.Expr,
org.apache.xpath.rwapi.expression.Expr)
+ */
+ public OperatorExpr createAndExpr(Expr firstOperand, Expr
secondOperand) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createOrExpr(org.apache.xpath.rwapi.expression.Expr,
org.apache.xpath.rwapi.expression.Expr)
+ */
+ public OperatorExpr createOrExpr(Expr firstOperand, Expr secondOperand)
{
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createIfExpr(org.apache.xpath.rwapi.expression.Expr,
org.apache.xpath.rwapi.expression.Expr, org.apache.xpath.rwapi.expression.Expr)
+ */
+ public ConditionalExpr createIfExpr(Expr test, Expr thenExpr, Expr
elseExpr) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createForExpr(java.lang.String,
org.apache.xpath.rwapi.expression.Expr, org.apache.xpath.rwapi.expression.Expr)
+ */
+ public ForAndQuantifiedExpr createForExpr(String varName, Expr
clauseExpr, Expr quantifiedExpr) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createCastExpr(org.apache.xpath.rwapi.datamodel.SequenceType,
org.apache.xpath.rwapi.expression.OperatorExpr)
+ */
+ public CastExpr createCastExpr(SequenceType seqType, OperatorExpr
parExpr) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createIntegerLiteralExpr(int)
+ */
+ public Literal createIntegerLiteralExpr(int value) {
+ LiteralImpl lit = new LiteralImpl();
+ lit.setIntValue(value);
+ return lit;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createDecimalLiteralExpr(float)
+ */
+ public Literal createDecimalLiteralExpr(float value) {
+ LiteralImpl lit = new LiteralImpl();
+ lit.setDecimalValue(value);
+ return lit;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createStringLiteralExpr(java.lang.String)
+ */
+ public Literal createStringLiteralExpr(String value) {
+ LiteralImpl lit = new LiteralImpl();
+ lit.setStringValue(value);
+ return lit;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ExpressionFactory#createDoubleLiteralExpr(double)
+ */
+ public Literal createDoubleLiteralExpr(double value) {
+ LiteralImpl lit = new LiteralImpl();
+ lit.setDoubleValue(value);
+ return lit;
+ }
+
+}
1.1.2.3 +182 -182
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ForAndQuantifiedExprImpl.java
Index: ForAndQuantifiedExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/ForAndQuantifiedExprImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- ForAndQuantifiedExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ ForAndQuantifiedExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,182 +1,182 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- *
- */
-public class ForAndQuantifiedExprImpl extends SimpleNode implements
ForAndQuantifiedExpr {
-
- /**
- * Constructor for ForAndQuantifiedExprImpl.
- * @param i
- */
- public ForAndQuantifiedExprImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for ForAndQuantifiedExprImpl.
- * @param p
- * @param i
- */
- public ForAndQuantifiedExprImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getClauseVarName(int)
- */
- public String getClauseVarName(int i) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getClauseExpr(int)
- */
- public Expr getClauseExpr(int i) {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getClauseCount()
- */
- public int getClauseCount() {
- return 0;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getReturnExpr()
- */
- public Expr getReturnExpr() throws XPathException {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getSatisfyExpr()
- */
- public Expr getSatisfyExpr() throws XPathException {
- return null;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#addClause(String, Expr)
- */
- public void addClause(String varName, Expr expr) {
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#removeClause(String)
- */
- public void removeClause(String varName) {
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return 0;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- return null;
- }
-
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), i);
- } else {
- super.jjtAddChild(n, i);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return children.length == 1; // means that there is no???
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
- */
- public void visit(Visitor visitor) {
- // TODO:
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ *
+ */
+public class ForAndQuantifiedExprImpl extends SimpleNode implements
ForAndQuantifiedExpr {
+
+ /**
+ * Constructor for ForAndQuantifiedExprImpl.
+ * @param i
+ */
+ public ForAndQuantifiedExprImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for ForAndQuantifiedExprImpl.
+ * @param p
+ * @param i
+ */
+ public ForAndQuantifiedExprImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getClauseVarName(int)
+ */
+ public String getClauseVarName(int i) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getClauseExpr(int)
+ */
+ public Expr getClauseExpr(int i) {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getClauseCount()
+ */
+ public int getClauseCount() {
+ return 0;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getReturnExpr()
+ */
+ public Expr getReturnExpr() throws XPathException {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#getSatisfyExpr()
+ */
+ public Expr getSatisfyExpr() throws XPathException {
+ return null;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#addClause(String, Expr)
+ */
+ public void addClause(String varName, Expr expr) {
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr#removeClause(String)
+ */
+ public void removeClause(String varName) {
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return 0;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ return null;
+ }
+
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), i);
+ } else {
+ super.jjtAddChild(n, i);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return children.length == 1; // means that there is no???
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
+ */
+ public void visit(Visitor visitor) {
+ // TODO:
+ }
+
+}
1.1.2.3 +180 -180
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/FunctionCallImpl.java
Index: FunctionCallImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/FunctionCallImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- FunctionCallImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ FunctionCallImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,180 +1,180 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.FunctionCall;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.QName;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-/**
- *
- */
-public class FunctionCallImpl extends OperatorImpl implements FunctionCall {
-
- String m_localPart;
- String m_prefix;
-
- /**
- * Constructor for FunctionCallImpl.
- * @param i
- */
- public FunctionCallImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for FunctionCallImpl.
- * @param p
- * @param i
- */
- public FunctionCallImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.FunctionCall#getFunctionName()
- */
- public String getFunctionName() {
- return m_localPart;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.FunctionCall#getFunctionPrefix()
- */
- public String getFunctionPrefix() {
- return m_prefix;
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
-
- if (n.getId() == XPathTreeConstants.JJTQNAMELPAR) {
- m_localPart = ((QName) n).getLocalPart();
- m_prefix = ((QName) n).getPrefix();
- } else {
- // parameter
- // -1 because of QNAMELPAR
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), i -
1);
- } else {
- super.jjtAddChild(n, i - 1);
- }
- }
-
- }
- /**
- * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
- */
- protected void getString(StringBuffer expr, boolean abbreviate) {
- if (m_prefix != null) {
- expr.append(m_prefix).append(":").append(m_localPart);
- } else {
- expr.append(m_localPart);
- }
- expr.append('(');
- int size = getOperandCount();
- for (int i = 0; i < size; i++) {
- ((ExprImpl) getOperand(i)).getString(expr, abbreviate);
- if (i < size - 1) {
- expr.append(',');
- }
- }
- expr.append(')');
-
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return FUNCTION_CALL_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperand(int)
- */
- public Expr getOperand(int i) {
- return (Expr) children[i];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperandCount()
- */
- public int getOperandCount() {
- return (children == null) ? 0 : children.length;
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.OperatorImpl#getOperatorChar()
- */
- protected String getOperatorChar() {
- return ",";
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperatorType()
- */
- public short getOperatorType() {
- return COMMA;
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.FunctionCall;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.QName;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+/**
+ *
+ */
+public class FunctionCallImpl extends OperatorImpl implements FunctionCall {
+
+ String m_localPart;
+ String m_prefix;
+
+ /**
+ * Constructor for FunctionCallImpl.
+ * @param i
+ */
+ public FunctionCallImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for FunctionCallImpl.
+ * @param p
+ * @param i
+ */
+ public FunctionCallImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.FunctionCall#getFunctionName()
+ */
+ public String getFunctionName() {
+ return m_localPart;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.FunctionCall#getFunctionPrefix()
+ */
+ public String getFunctionPrefix() {
+ return m_prefix;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+
+ if (n.getId() == XPathTreeConstants.JJTQNAMELPAR) {
+ m_localPart = ((QName) n).getLocalPart();
+ m_prefix = ((QName) n).getPrefix();
+ } else {
+ // parameter
+ // -1 because of QNAMELPAR
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), i -
1);
+ } else {
+ super.jjtAddChild(n, i - 1);
+ }
+ }
+
+ }
+ /**
+ * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate) {
+ if (m_prefix != null) {
+ expr.append(m_prefix).append(":").append(m_localPart);
+ } else {
+ expr.append(m_localPart);
+ }
+ expr.append('(');
+ int size = getOperandCount();
+ for (int i = 0; i < size; i++) {
+ ((ExprImpl) getOperand(i)).getString(expr, abbreviate);
+ if (i < size - 1) {
+ expr.append(',');
+ }
+ }
+ expr.append(')');
+
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return FUNCTION_CALL_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperand(int)
+ */
+ public Expr getOperand(int i) {
+ return (Expr) children[i];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperandCount()
+ */
+ public int getOperandCount() {
+ return (children == null) ? 0 : children.length;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.OperatorImpl#getOperatorChar()
+ */
+ protected String getOperatorChar() {
+ return ",";
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperatorType()
+ */
+ public short getOperatorType() {
+ return COMMA;
+ }
+
+}
1.1.2.3 +147 -147
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/InstanceOfExprImpl.java
Index: InstanceOfExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/InstanceOfExprImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- InstanceOfExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ InstanceOfExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,147 +1,147 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.datamodel.SequenceType;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.InstanceOfExpr;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- *
- */
-public class InstanceOfExprImpl extends ExprImpl implements InstanceOfExpr {
-
- /**
- * Constructor for InstanceOfExprImpl.
- * @param i
- */
- public InstanceOfExprImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for InstanceOfExprImpl.
- * @param p
- * @param i
- */
- public InstanceOfExprImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.InstanceOfExpr#getSequenceType()
- */
- public SequenceType getSequenceType() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.InstanceOfExpr#getTestedExpr()
- */
- public Expr getTestedExpr() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return INSTANCE_OF_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
- */
- public void visited(Visitor visitor) {
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), i);
- } else {
- super.jjtAddChild(n, i);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return children.length == 1; // means that there is no SequenceType
(pos=1)
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.datamodel.SequenceType;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.InstanceOfExpr;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ *
+ */
+public class InstanceOfExprImpl extends ExprImpl implements InstanceOfExpr {
+
+ /**
+ * Constructor for InstanceOfExprImpl.
+ * @param i
+ */
+ public InstanceOfExprImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for InstanceOfExprImpl.
+ * @param p
+ * @param i
+ */
+ public InstanceOfExprImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.InstanceOfExpr#getSequenceType()
+ */
+ public SequenceType getSequenceType() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.InstanceOfExpr#getTestedExpr()
+ */
+ public Expr getTestedExpr() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return INSTANCE_OF_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
+ */
+ public void visited(Visitor visitor) {
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), i);
+ } else {
+ super.jjtAddChild(n, i);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return children.length == 1; // means that there is no SequenceType
(pos=1)
+ }
+
+}
1.1.2.3 +184 -184
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/KindTestImpl.java
Index: KindTestImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/KindTestImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- KindTestImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ KindTestImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,184 +1,184 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.NodeTest;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.KindTest;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-/**
- *
- */
-public class KindTestImpl extends ExprImpl implements NodeTest {
-
- protected short m_kindTest;
-
- /**
- * Constructor for KindTestImpl.
- */
- public KindTestImpl() {
- super(XPathTreeConstants.JJTKINDTEST);
- }
-
- /**
- * Constructor for KindTestImpl.
- * @param i
- */
- public KindTestImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for KindTestImpl.
- * @param p
- * @param i
- */
- public KindTestImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#isNameTest()
- */
- public boolean isNameTest() {
- return false;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#isKindTest()
- */
- public boolean isKindTest() {
- return true;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#getKindTest()
- */
- public short getKindTest() throws XPathException {
- return m_kindTest;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#getLocalNameTest()
- */
- public String getLocalNameTest() throws XPathException {
- throw new XPathException("Invalid call this method on kind
test"); // I8
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#getPrefix()
- */
- public String getPrefix() throws XPathException {
- throw new XPathException("Invalid call this method on kind
test"); // I8
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return Expr.KINDTEST_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return null; //TODO
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- return KIND_TEST_NAME[m_kindTest];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
- */
- public void visited(Visitor visitor) {
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- // filter child
- m_kindTest = ((KindTest) n).getKindTest();
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
- */
- protected void getString(StringBuffer expr, boolean abbreviate) {
- expr.append(KIND_TEST_NAME[m_kindTest]);
- }
-
-
- /**
- * Sets the kindTest.
- * @param kindTest The kindTest to set
- */
- public void setKindTest(short kindTest) {
- m_kindTest = kindTest;
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.NodeTest;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.KindTest;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+/**
+ *
+ */
+public class KindTestImpl extends ExprImpl implements NodeTest {
+
+ protected short m_kindTest;
+
+ /**
+ * Constructor for KindTestImpl.
+ */
+ public KindTestImpl() {
+ super(XPathTreeConstants.JJTKINDTEST);
+ }
+
+ /**
+ * Constructor for KindTestImpl.
+ * @param i
+ */
+ public KindTestImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for KindTestImpl.
+ * @param p
+ * @param i
+ */
+ public KindTestImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#isNameTest()
+ */
+ public boolean isNameTest() {
+ return false;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#isKindTest()
+ */
+ public boolean isKindTest() {
+ return true;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#getKindTest()
+ */
+ public short getKindTest() throws XPathException {
+ return m_kindTest;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#getLocalNameTest()
+ */
+ public String getLocalNameTest() throws XPathException {
+ throw new XPathException("Invalid call this method on kind
test"); // I8
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#getPrefix()
+ */
+ public String getPrefix() throws XPathException {
+ throw new XPathException("Invalid call this method on kind
test"); // I8
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return Expr.KINDTEST_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return null; //TODO
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ return KIND_TEST_NAME[m_kindTest];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
+ */
+ public void visited(Visitor visitor) {
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ // filter child
+ m_kindTest = ((KindTest) n).getKindTest();
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate) {
+ expr.append(KIND_TEST_NAME[m_kindTest]);
+ }
+
+
+ /**
+ * Sets the kindTest.
+ * @param kindTest The kindTest to set
+ */
+ public void setKindTest(short kindTest) {
+ m_kindTest = kindTest;
+ }
+
+}
1.1.2.4 +298 -298
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.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- LiteralImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.3
+++ LiteralImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.4
@@ -1,298 +1,298 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.Literal;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Token;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-
-/**
- *
- */
-public class LiteralImpl extends ExprImpl implements Literal
-{
- Object m_literal;
-
- /**
- *
- *
- */
- protected LiteralImpl()
- {
- super();
- }
-
- /**
- * Constructor for PrimaryExprImpl.
- * @param i
- */
- public LiteralImpl(int i)
- {
- super(i);
- }
-
- /**
- * Constructor for PrimaryExprImpl.
- * @param p
- * @param i
- */
- public LiteralImpl(XPath p, int i)
- {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType()
- {
- return Expr.LITERAL_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression()
- {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Literal#getDecimalLiteral()
- */
- public float getDecimalLiteral() throws XPathException
- {
- if (getLiteralType() == DECIMAL_LITERAL)
- {
- return ((Float) m_literal).floatValue();
- }
-
- throw new XPathException(
- "Invalid method call: the literal is not a decimal");
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Literal#getDoubleLiteral()
- */
- public double getDoubleLiteral() throws XPathException
- {
- if (getLiteralType() == DOUBLE_LITERAL)
- {
- return ((Double) m_literal).doubleValue();
- }
-
- throw new XPathException(
- "Invalid method call: the literal is not a double");
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Literal#getIntegerLiteral()
- */
- public int getIntegerLiteral() throws XPathException
- {
- if (getLiteralType() == INTEGER_LITERAL)
- {
- return ((Integer) m_literal).intValue();
- }
-
- throw new XPathException(
- "Invalid method call: the literal is not a integer");
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Literal#getLiteralType()
- */
- public short getLiteralType()
- {
- switch (id)
- {
- case XPathTreeConstants.JJTINTEGERLITERAL:
- return INTEGER_LITERAL;
-
- //break;
- case XPathTreeConstants.JJTDOUBLELITERAL:
- return DOUBLE_LITERAL;
-
- //break;
- case XPathTreeConstants.JJTSTRINGLITERAL:
- return STRING_LITERAL;
-
- //break;
- case XPathTreeConstants.JJTDECIMALLITERAL:
- return DECIMAL_LITERAL;
-
- //break;
- default:
-
- // bug
- throw new RuntimeException("Invalid JJTree id:" + id);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Literal#getStringLiteral()
- */
- public String getStringLiteral() throws XPathException
- {
- if (getLiteralType() == STRING_LITERAL)
- {
- return (String) m_literal;
- }
-
- throw new XPathException(
- "Invalid method call: the literal is not a string");
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate)
- {
- return m_literal.toString();
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
- */
- public void visited(Visitor visitor) {}
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
- */
- public void processToken(Token token)
- {
- super.processToken(token);
-
- switch (id)
- {
- case XPathTreeConstants.JJTINTEGERLITERAL:
- m_literal = new Integer(token.image);
-
- break;
-
- case XPathTreeConstants.JJTDOUBLELITERAL:
- m_literal = new Double(token.image);
-
- //break;
- case XPathTreeConstants.JJTSTRINGLITERAL:
- m_literal = token.image;
-
- break;
-
- case XPathTreeConstants.JJTDECIMALLITERAL:
- m_literal = new Float(token.image);
-
- break;
-
- default:
-
- // bug
- throw new RuntimeException("Invalid JJTree id:" + id);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
- */
- protected void getString(StringBuffer expr, boolean abbreviate)
- {
- expr.append(m_literal.toString());
- }
-
- /**
- * @param value
- */
- protected void setIntValue(int value)
- {
- m_literal = new Integer(value);
- id = XPathTreeConstants.JJTINTEGERLITERAL;
- }
-
- /**
- *
- * @param value
- */
- protected void setDecimalValue(float value)
- {
- m_literal = new Float(value);
- id = XPathTreeConstants.JJTDECIMALLITERAL;
- }
-
- /**
- *
- * @param value
- */
- protected void setStringValue(String value)
- {
- m_literal = value;
- id = XPathTreeConstants.JJTSTRINGLITERAL;
- }
-
- /**
- *
- * @param value
- */
- protected void setDoubleValue(double value)
- {
- m_literal = new Double(value);
- id = XPathTreeConstants.JJTDOUBLELITERAL;
- }
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.Literal;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Token;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+
+/**
+ *
+ */
+public class LiteralImpl extends ExprImpl implements Literal
+{
+ Object m_literal;
+
+ /**
+ *
+ *
+ */
+ protected LiteralImpl()
+ {
+ super();
+ }
+
+ /**
+ * Constructor for PrimaryExprImpl.
+ * @param i
+ */
+ public LiteralImpl(int i)
+ {
+ super(i);
+ }
+
+ /**
+ * Constructor for PrimaryExprImpl.
+ * @param p
+ * @param i
+ */
+ public LiteralImpl(XPath p, int i)
+ {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType()
+ {
+ return Expr.LITERAL_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression()
+ {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Literal#getDecimalLiteral()
+ */
+ public float getDecimalLiteral() throws XPathException
+ {
+ if (getLiteralType() == DECIMAL_LITERAL)
+ {
+ return ((Float) m_literal).floatValue();
+ }
+
+ throw new XPathException(
+ "Invalid method call: the literal is not a decimal");
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Literal#getDoubleLiteral()
+ */
+ public double getDoubleLiteral() throws XPathException
+ {
+ if (getLiteralType() == DOUBLE_LITERAL)
+ {
+ return ((Double) m_literal).doubleValue();
+ }
+
+ throw new XPathException(
+ "Invalid method call: the literal is not a double");
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Literal#getIntegerLiteral()
+ */
+ public int getIntegerLiteral() throws XPathException
+ {
+ if (getLiteralType() == INTEGER_LITERAL)
+ {
+ return ((Integer) m_literal).intValue();
+ }
+
+ throw new XPathException(
+ "Invalid method call: the literal is not a integer");
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Literal#getLiteralType()
+ */
+ public short getLiteralType()
+ {
+ switch (id)
+ {
+ case XPathTreeConstants.JJTINTEGERLITERAL:
+ return INTEGER_LITERAL;
+
+ //break;
+ case XPathTreeConstants.JJTDOUBLELITERAL:
+ return DOUBLE_LITERAL;
+
+ //break;
+ case XPathTreeConstants.JJTSTRINGLITERAL:
+ return STRING_LITERAL;
+
+ //break;
+ case XPathTreeConstants.JJTDECIMALLITERAL:
+ return DECIMAL_LITERAL;
+
+ //break;
+ default:
+
+ // bug
+ throw new RuntimeException("Invalid JJTree id:" + id);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Literal#getStringLiteral()
+ */
+ public String getStringLiteral() throws XPathException
+ {
+ if (getLiteralType() == STRING_LITERAL)
+ {
+ return (String) m_literal;
+ }
+
+ throw new XPathException(
+ "Invalid method call: the literal is not a string");
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate)
+ {
+ return m_literal.toString();
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
+ */
+ public void visited(Visitor visitor) {}
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
+ */
+ public void processToken(Token token)
+ {
+ super.processToken(token);
+
+ switch (id)
+ {
+ case XPathTreeConstants.JJTINTEGERLITERAL:
+ m_literal = new Integer(token.image);
+
+ break;
+
+ case XPathTreeConstants.JJTDOUBLELITERAL:
+ m_literal = new Double(token.image);
+
+ //break;
+ case XPathTreeConstants.JJTSTRINGLITERAL:
+ m_literal = token.image;
+
+ break;
+
+ case XPathTreeConstants.JJTDECIMALLITERAL:
+ m_literal = new Float(token.image);
+
+ break;
+
+ default:
+
+ // bug
+ throw new RuntimeException("Invalid JJTree id:" + id);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate)
+ {
+ expr.append(m_literal.toString());
+ }
+
+ /**
+ * @param value
+ */
+ protected void setIntValue(int value)
+ {
+ m_literal = new Integer(value);
+ id = XPathTreeConstants.JJTINTEGERLITERAL;
+ }
+
+ /**
+ *
+ * @param value
+ */
+ protected void setDecimalValue(float value)
+ {
+ m_literal = new Float(value);
+ id = XPathTreeConstants.JJTDECIMALLITERAL;
+ }
+
+ /**
+ *
+ * @param value
+ */
+ protected void setStringValue(String value)
+ {
+ m_literal = value;
+ id = XPathTreeConstants.JJTSTRINGLITERAL;
+ }
+
+ /**
+ *
+ * @param value
+ */
+ protected void setDoubleValue(double value)
+ {
+ m_literal = new Double(value);
+ id = XPathTreeConstants.JJTDOUBLELITERAL;
+ }
+}
1.1.2.3 +184 -184
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/NameTestImpl.java
Index: NameTestImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/NameTestImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- NameTestImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ NameTestImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,184 +1,184 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.NodeTest;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.QName;
-import org.apache.xpath.rwapi.impl.parser.Token;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-/**
- *
- */
-public class NameTestImpl extends ExprImpl implements NodeTest {
-
- String m_localPart;
- String m_prefix;
-
-
- /**
- * Constructor for NameTestImpl.
- * @param i
- */
- public NameTestImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for NodeTestImpl.
- * @param p
- * @param i
- */
- public NameTestImpl(String localPart, String prefix) {
- super(XPathTreeConstants.JJTNAMETEST);
- m_localPart = localPart;
- m_prefix = prefix;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#isNameTest()
- */
- public boolean isNameTest() {
- return true;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#isKindTest()
- */
- public boolean isKindTest() {
- return false;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#getKindTest()
- */
- public short getKindTest() throws XPathException {
- throw new XPathException("Invalid call of this method on NameTest
node"); //I8
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#getLocalNameTest()
- */
- public String getLocalNameTest() throws XPathException {
- return m_localPart;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.NodeTest#getPrefix()
- */
- public String getPrefix() throws XPathException {
- return m_prefix;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return Expr.NAMETEST_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return new NameTestImpl(m_localPart, m_prefix);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
- */
- public String getString(boolean abbreviate) {
- return (m_prefix != null) ? m_prefix + ":" + m_localPart :
m_localPart;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
- */
- public void processToken(Token token) {
-
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeFiltered()
- */
- protected boolean canBeFiltered() {
- return false;
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- // don't add n in the tree
- m_localPart = ((QName) n).getLocalPart();
- m_prefix = ((QName) n).getPrefix();
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
- */
- protected void getString(StringBuffer expr, boolean abbreviate) {
- if ( m_prefix != null ) {
- expr.append(m_prefix).append(":").append(m_localPart);
- } else {
- expr.append(m_localPart);
- }
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.NodeTest;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.QName;
+import org.apache.xpath.rwapi.impl.parser.Token;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+/**
+ *
+ */
+public class NameTestImpl extends ExprImpl implements NodeTest {
+
+ String m_localPart;
+ String m_prefix;
+
+
+ /**
+ * Constructor for NameTestImpl.
+ * @param i
+ */
+ public NameTestImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for NodeTestImpl.
+ * @param p
+ * @param i
+ */
+ public NameTestImpl(String localPart, String prefix) {
+ super(XPathTreeConstants.JJTNAMETEST);
+ m_localPart = localPart;
+ m_prefix = prefix;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#isNameTest()
+ */
+ public boolean isNameTest() {
+ return true;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#isKindTest()
+ */
+ public boolean isKindTest() {
+ return false;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#getKindTest()
+ */
+ public short getKindTest() throws XPathException {
+ throw new XPathException("Invalid call of this method on NameTest
node"); //I8
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#getLocalNameTest()
+ */
+ public String getLocalNameTest() throws XPathException {
+ return m_localPart;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.NodeTest#getPrefix()
+ */
+ public String getPrefix() throws XPathException {
+ return m_prefix;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return Expr.NAMETEST_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return new NameTestImpl(m_localPart, m_prefix);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getString(boolean)
+ */
+ public String getString(boolean abbreviate) {
+ return (m_prefix != null) ? m_prefix + ":" + m_localPart :
m_localPart;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
+ */
+ public void processToken(Token token) {
+
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeFiltered()
+ */
+ protected boolean canBeFiltered() {
+ return false;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ // don't add n in the tree
+ m_localPart = ((QName) n).getLocalPart();
+ m_prefix = ((QName) n).getPrefix();
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate) {
+ if ( m_prefix != null ) {
+ expr.append(m_prefix).append(":").append(m_localPart);
+ } else {
+ expr.append(m_localPart);
+ }
+ }
+
+}
1.1.2.4 +511 -517
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/OperatorImpl.java
Index: OperatorImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/OperatorImpl.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- OperatorImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.3
+++ OperatorImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.4
@@ -1,517 +1,511 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.OperatorExpr;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.Token;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-
-/**
- *
- */
-public class OperatorImpl extends ExprImpl implements OperatorExpr
-{
- /**
- * Mapping between operation type and it's external representation
- */
- final private static String[] OPTYPE2STRING =
- {
- "|", "intersect",
"except",
- "+", "-", "to", "eq",
- "ne", "lt", "le", "gt",
- "ge", "=", "!=", "<",
"<=",
- ">", ">=", "is",
"isnot",
- "<<", ">>", "and",
"or",
- "+", "-", "/", "//",
",",
- "*", "div", "idiv",
"mod"
- };
-
- /**
- * Indicate whether space is needed around the operator
- */
- final private static boolean[] SPACE_NEEDED =
- {
- false, true, true,
false,
- false, true, true,
true,
- true, true, true, true,
- false, false, false,
false,
- false, false, true,
true,
- false, false, true,
true,
- false, false, false,
false,
- false, false, true,
true,
- true
- };
- short m_exprType;
- short m_opType;
-
- /**
- * Constructor for OperatorImpl.
- * @param i
- */
- public OperatorImpl(int i)
- {
- super(i);
-
- switch (i)
- {
- case XPathTreeConstants.JJTEXPRSEQUENCE:
- m_exprType = SEQUENCE_EXPR;
- m_opType = COMMA;
-
- break;
-
- case XPathTreeConstants.JJTUNARYEXPR:
- m_exprType = UNARY_EXPR;
-
- break;
-
- case XPathTreeConstants.JJTPATHEXPR:
- m_exprType = PATH_EXPR;
- m_opType = SLASH_STEP;
-
- break;
-
- case XPathTreeConstants.JJTUNIONEXPR:
- m_exprType = COMBINE_EXPR;
-
- // opType is not known yet
- break;
-
- case XPathTreeConstants.JJTFUNCTIONCALL:
-
- // ignore : see FunctionCallImpl subclass
- break;
-
- case XPathTreeConstants.JJTADDITIVEEXPR:
- case XPathTreeConstants.JJTMULTIPLICATIVEEXPR:
- m_exprType = ARITHMETIC_EXPR;
-
- // opType is not known yet
- break;
-
- case XPathTreeConstants.JJTOREXPR:
- case XPathTreeConstants.JJTANDEXPR:
- m_exprType = LOGICAL_EXPR;
-
- // opType is not known yet
- break;
-
- case XPathTreeConstants.JJTCOMPARISONEXPR:
- m_exprType = COMPARISON_EXPR;
-
- // opType is not known yet
- break;
-
- case XPathTreeConstants.JJTRANGEEXPR:
- m_exprType = RANGE_EXPR;
- m_opType = RANGE;
-
- break;
-
- default:
- System.out.println("not implemented yet:" + i);
- }
- }
-
- /**
- * Constructor for OperatorImpl.
- * @param p
- * @param i
- */
- public OperatorImpl(XPath p, int i)
- {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType()
- {
- return m_exprType;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression()
- {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
- */
- public void visit(Visitor visitor)
- {
- int count = getOperandCount();
-
- for (int i = 0; i < count; i++)
- {
- getOperand(i).visit(visitor);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.OperatorExpr#addOperand(Expr)
- */
- public void addOperand(Expr operand) throws XPathException
- {
- super.jjtAddChild((Node) operand,
- (children == null) ? 0 : children.length);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperand(int)
- */
- public Expr getOperand(int i)
- {
- if (children == null)
- {
- throw new ArrayIndexOutOfBoundsException();
- }
-
- return (Expr) children[i];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperandCount()
- */
- public int getOperandCount()
- {
- return (children == null) ? 0 : children.length;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperatorType()
- */
- public short getOperatorType()
- {
- return m_opType;
- }
-
- /**
- * @see
org.apache.xpath.rwapi.expression.OperatorExpr#removeOperand(Expr)
- */
- public void removeOperand(Expr operand) throws XPathException {}
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i)
- {
- // Filter operator
- if (n.getId() == XPathTreeConstants.JJTSLASH)
- {
- // Filter
- }
- else if (n.getId() == XPathTreeConstants.JJTMINUS)
- {
- // Minus expression
- m_opType = MINUS_UNARY;
- }else if (n.getId() ==
XPathTreeConstants.JJTPLUS)
- {
- // Plus expression
- m_opType = PLUS_UNARY;
- }
- else
- {
- //int last = (children == null) ? 0 : children.length;
- if (((SimpleNode) n).canBeReduced())
- {
- super.jjtInsertChild(n.jjtGetChild(0));
- }
- else
- {
- super.jjtInsertChild(n);
- }
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced()
- {
- switch (m_exprType)
- {
- case UNARY_EXPR:
-
- if ((m_opType != MINUS_UNARY) && (m_opType != PLUS_UNARY))
- {
- return true;
- }
-
- case SEQUENCE_EXPR:
- return false;
- }
-
- return super.canBeReduced();
- }
-
- /**
- * Gets operator as a char
- */
- protected String getOperatorChar()
- {
- return OPTYPE2STRING[m_opType];
- }
-
- /**
- * Tell is spaces are needed around the operator
- */
- protected boolean isSpaceNeeded()
- {
- return SPACE_NEEDED[m_opType];
- }
-
- /**
- * Gets expression as external string representation
- */
- protected void getString(StringBuffer expr, boolean abbreviate)
- {
- int size = getOperandCount();
- String oper = getOperatorChar();
- ExprImpl op;
-
- if (m_opType == MINUS_UNARY || m_opType == PLUS_UNARY)
- {
- expr.append(oper);
- }
-
- for (int i = 0; i < size; i++)
- {
- op = (ExprImpl) getOperand(i);
-
- if (op.getExprType() == ARITHMETIC_EXPR)
- {
- expr.append('(');
- }
-
- op.getString(expr, abbreviate);
-
- if (op.getExprType() == ARITHMETIC_EXPR)
- {
- expr.append(')');
- }
-
- if (i < (size - 1))
- {
- if (isSpaceNeeded())
- {
- expr.append(' ');
- }
-
- expr.append(oper);
-
- if (isSpaceNeeded())
- {
- expr.append(' ');
- }
- }
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
- */
- public void processToken(Token token)
- {
- if (m_exprType == ARITHMETIC_EXPR)
- {
- String op = token.image.trim();
-
- if (op.equals("+"))
- {
- m_opType = PLUS_ADDITIVE;
- }
- else if (op.equals("-"))
- {
- m_opType = MINUS_ADDITIVE;
- }
- else if (op.equals("*"))
- {
- m_opType = MULT_PRODUCT;
- }
- else if (op.equals("div"))
- {
- m_opType = MULT_DIV;
- }
- else if (op.equals("idiv"))
- {
- m_opType = MULT_IDIV;
- }
- else if (op.equals("mod"))
- {
- m_opType = MULT_MOD;
- }
- else
- {
- // Case not recognized yet
- }
- }
- else if (m_exprType == COMBINE_EXPR)
- {
- String op = token.image.trim();
-
- if (op.equals("|") || op.equals("union"))
- {
- m_opType = UNION_COMBINE;
- }
- else if (op.equals("intersect"))
- {
- m_opType = INTERSECT_COMBINE;
- }
- else if (op.equals("except"))
- {
- m_opType = EXCEPT_COMBINE;
- }
- else
- {
- // Case not recognized yet
- }
- }
- else if (m_exprType == LOGICAL_EXPR)
- {
- String op = token.image.trim();
-
- if (op.equals("and"))
- {
- m_opType = AND_LOGICAL;
- }
- else
- {
- m_opType = OR_LOGICAL;
- }
- }
- else if (m_exprType == COMPARISON_EXPR)
- {
- String op = token.image.trim();
-
- if (op.equals("="))
- {
- m_opType = EQUAL_GENERAL_COMPARISON;
- }
- else if (op.equals("!="))
- {
- m_opType = NOTEQUAL_GENERAL_COMPARISON;
- }
- else if (op.equals("<"))
- {
- m_opType = LESSTHAN_GENERAL_COMPARISON;
- }
- else if (op.equals("<="))
- {
- m_opType = LESSOREQUALTHAN_GENERAL_COMPARISON;
- }
- else if (op.equals(">"))
- {
- m_opType = GREATTHAN_GENERAL_COMPARISON;
- }
- else if (op.equals(">="))
- {
- m_opType = GREATOREQUALTHAN_GENERAL_COMPARISON;
- }
- else if (op.equals("eq"))
- {
- m_opType = EQUAL_VALUE_COMPARISON;
- }
- else if (op.equals("ne"))
- {
- m_opType = NOTEQUAL_VALUE_COMPARISON;
- }
- else if (op.equals("lt"))
- {
- m_opType = LESSTHAN_VALUE_COMPARISON;
- }
- else if (op.equals("le"))
- {
- m_opType = LESSOREQUALTHAN_VALUE_COMPARISON;
- }
- else if (op.equals("gt"))
- {
- m_opType = GREATTHAN_VALUE_COMPARISON;
- }
- else if (op.equals("ge"))
- {
- m_opType = GREATOREQUALTHAN_VALUE_COMPARISON;
- }
- else if (op.equals("is"))
- {
- m_opType = IS_NODE_COMPARISON;
- }
- else if (op.equals("isnot"))
- {
- m_opType = ISNOT_NODE_COMPARISON;
- }
- else if (op.equals("<<"))
- {
- m_opType = EARLIERTHAN_ORDER_COMPARISON;
- }
- else // if (op.equals(">>"))
- {
- m_opType = LATERTHAN_ORDER_COMPARISON;
- }
- }
- }
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.OperatorExpr;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.Token;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+
+/**
+ *
+ */
+public class OperatorImpl extends ExprImpl implements OperatorExpr
+{
+ /**
+ * Mapping between operation type and it's external representation
+ */
+ final private static String[] OPTYPE2STRING =
+ {
+ "|", "intersect", "except", "+", "-", "to", "eq", "ne", "lt", "le",
"gt",
+ "ge", "=", "!=", "<", "<=", ">", ">=", "is", "isnot", "<<", ">>",
"and",
+ "or", "+", "-", "/", "//", ",", "*", "div", "idiv", "mod"
+ };
+
+ /**
+ * Indicate whether space is needed around the operator
+ */
+ final private static boolean[] SPACE_NEEDED =
+ {
+ false, true, true, false, false, true, true, true, true, true, true,
+ true, false, false, false, false, false, false, true, true, false,
false,
+ true, true, false, false, false, false, false, false, true, true,
true
+ };
+ short m_exprType;
+ short m_opType;
+
+ /**
+ * Constructor for OperatorImpl.
+ * @param i
+ */
+ public OperatorImpl(int i)
+ {
+ super(i);
+
+ switch (i)
+ {
+ case XPathTreeConstants.JJTEXPRSEQUENCE:
+ m_exprType = SEQUENCE_EXPR;
+ m_opType = COMMA;
+
+ break;
+
+ case XPathTreeConstants.JJTUNARYEXPR:
+ m_exprType = UNARY_EXPR;
+
+ break;
+
+ case XPathTreeConstants.JJTPATHEXPR:
+ m_exprType = PATH_EXPR;
+ m_opType = SLASH_STEP;
+
+ break;
+
+ case XPathTreeConstants.JJTUNIONEXPR:
+ m_exprType = COMBINE_EXPR;
+
+ // opType is not known yet
+ break;
+
+ case XPathTreeConstants.JJTFUNCTIONCALL:
+
+ // ignore : see FunctionCallImpl subclass
+ break;
+
+ case XPathTreeConstants.JJTADDITIVEEXPR:
+ case XPathTreeConstants.JJTMULTIPLICATIVEEXPR:
+ m_exprType = ARITHMETIC_EXPR;
+
+ // opType is not known yet
+ break;
+
+ case XPathTreeConstants.JJTOREXPR:
+ case XPathTreeConstants.JJTANDEXPR:
+ m_exprType = LOGICAL_EXPR;
+
+ // opType is not known yet
+ break;
+
+ case XPathTreeConstants.JJTCOMPARISONEXPR:
+ m_exprType = COMPARISON_EXPR;
+
+ // opType is not known yet
+ break;
+
+ case XPathTreeConstants.JJTRANGEEXPR:
+ m_exprType = RANGE_EXPR;
+ m_opType = RANGE;
+
+ break;
+
+ default:
+ System.out.println("not implemented yet:" + i);
+ }
+ }
+
+ /**
+ * Constructor for OperatorImpl.
+ * @param p
+ * @param i
+ */
+ public OperatorImpl(XPath p, int i)
+ {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType()
+ {
+ return m_exprType;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression()
+ {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
+ */
+ public void visit(Visitor visitor)
+ {
+ int count = getOperandCount();
+
+ for (int i = 0; i < count; i++)
+ {
+ getOperand(i).visit(visitor);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.OperatorExpr#addOperand(Expr)
+ */
+ public void addOperand(Expr operand) throws XPathException
+ {
+ super.jjtAddChild((Node) operand,
+ (children == null) ? 0 : children.length);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperand(int)
+ */
+ public Expr getOperand(int i)
+ {
+ if (children == null)
+ {
+ throw new ArrayIndexOutOfBoundsException();
+ }
+
+ return (Expr) children[i];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperandCount()
+ */
+ public int getOperandCount()
+ {
+ return (children == null) ? 0 : children.length;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.OperatorExpr#getOperatorType()
+ */
+ public short getOperatorType()
+ {
+ return m_opType;
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.expression.OperatorExpr#removeOperand(Expr)
+ */
+ public void removeOperand(Expr operand) throws XPathException
+ {
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i)
+ {
+ // Filter operator
+ if (n.getId() == XPathTreeConstants.JJTSLASH)
+ {
+ // Filter
+ }
+ else if (n.getId() == XPathTreeConstants.JJTMINUS)
+ {
+ // Minus expression
+ m_opType = MINUS_UNARY;
+ }
+ else if (n.getId() == XPathTreeConstants.JJTPLUS)
+ {
+ // Plus expression
+ m_opType = PLUS_UNARY;
+ }
+ else
+ {
+ //int last = (children == null) ? 0 : children.length;
+ if (((SimpleNode) n).canBeReduced())
+ {
+ super.jjtInsertChild(n.jjtGetChild(0));
+ }
+ else
+ {
+ super.jjtInsertChild(n);
+ }
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced()
+ {
+ switch (m_exprType)
+ {
+ case UNARY_EXPR:
+
+ if ((m_opType != MINUS_UNARY) && (m_opType != PLUS_UNARY))
+ {
+ return true;
+ }
+ break;
+ case SEQUENCE_EXPR:
+ return (children == null) || (children.length <= 1);
+ }
+
+ return super.canBeReduced();
+ }
+
+ /**
+ * Gets operator as a char
+ */
+ protected String getOperatorChar()
+ {
+ return OPTYPE2STRING[m_opType];
+ }
+
+ /**
+ * Tell is spaces are needed around the operator
+ */
+ protected boolean isSpaceNeeded()
+ {
+ return SPACE_NEEDED[m_opType];
+ }
+
+ /**
+ * Gets expression as external string representation
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate)
+ {
+ int size = getOperandCount();
+ String oper = getOperatorChar();
+ ExprImpl op;
+
+ if ((m_opType == MINUS_UNARY) || (m_opType == PLUS_UNARY))
+ {
+ expr.append(oper);
+ }
+
+ for (int i = 0; i < size; i++)
+ {
+ op = (ExprImpl) getOperand(i);
+
+ if (op.getExprType() == ARITHMETIC_EXPR)
+ {
+ expr.append('(');
+ }
+
+ op.getString(expr, abbreviate);
+
+ if (op.getExprType() == ARITHMETIC_EXPR)
+ {
+ expr.append(')');
+ }
+
+ if (i < (size - 1))
+ {
+ if (isSpaceNeeded())
+ {
+ expr.append(' ');
+ }
+
+ expr.append(oper);
+
+ if (isSpaceNeeded())
+ {
+ expr.append(' ');
+ }
+ }
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
+ */
+ public void processToken(Token token)
+ {
+ // @TODO: optimization here: use a hashmap
+ if (m_exprType == ARITHMETIC_EXPR)
+ {
+ String op = token.image.trim();
+
+ if (op.equals("+"))
+ {
+ m_opType = PLUS_ADDITIVE;
+ }
+ else if (op.equals("-"))
+ {
+ m_opType = MINUS_ADDITIVE;
+ }
+ else if (op.equals("*"))
+ {
+ m_opType = MULT_PRODUCT;
+ }
+ else if (op.equals("div"))
+ {
+ m_opType = MULT_DIV;
+ }
+ else if (op.equals("idiv"))
+ {
+ m_opType = MULT_IDIV;
+ }
+ else if (op.equals("mod"))
+ {
+ m_opType = MULT_MOD;
+ }
+ else
+ {
+ // Case not recognized yet
+ }
+ }
+ else if (m_exprType == COMBINE_EXPR)
+ {
+ String op = token.image.trim();
+
+ if (op.equals("|") || op.equals("union"))
+ {
+ m_opType = UNION_COMBINE;
+ }
+ else if (op.equals("intersect"))
+ {
+ m_opType = INTERSECT_COMBINE;
+ }
+ else if (op.equals("except"))
+ {
+ m_opType = EXCEPT_COMBINE;
+ }
+ else
+ {
+ // Case not recognized yet
+ }
+ }
+ else if (m_exprType == LOGICAL_EXPR)
+ {
+ String op = token.image.trim();
+
+ if (op.equals("and"))
+ {
+ m_opType = AND_LOGICAL;
+ }
+ else
+ {
+ m_opType = OR_LOGICAL;
+ }
+ }
+ else if (m_exprType == COMPARISON_EXPR)
+ {
+ String op = token.image.trim();
+
+ if (op.equals("="))
+ {
+ m_opType = EQUAL_GENERAL_COMPARISON;
+ }
+ else if (op.equals("!="))
+ {
+ m_opType = NOTEQUAL_GENERAL_COMPARISON;
+ }
+ else if (op.equals("<"))
+ {
+ m_opType = LESSTHAN_GENERAL_COMPARISON;
+ }
+ else if (op.equals("<="))
+ {
+ m_opType = LESSOREQUALTHAN_GENERAL_COMPARISON;
+ }
+ else if (op.equals(">"))
+ {
+ m_opType = GREATTHAN_GENERAL_COMPARISON;
+ }
+ else if (op.equals(">="))
+ {
+ m_opType = GREATOREQUALTHAN_GENERAL_COMPARISON;
+ }
+ else if (op.equals("eq"))
+ {
+ m_opType = EQUAL_VALUE_COMPARISON;
+ }
+ else if (op.equals("ne"))
+ {
+ m_opType = NOTEQUAL_VALUE_COMPARISON;
+ }
+ else if (op.equals("lt"))
+ {
+ m_opType = LESSTHAN_VALUE_COMPARISON;
+ }
+ else if (op.equals("le"))
+ {
+ m_opType = LESSOREQUALTHAN_VALUE_COMPARISON;
+ }
+ else if (op.equals("gt"))
+ {
+ m_opType = GREATTHAN_VALUE_COMPARISON;
+ }
+ else if (op.equals("ge"))
+ {
+ m_opType = GREATOREQUALTHAN_VALUE_COMPARISON;
+ }
+ else if (op.equals("is"))
+ {
+ m_opType = IS_NODE_COMPARISON;
+ }
+ else if (op.equals("isnot"))
+ {
+ m_opType = ISNOT_NODE_COMPARISON;
+ }
+ else if (op.equals("<<"))
+ {
+ m_opType = EARLIERTHAN_ORDER_COMPARISON;
+ }
+ else // if (op.equals(">>"))
+ {
+ m_opType = LATERTHAN_ORDER_COMPARISON;
+ }
+ }
+
+ }
+}
1.1.2.4 +198 -194
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/PathExprImpl.java
Index: PathExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/PathExprImpl.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- PathExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.3
+++ PathExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.4
@@ -1,194 +1,198 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.PathExpr;
-import org.apache.xpath.rwapi.expression.StepExpr;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.Singletons;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-
-/**
- *
- */
-public class PathExprImpl extends OperatorImpl implements PathExpr
-{
- boolean m_isAbsolute;
-
- /**
- * Constructor for PathExprImpl.
- */
- protected PathExprImpl()
- {
- this(XPathTreeConstants.JJTPATHEXPR);
- }
-
- /**
- * Constructor for PathExprImpl.
- * @param i
- */
- public PathExprImpl(int i)
- {
- super(i);
-
- m_isAbsolute = false;
- }
-
- /**
- * Constructor for PathExprImpl.
- * @param p
- * @param i
- */
- public PathExprImpl(XPath p, int i)
- {
- super(p, i);
-
- m_isAbsolute = false;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.PathExpr#isAbsolute()
- */
- public boolean isAbsolute()
- {
- return m_isAbsolute;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
- */
- public void visit(Visitor visitor)
- {
- visitor.visitPath(this);
-
- // visit each step (operand)
- super.visit(visitor);
- }
-
- /**
- * @see
org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, boolean)
- */
- protected void getString(StringBuffer expr, boolean abbreviate)
- {
- if (m_isAbsolute)
- {
- expr.append("/");
- }
-
- super.getString(expr, abbreviate);
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i)
- {
- if (n.getId() == XPathTreeConstants.JJTROOT)
- {
- m_isAbsolute = true;
- }
- else if (n.getId() == XPathTreeConstants.JJTROOTDESCENDANTS)
- {
- m_isAbsolute = true;
- super.jjtAddChild(Singletons.SLASHSLASH, i);
- }
- // else if (n.getId() == XPathTreeConstants.JJTSLASHSLASH)
- // {
- // expand to /descendant-or-self::node()/
- // super.jjtAddChild(Singletons.SLASHSLASH, i);
- //}
- else if (n.getId() == XPathTreeConstants.JJTSLASH)
- {
- // filtered
- }
- else
- {
- if (((SimpleNode) n).canBeReduced())
- {
- super.jjtInsertChild(n.jjtGetChild(0));
- }
- else
- {
- super.jjtInsertChild(n);
- }
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced()
- {
- // Can be reduced whenever there is only one step and this step is a
primary expression
- if ((children != null) && (children.length == 1))
- {
- Expr step = (Expr) children[0];
- int et = step.getExprType();
-
- return (((et == STEP) && ((StepExpr) step).isPrimaryExpr())
- || (et == LITERAL_EXPR) || (et == FUNCTION_CALL_EXPR)
- || (et == SEQUENCE_EXPR) || (et == VARIABLE_REF_EXPR)
- || (et == ARITHMETIC_EXPR));
- }
-
- return false;
- }
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.PathExpr;
+import org.apache.xpath.rwapi.expression.StepExpr;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.Singletons;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+
+/**
+ *
+ */
+public class PathExprImpl extends OperatorImpl implements PathExpr
+{
+ boolean m_isAbsolute;
+
+ /**
+ * Constructor for PathExprImpl.
+ */
+ protected PathExprImpl()
+ {
+ this(XPathTreeConstants.JJTPATHEXPR);
+ }
+
+ /**
+ * Constructor for PathExprImpl.
+ * @param i
+ */
+ public PathExprImpl(int i)
+ {
+ super(i);
+
+ m_isAbsolute = false;
+ }
+
+ /**
+ * Constructor for PathExprImpl.
+ * @param p
+ * @param i
+ */
+ public PathExprImpl(XPath p, int i)
+ {
+ super(p, i);
+
+ m_isAbsolute = false;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.PathExpr#isAbsolute()
+ */
+ public boolean isAbsolute()
+ {
+ return m_isAbsolute;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
+ */
+ public void visit(Visitor visitor)
+ {
+ visitor.visitPath(this);
+
+ // visit each step (operand)
+ super.visit(visitor);
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer, boolean)
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate)
+ {
+ if (m_isAbsolute)
+ {
+ expr.append("/");
+ }
+
+ super.getString(expr, abbreviate);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i)
+ {
+ if (n.getId() == XPathTreeConstants.JJTROOT)
+ {
+ m_isAbsolute = true;
+ }
+ else if (n.getId() == XPathTreeConstants.JJTROOTDESCENDANTS)
+ {
+ m_isAbsolute = true;
+ super.jjtAddChild(Singletons.SLASHSLASH, i);
+ }
+
+ // else if (n.getId() == XPathTreeConstants.JJTSLASHSLASH)
+ // {
+ // expand to /descendant-or-self::node()/
+ // super.jjtAddChild(Singletons.SLASHSLASH, i);
+ //}
+ else if (n.getId() == XPathTreeConstants.JJTSLASH)
+ {
+ // filtered
+ }
+ else
+ {
+ if (((SimpleNode) n).canBeReduced())
+ {
+ if (n.jjtGetNumChildren() > 0)
+ {
+ super.jjtInsertChild(n.jjtGetChild(0));
+ }
+ }
+ else
+ {
+ super.jjtInsertChild(n);
+ }
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced()
+ {
+ // Can be reduced whenever there is only one step and this step is a
primary expression
+ if ((children != null) && (children.length == 1))
+ {
+ Expr step = (Expr) children[0];
+ int et = step.getExprType();
+
+ return (((et == STEP) && ((StepExpr) step).isPrimaryExpr())
+ || (et == LITERAL_EXPR) || (et == FUNCTION_CALL_EXPR)
+ || (et == SEQUENCE_EXPR) || (et == VARIABLE_REF_EXPR)
+ || (et == ARITHMETIC_EXPR));
+ }
+
+ return false;
+ }
+}
1.1.2.4 +455 -451
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/StepExprImpl.java
Index: StepExprImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/StepExprImpl.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- StepExprImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.3
+++ StepExprImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.4
@@ -1,451 +1,455 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.NodeTest;
-import org.apache.xpath.rwapi.expression.StepExpr;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Axis;
-import org.apache.xpath.rwapi.impl.parser.Node;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-
-/**
- * Implementation of step expression
- */
-public class StepExprImpl extends ExprImpl implements StepExpr
-{
- final static boolean[] AXIS_FORWARD =
- {
- false, true, true, false, true,
- true, true, false, true, false,
- true, false, true, false
- };
-
- /**
- * Axis type. -1 whenever this step expr is a primary expr
- */
- short m_axisType = -2;
-
- /**
- * Constructor for StepExprImpl.
- * @param i
- */
- public StepExprImpl(int i)
- {
- super(i);
- }
-
- /**
- * Constructor for StepExprImpl.
- * @param p
- * @param i
- */
- public StepExprImpl(XPath p, int i)
- {
- super(p, i);
- }
-
- /**
- * Constructor for StepExprImpl.
- * @param axisType
- * @param NodeTest
- */
- public StepExprImpl(short axisType, NodeTest nodeTest)
- {
- super(XPathTreeConstants.JJTSTEPEXPR);
-
- m_axisType = axisType;
- super.jjtAddChild((Node) nodeTest, 0);
-
- // super.jjtAddChild(new
OperatorImpl(XPathTreeConstants.JJTPREDICATES), 1);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateAt(int)
- */
- public Expr getPredicateAt(int i)
- {
- return (Expr) children[i + 1];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateCount()
- */
- public int getPredicateCount()
- {
- return children.length - 1;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#appendPredicate(Expr)
- */
- public void appendPredicate(Expr predicate)
- {
- super.jjtAddChild((Node) predicate, children.length);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#removePredicate(Expr)
- */
- public void removePredicate(Expr predicate) {}
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
- */
- public void visit(Visitor visitor)
- {
- visitor.visitStep(this);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#isForwardStep()
- */
- public boolean isForwardStep()
- {
- return (m_axisType != -1) && AXIS_FORWARD[m_axisType];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#isReversedStep()
- */
- public boolean isReversedStep()
- {
- return (m_axisType != -1) && !AXIS_FORWARD[m_axisType];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#isPrimaryExpr()
- */
- public boolean isPrimaryExpr()
- {
- return m_axisType == -1;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisType()
- */
- public short getAxisType() throws XPathException
- {
- if (m_axisType == -1)
- {
- throw new XPathException("Invalid call of this method on primary
expression");
- }
-
- return m_axisType;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#setAxisType(short)
- */
- public void setAxisType(short newType) throws XPathException
- {
- if (m_axisType == -1)
- {
- throw new XPathException("Invalid call of this method on primary
expression");
- }
-
- m_axisType = newType;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisName()
- */
- public String getAxisName() throws XPathException
- {
- if (m_axisType == -1)
- {
- throw new XPathException("Invalid call of this method on primary
expression");
- }
-
- return StepExprImpl.FULL_AXIS_NAME[m_axisType];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#getStepNodeTest()
- */
- public NodeTest getStepNodeTest() throws XPathException
- {
- if (m_axisType == -1)
- {
- throw new XPathException("Invalid call of this method on step
compose of primary expression");
- }
-
- return (NodeTest) children[0];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#getPrimaryExpr()
- */
- public Expr getPrimaryExpr() throws XPathException
- {
- if (m_axisType != -1)
- {
- throw new XPathException("Invalid call of this method on step
compose of node test");
- }
-
- return (Expr) children[0];
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.StepExpr#cloneStep()
- */
- public StepExpr cloneStep()
- {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType()
- {
- return StepExprImpl.STEP;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression()
- {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i)
- {
- switch (n.getId())
- {
- case XPathTreeConstants.JJTAT:
- m_axisType = AXIS_ATTRIBUTE;
-
- break;
-
- case XPathTreeConstants.JJTAXISCHILD:
- case XPathTreeConstants.JJTAXISDESCENDANT:
- case XPathTreeConstants.JJTAXISANCESTOR:
- case XPathTreeConstants.JJTAXISSELF:
- case XPathTreeConstants.JJTAXISDESCENDANTORSELF:
- case XPathTreeConstants.JJTAXISFOLLOWINGSIBLING:
- case XPathTreeConstants.JJTAXISFOLLOWING:
- case XPathTreeConstants.JJTAXISNAMESPACE:
- case XPathTreeConstants.JJTAXISPARENT:
- case XPathTreeConstants.JJTAXISPRECEDINGSIBLING:
- case XPathTreeConstants.JJTAXISPRECEDING:
- case XPathTreeConstants.JJTAXISANCESTORORSELF:
- m_axisType = ((Axis) n).getAxis();
-
- break;
-
- case XPathTreeConstants.JJTNAMETEST:
-
- // At production
- super.jjtAddChild(n, 0);
-
- break;
-
- case XPathTreeConstants.JJTNODETEST:
-
- if (m_axisType == -2)
- {
- // NodeTest production
- m_axisType = AXIS_CHILD;
- super.jjtAddChild(n.jjtGetChild(0), 0);
- }
- else
- {
- // reduce
- super.jjtAddChild(n.jjtGetChild(0), 0);
- }
-
- break;
-
- case XPathTreeConstants.JJTDOTDOT:
- m_axisType = AXIS_PARENT;
-
- KindTestImpl node = new KindTestImpl();
- node.m_kindTest = NodeTest.ANY_KIND_TEST;
- super.jjtAddChild(node, 0);
-
- break;
-
- case XPathTreeConstants.JJTDOT:
-
- // TODO : need to extend XPath API?
- break;
-
- case XPathTreeConstants.JJTINTEGERLITERAL:
- case XPathTreeConstants.JJTSTRINGLITERAL:
- case XPathTreeConstants.JJTDECIMALLITERAL:
- case XPathTreeConstants.JJTDOUBLELITERAL:
- case XPathTreeConstants.JJTFUNCTIONCALL:
- case XPathTreeConstants.JJTVARNAME:
- m_axisType = -1;
- super.jjtAddChild(n, 0);
-
- break;
-
- case XPathTreeConstants.JJTEXPRSEQUENCE:
- m_axisType = -1;
- super.jjtAddChild(n.jjtGetChild(0), 0);
-
- break;
-
- case XPathTreeConstants.JJTPREDICATES:
-
- int size = n.jjtGetNumChildren();
-
- for (int j = 0; j < size; j++)
- {
- super.jjtAddChild(n.jjtGetChild(j), size - j);
- }
-
- break;
-
- default:
- System.out.println("not implemented yet " + n.getId());
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
- */
- protected void getString(StringBuffer expr, boolean abbreviate)
- {
- try
- {
- if (m_axisType == -1)
- {
- ExprImpl p = (ExprImpl) getPrimaryExpr();
-
- if ((p.getExprType() == SEQUENCE_EXPR)
- || (p.getExprType() == COMBINE_EXPR)
- || (p.getExprType() == RANGE_EXPR))
- {
- expr.append('(');
- p.getString(expr, abbreviate);
- expr.append(')');
- }
- else
- {
- p.getString(expr, abbreviate);
- }
- }
- else
- {
- if (abbreviate && (m_axisType == AXIS_CHILD))
- {
- ((ExprImpl) getStepNodeTest()).getString(expr,
abbreviate);
- }
- else if (abbreviate && (m_axisType == AXIS_ATTRIBUTE))
- {
- expr.append("@");
- ((ExprImpl) getStepNodeTest()).getString(expr,
abbreviate);
- }
- else if (abbreviate && (m_axisType == AXIS_PARENT)
- && getStepNodeTest().isKindTest()
- && (getStepNodeTest().getKindTest() ==
NodeTest.ANY_KIND_TEST))
- {
- expr.append("..");
- }
- else if (abbreviate && (m_axisType ==
AXIS_DESCENDANT_OR_SELF)
- && getStepNodeTest().isKindTest()
- && (getStepNodeTest().getKindTest() ==
NodeTest.ANY_KIND_TEST))
- {
- // empty step
- }
- else
- {
- expr.append(getAxisName()).append("::");
- ((ExprImpl) getStepNodeTest()).getString(expr,
abbreviate);
- }
- }
-
- // Predicates
- int size = getPredicateCount();
-
- for (int i = 0; i < size; i++)
- {
- expr.append('[');
- ((ExprImpl) getPredicateAt(i)).getString(expr, abbreviate);
- expr.append(']');
- }
- }
- catch (XPathException e)
- {
- // never
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced()
- {
- // StepExpr can be reduce whenever it's a primary expression and
- // there is no predicate
- int et = ((Expr) children[0]).getExprType();
-
- return ((getPredicateCount() == 0) && (et == LITERAL_EXPR))
- || (et == FUNCTION_CALL_EXPR) || (et == SEQUENCE_EXPR)
- || (et == VARIABLE_REF_EXPR) || (et == ARITHMETIC_EXPR);
- }
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.NodeTest;
+import org.apache.xpath.rwapi.expression.StepExpr;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Axis;
+import org.apache.xpath.rwapi.impl.parser.Node;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+
+/**
+ * Implementation of step expression
+ */
+public class StepExprImpl extends ExprImpl implements StepExpr
+{
+ final static boolean[] AXIS_FORWARD =
+ {
+ false, true, true, false, true,
+ true, true, false, true, false,
+ true, false, true, false
+ };
+
+ /**
+ * Axis type. -1 whenever this step expr is a primary expr
+ */
+ short m_axisType = -2;
+
+ /**
+ * Constructor for StepExprImpl.
+ * @param i
+ */
+ public StepExprImpl(int i)
+ {
+ super(i);
+ }
+
+ /**
+ * Constructor for StepExprImpl.
+ * @param p
+ * @param i
+ */
+ public StepExprImpl(XPath p, int i)
+ {
+ super(p, i);
+ }
+
+ /**
+ * Constructor for StepExprImpl.
+ * @param axisType
+ * @param NodeTest
+ */
+ public StepExprImpl(short axisType, NodeTest nodeTest)
+ {
+ super(XPathTreeConstants.JJTSTEPEXPR);
+
+ m_axisType = axisType;
+ super.jjtAddChild((Node) nodeTest, 0);
+
+ // super.jjtAddChild(new
OperatorImpl(XPathTreeConstants.JJTPREDICATES), 1);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateAt(int)
+ */
+ public Expr getPredicateAt(int i)
+ {
+ return (Expr) children[i + 1];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#getPredicateCount()
+ */
+ public int getPredicateCount()
+ {
+ return children.length - 1;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#appendPredicate(Expr)
+ */
+ public void appendPredicate(Expr predicate)
+ {
+ super.jjtAddChild((Node) predicate, children.length);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#removePredicate(Expr)
+ */
+ public void removePredicate(Expr predicate) {}
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visit(Visitor)
+ */
+ public void visit(Visitor visitor)
+ {
+ visitor.visitStep(this);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#isForwardStep()
+ */
+ public boolean isForwardStep()
+ {
+ return (m_axisType != -1) && AXIS_FORWARD[m_axisType];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#isReversedStep()
+ */
+ public boolean isReversedStep()
+ {
+ return (m_axisType != -1) && !AXIS_FORWARD[m_axisType];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#isPrimaryExpr()
+ */
+ public boolean isPrimaryExpr()
+ {
+ return m_axisType == -1;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisType()
+ */
+ public short getAxisType() throws XPathException
+ {
+ if (m_axisType == -1)
+ {
+ throw new XPathException("Invalid call of this method on primary
expression");
+ }
+
+ return m_axisType;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#setAxisType(short)
+ */
+ public void setAxisType(short newType) throws XPathException
+ {
+ if (m_axisType == -1)
+ {
+ throw new XPathException("Invalid call of this method on primary
expression");
+ }
+
+ m_axisType = newType;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#getAxisName()
+ */
+ public String getAxisName() throws XPathException
+ {
+ if (m_axisType == -1)
+ {
+ throw new XPathException("Invalid call of this method on primary
expression");
+ }
+
+ return StepExprImpl.FULL_AXIS_NAME[m_axisType];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#getStepNodeTest()
+ */
+ public NodeTest getStepNodeTest() throws XPathException
+ {
+ if (m_axisType == -1)
+ {
+ throw new XPathException("Invalid call of this method on step
compose of primary expression");
+ }
+
+ return (NodeTest) children[0];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#getPrimaryExpr()
+ */
+ public Expr getPrimaryExpr() throws XPathException
+ {
+ if (m_axisType != -1)
+ {
+ throw new XPathException("Invalid call of this method on step
compose of node test");
+ }
+
+ return (Expr) children[0];
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.StepExpr#cloneStep()
+ */
+ public StepExpr cloneStep()
+ {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType()
+ {
+ return StepExprImpl.STEP;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression()
+ {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i)
+ {
+ switch (n.getId())
+ {
+ case XPathTreeConstants.JJTAT:
+ m_axisType = AXIS_ATTRIBUTE;
+
+ break;
+
+ case XPathTreeConstants.JJTAXISCHILD:
+ case XPathTreeConstants.JJTAXISDESCENDANT:
+ case XPathTreeConstants.JJTAXISANCESTOR:
+ case XPathTreeConstants.JJTAXISSELF:
+ case XPathTreeConstants.JJTAXISDESCENDANTORSELF:
+ case XPathTreeConstants.JJTAXISFOLLOWINGSIBLING:
+ case XPathTreeConstants.JJTAXISFOLLOWING:
+ case XPathTreeConstants.JJTAXISNAMESPACE:
+ case XPathTreeConstants.JJTAXISPARENT:
+ case XPathTreeConstants.JJTAXISPRECEDINGSIBLING:
+ case XPathTreeConstants.JJTAXISPRECEDING:
+ case XPathTreeConstants.JJTAXISANCESTORORSELF:
+ m_axisType = ((Axis) n).getAxis();
+
+ break;
+
+ case XPathTreeConstants.JJTNAMETEST:
+ case XPathTreeConstants.JJTDOT:
+ // At and Dot production: just add child since reduction has
been done in SimpleNode
+ super.jjtAddChild(n, 0);
+
+ break;
+
+ case XPathTreeConstants.JJTNODETEST:
+
+ if (m_axisType == -2)
+ {
+ // NodeTest production
+ m_axisType = AXIS_CHILD;
+ super.jjtAddChild(n.jjtGetChild(0), 0);
+ }
+ else
+ {
+ // reduce
+ super.jjtAddChild(n.jjtGetChild(0), 0);
+ }
+
+ break;
+
+ case XPathTreeConstants.JJTDOTDOT:
+ m_axisType = AXIS_PARENT;
+
+ KindTestImpl node = new KindTestImpl();
+ node.m_kindTest = NodeTest.ANY_KIND_TEST;
+ super.jjtAddChild(node, 0);
+
+ break;
+
+ case XPathTreeConstants.JJTINTEGERLITERAL:
+ case XPathTreeConstants.JJTSTRINGLITERAL:
+ case XPathTreeConstants.JJTDECIMALLITERAL:
+ case XPathTreeConstants.JJTDOUBLELITERAL:
+ case XPathTreeConstants.JJTFUNCTIONCALL:
+ case XPathTreeConstants.JJTVARNAME:
+ m_axisType = -1;
+ super.jjtAddChild(n, 0);
+
+ break;
+
+ case XPathTreeConstants.JJTEXPRSEQUENCE:
+ m_axisType = -1;
+
+ if (((SimpleNode) n).canBeReduced())
+ {
+ super.jjtAddChild(n.jjtGetChild(0), 0);
+ }
+ else
+ {
+ super.jjtAddChild(n, 0);
+ }
+
+ break;
+
+ case XPathTreeConstants.JJTPREDICATES:
+
+ int size = n.jjtGetNumChildren();
+
+ for (int j = 0; j < size; j++)
+ {
+ super.jjtAddChild(n.jjtGetChild(j), size - j);
+ }
+
+ break;
+
+ default:
+ System.out.println("not implemented yet " + n.getId());
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate)
+ {
+ try
+ {
+ if (m_axisType == -1)
+ {
+ ExprImpl p = (ExprImpl) getPrimaryExpr();
+
+ if ((p.getExprType() == SEQUENCE_EXPR)
+ || (p.getExprType() == COMBINE_EXPR)
+ || (p.getExprType() == RANGE_EXPR))
+ {
+ expr.append('(');
+ p.getString(expr, abbreviate);
+ expr.append(')');
+ }
+ else
+ {
+ p.getString(expr, abbreviate);
+ }
+ }
+ else
+ {
+ if (abbreviate && (m_axisType == AXIS_CHILD))
+ {
+ ((ExprImpl) getStepNodeTest()).getString(expr,
abbreviate);
+ }
+ else if (abbreviate && (m_axisType == AXIS_ATTRIBUTE))
+ {
+ expr.append("@");
+ ((ExprImpl) getStepNodeTest()).getString(expr,
abbreviate);
+ }
+ else if (abbreviate && (m_axisType == AXIS_PARENT)
+ && getStepNodeTest().isKindTest()
+ && (getStepNodeTest().getKindTest() ==
NodeTest.ANY_KIND_TEST))
+ {
+ expr.append("..");
+ }
+ else if (abbreviate && (m_axisType ==
AXIS_DESCENDANT_OR_SELF)
+ && getStepNodeTest().isKindTest()
+ && (getStepNodeTest().getKindTest() ==
NodeTest.ANY_KIND_TEST))
+ {
+ // empty step
+ }
+ else
+ {
+ expr.append(getAxisName()).append("::");
+ ((ExprImpl) getStepNodeTest()).getString(expr,
abbreviate);
+ }
+ }
+
+ // Predicates
+ int size = getPredicateCount();
+
+ for (int i = 0; i < size; i++)
+ {
+ expr.append('[');
+ ((ExprImpl) getPredicateAt(i)).getString(expr, abbreviate);
+ expr.append(']');
+ }
+ }
+ catch (XPathException e)
+ {
+ // never
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced()
+ {
+ // StepExpr can be reduce whenever it's a primary expression and
+ // there is no predicate
+ int et = ((Expr) children[0]).getExprType();
+
+ return ((getPredicateCount() == 0) && (et == LITERAL_EXPR))
+ || (et == FUNCTION_CALL_EXPR) || (et == SEQUENCE_EXPR)
+ || (et == VARIABLE_REF_EXPR) || (et == ARITHMETIC_EXPR);
+ }
+}
1.1.2.3 +130 -130
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/VariableImpl.java
Index: VariableImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/VariableImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- VariableImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ VariableImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,130 +1,130 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.Variable;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.Token;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-/**
- *
- */
-public class VariableImpl extends ExprImpl implements Variable {
-
- String m_varName;
-
- /**
- * Constructor for VariableImpl.
- * @param i
- */
- public VariableImpl(int i) {
- super(i);
- }
-
- /**
- * Constructor for VariableImpl.
- * @param p
- * @param i
- */
- public VariableImpl(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Variable#getVariableName()
- */
- public String getVariableName() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
- */
- public short getExprType() {
- return VARIABLE_REF_EXPR;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
- */
- public Expr cloneExpression() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
- */
- public void visited(Visitor visitor) {
- }
-
- /**
- * @see
org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
- */
- public void processToken(Token token) {
- super.processToken(token);
- m_varName = token.image.trim();
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
- */
- protected void getString(StringBuffer expr, boolean abbreviate) {
- expr.append('$').append(m_varName);
- }
-
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.Variable;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.Token;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+/**
+ *
+ */
+public class VariableImpl extends ExprImpl implements Variable {
+
+ String m_varName;
+
+ /**
+ * Constructor for VariableImpl.
+ * @param i
+ */
+ public VariableImpl(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for VariableImpl.
+ * @param p
+ * @param i
+ */
+ public VariableImpl(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Variable#getVariableName()
+ */
+ public String getVariableName() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#getExprType()
+ */
+ public short getExprType() {
+ return VARIABLE_REF_EXPR;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Expr#cloneExpression()
+ */
+ public Expr cloneExpression() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.expression.Visitable#visited(Visitor)
+ */
+ public void visited(Visitor visitor) {
+ }
+
+ /**
+ * @see
org.apache.xpath.rwapi.impl.parser.SimpleNode#processToken(Token)
+ */
+ public void processToken(Token token) {
+ super.processToken(token);
+ m_varName = token.image.trim();
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.ExprImpl#getString(StringBuffer,
boolean)
+ */
+ protected void getString(StringBuffer expr, boolean abbreviate) {
+ expr.append('$').append(m_varName);
+ }
+
+}
1.1.2.3 +88 -88
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/XPathFactoryImpl.java
Index: XPathFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/Attic/XPathFactoryImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XPathFactoryImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ XPathFactoryImpl.java 5 Feb 2003 16:09:47 -0000 1.1.2.3
@@ -1,88 +1,88 @@
-/*
- * 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.impl;
-
-import org.apache.xpath.rwapi.XPathFactory;
-import org.apache.xpath.rwapi.datamodel.ItemFactory;
-import org.apache.xpath.rwapi.eval.EvaluatorFactory;
-import org.apache.xpath.rwapi.expression.ExpressionFactory;
-
-/**
- *
- */
-public class XPathFactoryImpl extends XPathFactory {
-
- /**
- * @see org.apache.xpath.rwapi.XPathFactory#newExpressionFactory()
- */
- public ExpressionFactory newExpressionFactory() {
- return new ExpressionFactoryImpl();
- }
-
- /**
- * @see org.apache.xpath.rwapi.XPathFactory#newItemFactory()
- */
- public ItemFactory newItemFactory() {
- return null;
- }
-
- /**
- * @see org.apache.xpath.rwapi.XPathFactory#newEvaluatorFactory()
- */
- public EvaluatorFactory newEvaluatorFactory() {
- return new EvaluatorFactoryImpl();
- }
-}
+/*
+ * 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.impl;
+
+import org.apache.xpath.rwapi.XPathFactory;
+import org.apache.xpath.rwapi.datamodel.ItemFactory;
+import org.apache.xpath.rwapi.eval.EvaluatorFactory;
+import org.apache.xpath.rwapi.expression.ExpressionFactory;
+
+/**
+ *
+ */
+public class XPathFactoryImpl extends XPathFactory {
+
+ /**
+ * @see org.apache.xpath.rwapi.XPathFactory#newExpressionFactory()
+ */
+ public ExpressionFactory newExpressionFactory() {
+ return new ExpressionFactoryImpl();
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.XPathFactory#newItemFactory()
+ */
+ public ItemFactory newItemFactory() {
+ return null;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.XPathFactory#newEvaluatorFactory()
+ */
+ public EvaluatorFactory newEvaluatorFactory() {
+ return new EvaluatorFactoryImpl();
+ }
+}
No revision
No revision
1.1.2.3 +124 -124
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Axis.java
Index: Axis.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Axis.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Axis.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ Axis.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -1,124 +1,124 @@
-/*
- * 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.impl.parser;
-
-import org.apache.xpath.rwapi.expression.StepExpr;
-
-/**
- *
- */
-public class Axis extends SimpleNode {
-
- static final protected Axis AXIS_CHILD = new
Axis(XPathTreeConstants.JJTAXISCHILD, StepExpr.AXIS_CHILD);
- static final protected Axis AXIS_ATTRIBUTE = new
Axis(XPathTreeConstants.JJTAXISATTRIBUTE , StepExpr.AXIS_ATTRIBUTE);
- static final protected Axis AXIS_DESCENDANT = new
Axis(XPathTreeConstants.JJTAXISDESCENDANT, StepExpr.AXIS_DESCENDANT);
- static final protected Axis AXIS_SELF = new
Axis(XPathTreeConstants.JJTAXISSELF, StepExpr.AXIS_SELF);
- static final protected Axis AXIS_DESCENDANTORSELF = new
Axis(XPathTreeConstants.JJTAXISDESCENDANTORSELF,
StepExpr.AXIS_DESCENDANT_OR_SELF);
- static final protected Axis AXIS_FOLLOWINGSIBLING = new
Axis(XPathTreeConstants.JJTAXISFOLLOWINGSIBLING,
StepExpr.AXIS_FOLLOWING_SIBLING);
- static final protected Axis AXIS_FOLLOWING = new
Axis(XPathTreeConstants.JJTAXISFOLLOWING, StepExpr.AXIS_FOLLOWING);
- static final protected Axis AXIS_NAMESPACE = new
Axis(XPathTreeConstants.JJTAXISNAMESPACE, StepExpr.AXIS_NAMESPACE);
- static final protected Axis AXIS_PARENT = new
Axis(XPathTreeConstants.JJTAXISPARENT, StepExpr.AXIS_PARENT);
- static final protected Axis AXIS_ANCESTOR = new
Axis(XPathTreeConstants.JJTAXISANCESTOR, StepExpr.AXIS_ANCESTOR);
- static final protected Axis AXIS_PRECEDINGSIBLING = new
Axis(XPathTreeConstants.JJTAXISPRECEDINGSIBLING,
StepExpr.AXIS_PRECEDING_SIBLING);
- static final protected Axis AXIS_PRECEDING = new
Axis(XPathTreeConstants.JJTAXISPRECEDING, StepExpr.AXIS_PRECEDING);
- static final protected Axis AXIS_ANCESTORORSELF = new
Axis(XPathTreeConstants.JJTAXISANCESTORORSELF, StepExpr.AXIS_ANCESTOR_OR_SELF);
-
- short m_axis;
-
- /**
- * Constructor for Axis.
- * @param i
- */
- private Axis(int i) {
- super(i);
- }
-
- /**
- * Constructor for Axis.
- * @param p
- * @param i
- */
- private Axis(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * Constructor for Axis.
- * @param p
- * @param i
- */
- private Axis(int id, short axis) {
- super(id);
- m_axis = axis;
- }
-
- /**
- *
- */
- public short getAxis() {
- return m_axis;
- }
-
- /**
- *
- */
- public int getId() {
- return id;
- }
-
-
-
-}
+/*
+ * 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.impl.parser;
+
+import org.apache.xpath.rwapi.expression.StepExpr;
+
+/**
+ *
+ */
+public class Axis extends SimpleNode {
+
+ static final protected Axis AXIS_CHILD = new
Axis(XPathTreeConstants.JJTAXISCHILD, StepExpr.AXIS_CHILD);
+ static final protected Axis AXIS_ATTRIBUTE = new
Axis(XPathTreeConstants.JJTAXISATTRIBUTE , StepExpr.AXIS_ATTRIBUTE);
+ static final protected Axis AXIS_DESCENDANT = new
Axis(XPathTreeConstants.JJTAXISDESCENDANT, StepExpr.AXIS_DESCENDANT);
+ static final protected Axis AXIS_SELF = new
Axis(XPathTreeConstants.JJTAXISSELF, StepExpr.AXIS_SELF);
+ static final protected Axis AXIS_DESCENDANTORSELF = new
Axis(XPathTreeConstants.JJTAXISDESCENDANTORSELF,
StepExpr.AXIS_DESCENDANT_OR_SELF);
+ static final protected Axis AXIS_FOLLOWINGSIBLING = new
Axis(XPathTreeConstants.JJTAXISFOLLOWINGSIBLING,
StepExpr.AXIS_FOLLOWING_SIBLING);
+ static final protected Axis AXIS_FOLLOWING = new
Axis(XPathTreeConstants.JJTAXISFOLLOWING, StepExpr.AXIS_FOLLOWING);
+ static final protected Axis AXIS_NAMESPACE = new
Axis(XPathTreeConstants.JJTAXISNAMESPACE, StepExpr.AXIS_NAMESPACE);
+ static final protected Axis AXIS_PARENT = new
Axis(XPathTreeConstants.JJTAXISPARENT, StepExpr.AXIS_PARENT);
+ static final protected Axis AXIS_ANCESTOR = new
Axis(XPathTreeConstants.JJTAXISANCESTOR, StepExpr.AXIS_ANCESTOR);
+ static final protected Axis AXIS_PRECEDINGSIBLING = new
Axis(XPathTreeConstants.JJTAXISPRECEDINGSIBLING,
StepExpr.AXIS_PRECEDING_SIBLING);
+ static final protected Axis AXIS_PRECEDING = new
Axis(XPathTreeConstants.JJTAXISPRECEDING, StepExpr.AXIS_PRECEDING);
+ static final protected Axis AXIS_ANCESTORORSELF = new
Axis(XPathTreeConstants.JJTAXISANCESTORORSELF, StepExpr.AXIS_ANCESTOR_OR_SELF);
+
+ short m_axis;
+
+ /**
+ * Constructor for Axis.
+ * @param i
+ */
+ private Axis(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for Axis.
+ * @param p
+ * @param i
+ */
+ private Axis(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * Constructor for Axis.
+ * @param p
+ * @param i
+ */
+ private Axis(int id, short axis) {
+ super(id);
+ m_axis = axis;
+ }
+
+ /**
+ *
+ */
+ public short getAxis() {
+ return m_axis;
+ }
+
+ /**
+ *
+ */
+ public int getId() {
+ return id;
+ }
+
+
+
+}
1.1.2.3 +101 -101
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/KindTest.java
Index: KindTest.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/KindTest.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- KindTest.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ KindTest.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -1,101 +1,101 @@
-/*
- * 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.impl.parser;
-
-import org.apache.xpath.rwapi.expression.NodeTest;
-
-/**
- *
- */
-public class KindTest extends SimpleNode {
-
- /**
- * Constructor for KindTest.
- * @param i
- */
- public KindTest(int i) {
- super(i);
- }
-
- /**
- * Constructor for KindTest.
- * @param p
- * @param i
- */
- public KindTest(XPath p, int i) {
- super(p, i);
- }
-
- /**
- *
- */
- public short getKindTest() {
- switch (id) {
- case XPathTreeConstants.JJTPROCESSINGINSTRUCTIONTEST :
//69;
- return NodeTest.PROCESSING_INSTRUCTION_TEST;
- case XPathTreeConstants.JJTCOMMENTTEST : //71;
- return NodeTest.COMMENT_TEST;
-
- case XPathTreeConstants.JJTTEXTTEST : //72;
- return NodeTest.TEXT_TEST;
-
- case XPathTreeConstants.JJTANYKINDTEST : //73;
- return NodeTest.ANY_KIND_TEST;
- }
- return -1;
- }
-
-}
+/*
+ * 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.impl.parser;
+
+import org.apache.xpath.rwapi.expression.NodeTest;
+
+/**
+ *
+ */
+public class KindTest extends SimpleNode {
+
+ /**
+ * Constructor for KindTest.
+ * @param i
+ */
+ public KindTest(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for KindTest.
+ * @param p
+ * @param i
+ */
+ public KindTest(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ *
+ */
+ public short getKindTest() {
+ switch (id) {
+ case XPathTreeConstants.JJTPROCESSINGINSTRUCTIONTEST :
//69;
+ return NodeTest.PROCESSING_INSTRUCTION_TEST;
+ case XPathTreeConstants.JJTCOMMENTTEST : //71;
+ return NodeTest.COMMENT_TEST;
+
+ case XPathTreeConstants.JJTTEXTTEST : //72;
+ return NodeTest.TEXT_TEST;
+
+ case XPathTreeConstants.JJTANYKINDTEST : //73;
+ return NodeTest.ANY_KIND_TEST;
+ }
+ return -1;
+ }
+
+}
1.1.2.3 +104 -104
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Predicates.java
Index: Predicates.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Predicates.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Predicates.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ Predicates.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -1,104 +1,104 @@
-/*
- * 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.impl.parser;
-
-/**
- *
- */
-public class Predicates extends SimpleNode {
-
- /**
- * Constructor for Predicates.
- * @param i
- */
- public Predicates(int i) {
- super(i);
- }
-
- /**
- * Constructor for Predicates.
- * @param p
- * @param i
- */
- public Predicates(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- // Filter bracket
- if ( n.getId() == XPathTreeConstants.JJTLBRACK || n.getId() ==
XPathTreeConstants.JJTRBRACK ) {
- // filter
- } else {
- int last = (children == null) ? 0 : children.length;
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), last);
- } else {
- super.jjtAddChild(n, last);
- }
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return true;
- }
-
-}
+/*
+ * 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.impl.parser;
+
+/**
+ *
+ */
+public class Predicates extends SimpleNode {
+
+ /**
+ * Constructor for Predicates.
+ * @param i
+ */
+ public Predicates(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for Predicates.
+ * @param p
+ * @param i
+ */
+ public Predicates(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ // Filter bracket
+ if ( n.getId() == XPathTreeConstants.JJTLBRACK || n.getId() ==
XPathTreeConstants.JJTRBRACK ) {
+ // filter
+ } else {
+ int last = (children == null) ? 0 : children.length;
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), last);
+ } else {
+ super.jjtAddChild(n, last);
+ }
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return true;
+ }
+
+}
1.1.2.3 +148 -148
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/QName.java
Index: QName.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/QName.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- QName.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ QName.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -1,148 +1,148 @@
-/*
- * 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.impl.parser;
-
-import org.apache.xpath.rwapi.expression.NodeTest;
-
-/**
- *
- */
-public class QName extends SimpleNode {
-
- //PrefixResolver m_prefixResolver;
- //org.apache.xml.utils.QName m_qname;
- String m_localPart;
- String m_prefix;
-
-
- /**
- * Constructor for QName.
- * @param i
- */
- public QName(int i) {
- super(i);
- }
-
- /**
- * Constructor for QName.
- * @param p
- * @param i
- */
- public QName(XPath p, int i) {
- super(p, i);
- //m_prefixResolver = p.m_prefixResolver;
- }
-
- /**
- * @see org.apache.xpath.parser.SimpleNode#processToken(Token)
- */
- public void processToken(Token t) {
- super.processToken(t);
-
- switch (id) {
- case XPathTreeConstants.JJTSTAR :
- m_prefix = null;
- m_localPart = NodeTest.WILDCARD;
- break;
- case XPathTreeConstants.JJTSTARCOLONNCNAME :
- m_prefix = NodeTest.WILDCARD;
- m_localPart = t.image.trim();
-
m_localPart=m_localPart.substring(m_localPart.indexOf(":")+1);
- break;
- case XPathTreeConstants.JJTNCNAMECOLONSTAR :
- case XPathTreeConstants.JJTQNAME :
- case XPathTreeConstants.JJTQNAMELPAR :
- String qname = t.image;
- int parenIndex = qname.lastIndexOf("(");
- if (parenIndex > 0) {
- qname = qname.substring(0,
qname.lastIndexOf("("));
- }
- qname = qname.trim();
- //m_qname = new
org.apache.xml.utils.QName(qname, m_prefixResolver);
- int colonIdx = qname.indexOf(":");
- if ( colonIdx == -1 ) {
- m_prefix = null;
- m_localPart = qname;
- } else {
- m_prefix = qname.substring(0, colonIdx );
- m_localPart = qname.substring(colonIdx + 1);
- }
- break;
-
-
- default:
- throw new RuntimeException( "Invalid jjtree id: don't correspond
to a QName id=" + id);
- }
- }
-
-
- /**
- * Returns the localPart.
- * @return String
- */
- public String getLocalPart() {
- return m_localPart;
- }
-
- /**
- * Returns the prefix.
- * @return String
- */
- public String getPrefix() {
- return m_prefix;
- }
-
-}
+/*
+ * 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.impl.parser;
+
+import org.apache.xpath.rwapi.expression.NodeTest;
+
+/**
+ *
+ */
+public class QName extends SimpleNode {
+
+ //PrefixResolver m_prefixResolver;
+ //org.apache.xml.utils.QName m_qname;
+ String m_localPart;
+ String m_prefix;
+
+
+ /**
+ * Constructor for QName.
+ * @param i
+ */
+ public QName(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for QName.
+ * @param p
+ * @param i
+ */
+ public QName(XPath p, int i) {
+ super(p, i);
+ //m_prefixResolver = p.m_prefixResolver;
+ }
+
+ /**
+ * @see org.apache.xpath.parser.SimpleNode#processToken(Token)
+ */
+ public void processToken(Token t) {
+ super.processToken(t);
+
+ switch (id) {
+ case XPathTreeConstants.JJTSTAR :
+ m_prefix = null;
+ m_localPart = NodeTest.WILDCARD;
+ break;
+ case XPathTreeConstants.JJTSTARCOLONNCNAME :
+ m_prefix = NodeTest.WILDCARD;
+ m_localPart = t.image.trim();
+
m_localPart=m_localPart.substring(m_localPart.indexOf(":")+1);
+ break;
+ case XPathTreeConstants.JJTNCNAMECOLONSTAR :
+ case XPathTreeConstants.JJTQNAME :
+ case XPathTreeConstants.JJTQNAMELPAR :
+ String qname = t.image;
+ int parenIndex = qname.lastIndexOf("(");
+ if (parenIndex > 0) {
+ qname = qname.substring(0,
qname.lastIndexOf("("));
+ }
+ qname = qname.trim();
+ //m_qname = new
org.apache.xml.utils.QName(qname, m_prefixResolver);
+ int colonIdx = qname.indexOf(":");
+ if ( colonIdx == -1 ) {
+ m_prefix = null;
+ m_localPart = qname;
+ } else {
+ m_prefix = qname.substring(0, colonIdx );
+ m_localPart = qname.substring(colonIdx + 1);
+ }
+ break;
+
+
+ default:
+ throw new RuntimeException( "Invalid jjtree id: don't correspond
to a QName id=" + id);
+ }
+ }
+
+
+ /**
+ * Returns the localPart.
+ * @return String
+ */
+ public String getLocalPart() {
+ return m_localPart;
+ }
+
+ /**
+ * Returns the prefix.
+ * @return String
+ */
+ public String getPrefix() {
+ return m_prefix;
+ }
+
+}
1.1.2.3 +280 -89
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/SimpleNode.java
Index: SimpleNode.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/SimpleNode.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- SimpleNode.java 23 Jan 2003 19:36:49 -0000 1.1.2.2
+++ SimpleNode.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -16,14 +16,16 @@
import org.apache.xpath.rwapi.impl.VariableImpl;
-public class SimpleNode implements Node
+/**
+ *
+ */
+public class SimpleNode implements Node, NodeFactory
{
static public final boolean PRODUCE_RAW_TREE = false;
protected Node parent; // to remove
protected Node[] children; // to remove
protected int id; // to remove
- // protected XPath parser;
protected SimpleNode() {}
public SimpleNode(int i)
@@ -34,8 +36,6 @@
public SimpleNode(XPath p, int i)
{
this(i);
-
- // parser = p;
}
public static Node jjtCreate(XPath p, int id)
@@ -46,12 +46,17 @@
}
Node newNode;
+ NodeFactory nodeFactory = (p.m_nodeFactory == null) ? p :
p.m_nodeFactory;
switch (id)
{
case XPathTreeConstants.JJTNAMETEST:
- newNode = new NameTestImpl(id);
+ newNode = (NameTestImpl) nodeFactory.createNode(id);
+ if (newNode == null)
+ {
+ newNode = new NameTestImpl(id);
+ }
break;
case XPathTreeConstants.JJTQNAME:
@@ -59,232 +64,409 @@
case XPathTreeConstants.JJTSTAR:
case XPathTreeConstants.JJTNCNAMECOLONSTAR:
case XPathTreeConstants.JJTSTARCOLONNCNAME:
- newNode = new QName(id);
+ newNode = (QName) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new QName(id);
+ }
break;
- case XPathTreeConstants.JJTKINDTEST: //68;
- newNode = new KindTestImpl(id);
+ case XPathTreeConstants.JJTKINDTEST:
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new KindTestImpl(id);
+ }
break;
- case XPathTreeConstants.JJTPROCESSINGINSTRUCTIONTEST: //69;
- case XPathTreeConstants.JJTCOMMENTTEST: //71;
- case XPathTreeConstants.JJTTEXTTEST: //72;
- case XPathTreeConstants.JJTANYKINDTEST: //73;
- newNode = new KindTest(id);
+ case XPathTreeConstants.JJTPROCESSINGINSTRUCTIONTEST:
+ case XPathTreeConstants.JJTCOMMENTTEST:
+ case XPathTreeConstants.JJTTEXTTEST:
+ case XPathTreeConstants.JJTANYKINDTEST:
+ newNode = (KindTest) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new KindTest(id);
+ }
break;
- case XPathTreeConstants.JJTSTEPEXPR: //42;
- newNode = new StepExprImpl(id);
+ case XPathTreeConstants.JJTSTEPEXPR:
+ newNode = (StepExprImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new StepExprImpl(id);
+ }
break;
case XPathTreeConstants.JJTAXISCHILD:
- newNode = Axis.AXIS_CHILD;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_CHILD;
+ }
break;
case XPathTreeConstants.JJTAXISATTRIBUTE:
- newNode = Axis.AXIS_ATTRIBUTE;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_ATTRIBUTE;
+ }
break;
case XPathTreeConstants.JJTAXISDESCENDANT:
- newNode = Axis.AXIS_DESCENDANT;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_DESCENDANT;
+ }
break;
case XPathTreeConstants.JJTAXISSELF:
- newNode = Axis.AXIS_SELF;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_SELF;
+ }
break;
case XPathTreeConstants.JJTAXISDESCENDANTORSELF:
- newNode = Axis.AXIS_DESCENDANTORSELF;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_DESCENDANTORSELF;
+ }
break;
case XPathTreeConstants.JJTAXISFOLLOWINGSIBLING:
- newNode = Axis.AXIS_FOLLOWINGSIBLING;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_FOLLOWINGSIBLING;
+ }
break;
case XPathTreeConstants.JJTAXISFOLLOWING:
- newNode = Axis.AXIS_FOLLOWING;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_FOLLOWING;
+ }
break;
case XPathTreeConstants.JJTAXISNAMESPACE:
- newNode = Axis.AXIS_NAMESPACE;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_NAMESPACE;
+ }
break;
case XPathTreeConstants.JJTAXISPARENT:
- newNode = Axis.AXIS_PARENT;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_PARENT;
+ }
break;
case XPathTreeConstants.JJTAXISANCESTOR:
- newNode = Axis.AXIS_ANCESTOR;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_ANCESTOR;
+ }
break;
case XPathTreeConstants.JJTAXISPRECEDINGSIBLING:
- newNode = Axis.AXIS_PRECEDINGSIBLING;
+ newNode = (Axis) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_PRECEDINGSIBLING;
+ }
break;
case XPathTreeConstants.JJTAXISPRECEDING:
- newNode = Axis.AXIS_PRECEDING;
+ newNode = (Axis) nodeFactory.createNode(id);
- break;
-
- case XPathTreeConstants.JJTAXISANCESTORORSELF:
- newNode = Axis.AXIS_ANCESTORORSELF;
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_PRECEDING;
+ }
break;
- case XPathTreeConstants.JJTDOT:
- newNode = new SimpleNode(id);
-
- break;
+ case XPathTreeConstants.JJTAXISANCESTORORSELF:
+ newNode = (Axis) nodeFactory.createNode(id);
- case XPathTreeConstants.JJTDOTDOT:
- newNode = Singletons.DOTDOT;
+ if (newNode == null)
+ {
+ newNode = Axis.AXIS_ANCESTORORSELF;
+ }
break;
- case XPathTreeConstants.JJTAT:
- newNode = Singletons.AT;
-
- break;
+
case XPathTreeConstants.JJTUNARYEXPR:
- newNode = new OperatorImpl(id);
-
- break;
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
- case XPathTreeConstants.JJTPLUS:
- newNode = Singletons.PLUS;
- break;
+ if (newNode == null)
+ {
+ newNode = new OperatorImpl(id);
+ }
- case XPathTreeConstants.JJTMINUS:
+ break;
- newNode = Singletons.MINUS;
- break;
case XPathTreeConstants.JJTINTEGERLITERAL:
case XPathTreeConstants.JJTDOUBLELITERAL:
case XPathTreeConstants.JJTSTRINGLITERAL:
case XPathTreeConstants.JJTDECIMALLITERAL:
- newNode = new LiteralImpl(id);
+ newNode = (LiteralImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new LiteralImpl(id);
+ }
break;
case XPathTreeConstants.JJTCASTEXPR:
- newNode = new CastExprImpl(id);
+ newNode = (CastExprImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new CastExprImpl(id);
+ }
break;
case XPathTreeConstants.JJTCASTABLEEXPR:
- newNode = new CastableExprImpl(id);
+ newNode = (CastableExprImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new CastableExprImpl(id);
+ }
break;
case XPathTreeConstants.JJTINSTANCEOFEXPR:
- newNode = new InstanceOfExprImpl(id);
+ newNode = (InstanceOfExprImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new InstanceOfExprImpl(id);
+ }
break;
case XPathTreeConstants.JJTQUANTIFIEDEXPR:
case XPathTreeConstants.JJTFLWREXPR:
- newNode = new ForAndQuantifiedExprImpl(id);
+ newNode = (ForAndQuantifiedExprImpl)
nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new ForAndQuantifiedExprImpl(id);
+ }
break;
case XPathTreeConstants.JJTIFEXPR:
- newNode = new ConditionalExprImpl(id);
+ newNode = (ConditionalExprImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new ConditionalExprImpl(id);
+ }
break;
case XPathTreeConstants.JJTEXPRSEQUENCE:
- newNode = new OperatorImpl(id);
+ newNode = (OperatorImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new OperatorImpl(id);
+ }
break;
- case XPathTreeConstants.JJTXPATH:
- newNode = XPathNode.m_singleton;
+ case XPathTreeConstants.JJTPATHEXPR:
+ newNode = (PathExprImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new PathExprImpl(id);
+ }
break;
- case XPathTreeConstants.JJTXPATH2:
- newNode = XPath2Node.m_singleton;
+ case XPathTreeConstants.JJTNODETEST:
+ newNode = (SimpleNode) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new SimpleNode(id); //Singletons.NODETEST;
+ }
break;
- case XPathTreeConstants.JJTPATHEXPR:
- newNode = new PathExprImpl(id);
+ case XPathTreeConstants.JJTADDITIVEEXPR:
+ case XPathTreeConstants.JJTMULTIPLICATIVEEXPR:
+ case XPathTreeConstants.JJTUNIONEXPR:
+ case XPathTreeConstants.JJTRANGEEXPR:
+ case XPathTreeConstants.JJTOREXPR:
+ case XPathTreeConstants.JJTANDEXPR:
+ case XPathTreeConstants.JJTCOMPARISONEXPR:
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new OperatorImpl(id);
+ }
break;
- case XPathTreeConstants.JJTSLASH:
- newNode = Singletons.SLASH;
+ case XPathTreeConstants.JJTFUNCTIONCALL:
+ newNode = (FunctionCallImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new FunctionCallImpl(id);
+ }
break;
- case XPathTreeConstants.JJTNODETEST:
- newNode = new SimpleNode(id); //Singletons.NODETEST;
+ case XPathTreeConstants.JJTVARNAME:
+ newNode = (VariableImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new VariableImpl(id);
+ }
break;
- case XPathTreeConstants.JJTPREDICATES:
- newNode = new Predicates(id); // can use a singleton
+ // The nodes belows are filtered: no customisation possible
+ case XPathTreeConstants.JJTDOTDOT:
+ newNode = Singletons.DOTDOT;
break;
- case XPathTreeConstants.JJTFUNCTIONCALL:
- newNode = new FunctionCallImpl(id);
+ case XPathTreeConstants.JJTAT:
+ newNode = Singletons.AT;
break;
- case XPathTreeConstants.JJTVARNAME:
- newNode = new VariableImpl(id);
+ case XPathTreeConstants.JJTPLUS:
+ newNode = Singletons.PLUS;
break;
- case XPathTreeConstants.JJTROOT:
- newNode = Singletons.ROOT;
+ case XPathTreeConstants.JJTMINUS:
+ newNode = Singletons.MINUS;
break;
- case XPathTreeConstants.JJTROOTDESCENDANTS:
- newNode = Singletons.ROOTDESCENDANT;
+ case XPathTreeConstants.JJTXPATH:
+ newNode = XPathNode.m_singleton;
break;
- case XPathTreeConstants.JJTADDITIVEEXPR:
- case XPathTreeConstants.JJTMULTIPLICATIVEEXPR:
- case XPathTreeConstants.JJTUNIONEXPR:
- case XPathTreeConstants.JJTRANGEEXPR:
- case XPathTreeConstants.JJTOREXPR:
- case XPathTreeConstants.JJTANDEXPR:
- case XPathTreeConstants.JJTCOMPARISONEXPR:
- newNode = new OperatorImpl(id);
+ case XPathTreeConstants.JJTXPATH2:
+ newNode = XPath2Node.m_singleton;
+
+ break;
+ case XPathTreeConstants.JJTDOT:
+ newNode = Singletons.DOT;
+ break;
+
+ case XPathTreeConstants.JJTSLASH:
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Singletons.SLASH;
+ }
+
+ break;
+
+ case XPathTreeConstants.JJTPREDICATES:
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = new Predicates(id); // can use a singleton
+ }
+
+ break;
+
+ case XPathTreeConstants.JJTROOT:
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Singletons.ROOT;
+ }
+
+ break;
+
+ case XPathTreeConstants.JJTROOTDESCENDANTS:
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Singletons.ROOTDESCENDANT;
+ }
break;
case XPathTreeConstants.JJTSLASHSLASH:
- newNode = Singletons.SLASHSLASH;
+ newNode = (KindTestImpl) nodeFactory.createNode(id);
+
+ if (newNode == null)
+ {
+ newNode = Singletons.SLASHSLASH;
+ }
break;
-
+
case XPathTreeConstants.JJTMATCHPATTERN:
case XPathTreeConstants.JJTPATTERN:
case XPathTreeConstants.JJTPATHPATTERN:
case XPathTreeConstants.JJTVOID:
case XPathTreeConstants.JJTPATTERNSTEP:
-
case XPathTreeConstants.JJTIDKEYPATTERN:
case XPathTreeConstants.JJTRETURN:
case XPathTreeConstants.JJTSOME:
@@ -325,7 +507,6 @@
case XPathTreeConstants.JJTOCCURRENCEINDICATOR: //105;
case XPathTreeConstants.JJTMULTIPLY: //106;
case XPathTreeConstants.JJTQMARK: //107;
-
default:
@@ -477,4 +658,14 @@
}
}
}
+
+
+ /**
+ * Default implementation: no customization
+ * @see org.apache.xpath.rwapi.impl.parser.NodeFactory#createNode(int)
+ */
+ public Node createNode(int id) {
+ return null;
+ }
+
}
1.1.2.4 +151 -140
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Singletons.java
Index: Singletons.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/Singletons.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Singletons.java 30 Jan 2003 00:45:41 -0000 1.1.2.3
+++ Singletons.java 5 Feb 2003 16:09:48 -0000 1.1.2.4
@@ -1,140 +1,151 @@
-/*
- * 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.impl.parser;
-
-import org.apache.xpath.rwapi.expression.NodeTest;
-import org.apache.xpath.rwapi.expression.StepExpr;
-import org.apache.xpath.rwapi.impl.KindTestImpl;
-import org.apache.xpath.rwapi.impl.StepExprImpl;
-
-
-/**
- *
- */
-public class Singletons extends SimpleNode
-{
- /**
- * DotDot singleton
- */
- static final protected Singletons DOTDOT = new
Singletons(XPathTreeConstants.JJTDOTDOT);
-
- /**
- * Slash singleton
- */
- static final protected Singletons SLASH = new
Singletons(XPathTreeConstants.JJTSLASH);
-
- /**
- * At singleton
- */
- static final protected Singletons AT = new
Singletons(XPathTreeConstants.JJTAT);
-
- /**
- * NodeTest singleton
- */
- static final protected Singletons NODETEST = new
Singletons(XPathTreeConstants.JJTNODETEST);
-
- /**
- * Root singleton
- */
- static final protected Singletons ROOT = new
Singletons(XPathTreeConstants.JJTROOT);
-
- /**
- * Root descendants singleton
- */
- static final protected Singletons ROOTDESCENDANT = new
Singletons(XPathTreeConstants.JJTROOTDESCENDANTS);
-
- /**
- * Minus singleton
- */
- static final protected Singletons MINUS = new
Singletons(XPathTreeConstants.JJTMINUS);
-
- /**
- * Plus singleton
- */
- static final protected Singletons PLUS = new
Singletons(XPathTreeConstants.JJTPLUS);
-
- /**
- * SlashSlash singleton
- */
- static final public StepExprImpl SLASHSLASH;
-
- static
- {
- KindTestImpl kt = new KindTestImpl();
- kt.setKindTest(NodeTest.ANY_KIND_TEST);
-
- SLASHSLASH = new StepExprImpl(StepExpr.AXIS_DESCENDANT_OR_SELF, kt);
- }
-
- /**
- * Constructor for Singletons.
- * @param i
- */
- private Singletons(int i)
- {
- super(i);
- }
-
- /**
- * Constructor for Singletons.
- * @param p
- * @param i
- */
- private Singletons(XPath p, int i)
- {
- super(p, i);
- }
-}
+/*
+ * 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.impl.parser;
+
+import org.apache.xpath.rwapi.expression.NodeTest;
+import org.apache.xpath.rwapi.expression.StepExpr;
+import org.apache.xpath.rwapi.impl.KindTestImpl;
+import org.apache.xpath.rwapi.impl.StepExprImpl;
+
+
+/**
+ *
+ */
+public class Singletons extends SimpleNode
+{
+ /**
+ * DotDot singleton
+ */
+ static final protected Singletons DOTDOT = new
Singletons(XPathTreeConstants.JJTDOTDOT);
+
+ /**
+ * Slash singleton
+ */
+ static final protected Singletons SLASH = new
Singletons(XPathTreeConstants.JJTSLASH);
+
+ /**
+ * At singleton
+ */
+ static final protected Singletons AT = new
Singletons(XPathTreeConstants.JJTAT);
+
+ /**
+ * NodeTest singleton
+ */
+ static final protected Singletons NODETEST = new
Singletons(XPathTreeConstants.JJTNODETEST);
+
+ /**
+ * Root singleton
+ */
+ static final protected Singletons ROOT = new
Singletons(XPathTreeConstants.JJTROOT);
+
+ /**
+ * Root descendants singleton
+ */
+ static final protected Singletons ROOTDESCENDANT = new
Singletons(XPathTreeConstants.JJTROOTDESCENDANTS);
+
+ /**
+ * Minus singleton
+ */
+ static final protected Singletons MINUS = new
Singletons(XPathTreeConstants.JJTMINUS);
+
+ /**
+ * Plus singleton
+ */
+ static final protected Singletons PLUS = new
Singletons(XPathTreeConstants.JJTPLUS);
+
+ /**
+ * SlashSlash singleton
+ */
+ static final public StepExprImpl SLASHSLASH;
+
+ /**
+ * Dot singleton
+ */
+ static final protected StepExprImpl DOT;
+
+ static
+ {
+ KindTestImpl kt = new KindTestImpl();
+ kt.setKindTest(NodeTest.ANY_KIND_TEST);
+
+ SLASHSLASH = new StepExprImpl(StepExpr.AXIS_DESCENDANT_OR_SELF, kt);
+
+ kt = new KindTestImpl();
+
+ // well use any kind test for dot, but it's more than
that..
+ kt.setKindTest(NodeTest.ANY_KIND_TEST);
+ DOT = new StepExprImpl(StepExpr.AXIS_SELF, kt);
+ }
+
+ /**
+ * Constructor for Singletons.
+ * @param i
+ */
+ private Singletons(int i)
+ {
+ super(i);
+ }
+
+ /**
+ * Constructor for Singletons.
+ * @param p
+ * @param i
+ */
+ private Singletons(XPath p, int i)
+ {
+ super(p, i);
+ }
+}
1.1.2.3 +29 -1
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.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XPath.java 23 Jan 2003 19:36:50 -0000 1.1.2.2
+++ XPath.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -4,11 +4,17 @@
import java.util.Stack;
-public class XPath/[EMAIL PROTECTED](jjtree)*/implements XPathTreeConstants,
XPathConstants {/[EMAIL PROTECTED](jjtree)*/
+public class XPath implements/[EMAIL PROTECTED](jjtree)*/
XPathTreeConstants,NodeFactory, XPathConstants {/[EMAIL PROTECTED](jjtree)*/
protected JJTXPathState jjtree = new JJTXPathState();
org.apache.xml.utils.PrefixResolver m_prefixResolver;
org.apache.xpath.patterns.FunctionPattern m_matchFunc = null; // short
lived.
+
+ /**
+ * Node factory for customized parser
+ */
+ NodeFactory m_nodeFactory;
+
int m_predLevel = 0;
public void setPrefixResolver(org.apache.xml.utils.PrefixResolver
resolver)
@@ -21,6 +27,21 @@
return m_prefixResolver;
}
+ /**
+ * Sets the node factory
+ */
+ public void setNodeFactory(NodeFactory nodeFactory) {
+ m_nodeFactory = nodeFactory;
+ }
+
+ /**
+ * Returns the node factory.
+ * @return NodeFactory
+ */
+ public NodeFactory getNodeFactory() {
+ return m_nodeFactory;
+ }
+
/**
* The "version" property.
* @serial
@@ -52,6 +73,13 @@
boolean m_isMatchPattern = false;
Stack binaryTokenStack = new Stack();
+
+ public Node createNode(int id) {
+ return null;
+ }
+
+
+
public static void main(String args[])
throws Exception
{
1.1.2.3 +105 -105
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPath2Node.java
Index: XPath2Node.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPath2Node.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XPath2Node.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ XPath2Node.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -1,105 +1,105 @@
-/*
- * 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.impl.parser;
-
-
-
-/**
- *
- */
-public class XPath2Node extends SimpleNode {
-
- /**
- * Singleton
- */
- static final protected XPath2Node m_singleton = new
XPath2Node(XPathTreeConstants.JJTXPATH2);
-
- /**
- * Constructor for XPath.
- * @param i
- */
- public XPath2Node(int i) {
- super(i);
- }
-
- /**
- * Constructor for XPath.
- * @param p
- * @param i
- */
- public XPath2Node(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return true;
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
- */
- public void jjtAddChild(Node n, int i) {
- if (((SimpleNode) n).canBeReduced()) {
- super.jjtAddChild(n.jjtGetChild(0), i);
- } else {
- super.jjtAddChild(n, i);
- }
- }
-
-}
+/*
+ * 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.impl.parser;
+
+
+
+/**
+ *
+ */
+public class XPath2Node extends SimpleNode {
+
+ /**
+ * Singleton
+ */
+ static final protected XPath2Node m_singleton = new
XPath2Node(XPathTreeConstants.JJTXPATH2);
+
+ /**
+ * Constructor for XPath.
+ * @param i
+ */
+ public XPath2Node(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for XPath.
+ * @param p
+ * @param i
+ */
+ public XPath2Node(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return true;
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.Node#jjtAddChild(Node, int)
+ */
+ public void jjtAddChild(Node n, int i) {
+ if (((SimpleNode) n).canBeReduced()) {
+ super.jjtAddChild(n.jjtGetChild(0), i);
+ } else {
+ super.jjtAddChild(n, i);
+ }
+ }
+
+}
1.1.2.3 +95 -95
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathNode.java
Index: XPathNode.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/parser/Attic/XPathNode.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XPathNode.java 30 Jan 2003 00:45:41 -0000 1.1.2.2
+++ XPathNode.java 5 Feb 2003 16:09:48 -0000 1.1.2.3
@@ -1,95 +1,95 @@
-/*
- * 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.impl.parser;
-
-
-
-/**
- *
- */
-public class XPathNode extends SimpleNode {
-
- /**
- * Singleton
- */
- static final protected XPathNode m_singleton = new
XPathNode(XPathTreeConstants.JJTXPATH);
-
-
- /**
- * Constructor for XPath.
- * @param i
- */
- public XPathNode(int i) {
- super(i);
- }
-
- /**
- * Constructor for XPath.
- * @param p
- * @param i
- */
- public XPathNode(XPath p, int i) {
- super(p, i);
- }
-
- /**
- * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
- */
- public boolean canBeReduced() {
- return true;
- }
-
-}
+/*
+ * 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.impl.parser;
+
+
+
+/**
+ *
+ */
+public class XPathNode extends SimpleNode {
+
+ /**
+ * Singleton
+ */
+ static final protected XPathNode m_singleton = new
XPathNode(XPathTreeConstants.JJTXPATH);
+
+
+ /**
+ * Constructor for XPath.
+ * @param i
+ */
+ public XPathNode(int i) {
+ super(i);
+ }
+
+ /**
+ * Constructor for XPath.
+ * @param p
+ * @param i
+ */
+ public XPathNode(XPath p, int i) {
+ super(p, i);
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.impl.parser.SimpleNode#canBeReduced()
+ */
+ public boolean canBeReduced() {
+ return true;
+ }
+
+}
No revision
No revision
1.1.2.3 +100 -100
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/EvaluatorImpl.java
Index: EvaluatorImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/EvaluatorImpl.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- EvaluatorImpl.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ EvaluatorImpl.java 5 Feb 2003 16:09:49 -0000 1.1.2.3
@@ -1,100 +1,100 @@
-/*
- * 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.impl.xalan;
-
-import javax.xml.transform.TransformerException;
-
-import org.apache.xpath.XPathAPI;
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xpath.rwapi.XPathException;
-import org.apache.xpath.rwapi.eval.Evaluator;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.ExprContext;
-import org.apache.xpath.rwapi.impl.ExprContextImpl;
-
-/**
- *
- */
-public class EvaluatorImpl implements Evaluator {
-
- /**
- * @see org.apache.xpath.rwapi.eval.Evaluator#createExprContext()
- */
- public ExprContext createExprContext() {
- return new ExprContextImpl();
- }
-
- /**
- * @see org.apache.xpath.rwapi.eval.Evaluator#evaluate(ExprContext,
Expr)
- */
- public Object evaluate(ExprContext ctx, Expr expr) throws
XPathException {
- try {
- XObject xobj = XPathAPI.eval((org.w3c.dom.Node)
ctx.getDynamicContext().getContextItem(), expr.getString(true));
- return xobj;
- } catch (TransformerException e) {
- throw new XPathException(e);
- }
- }
-
- /**
- * @see org.apache.xpath.rwapi.eval.Evaluator#match(ExprContext, Expr,
Node)
- */
- public boolean match(ExprContext ctx, Expr expr, Object node) throws
XPathException {
- return false;
- }
-
-}
+/*
+ * 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.impl.xalan;
+
+import javax.xml.transform.TransformerException;
+
+import org.apache.xpath.XPathAPI;
+import org.apache.xpath.objects.XObject;
+
+import org.apache.xpath.rwapi.XPathException;
+import org.apache.xpath.rwapi.eval.Evaluator;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.ExprContext;
+import org.apache.xpath.rwapi.impl.ExprContextImpl;
+
+/**
+ *
+ */
+public class EvaluatorImpl implements Evaluator {
+
+ /**
+ * @see org.apache.xpath.rwapi.eval.Evaluator#createExprContext()
+ */
+ public ExprContext createExprContext() {
+ return new ExprContextImpl();
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.eval.Evaluator#evaluate(ExprContext,
Expr)
+ */
+ public Object evaluate(ExprContext ctx, Expr expr) throws
XPathException {
+ try {
+ XObject xobj = XPathAPI.eval((org.w3c.dom.Node)
ctx.getDynamicContext().getContextItem(), expr.getString(true));
+ return xobj;
+ } catch (TransformerException e) {
+ throw new XPathException(e);
+ }
+ }
+
+ /**
+ * @see org.apache.xpath.rwapi.eval.Evaluator#match(ExprContext, Expr,
Node)
+ */
+ public boolean match(ExprContext ctx, Expr expr, Object node) throws
XPathException {
+ return false;
+ }
+
+}
1.1.2.3 +85 -85
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/XObjectToSequence.java
Index: XObjectToSequence.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/impl/xalan/Attic/XObjectToSequence.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XObjectToSequence.java 30 Jan 2003 00:45:36 -0000 1.1.2.2
+++ XObjectToSequence.java 5 Feb 2003 16:09:49 -0000 1.1.2.3
@@ -1,85 +1,85 @@
-/*
- * 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.impl.xalan;
-
-import org.apache.xpath.objects.XObject;
-
-import org.apache.xpath.rwapi.datamodel.Item;
-import org.apache.xpath.rwapi.datamodel.Sequence;
-
-/**
- *
- */
-public class XObjectToSequence implements Sequence {
-
- XObject m_xobject;
-
- /**
- *
- */
- protected XObjectToSequence(XObject xobj) {
- m_xobject = xobj;
- }
-
-
- /**
- * @see org.apache.xpath.rwapi.datamodel.Sequence#nextItem()
- */
- public Item nextItem() {
- return null;
- }
-
-}
+/*
+ * 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.impl.xalan;
+
+import org.apache.xpath.objects.XObject;
+
+import org.apache.xpath.rwapi.datamodel.Item;
+import org.apache.xpath.rwapi.datamodel.Sequence;
+
+/**
+ *
+ */
+public class XObjectToSequence implements Sequence {
+
+ XObject m_xobject;
+
+ /**
+ *
+ */
+ protected XObjectToSequence(XObject xobj) {
+ m_xobject = xobj;
+ }
+
+
+ /**
+ * @see org.apache.xpath.rwapi.datamodel.Sequence#nextItem()
+ */
+ public Item nextItem() {
+ return null;
+ }
+
+}
No revision
No revision
1.1.2.4 +378 -378
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test.java
Index: Test.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- Test.java 30 Jan 2003 00:45:42 -0000 1.1.2.3
+++ Test.java 5 Feb 2003 16:09:49 -0000 1.1.2.4
@@ -1,378 +1,378 @@
-/*
- * 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.test;
-
-import org.apache.xpath.objects.XObject;
-import org.apache.xpath.rwapi.XPathFactory;
-import org.apache.xpath.rwapi.eval.Evaluator;
-import org.apache.xpath.rwapi.expression.ConditionalExpr;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.ExprContext;
-import org.apache.xpath.rwapi.expression.ExpressionFactory;
-import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
-import org.apache.xpath.rwapi.expression.Literal;
-import org.apache.xpath.rwapi.expression.NodeTest;
-import org.apache.xpath.rwapi.expression.OperatorExpr;
-import org.apache.xpath.rwapi.expression.PathExpr;
-import org.apache.xpath.rwapi.expression.StepExpr;
-import org.apache.xpath.rwapi.expression.Variable;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-import java.io.StringReader;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-
-/**
- * Title:
- * Description:
- * Copyright: Copyright (c) 2001
- * Company:
- * @author
- * @version 1.0
- */
-public class Test
-{
- public Test(String[] args)
- {
- try
- {
- final boolean dumpTree = ((args.length == 1)
- && args[0].equals("-dump")) ? true : false;
-
- /*if(args[0].endsWith(".xquery"))
- {
- System.out.println("Running test for: "+args[0]);
- File file = new File(args[0]);
- FileInputStream fis = new FileInputStream(file);
- XPath parser = new XPath(fis);
- SimpleNode tree = parser.XPath2();
- if(dumpTree)
- tree.dump("|") ;
- }
- else
- {*/
- DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
- DocumentBuilder db = dbf.newDocumentBuilder();
- Document doc = db.parse(ClassLoader.getSystemResourceAsStream(
- "org/apache/xpath/rwapi/test/xpathsamples.xml"));
- doc.normalize();
-
- Element tests = doc.getDocumentElement();
- NodeList testElems = tests.getChildNodes();
- int nChildren = testElems.getLength();
- int testid = 0;
- boolean testSuccess = true;
-
- for (int i = 0; i < nChildren; i++)
- {
- org.w3c.dom.Node node = testElems.item(i);
-
- if (org.w3c.dom.Node.ELEMENT_NODE == node.getNodeType())
- {
- testid++;
-
- String xpathString = ((Element)
node).getAttribute("value");
- System.out.println("Test[" + testid + "]: " +
xpathString);
-
- XPath parser = new XPath(new StringReader(xpathString));
- SimpleNode tree = parser.XPath2();
-
- if (SimpleNode.PRODUCE_RAW_TREE)
- {
- if (dumpTree)
- {
- tree.dump("|");
- }
- }
- else
- {
- Expr expr = (Expr) tree.jjtGetChild(0);
-
- // Gets the reference AST to compare with
- NodeList astNodes = ((Element) node)
- .getElementsByTagName("ast");
-
- if ((astNodes != null) && (astNodes.getLength() >=
1))
- {
- Node astNode = astNodes.item(0);
-
- if (!checkAST((SimpleNode) expr,
- (Element) ((Element)
astNode).getElementsByTagName(
- "node").item(0)))
- {
- System.err.println(
- "Generated AST doesn't match the
reference one");
-
- tree.dump("|");
- }
- }
- else
- {
- System.err.println("No reference AST provided");
- }
-
- String ab = expr.getString(true);
-
- //System.out.println(
- // "Parsed expr (abbreviate form):" + ab);
- //System.out.println(
- // "Parsed expr (non-abbreviate form):"
- // + expr.getString(false));
- if (!ab.equals(xpathString))
- {
- System.err.print(
- "Bad external or internal representation: ");
- System.err.println(ab + " != " + xpathString);
- testSuccess = false;
- }
- }
- }
- }
-
- // }
- if (testSuccess)
- {
- System.out.println("Parsing test successful!!!");
- }
- else
- {
- System.out.println("Parsing Test fails!!!!!!!!!");
- }
-
- // Test creation
- ExpressionFactory exprFct = XPathFactory.newInstance()
- .newExpressionFactory();
-
- Expr expr = exprFct.createExpr("child::tutu[10]");
- System.out.println("tutu[10] =? " + expr.getString(true));
-
- PathExpr pathExpr = exprFct.createPathExpr(true);
- System.out.println("/ =? " + pathExpr.getString(true));
-
- NodeTest nt = exprFct.createNameTest(null, "toto");
- pathExpr.addOperand(exprFct.createStepExpr(StepExpr.AXIS_CHILD,
nt));
- System.out.println("/toto =? " + pathExpr.getString(true));
- System.out.println("/child::toto =? " +
pathExpr.getString(false));
-
- nt = exprFct.createNameTest(null, "titi");
- pathExpr.addOperand(exprFct.createStepExpr(
- StepExpr.AXIS_DESCENDANT, nt));
-
- System.out.println("/toto/descendant::titi =? "
- + pathExpr.getString(true));
- System.out.println("/child::toto/descendant::titi =? "
- + pathExpr.getString(false));
-
- StepExpr se = (StepExpr) pathExpr.getOperand(0); // first step
- se.appendPredicate(exprFct.createIntegerLiteralExpr(50));
- System.out.println("/toto[50]/descendant::titi =? "
- + pathExpr.getString(true));
- System.out.println("/child::toto[50]/descendant::titi =? "
- + pathExpr.getString(false));
-
- // Test visitor
- pathExpr.visit(new Visitor()
- {
- /**
- *
- */
- public boolean visitPath(PathExpr path)
- {
- System.out.println("visit path "
- + path.getString(false));
-
- return true;
- }
-
- /**
- *
- */
- public boolean visitStep(StepExpr step)
- {
- System.out.println("visit step "
- + step.getString(false));
-
- return true;
- }
-
- /**
- *
- */
- public boolean visitLiteral(Literal primary)
- {
- System.out.println(primary.getString(false));
-
- return true;
- }
-
- /**
- *
- */
- public boolean visitOperator(OperatorExpr arithmetic)
- {
- System.out.println(arithmetic.getString(false));
-
- return true;
- }
-
- /**
- *
- */
- public boolean visitConditional(ConditionalExpr
condition)
- {
- System.out.println(condition.getString(false));
-
- return true;
- }
-
- /**
- *
- */
- public boolean visitForOrQuantifiedExpr(
- ForAndQuantifiedExpr expr)
- {
- System.out.println(expr.getString(false));
-
- return true;
- }
-
- /**
- *
- */
- public boolean visitVariable(Variable var)
- {
- return false;
- }
- });
-
- // Evaluation
- Evaluator eval = XPathFactory.newInstance().newEvaluatorFactory()
- .createEvaluator();
-
- ExprContext ctx = eval.createExprContext();
- ctx.getDynamicContext().setContextItem(doc.getDocumentElement());
-
- // exprs
- Expr e = exprFct.createExpr("expr[2]/@value");
- Object res = eval.evaluate(ctx, e);
-
- // Xalan dependent code
- System.out.println("10[$var] ?= " + ((XObject) res).str());
- }
- catch (Exception e)
- {
- System.out.println(e.getMessage());
- e.printStackTrace();
- }
- }
-
- /**
- * Check that the given internal representation of expr match the
reference
- * AST
- * @param expr
- * @param refAST
- * @return boolean
- */
- public boolean checkAST(SimpleNode expr, Element refAST)
- {
- String nodeName = refAST.getAttributes().getNamedItem("name")
- .getNodeValue();
-
- if (XPathTreeConstants.jjtNodeName[expr.getId()].equals(nodeName))
- {
- int i = 0;
-
- for (Node rac = refAST.getFirstChild(); rac != null;
- rac = rac.getNextSibling())
- {
- if ("node".equals(rac.getNodeName()))
- {
- if (!checkAST((SimpleNode) expr.jjtGetChild(i),
- (Element) rac))
- {
- return false;
- }
-
- i++;
- }
- }
-
- if (i < expr.jjtGetNumChildren())
- {
- return false;
- }
-
- return true;
- }
-
- return false;
- }
-
- public static void main(String[] args)
- {
- new Test(args);
- }
-}
+/*
+ * 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.test;
+
+import org.apache.xpath.objects.XObject;
+import org.apache.xpath.rwapi.XPathFactory;
+import org.apache.xpath.rwapi.eval.Evaluator;
+import org.apache.xpath.rwapi.expression.ConditionalExpr;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.ExprContext;
+import org.apache.xpath.rwapi.expression.ExpressionFactory;
+import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
+import org.apache.xpath.rwapi.expression.Literal;
+import org.apache.xpath.rwapi.expression.NodeTest;
+import org.apache.xpath.rwapi.expression.OperatorExpr;
+import org.apache.xpath.rwapi.expression.PathExpr;
+import org.apache.xpath.rwapi.expression.StepExpr;
+import org.apache.xpath.rwapi.expression.Variable;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+import org.apache.xpath.rwapi.impl.parser.XPathTreeConstants;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import java.io.StringReader;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+
+/**
+ * Title:
+ * Description:
+ * Copyright: Copyright (c) 2001
+ * Company:
+ * @author
+ * @version 1.0
+ */
+public class Test
+{
+ public Test(String[] args)
+ {
+ try
+ {
+ final boolean dumpTree = ((args.length == 1)
+ && args[0].equals("-dump")) ? true : false;
+
+ /*if(args[0].endsWith(".xquery"))
+ {
+ System.out.println("Running test for: "+args[0]);
+ File file = new File(args[0]);
+ FileInputStream fis = new FileInputStream(file);
+ XPath parser = new XPath(fis);
+ SimpleNode tree = parser.XPath2();
+ if(dumpTree)
+ tree.dump("|") ;
+ }
+ else
+ {*/
+ DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document doc = db.parse(ClassLoader.getSystemResourceAsStream(
+ "org/apache/xpath/rwapi/test/xpathsamples.xml"));
+ doc.normalize();
+
+ Element tests = doc.getDocumentElement();
+ NodeList testElems = tests.getChildNodes();
+ int nChildren = testElems.getLength();
+ int testid = 0;
+ boolean testSuccess = true;
+
+ for (int i = 0; i < nChildren; i++)
+ {
+ org.w3c.dom.Node node = testElems.item(i);
+
+ if (org.w3c.dom.Node.ELEMENT_NODE == node.getNodeType())
+ {
+ testid++;
+
+ String xpathString = ((Element)
node).getAttribute("value");
+ System.out.println("Test[" + testid + "]: " +
xpathString);
+
+ XPath parser = new XPath(new StringReader(xpathString));
+ SimpleNode tree = parser.XPath2();
+
+ if (SimpleNode.PRODUCE_RAW_TREE)
+ {
+ // if (dumpTree)
+ //{
+ tree.dump("|");
+ // }
+ }
+ else
+ {
+ Expr expr = (Expr) tree.jjtGetChild(0);
+
+ // Gets the reference AST to compare with
+ NodeList astNodes = ((Element) node)
+ .getElementsByTagName("ast");
+
+ if ((astNodes != null) && (astNodes.getLength() >=
1))
+ {
+ Node astNode = astNodes.item(0);
+
+ if (!checkAST((SimpleNode) expr,
+ (Element) ((Element)
astNode).getElementsByTagName(
+ "node").item(0)))
+ {
+ System.err.println(
+ "Generated AST doesn't match the
reference one");
+
+ tree.dump("|");
+ }
+ }
+ else
+ {
+ System.err.println("No reference AST provided");
+ }
+
+ String ab = expr.getString(true);
+
+ //System.out.println(
+ // "Parsed expr (abbreviate form):" + ab);
+ //System.out.println(
+ // "Parsed expr (non-abbreviate form):"
+ // + expr.getString(false));
+ if (!ab.equals(xpathString))
+ {
+ System.err.print(
+ "Bad external or internal representation: ");
+ System.err.println(ab + " != " + xpathString);
+ testSuccess = false;
+ }
+ }
+ }
+ }
+
+ // }
+ if (testSuccess)
+ {
+ System.out.println("Parsing test successful!!!");
+ }
+ else
+ {
+ System.out.println("Parsing Test fails!!!!!!!!!");
+ }
+
+ // Test creation
+ ExpressionFactory exprFct = XPathFactory.newInstance()
+ .newExpressionFactory();
+
+ Expr expr = exprFct.createExpr("child::tutu[10]");
+ System.out.println("tutu[10] =? " + expr.getString(true));
+
+ PathExpr pathExpr = exprFct.createPathExpr(true);
+ System.out.println("/ =? " + pathExpr.getString(true));
+
+ NodeTest nt = exprFct.createNameTest(null, "toto");
+ pathExpr.addOperand(exprFct.createStepExpr(StepExpr.AXIS_CHILD,
nt));
+ System.out.println("/toto =? " + pathExpr.getString(true));
+ System.out.println("/child::toto =? " +
pathExpr.getString(false));
+
+ nt = exprFct.createNameTest(null, "titi");
+ pathExpr.addOperand(exprFct.createStepExpr(
+ StepExpr.AXIS_DESCENDANT, nt));
+
+ System.out.println("/toto/descendant::titi =? "
+ + pathExpr.getString(true));
+ System.out.println("/child::toto/descendant::titi =? "
+ + pathExpr.getString(false));
+
+ StepExpr se = (StepExpr) pathExpr.getOperand(0); // first step
+ se.appendPredicate(exprFct.createIntegerLiteralExpr(50));
+ System.out.println("/toto[50]/descendant::titi =? "
+ + pathExpr.getString(true));
+ System.out.println("/child::toto[50]/descendant::titi =? "
+ + pathExpr.getString(false));
+
+ // Test visitor
+ pathExpr.visit(new Visitor()
+ {
+ /**
+ *
+ */
+ public boolean visitPath(PathExpr path)
+ {
+ System.out.println("visit path "
+ + path.getString(false));
+
+ return true;
+ }
+
+ /**
+ *
+ */
+ public boolean visitStep(StepExpr step)
+ {
+ System.out.println("visit step "
+ + step.getString(false));
+
+ return true;
+ }
+
+ /**
+ *
+ */
+ public boolean visitLiteral(Literal primary)
+ {
+ System.out.println(primary.getString(false));
+
+ return true;
+ }
+
+ /**
+ *
+ */
+ public boolean visitOperator(OperatorExpr arithmetic)
+ {
+ System.out.println(arithmetic.getString(false));
+
+ return true;
+ }
+
+ /**
+ *
+ */
+ public boolean visitConditional(ConditionalExpr
condition)
+ {
+ System.out.println(condition.getString(false));
+
+ return true;
+ }
+
+ /**
+ *
+ */
+ public boolean visitForOrQuantifiedExpr(
+ ForAndQuantifiedExpr expr)
+ {
+ System.out.println(expr.getString(false));
+
+ return true;
+ }
+
+ /**
+ *
+ */
+ public boolean visitVariable(Variable var)
+ {
+ return false;
+ }
+ });
+
+ // Evaluation
+ Evaluator eval = XPathFactory.newInstance().newEvaluatorFactory()
+ .createEvaluator();
+
+ ExprContext ctx = eval.createExprContext();
+ ctx.getDynamicContext().setContextItem(doc.getDocumentElement());
+
+ // exprs
+ Expr e = exprFct.createExpr("expr[2]/@value");
+ Object res = eval.evaluate(ctx, e);
+
+ // Xalan dependent code
+ System.out.println("10[$var] ?= " + ((XObject) res).str());
+ }
+ catch (Exception e)
+ {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * Check that the given internal representation of expr match the
reference
+ * AST
+ * @param expr
+ * @param refAST
+ * @return boolean
+ */
+ public boolean checkAST(SimpleNode expr, Element refAST)
+ {
+ String nodeName = refAST.getAttributes().getNamedItem("name")
+ .getNodeValue();
+
+ if (XPathTreeConstants.jjtNodeName[expr.getId()].equals(nodeName))
+ {
+ int i = 0;
+
+ for (Node rac = refAST.getFirstChild(); rac != null;
+ rac = rac.getNextSibling())
+ {
+ if ("node".equals(rac.getNodeName()))
+ {
+ if (!checkAST((SimpleNode) expr.jjtGetChild(i),
+ (Element) rac))
+ {
+ return false;
+ }
+
+ i++;
+ }
+ }
+
+ if (i < expr.jjtGetNumChildren())
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public static void main(String[] args)
+ {
+ new Test(args);
+ }
+}
1.1.2.3 +106 -106
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test2.java
Index: Test2.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/Test2.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- Test2.java 30 Jan 2003 00:45:42 -0000 1.1.2.2
+++ Test2.java 5 Feb 2003 16:09:49 -0000 1.1.2.3
@@ -1,106 +1,106 @@
-/*
- * 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.test;
-
-import java.io.StringReader;
-import java.io.FileInputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.xpath.objects.XObject;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-import org.apache.xpath.rwapi.XPathFactory;
-import org.apache.xpath.rwapi.eval.Evaluator;
-import org.apache.xpath.rwapi.expression.ConditionalExpr;
-import org.apache.xpath.rwapi.expression.Expr;
-import org.apache.xpath.rwapi.expression.ExprContext;
-import org.apache.xpath.rwapi.expression.ExpressionFactory;
-import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
-import org.apache.xpath.rwapi.expression.Literal;
-import org.apache.xpath.rwapi.expression.NodeTest;
-import org.apache.xpath.rwapi.expression.OperatorExpr;
-import org.apache.xpath.rwapi.expression.PathExpr;
-import org.apache.xpath.rwapi.expression.StepExpr;
-import org.apache.xpath.rwapi.expression.Variable;
-import org.apache.xpath.rwapi.expression.Visitor;
-import org.apache.xpath.rwapi.impl.parser.SimpleNode;
-import org.apache.xpath.rwapi.impl.parser.XPath;
-
-
-public class Test2 {
-
- public Test2(String[] args) {
- try {
- String s = (args.length > 0) ? args[0] : "a/b";
- XPath parser = new XPath(new StringReader(s));
- parser.XPath2().dump("|");
- }
- catch (Exception e) {
- System.out.println(e.getMessage());
- e.printStackTrace();
- }
- }
-
- public static void main(String[] args) {
- new Test2(args);
- }
-
-}
+/*
+ * 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.test;
+
+import java.io.StringReader;
+import java.io.FileInputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.xpath.objects.XObject;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+import org.apache.xpath.rwapi.XPathFactory;
+import org.apache.xpath.rwapi.eval.Evaluator;
+import org.apache.xpath.rwapi.expression.ConditionalExpr;
+import org.apache.xpath.rwapi.expression.Expr;
+import org.apache.xpath.rwapi.expression.ExprContext;
+import org.apache.xpath.rwapi.expression.ExpressionFactory;
+import org.apache.xpath.rwapi.expression.ForAndQuantifiedExpr;
+import org.apache.xpath.rwapi.expression.Literal;
+import org.apache.xpath.rwapi.expression.NodeTest;
+import org.apache.xpath.rwapi.expression.OperatorExpr;
+import org.apache.xpath.rwapi.expression.PathExpr;
+import org.apache.xpath.rwapi.expression.StepExpr;
+import org.apache.xpath.rwapi.expression.Variable;
+import org.apache.xpath.rwapi.expression.Visitor;
+import org.apache.xpath.rwapi.impl.parser.SimpleNode;
+import org.apache.xpath.rwapi.impl.parser.XPath;
+
+
+public class Test2 {
+
+ public Test2(String[] args) {
+ try {
+ String s = (args.length > 0) ? args[0] : "a/b";
+ XPath parser = new XPath(new StringReader(s));
+ parser.XPath2().dump("|");
+ }
+ catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ public static void main(String[] args) {
+ new Test2(args);
+ }
+
+}
1.1.2.3 +65 -19
xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/xpathsamples.xml
Index: xpathsamples.xml
===================================================================
RCS file:
/home/cvs/xml-xalan/java/xpath_rwapi/src/org/apache/xpath/rwapi/test/Attic/xpathsamples.xml,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- xpathsamples.xml 23 Jan 2003 19:36:55 -0000 1.1.2.2
+++ xpathsamples.xml 5 Feb 2003 16:09:49 -0000 1.1.2.3
@@ -1,53 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<exprs>
- <!-- primary -->
+ <!-- primary expressions -->
<expr value="10">
<ast>
- <node name="ExprSequence">
- <!-- No predicate so filter StepExpr node -->
+ <node name="ExprSequence">
+ <!-- direct access to primary expression -->
<node name="IntegerLiteral"/>
</node>
</ast>
</expr>
- <expr value="10[$var]">
+ <expr value="'chaine'">
<ast>
<node name="ExprSequence">
- <node name="StepExpr">
- <node name="IntegerLiteral"/>
- <node name="VarName"/>
- </node>
+ <node name="StringLiteral"/>
</node>
</ast>
</expr>
- <expr value="'chaine'">
+ <expr value="$var">
<ast>
<node name="ExprSequence">
- <node name="StringLiteral"/>
+ <node name="VarName"/>
</node>
</ast>
</expr>
- <expr value="toto,10">
+
+ <expr value="10[$var]">
<ast>
<node name="ExprSequence">
- <node name="PathExpr">
- <node name="StepExpr">
- <node name="NameTest"/>
- </node>
+ <node name="StepExpr">
+ <!-- first child: the node test -->
+ <node name="IntegerLiteral"/>
+ <!-- second and following children:
predicates -->
+ <node name="VarName"/>
</node>
- <node name="IntegerLiteral"/>
</node>
</ast>
</expr>
-
<expr value="func()">
<ast>
<node name="ExprSequence">
<node name="FunctionCall"/>
+ <!-- no child since no parameters -->
</node>
</ast>
</expr>
@@ -56,6 +54,7 @@
<ast>
<node name="ExprSequence">
<node name="FunctionCall">
+ <!-- children correspond to function
call parameters -->
<node name="StringLiteral"/>
<node name="IntegerLiteral"/>
</node>
@@ -63,13 +62,60 @@
</ast>
</expr>
- <expr value="$varvar">
+ <expr value="func3([EMAIL PROTECTED]'val'],56)">
<ast>
<node name="ExprSequence">
- <node name="VarName"/>
+ <node name="FunctionCall">
+ <node name="PathExpr">
+ <node name="StepExpr">
+ <node name="NameTest"/>
+ <node
name="ComparisonExpr">
+ <node
name="PathExpr">
+ <node
name="StepExpr">
+
<node name="NameTest"/>
+ </node>
+ </node>
+ <node
name="StringLiteral"/>
+ </node>
+ </node>
+ </node>
+ <node name="IntegerLiteral"/>
+ </node>
</node>
</ast>
</expr>
+
+ <expr value="(10)">
+ <ast>
+ <node name="ExprSequence">
+ <node name="IntegerLiteral"/>
+ </node>
+ </ast>
+ </expr>
+
+ <expr value="(toto,10)">
+ <ast>
+ <node name="ExprSequence">
+ <node name="PathExpr">
+ <node name="StepExpr">
+ <node name="NameTest"/>
+ </node>
+ </node>
+ <node name="IntegerLiteral"/>
+ </node>
+ </ast>
+ </expr>
+
+ <expr value="(toto, (), (10, 'str'))">
+ <ast>
+ <node name="ExprSequence">
+ <node name="NameTest"/>
+ <node name="IntegerLiteral"/>
+ <node name="StringLiteral"/>
+ </node>
+ </ast>
+ </expr>
+
<!-- nametest (AbbreviateForwardStep) -->
<expr value="toto">
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]