Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'develop' into feature/lucence-range-index

  • Loading branch information...
commit 41c094d98c244446199a9516b367a7ed0df1a5ff 2 parents 2f815e1 + 977cbbf
@wolfgangmm wolfgangmm authored
Showing with 1,900 additions and 1,065 deletions.
  1. +1 −1  extensions/debuggee/src/org/exist/debuggee/ScriptRunner.java
  2. +27 −2 extensions/modules/src/org/exist/xquery/modules/jfreechart/Configuration.java
  3. +16 −2 extensions/modules/src/org/exist/xquery/modules/jfreechart/JFreeChartFactory.java
  4. +22 −8 schema/conf.xsd
  5. +4 −1 src/org/exist/memtree/DocumentImpl.java
  6. +11 −6 src/org/exist/memtree/MemTreeBuilder.java
  7. +10 −1 src/org/exist/memtree/NamespaceNode.java
  8. +1 −0  src/org/exist/xquery/DynamicFunctionCall.java
  9. +1 −1  src/org/exist/xquery/EnclosedExpr.java
  10. +6 −0 src/org/exist/xquery/ErrorCodes.java
  11. +84 −38 src/org/exist/xquery/NamespaceConstructor.java
  12. +4 −1 src/org/exist/xquery/PartialFunctionApplication.java
  13. +8 −10 src/org/exist/xquery/functions/securitymanager/AccountManagementFunction.java
  14. +15 −22 src/org/exist/xquery/parser/XQuery.g
  15. +131 −131 src/org/exist/xquery/parser/XQueryLexer.java
  16. +803 −563 src/org/exist/xquery/parser/XQueryParser.java
  17. +17 −5 src/org/exist/xquery/parser/XQueryTree.g
  18. +240 −188 src/org/exist/xquery/parser/XQueryTreeParser.java
  19. +1 −1  src/template_java.txt
  20. +2 −2 test/src/org/exist/xquery/XQueryTest.java
  21. +235 −0 test/src/xquery/namespaces.xql
  22. +4 −3 test/src/xquery/suite.xql
  23. +18 −0 test/src/xquery/xquery3/higher-order.xml
  24. +44 −22 tools/wrapper/bin/exist.bat
  25. +9 −9 tools/wrapper/bin/exist.sh.in
  26. +43 −21 tools/wrapper/bin/install.bat
  27. +51 −18 tools/wrapper/bin/uninstall.bat
  28. BIN  tools/wrapper/bin/wrapper-linux-ia-64
  29. BIN  tools/wrapper/bin/wrapper-linux-x86-32
  30. BIN  tools/wrapper/bin/wrapper-linux-x86-64
  31. BIN  tools/wrapper/bin/wrapper-macosx-universal-32
  32. BIN  tools/wrapper/bin/wrapper-macosx-universal-64
  33. BIN  tools/wrapper/bin/wrapper-solaris-sparc-32
  34. BIN  tools/wrapper/bin/wrapper-solaris-sparc-64
  35. BIN  tools/wrapper/bin/wrapper-solaris-x86-32
  36. BIN  tools/wrapper/bin/wrapper-solaris-x86-64
  37. BIN  tools/wrapper/bin/wrapper-windows-x86-32.exe
  38. BIN  tools/wrapper/bin/wrapper-windows-x86-64.exe
  39. +92 −9 tools/wrapper/conf/wrapper.conf.in
  40. BIN  tools/wrapper/lib/libwrapper-linux-ia-64.so
  41. BIN  tools/wrapper/lib/libwrapper-linux-x86-32.so
  42. BIN  tools/wrapper/lib/libwrapper-linux-x86-64.so
  43. BIN  tools/wrapper/lib/libwrapper-macosx-universal-32.jnilib
  44. BIN  tools/wrapper/lib/libwrapper-macosx-universal-64.jnilib
  45. BIN  tools/wrapper/lib/libwrapper-solaris-sparc-32.so
  46. BIN  tools/wrapper/lib/libwrapper-solaris-sparc-64.so
  47. BIN  tools/wrapper/lib/libwrapper-solaris-x86-32.so
  48. BIN  tools/wrapper/lib/libwrapper-solaris-x86-64.so
  49. BIN  tools/wrapper/lib/wrapper-windows-x86-32.dll
  50. BIN  tools/wrapper/lib/wrapper-windows-x86-64.dll
  51. BIN  tools/wrapper/lib/wrapper.jar
View
2  extensions/debuggee/src/org/exist/debuggee/ScriptRunner.java
@@ -72,7 +72,7 @@ public void run() {
try {
db = BrokerPool.getInstance();
- db.addObserver(this);
+ BrokerPool.registerStatusObserver(this);
broker = db.get(null);
View
29 extensions/modules/src/org/exist/xquery/modules/jfreechart/Configuration.java
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2009 The eXist Project
+ * Copyright (C) 2009-2013 The eXist-db Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
import org.apache.log4j.Logger;
import org.exist.xquery.XPathException;
+import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.plot.PlotOrientation;
import org.jfree.util.TableOrder;
import org.w3c.dom.Node;
@@ -34,6 +35,7 @@
*
* @author Dannes Wessels (dizzzz@exist-db.org)
* @author Andrzej Taramina (andrzej@chaeron.com)
+ * @author Leif-Jöran Olsson (ljo@exist-db.org)
*/
public class Configuration {
@@ -63,6 +65,7 @@
private String categoryItemLabelGeneratorClass;
private String categoryItemLabelGeneratorParameter = "{2}";
private String categoryItemLabelGeneratorNumberFormat = "0";
+ private CategoryLabelPositions categoryLabelPositions = CategoryLabelPositions.STANDARD;
// Orientation and Order
private TableOrder order = TableOrder.BY_COLUMN;
@@ -207,6 +210,10 @@ public String getCategoryItemLabelGeneratorParameter() {
public String getCategoryItemLabelGeneratorNumberFormat() {
return categoryItemLabelGeneratorNumberFormat;
}
+
+ public CategoryLabelPositions getCategoryLabelPositions() {
+ return categoryLabelPositions;
+ }
public String getSeriesColors() {
return seriesColors;
@@ -489,7 +496,25 @@ public void parse(Node configuration) throws XPathException {
} else {
categoryItemLabelGeneratorNumberFormat = value;
}
-
+
+ } else if (child.getLocalName().equals("categoryLabelPositions")) {
+ String value = getValue(child);
+ if (value == null) {
+ throw new XPathException("Value for 'categoryLabelPostions' cannot be parsed");
+ } else if ("UP_45".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.UP_45;
+ } else if ("UP_90".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.UP_90;
+ } else if ("DOWN_45".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.DOWN_45;
+
+ } else if ("DOWN_90".equalsIgnoreCase(value)) {
+ categoryLabelPositions = CategoryLabelPositions.DOWN_90;
+
+ } else {
+ throw new XPathException("Wrong value for 'categoryLabelPositions'");
+ }
+
} else if (child.getLocalName().equals("imageType")) {
String value = getValue(child);
if (value == null) {
View
18 extensions/modules/src/org/exist/xquery/modules/jfreechart/JFreeChartFactory.java
@@ -1,6 +1,6 @@
/*
* eXist Open Source Native XML Database
- * Copyright (C) 2009 The eXist Project
+ * Copyright (C) 2009-2013 The eXist-db Project
* http://exist-db.org
*
* This program is free software; you can redistribute it and/or
@@ -33,11 +33,13 @@
import org.exist.xquery.XPathException;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.JFreeChart;
+import org.jfree.chart.axis.CategoryLabelPositions;
import org.jfree.chart.labels.CategoryItemLabelGenerator;
import org.jfree.chart.labels.StandardCategoryToolTipGenerator;
import org.jfree.chart.labels.StandardPieSectionLabelGenerator;
import org.jfree.chart.plot.CategoryPlot;
import org.jfree.chart.plot.PiePlot;
+import org.jfree.chart.plot.MultiplePiePlot;
import org.jfree.chart.plot.SpiderWebPlot;
import org.jfree.chart.renderer.category.CategoryItemRenderer;
import org.jfree.chart.title.LegendTitle;
@@ -237,8 +239,9 @@ private static void setCategoryChartParameters( JFreeChart chart, Configuration
{
setCategoryRange( chart, config );
setCategoryItemLabelGenerator( chart, config );
+ setCategoryLabelPositions( chart, config );
setSeriesColors( chart, config );
- setAxisColors( chart, config );
+ setAxisColors( chart, config );
}
@@ -295,6 +298,13 @@ private static void setCategoryItemLabelGenerator( JFreeChart chart, Configurati
}
}
+ private static void setCategoryLabelPositions( JFreeChart chart, Configuration config )
+ {
+ CategoryLabelPositions positions = config.getCategoryLabelPositions();
+ if (chart.getPlot() instanceof CategoryPlot) {
+ ((CategoryPlot)chart.getPlot()).getDomainAxis().setCategoryLabelPositions(positions);
+ }
+ }
private static void setSeriesColors( JFreeChart chart, Configuration config )
{
@@ -373,7 +383,11 @@ private static void setPieSectionLabel( JFreeChart chart, Configuration config )
String pieSectionPercentFormat = config.getPieSectionPercentFormat();
if( pieSectionLabel != null ) {
+ if (chart.getPlot() instanceof MultiplePiePlot) {
+ ((PiePlot) ((MultiplePiePlot)chart.getPlot()).getPieChart().getPlot()).setLabelGenerator( new StandardPieSectionLabelGenerator( pieSectionLabel, new DecimalFormat( pieSectionNumberFormat ), new DecimalFormat( pieSectionPercentFormat ) ) );
+ } else {
((PiePlot)chart.getPlot()).setLabelGenerator( new StandardPieSectionLabelGenerator( pieSectionLabel, new DecimalFormat( pieSectionNumberFormat ), new DecimalFormat( pieSectionPercentFormat ) ) );
+ }
}
}
View
30 schema/conf.xsd
@@ -7,12 +7,21 @@
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
+
+ <!-- Shared types -->
<xs:simpleType name="yes_no">
<xs:restriction base="xs:string">
<xs:enumeration value="yes"/>
<xs:enumeration value="no"/>
</xs:restriction>
</xs:simpleType>
+
+ <xs:complexType name="parameterType">
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="value" type="xs:string"/>
+ </xs:complexType>
+
+ <!-- Root element -->
<xs:element name="exist">
<xs:complexType>
<xs:sequence>
@@ -28,12 +37,14 @@
<xs:element name="startup" minOccurs="0">
<xs:complexType>
<xs:sequence>
- <!-- TODO commonise with collection.xconf.xsd -->
<xs:element name="triggers" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="trigger" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
+ <xs:sequence minOccurs="0" maxOccurs="unbounded">
+ <xs:element name="parameter" type="parameterType"/>
+ </xs:sequence>
<xs:attribute name="class" type="xs:string"/>
</xs:complexType>
</xs:element>
@@ -150,7 +161,8 @@
<xs:attribute name="flushAfter" type="xs:integer"
default="300"/>
<xs:attribute name="n" type="xs:integer" default="3"/>
- <xs:attribute name="buffer" type="xs:integer" default="32"/>
+ <xs:attribute name="buffer" type="xs:integer"
+ default="32"/>
</xs:complexType>
</xs:element>
</xs:sequence>
@@ -343,12 +355,13 @@
<xs:element name="module" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
- <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded">
- <xs:complexType>
- <xs:attribute name="name" type="xs:string"/>
- <xs:attribute name="value" type="xs:string"/>
- </xs:complexType>
- </xs:element>
+ <xs:element name="parameter" minOccurs="0"
+ maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="value" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
</xs:sequence>
<xs:attribute name="class" type="xs:string"/>
<xs:attribute name="uri" type="xs:anyURI"/>
@@ -385,4 +398,5 @@
</xs:sequence>
</xs:complexType>
</xs:element>
+
</xs:schema>
View
5 src/org/exist/memtree/DocumentImpl.java
@@ -325,7 +325,7 @@ public int addAttribute(int nodeNum, QName qname, String value, int type) throws
if (nodeKind == null) {
init();
}
- if ((nodeNum > 0 ) && (nodeKind[nodeNum] != Node.ELEMENT_NODE)) {
+ if ((nodeNum > 0 ) && !(nodeKind[nodeNum] == Node.ELEMENT_NODE || nodeKind[nodeNum] == NodeImpl.NAMESPACE_NODE)) {
throw( new DOMException( DOMException.INUSE_ATTRIBUTE_ERR,
"err:XQTY0024: An attribute node cannot follow a node that is not an attribute node."));
}
@@ -1104,6 +1104,9 @@ private void copyStartNode(NodeImpl node, DocumentBuilderReceiver receiver, bool
final String data = new String(document.characters, document.alpha[nr], document.alphaLen[nr]);
receiver.processingInstruction(qn.getLocalName(), data);
break;
+ case NodeImpl.NAMESPACE_NODE:
+ receiver.addNamespaceNode(document.namespaceCode[nr]);
+ break;
case NodeImpl.REFERENCE_NODE:
if (expandRefs) {
DBBroker broker = null;
View
17 src/org/exist/memtree/MemTreeBuilder.java
@@ -446,13 +446,18 @@ public int namespaceNode( String prefix, String uri )
public int namespaceNode( QName qn )
{
final int lastNode = doc.getLastNode();
- final QName elemQN = doc.nodeName[lastNode];
- final String elemPrefix = ( elemQN.getPrefix() == null ) ? "" : elemQN.getPrefix();
-
- if( elemPrefix.equals( qn.getLocalName() ) && ( elemQN.getNamespaceURI() != null ) && !elemQN.getNamespaceURI().equals( qn.getNamespaceURI() ) ) {
- return( -1 );
+ boolean addNode = true;
+ if (doc.nodeName != null) {
+ final QName elemQN = doc.nodeName[lastNode];
+ if (elemQN != null) {
+ final String elemPrefix = ( elemQN.getPrefix() == null ) ? "" : elemQN.getPrefix();
+
+ if( elemPrefix.equals( qn.getLocalName() ) && ( elemQN.getNamespaceURI() != null ) ) {
+ addNode = false;
+ }
+ }
}
- return( doc.addNamespace( lastNode, qn ) );
+ return( addNode ? doc.addNamespace( lastNode, qn ) : -1 );
}
View
11 src/org/exist/memtree/NamespaceNode.java
@@ -65,7 +65,7 @@ public short getNodeType()
//XQuery doesn't support namespace nodes
//so, mapping as an attribute at *serialization tile* makes sense
//however, the Query parser should not accept them in constructors !
- return( Node.ATTRIBUTE_NODE );
+ return( NodeImpl.NAMESPACE_NODE);
}
@@ -142,6 +142,15 @@ public void setValue( String value ) throws DOMException
{
}
+ @Override
+ public Node getFirstChild() {
+ return null;
+ }
+
+ @Override
+ public Node getLastChild() {
+ return null;
+ }
public String getNodeValue() throws DOMException
{
View
1  src/org/exist/xquery/DynamicFunctionCall.java
@@ -59,6 +59,7 @@ public Sequence eval(Sequence contextSequence, Item contextItem)
final FunctionCall call = ref.getCall();
call.setArguments(arguments);
final PartialFunctionApplication partialApp = new PartialFunctionApplication(context, call);
+ partialApp.analyze(new AnalyzeContextInfo(cachedContextInfo));
return partialApp.eval(contextSequence, contextItem);
} catch (final XPathException e) {
e.setLocation(line, column, getSource());
View
2  src/org/exist/xquery/EnclosedExpr.java
@@ -121,7 +121,7 @@ else if (buf.length() > 0)
{throw new XPathException(this, ErrorCodes.XQTY0024,
"An attribute may not appear after another child node.");}
next.copyTo(context.getBroker(), receiver);
- allowAttribs = next.getType() == Type.ATTRIBUTE;
+ allowAttribs = next.getType() == Type.ATTRIBUTE || next.getType() == Type.NAMESPACE;
next = i.nextItem();
}
}
View
6 src/org/exist/xquery/ErrorCodes.java
@@ -125,6 +125,12 @@
public static ErrorCode XQDY0091 = new W3CErrorCode("XQDY0091", "An implementation MAY raise a dynamic error if an xml:id error, as defined in [XML ID], is encountered during construction of an attribute named xml:id.");
public static ErrorCode XQDY0092 = new W3CErrorCode("XQDY0092", "An implementation MAY raise a dynamic error if a constructed attribute named xml:space has a value other than preserve or default.");
public static ErrorCode XQST0093 = new W3CErrorCode("XQST0093", "It is a static error to import a module M1 if there exists a sequence of modules M1 ... Mi ... M1 such that each module directly depends on the next module in the sequence (informally, if M1 depends on itself through some chain of module dependencies.)");
+ public static ErrorCode XQDY0101 = new W3CErrorCode("XQDY0101", "An error is raised if a computed namespace constructor attempts to do any of the following:\n" +
+ "Bind the prefix xml to some namespace URI other than http://www.w3.org/XML/1998/namespace.\n" +
+ "Bind a prefix other than xml to the namespace URI http://www.w3.org/XML/1998/namespace.\n" +
+ "Bind the prefix xmlns to any namespace URI.\n" +
+ "Bind a prefix to the namespace URI http://www.w3.org/2000/xmlns/.\n" +
+ "Bind any prefix (including the empty prefix) to a zero-length namespace URI.");
/* XQuery 1.0 and XPath 2.0 Functions and Operators http://www.w3.org/TR/xpath-functions/#error-summary */
public static ErrorCode FOER0000 = new W3CErrorCode("FOER0000", "Unidentified error.");
View
122 src/org/exist/xquery/NamespaceConstructor.java
@@ -22,42 +22,60 @@
*/
package org.exist.xquery;
+import org.exist.Namespaces;
import org.exist.memtree.DocumentImpl;
import org.exist.memtree.MemTreeBuilder;
-import org.exist.xquery.util.ExpressionDumper;
-import org.exist.xquery.value.Item;
-import org.exist.xquery.value.Sequence;
-import org.exist.xquery.value.SequenceIterator;
+import org.exist.util.XMLChar;
+import org.exist.xquery.util.*;
+import org.exist.xquery.util.Error;
+import org.exist.xquery.value.*;
+
+import java.util.Iterator;
/**
- * Implements a dynamic namespace constructor.
+ * XQuery 3.0 computed namespace constructor.
*
* @author wolf
*/
public class NamespaceConstructor extends NodeConstructor {
- final private String prefix;
- private Expression uri = null;
+ private Expression qnameExpr;
+ private Expression content = null;
/**
* @param context
*/
- public NamespaceConstructor(XQueryContext context, String prefix) {
+ public NamespaceConstructor(XQueryContext context) {
super(context);
- this.prefix = prefix;
}
- public void setURIExpression(Expression uriExpr) {
- this.uri = new Atomize(context, uriExpr);
+ public void setContentExpr(PathExpr path) {
+ path.setUseStaticContext(true);
+ final Expression expr = new DynamicCardinalityCheck(context, Cardinality.EXACTLY_ONE, path,
+ new Error(Error.FUNC_PARAM_CARDINALITY));
+ this.content = expr;
+ }
+
+ public void setNameExpr(Expression expr) {
+ expr = new Atomize(context, expr);
+ expr = new DynamicCardinalityCheck(context, Cardinality.ZERO_OR_ONE, expr,
+ new Error(Error.FUNC_PARAM_CARDINALITY));
+ this.qnameExpr = expr;
}
/* (non-Javadoc)
* @see org.exist.xquery.Expression#analyze(org.exist.xquery.Expression)
*/
public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
- contextInfo.setParent(this);
- uri.analyze(contextInfo);
+ super.analyze(contextInfo);
+ final AnalyzeContextInfo newContextInfo = new AnalyzeContextInfo(contextInfo);
+ newContextInfo.setParent(this);
+ newContextInfo.addFlag(IN_NODE_CONSTRUCTOR);
+ qnameExpr.analyze(newContextInfo);
+ if (content != null) {
+ content.analyze(newContextInfo);
+ }
}
/* (non-Javadoc)
@@ -75,23 +93,34 @@ public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathExc
final MemTreeBuilder builder = context.getDocumentBuilder();
context.proceed(this, builder);
-
- final Sequence uriSeq = uri.eval(contextSequence, contextItem);
- String value;
- if(uriSeq.isEmpty())
- {value = "";}
- else {
- final StringBuilder buf = new StringBuilder();
- for(final SequenceIterator i = uriSeq.iterate(); i.hasNext(); ) {
- context.proceed(this, builder);
- final Item next = i.nextItem();
- if(buf.length() > 0)
- {buf.append(' ');}
- buf.append(next.toString());
+
+ final Sequence prefixSeq = qnameExpr.eval(contextSequence, contextItem);
+ if (!(Type.subTypeOf(prefixSeq.getItemType(), Type.STRING) || prefixSeq.getItemType() == Type.UNTYPED_ATOMIC)) {
+ throw new XPathException(this, ErrorCodes.XPTY0004, "Prefix needs to be xs:string or xs:untypedAtomic");
+ }
+ String prefix = "";
+ if (!prefixSeq.isEmpty()) {
+ prefix = prefixSeq.getStringValue();
+ if (!(prefix.length() == 0 || XMLChar.isValidNCName(prefix))) {
+ throw new XPathException(this, ErrorCodes.XQDY0074, "Prefix cannot be cast to xs:NCName");
}
- value = buf.toString();
}
- context.declareInScopeNamespace(prefix, value);
+ final Sequence uriSeq = content.eval(contextSequence, contextItem);
+ final String value = uriSeq.getStringValue();
+
+ if (prefix.equals("xmlns")) {
+ throw new XPathException(this, ErrorCodes.XQDY0101, "Cannot bind xmlns prefix");
+ } else if (prefix.equals("xml") && !value.equals(Namespaces.XML_NS)) {
+ throw new XPathException(this, ErrorCodes.XQDY0101, "Cannot bind xml prefix to another namespace");
+ } else if (value.equals(Namespaces.XML_NS) && !prefix.equals("xml")) {
+ throw new XPathException(this, ErrorCodes.XQDY0101, "Cannot bind prefix to XML namespace");
+ } else if (value.equals(Namespaces.XMLNS_NS)) {
+ throw new XPathException(this, ErrorCodes.XQDY0101, "Cannot bind prefix to xmlns namespace");
+ } else if (value.length() == 0) {
+ throw new XPathException(this, ErrorCodes.XQDY0101, "Cannot bind prefix to empty or zero-length namespace");
+ }
+
+ //context.declareInScopeNamespace(prefix, value);
final int nodeNr = builder.namespaceNode(prefix, value);
final Sequence result = ((DocumentImpl)builder.getDocument()).getNamespaceNode(nodeNr);
@@ -105,23 +134,40 @@ public Sequence eval(Sequence contextSequence, Item contextItem) throws XPathExc
* @see org.exist.xquery.Expression#dump(org.exist.xquery.util.ExpressionDumper)
*/
public void dump(ExpressionDumper dumper) {
- dumper.display("namespace ").display(prefix);
+ dumper.display("namespace ");
+ //TODO : remove curly braces if Qname
+ dumper.display("{");
+ qnameExpr.dump(dumper);
+ dumper.display("} ");
dumper.display("{");
- uri.dump(dumper);
- dumper.display("}");
+ dumper.startIndent();
+ if(content != null) {
+ content.dump(dumper);
+ }
+ dumper.endIndent().nl();
+ dumper.display("} ");
}
public String toString() {
- final StringBuilder result = new StringBuilder();
- result.append("namespace ").append(prefix);
- result.append("{");
- result.append(uri.toString());
- result.append("}");
- return result.toString();
+ final StringBuilder result = new StringBuilder();
+ result.append("namespace ");
+ //TODO : remove curly braces if Qname
+ result.append("{");
+ result.append(qnameExpr.toString());
+ result.append("} ");
+ result.append("{");
+ if (content != null) {
+ result.append(content.toString());
+ }
+ result.append("} ");
+ return result.toString();
}
public void resetState(boolean postOptimization) {
super.resetState(postOptimization);
- uri.resetState(postOptimization);
+ qnameExpr.resetState(postOptimization);
+ if(content != null) {
+ content.resetState(postOptimization);
+ }
}
}
View
5 src/org/exist/xquery/PartialFunctionApplication.java
@@ -16,7 +16,8 @@
public final static String PARTIAL_FUN_PREFIX = "partial";
protected FunctionCall function;
-
+ protected AnalyzeContextInfo cachedContextInfo;
+
public PartialFunctionApplication(XQueryContext context, FunctionCall call) {
super(context);
this.function = call;
@@ -24,6 +25,7 @@ public PartialFunctionApplication(XQueryContext context, FunctionCall call) {
@Override
public void analyze(AnalyzeContextInfo contextInfo) throws XPathException {
+ this.cachedContextInfo = contextInfo;
}
@Override
@@ -79,6 +81,7 @@ private FunctionReference createPartial(Sequence contextSequence, Item contextIt
} else {
// fixed argument: just compute the argument value
try {
+ param.analyze(cachedContextInfo);
final Sequence seq = param.eval(contextSequence, contextItem);
callArgs.add(new PrecomputedValue(context, seq));
} catch (final XPathException e) {
View
18 src/org/exist/xquery/functions/securitymanager/AccountManagementFunction.java
@@ -105,17 +105,16 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro
final DBBroker broker = getContext().getBroker();
final Subject currentUser = broker.getSubject();
final SecurityManager securityManager = broker.getBrokerPool().getSecurityManager();
-
- if(!currentUser.hasDbaRole()) {
- throw new XPathException("You must be a DBA to create a User Account.");
- }
final String username = args[0].getStringValue();
try {
if(isCalledAs(qnRemoveAccount.getLocalName())) {
/* remove account */
-
+ if(!currentUser.hasDbaRole()) {
+ throw new XPathException("Only a DBA user may remove accounts.");
+ }
+
if(!securityManager.hasAccount(username)) {
throw new XPathException("The user account with username " + username + " does not exist.");
}
@@ -124,10 +123,6 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro
throw new XPathException("You cannot remove yourself i.e. the currently logged in user.");
}
- if(!currentUser.hasDbaRole()) {
- throw new XPathException("Only a DBA user may remove accounts.");
- }
-
securityManager.deleteAccount(username);
} else {
@@ -147,7 +142,10 @@ public Sequence eval(final Sequence[] args, final Sequence contextSequence) thro
} else if(isCalledAs(qnCreateAccount.getLocalName())) {
/* create account */
-
+ if(!currentUser.hasDbaRole()) {
+ throw new XPathException("You must be a DBA to create a User Account.");
+ }
+
if(securityManager.hasAccount(username)) {
throw new XPathException("The user account with username " + username + " already exists.");
}
View
37 src/org/exist/xquery/parser/XQuery.g
@@ -1010,7 +1010,7 @@ stepExpr throws XPathException
( ( "text" | "node" | "element" | "attribute" | "comment" | "processing-instruction" | "document-node" ) LPAREN )
=> axisStep
|
- ( ( "element" | "attribute" | "text" | "document" | "processing-instruction" |
+ ( ( "element" | "attribute" | "text" | "document" | "processing-instruction" | "namespace" |
"comment" | "ordered" | "unordered" | "map" ) LCURLY ) =>
postfixExpr
|
@@ -1128,7 +1128,7 @@ primaryExpr throws XPathException
{ String varName= null; }
:
( ( "element" | "attribute" | "text" | "document" | "processing-instruction" |
- "comment" ) LCURLY ) =>
+ "comment" | "namespace" ) LCURLY ) =>
computedConstructor
|
( ( "element" | "attribute" | "processing-instruction" | "namespace" ) qName LCURLY ) => computedConstructor
@@ -1347,6 +1347,8 @@ computedConstructor throws XPathException
|
compTextConstructor
|
+ compNamespaceConstructor
+ |
compDocumentConstructor
|
compXmlPI
@@ -1360,27 +1362,13 @@ compElemConstructor throws XPathException
}
:
( "element" LCURLY ) =>
- "element"! LCURLY! expr RCURLY! LCURLY! (compElemBody)? RCURLY!
+ "element"! LCURLY! expr RCURLY! LCURLY! (expr)? RCURLY!
{ #compElemConstructor = #(#[COMP_ELEM_CONSTRUCTOR], #compElemConstructor); }
|
- "element"! qn=qName LCURLY! (e3:compElemBody)? RCURLY!
+ "element"! qn=qName LCURLY! (e3:expr)? RCURLY!
{ #compElemConstructor = #(#[COMP_ELEM_CONSTRUCTOR, qn], #[STRING_LITERAL, qn], #e3); }
;
-compElemBody throws XPathException
-:
- (
- ( "namespace" ncnameOrKeyword LCURLY ) => localNamespaceDecl
- |
- exprSingle
- )
- ( COMMA! (
- ( "namespace" ncnameOrKeyword LCURLY ) => localNamespaceDecl
- |
- exprSingle )
- )*
- ;
-
compAttrConstructor throws XPathException
{
String qn;
@@ -1393,6 +1381,7 @@ compAttrConstructor throws XPathException
"attribute"! qn=qName e3:compConstructorValue
{ #compAttrConstructor = #(#[COMP_ATTR_CONSTRUCTOR, qn], #[STRING_LITERAL, qn], #e3); }
;
+
compConstructorValue throws XPathException
:
LCURLY^ ( e2:expr )? RCURLY!
@@ -1429,13 +1418,17 @@ compXmlComment throws XPathException
{ #compXmlComment = #(#[COMP_COMMENT_CONSTRUCTOR, "comment"], #e); }
;
-localNamespaceDecl
+compNamespaceConstructor throws XPathException
{
- String nc = null;
+ String qn;
}
:
- "namespace"! nc=ncnameOrKeyword LCURLY! l:STRING_LITERAL RCURLY!
- { #localNamespaceDecl = #(#[COMP_NS_CONSTRUCTOR, nc], #l); }
+ ( "namespace" LCURLY ) =>
+ "namespace"! LCURLY! expr RCURLY! LCURLY! (expr)? RCURLY!
+ { #compNamespaceConstructor = #(#[COMP_NS_CONSTRUCTOR], #compNamespaceConstructor); }
+ |
+ "namespace"! qn=qName LCURLY! (e3:expr)? RCURLY!
+ { #compNamespaceConstructor = #(#[COMP_NS_CONSTRUCTOR, qn], #[STRING_LITERAL, qn], #e3); }
;
elementConstructor throws XPathException
View
262 src/org/exist/xquery/parser/XQueryLexer.java
@@ -2331,17 +2331,17 @@ protected final void mDIGITS(boolean _createToken) throws RecognitionException,
int _saveIndex;
{
- int _cnt546=0;
- _loop546:
+ int _cnt541=0;
+ _loop541:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- if ( _cnt546>=1 ) { break _loop546; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt541>=1 ) { break _loop541; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt546++;
+ _cnt541++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -2482,8 +2482,8 @@ protected final void mHEX_DIGITS(boolean _createToken) throws RecognitionExcepti
int _saveIndex;
{
- int _cnt549=0;
- _loop549:
+ int _cnt544=0;
+ _loop544:
do {
switch ( LA(1)) {
case '0': case '1': case '2': case '3':
@@ -2507,10 +2507,10 @@ protected final void mHEX_DIGITS(boolean _createToken) throws RecognitionExcepti
}
default:
{
- if ( _cnt549>=1 ) { break _loop549; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt544>=1 ) { break _loop544; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
}
- _cnt549++;
+ _cnt544++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3234,13 +3234,13 @@ protected final void mNCNAME(boolean _createToken) throws RecognitionException,
mNMSTART(false);
{
- _loop556:
+ _loop551:
do {
if ((_tokenSet_5.member(LA(1)))) {
mNMCHAR(false);
}
else {
- break _loop556;
+ break _loop551;
}
} while (true);
@@ -3259,8 +3259,8 @@ protected final void mWS(boolean _createToken) throws RecognitionException, Char
int _saveIndex;
{
- int _cnt559=0;
- _loop559:
+ int _cnt554=0;
+ _loop554:
do {
if ((LA(1)==' ') && (true) && (true) && (true)) {
match(' ');
@@ -3278,10 +3278,10 @@ else if ((LA(1)=='\r') && (true) && (true) && (true)) {
match('\r');
}
else {
- if ( _cnt559>=1 ) { break _loop559; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt554>=1 ) { break _loop554; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt559++;
+ _cnt554++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3298,10 +3298,10 @@ protected final void mXQDOC_COMMENT(boolean _createToken) throws RecognitionExce
match("(:~");
{
- _loop563:
+ _loop558:
do {
// nongreedy exit test
- if ((LA(1)==':') && (LA(2)==')') && (true)) break _loop563;
+ if ((LA(1)==':') && (LA(2)==')') && (true)) break _loop558;
if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe'))) {
{
if ((LA(1)=='(') && (LA(2)==':') && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe'))) {
@@ -3317,7 +3317,7 @@ else if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA
}
}
else {
- break _loop563;
+ break _loop558;
}
} while (true);
@@ -3337,10 +3337,10 @@ protected final void mEXPR_COMMENT(boolean _createToken) throws RecognitionExcep
match("(:");
{
- _loop567:
+ _loop562:
do {
// nongreedy exit test
- if ((LA(1)==':') && (LA(2)==')') && (true) && (true)) break _loop567;
+ if ((LA(1)==':') && (LA(2)==')') && (true) && (true)) break _loop562;
if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && (true)) {
{
if ((LA(1)=='(') && (LA(2)==':') && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe'))) {
@@ -3356,7 +3356,7 @@ else if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA
}
}
else {
- break _loop567;
+ break _loop562;
}
} while (true);
@@ -3407,13 +3407,13 @@ else if ((_tokenSet_2.member(LA(1)))) {
{
match('.');
{
- _loop575:
+ _loop570:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- break _loop575;
+ break _loop570;
}
} while (true);
@@ -3501,13 +3501,13 @@ else if ((_tokenSet_2.member(LA(1)))) {
if ((LA(1)=='.')) {
match('.');
{
- _loop583:
+ _loop578:
do {
if ((_tokenSet_2.member(LA(1)))) {
mDIGIT(false);
}
else {
- break _loop583;
+ break _loop578;
}
} while (true);
@@ -3615,7 +3615,7 @@ protected final void mSTRING_LITERAL(boolean _createToken) throws RecognitionExc
match('"');
text.setLength(_saveIndex);
{
- _loop593:
+ _loop588:
do {
if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) {
mPREDEFINED_ENTITY_REF(false);
@@ -3637,7 +3637,7 @@ else if ((_tokenSet_6.member(LA(1)))) {
}
}
else {
- break _loop593;
+ break _loop588;
}
} while (true);
@@ -3653,7 +3653,7 @@ else if ((_tokenSet_6.member(LA(1)))) {
match('\'');
text.setLength(_saveIndex);
{
- _loop597:
+ _loop592:
do {
if ((LA(1)=='&') && (LA(2)=='a'||LA(2)=='g'||LA(2)=='l'||LA(2)=='q')) {
mPREDEFINED_ENTITY_REF(false);
@@ -3675,7 +3675,7 @@ else if ((_tokenSet_7.member(LA(1)))) {
}
}
else {
- break _loop597;
+ break _loop592;
}
} while (true);
@@ -3703,8 +3703,8 @@ protected final void mQUOT_ATTRIBUTE_CONTENT(boolean _createToken) throws Recogn
int _saveIndex;
{
- int _cnt601=0;
- _loop601:
+ int _cnt596=0;
+ _loop596:
do {
if ((_tokenSet_8.member(LA(1)))) {
{
@@ -3712,10 +3712,10 @@ protected final void mQUOT_ATTRIBUTE_CONTENT(boolean _createToken) throws Recogn
}
}
else {
- if ( _cnt601>=1 ) { break _loop601; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt596>=1 ) { break _loop596; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt601++;
+ _cnt596++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3737,8 +3737,8 @@ protected final void mAPOS_ATTRIBUTE_CONTENT(boolean _createToken) throws Recogn
int _saveIndex;
{
- int _cnt605=0;
- _loop605:
+ int _cnt600=0;
+ _loop600:
do {
if ((_tokenSet_9.member(LA(1)))) {
{
@@ -3746,10 +3746,10 @@ protected final void mAPOS_ATTRIBUTE_CONTENT(boolean _createToken) throws Recogn
}
}
else {
- if ( _cnt605>=1 ) { break _loop605; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt600>=1 ) { break _loop600; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt605++;
+ _cnt600++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3799,8 +3799,8 @@ protected final void mELEMENT_CONTENT(boolean _createToken) throws RecognitionEx
int _saveIndex;
{
- int _cnt610=0;
- _loop610:
+ int _cnt605=0;
+ _loop605:
do {
switch ( LA(1)) {
case '\t':
@@ -3862,10 +3862,10 @@ protected final void mELEMENT_CONTENT(boolean _createToken) throws RecognitionEx
matchRange('\u007e','\uFFFD');
}
else {
- if ( _cnt610>=1 ) { break _loop610; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt605>=1 ) { break _loop605; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
}
- _cnt610++;
+ _cnt605++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -3884,7 +3884,7 @@ protected final void mXML_COMMENT(boolean _createToken) throws RecognitionExcept
match("<!--");
text.setLength(_saveIndex);
{
- _loop617:
+ _loop612:
do {
if ((_tokenSet_10.member(LA(1)))) {
{
@@ -3892,10 +3892,10 @@ protected final void mXML_COMMENT(boolean _createToken) throws RecognitionExcept
}
}
else {
- boolean synPredMatched616 = false;
+ boolean synPredMatched611 = false;
if (((LA(1)=='-'))) {
- int _m616 = mark();
- synPredMatched616 = true;
+ int _m611 = mark();
+ synPredMatched611 = true;
inputState.guessing++;
try {
{
@@ -3906,16 +3906,16 @@ protected final void mXML_COMMENT(boolean _createToken) throws RecognitionExcept
}
}
catch (RecognitionException pe) {
- synPredMatched616 = false;
+ synPredMatched611 = false;
}
- rewind(_m616);
+ rewind(_m611);
inputState.guessing--;
}
- if ( synPredMatched616 ) {
+ if ( synPredMatched611 ) {
match('-');
}
else {
- break _loop617;
+ break _loop612;
}
}
} while (true);
@@ -3940,7 +3940,7 @@ protected final void mXML_PI(boolean _createToken) throws RecognitionException,
if ((LA(1)==' ')) {
match(' ');
{
- _loop625:
+ _loop620:
do {
if ((_tokenSet_11.member(LA(1)))) {
{
@@ -3948,10 +3948,10 @@ protected final void mXML_PI(boolean _createToken) throws RecognitionException,
}
}
else {
- boolean synPredMatched624 = false;
+ boolean synPredMatched619 = false;
if (((LA(1)=='?'))) {
- int _m624 = mark();
- synPredMatched624 = true;
+ int _m619 = mark();
+ synPredMatched619 = true;
inputState.guessing++;
try {
{
@@ -3962,16 +3962,16 @@ protected final void mXML_PI(boolean _createToken) throws RecognitionException,
}
}
catch (RecognitionException pe) {
- synPredMatched624 = false;
+ synPredMatched619 = false;
}
- rewind(_m624);
+ rewind(_m619);
inputState.guessing--;
}
- if ( synPredMatched624 ) {
+ if ( synPredMatched619 ) {
match('?');
}
else {
- break _loop625;
+ break _loop620;
}
}
} while (true);
@@ -3997,12 +3997,12 @@ protected final void mXML_CDATA(boolean _createToken) throws RecognitionExceptio
mXML_CDATA_START(false);
text.setLength(_saveIndex);
{
- _loop636:
+ _loop631:
do {
- boolean synPredMatched631 = false;
+ boolean synPredMatched626 = false;
if (((LA(1)==']') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe')))) {
- int _m631 = mark();
- synPredMatched631 = true;
+ int _m626 = mark();
+ synPredMatched626 = true;
inputState.guessing++;
try {
{
@@ -4013,19 +4013,19 @@ protected final void mXML_CDATA(boolean _createToken) throws RecognitionExceptio
}
}
catch (RecognitionException pe) {
- synPredMatched631 = false;
+ synPredMatched626 = false;
}
- rewind(_m631);
+ rewind(_m626);
inputState.guessing--;
}
- if ( synPredMatched631 ) {
+ if ( synPredMatched626 ) {
match(']');
}
else {
- boolean synPredMatched634 = false;
+ boolean synPredMatched629 = false;
if (((LA(1)==']') && (LA(2)==']') && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe')))) {
- int _m634 = mark();
- synPredMatched634 = true;
+ int _m629 = mark();
+ synPredMatched629 = true;
inputState.guessing++;
try {
{
@@ -4037,12 +4037,12 @@ protected final void mXML_CDATA(boolean _createToken) throws RecognitionExceptio
}
}
catch (RecognitionException pe) {
- synPredMatched634 = false;
+ synPredMatched629 = false;
}
- rewind(_m634);
+ rewind(_m629);
inputState.guessing--;
}
- if ( synPredMatched634 ) {
+ if ( synPredMatched629 ) {
{
match(']');
match(']');
@@ -4054,7 +4054,7 @@ else if ((_tokenSet_13.member(LA(1)))) {
}
}
else {
- break _loop636;
+ break _loop631;
}
}
} while (true);
@@ -4075,8 +4075,8 @@ protected final void mS(boolean _createToken) throws RecognitionException, CharS
int _saveIndex;
{
- int _cnt640=0;
- _loop640:
+ int _cnt635=0;
+ _loop635:
do {
if ((LA(1)=='\t'||LA(1)=='\n'||LA(1)=='\r'||LA(1)==' ')) {
{
@@ -4109,10 +4109,10 @@ protected final void mS(boolean _createToken) throws RecognitionException, CharS
}
}
else {
- if ( _cnt640>=1 ) { break _loop640; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
+ if ( _cnt635>=1 ) { break _loop635; } else {throw new NoViableAltForCharException((char)LA(1), getFilename(), getLine(), getColumn());}
}
- _cnt640++;
+ _cnt635++;
} while (true);
}
if ( _createToken && _token==null && _ttype!=Token.SKIP ) {
@@ -4159,15 +4159,15 @@ protected final void mPRAGMA_END(boolean _createToken) throws RecognitionExcepti
mWS(false);
text.setLength(_saveIndex);
{
- _loop646:
+ _loop641:
do {
// nongreedy exit test
- if ((LA(1)=='#') && (LA(2)==')') && (true)) break _loop646;
+ if ((LA(1)=='#') && (LA(2)==')') && (true)) break _loop641;
if (((LA(1) >= '\u0003' && LA(1) <= '\ufffe')) && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\ufffe'))) {
matchNot(EOF_CHAR);
}
else {
- break _loop646;
+ break _loop641;
}
} while (true);
@@ -4227,10 +4227,10 @@ public final void mNEXT_TOKEN(boolean _createToken) throws RecognitionException,
break;
}
default:
- boolean synPredMatched651 = false;
+ boolean synPredMatched646 = false;
if (((LA(1)=='(') && (LA(2)==':') && (LA(3)=='~') && ((LA(4) >= '\u0003' && LA(4) <= '\ufffe')))) {
- int _m651 = mark();
- synPredMatched651 = true;
+ int _m646 = mark();
+ synPredMatched646 = true;
inputState.guessing++;
try {
{
@@ -4240,12 +4240,12 @@ public final void mNEXT_TOKEN(boolean _createToken) throws RecognitionException,
}
}
catch (RecognitionException pe) {
- synPredMatched651 = false;
+ synPredMatched646 = false;
}
- rewind(_m651);
+ rewind(_m646);
inputState.guessing--;
}
- if ( synPredMatched651 ) {
+ if ( synPredMatched646 ) {
mXQDOC_COMMENT(false);
if ( inputState.guessing==0 ) {
@@ -4288,10 +4288,10 @@ else if ((LA(1)=='<') && (LA(2)=='!') && (LA(3)=='[')) {
}
}
else {
- boolean synPredMatched658 = false;
+ boolean synPredMatched653 = false;
if (((_tokenSet_14.member(LA(1))) && (_tokenSet_15.member(LA(2))) && (_tokenSet_16.member(LA(3))) && (true))) {
- int _m658 = mark();
- synPredMatched658 = true;
+ int _m653 = mark();
+ synPredMatched653 = true;
inputState.guessing++;
try {
{
@@ -4318,22 +4318,22 @@ else if ((LA(1)=='<') && (LA(2)=='!') && (LA(3)=='[')) {
}
}
catch (RecognitionException pe) {
- synPredMatched658 = false;
+ synPredMatched653 = false;
}
- rewind(_m658);
+ rewind(_m653);
inputState.guessing--;
}
- if ( synPredMatched658 ) {
+ if ( synPredMatched653 ) {
mDOUBLE_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DOUBLE_LITERAL;
}
}
else {
- boolean synPredMatched667 = false;
+ boolean synPredMatched662 = false;
if (((_tokenSet_14.member(LA(1))) && (_tokenSet_15.member(LA(2))) && (_tokenSet_16.member(LA(3))) && (true))) {
- int _m667 = mark();
- synPredMatched667 = true;
+ int _m662 = mark();
+ synPredMatched662 = true;
inputState.guessing++;
try {
{
@@ -4387,12 +4387,12 @@ else if ((LA(1)=='E'||LA(1)=='e')) {
}
}
catch (RecognitionException pe) {
- synPredMatched667 = false;
+ synPredMatched662 = false;
}
- rewind(_m667);
+ rewind(_m662);
inputState.guessing--;
}
- if ( synPredMatched667 ) {
+ if ( synPredMatched662 ) {
mDOUBLE_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DOUBLE_LITERAL;
@@ -4411,10 +4411,10 @@ else if ((LA(1)==']') && (LA(2)==']') && (LA(3)=='>') && (true)) {
}
}
else {
- boolean synPredMatched649 = false;
+ boolean synPredMatched644 = false;
if (((LA(1)=='<') && (LA(2)=='?'))) {
- int _m649 = mark();
- synPredMatched649 = true;
+ int _m644 = mark();
+ synPredMatched644 = true;
inputState.guessing++;
try {
{
@@ -4422,12 +4422,12 @@ else if ((LA(1)==']') && (LA(2)==']') && (LA(3)=='>') && (true)) {
}
}
catch (RecognitionException pe) {
- synPredMatched649 = false;
+ synPredMatched644 = false;
}
- rewind(_m649);
+ rewind(_m644);
inputState.guessing--;
}
- if ( synPredMatched649 ) {
+ if ( synPredMatched644 ) {
mXML_PI(false);
if ( inputState.guessing==0 ) {
_ttype = XML_PI;
@@ -4474,10 +4474,10 @@ else if (((LA(1)=='"'||LA(1)=='\'') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')
}
}
else {
- boolean synPredMatched653 = false;
+ boolean synPredMatched648 = false;
if (((LA(1)=='|') && (LA(2)=='|') && (true) && (true))) {
- int _m653 = mark();
- synPredMatched653 = true;
+ int _m648 = mark();
+ synPredMatched648 = true;
inputState.guessing++;
try {
{
@@ -4486,22 +4486,22 @@ else if (((LA(1)=='"'||LA(1)=='\'') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')
}
}
catch (RecognitionException pe) {
- synPredMatched653 = false;
+ synPredMatched648 = false;
}
- rewind(_m653);
+ rewind(_m648);
inputState.guessing--;
}
- if ( synPredMatched653 ) {
+ if ( synPredMatched648 ) {
mCONCAT(false);
if ( inputState.guessing==0 ) {
_ttype = CONCAT;
}
}
else {
- boolean synPredMatched655 = false;
+ boolean synPredMatched650 = false;
if ((((LA(1)=='.') && (LA(2)=='.') && (true) && (true))&&( !(inAttributeContent || inElementContent) ))) {
- int _m655 = mark();
- synPredMatched655 = true;
+ int _m650 = mark();
+ synPredMatched650 = true;
inputState.guessing++;
try {
{
@@ -4510,12 +4510,12 @@ else if (((LA(1)=='"'||LA(1)=='\'') && ((LA(2) >= '\u0003' && LA(2) <= '\ufffe')
}
}
catch (RecognitionException pe) {
- synPredMatched655 = false;
+ synPredMatched650 = false;
}
- rewind(_m655);
+ rewind(_m650);
inputState.guessing--;
}
- if ( synPredMatched655 ) {
+ if ( synPredMatched650 ) {
mPARENT(false);
if ( inputState.guessing==0 ) {
_ttype = PARENT;
@@ -4640,10 +4640,10 @@ else if ((LA(1)=='|') && (true) && (true) && (true)) {
}
}
else {
- boolean synPredMatched660 = false;
+ boolean synPredMatched655 = false;
if (((_tokenSet_14.member(LA(1))) && (true) && (true) && (true))) {
- int _m660 = mark();
- synPredMatched660 = true;
+ int _m655 = mark();
+ synPredMatched655 = true;
inputState.guessing++;
try {
{
@@ -4652,22 +4652,22 @@ else if ((LA(1)=='|') && (true) && (true) && (true)) {
}
}
catch (RecognitionException pe) {
- synPredMatched660 = false;
+ synPredMatched655 = false;
}
- rewind(_m660);
+ rewind(_m655);
inputState.guessing--;
}
- if ( synPredMatched660 ) {
+ if ( synPredMatched655 ) {
mDECIMAL_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DECIMAL_LITERAL;
}
}
else {
- boolean synPredMatched662 = false;
+ boolean synPredMatched657 = false;
if (((LA(1)=='.') && (true) && (true) && (true))) {
- int _m662 = mark();
- synPredMatched662 = true;
+ int _m657 = mark();
+ synPredMatched657 = true;
inputState.guessing++;
try {
{
@@ -4675,22 +4675,22 @@ else if ((LA(1)=='|') && (true) && (true) && (true)) {
}
}
catch (RecognitionException pe) {
- synPredMatched662 = false;
+ synPredMatched657 = false;
}
- rewind(_m662);
+ rewind(_m657);
inputState.guessing--;
}
- if ( synPredMatched662 ) {
+ if ( synPredMatched657 ) {
mSELF(false);
if ( inputState.guessing==0 ) {
_ttype = SELF;
}
}
else {
- boolean synPredMatched669 = false;
+ boolean synPredMatched664 = false;
if (((_tokenSet_14.member(LA(1))) && (true) && (true) && (true))) {
- int _m669 = mark();
- synPredMatched669 = true;
+ int _m664 = mark();
+ synPredMatched664 = true;
inputState.guessing++;
try {
{
@@ -4699,12 +4699,12 @@ else if ((LA(1)=='|') && (true) && (true) && (true)) {
}
}
catch (RecognitionException pe) {
- synPredMatched669 = false;
+ synPredMatched664 = false;
}
- rewind(_m669);
+ rewind(_m664);
inputState.guessing--;
}
- if ( synPredMatched669 ) {
+ if ( synPredMatched664 ) {
mDECIMAL_LITERAL(false);
if ( inputState.guessing==0 ) {
_ttype = DECIMAL_LITERAL;
View
1,366 src/org/exist/xquery/parser/XQueryParser.java
@@ -7442,6 +7442,11 @@ public final void stepExpr() throws RecognitionException, TokenStreamException,
match(185);
break;
}
+ case LITERAL_namespace:
+ {
+ match(LITERAL_namespace);
+ break;
+ }
case LITERAL_comment:
{
match(LITERAL_comment);
@@ -8518,6 +8523,11 @@ public final void primaryExpr() throws RecognitionException, TokenStreamExceptio
match(LITERAL_comment);
break;
}
+ case LITERAL_namespace:
+ {
+ match(LITERAL_namespace);
+ break;
+ }
default:
{
throw new NoViableAltException(LT(1), getFilename());
@@ -8944,6 +8954,13 @@ public final void computedConstructor() throws RecognitionException, TokenStream
computedConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
break;
}
+ case LITERAL_namespace:
+ {
+ compNamespaceConstructor();
+ astFactory.addASTChild(currentAST, returnAST);
+ computedConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
+ break;
+ }
case LITERAL_document:
{
compDocumentConstructor();
@@ -10672,10 +10689,10 @@ public final void elementConstructor() throws RecognitionException, TokenStreamE
//lexer.wsExplicit = true;
- boolean synPredMatched465 = false;
+ boolean synPredMatched460 = false;
if (((LA(1)==LT))) {
- int _m465 = mark();
- synPredMatched465 = true;
+ int _m460 = mark();
+ synPredMatched460 = true;
inputState.guessing++;
try {
{
@@ -10687,12 +10704,12 @@ public final void elementConstructor() throws RecognitionException, TokenStreamE
}
}
catch (RecognitionException pe) {
- synPredMatched465 = false;
+ synPredMatched460 = false;
}
- rewind(_m465);
+ rewind(_m460);
inputState.guessing--;
}
- if ( synPredMatched465 ) {
+ if ( synPredMatched460 ) {
elementWithAttributes();
astFactory.addASTChild(currentAST, returnAST);
elementConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
@@ -10895,7 +10912,7 @@ public final void compElemConstructor() throws RecognitionException, TokenStream
case LITERAL_collection:
case LITERAL_validate:
{
- compElemBody();
+ expr();
astFactory.addASTChild(currentAST, returnAST);
break;
}
@@ -11047,7 +11064,7 @@ else if ((LA(1)==LITERAL_element)) {
case LITERAL_collection:
case LITERAL_validate:
{
- compElemBody();
+ expr();
e3_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
astFactory.addASTChild(currentAST, returnAST);
break;
@@ -11092,10 +11109,10 @@ public final void compAttrConstructor() throws RecognitionException, TokenStream
String qn;
- boolean synPredMatched452 = false;
+ boolean synPredMatched443 = false;
if (((LA(1)==LITERAL_attribute))) {
- int _m452 = mark();
- synPredMatched452 = true;
+ int _m443 = mark();
+ synPredMatched443 = true;
inputState.guessing++;
try {
{
@@ -11104,12 +11121,12 @@ public final void compAttrConstructor() throws RecognitionException, TokenStream
}
}
catch (RecognitionException pe) {
- synPredMatched452 = false;
+ synPredMatched443 = false;
}
- rewind(_m452);
+ rewind(_m443);
inputState.guessing--;
}
- if ( synPredMatched452 ) {
+ if ( synPredMatched443 ) {
match(LITERAL_attribute);
match(LCURLY);
expr();
@@ -11181,251 +11198,474 @@ public final void compTextConstructor() throws RecognitionException, TokenStream
returnAST = compTextConstructor_AST;
}
- public final void compDocumentConstructor() throws RecognitionException, TokenStreamException, XPathException {
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- org.exist.xquery.parser.XQueryAST compDocumentConstructor_AST = null;
- org.exist.xquery.parser.XQueryAST e_AST = null;
-
- org.exist.xquery.parser.XQueryAST tmp412_AST = null;
- tmp412_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp412_AST);
- match(LITERAL_document);
- match(LCURLY);
- expr();
- e_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
- astFactory.addASTChild(currentAST, returnAST);
- match(RCURLY);
- if ( inputState.guessing==0 ) {
- compDocumentConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
- compDocumentConstructor_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(COMP_DOC_CONSTRUCTOR,"document")).add(e_AST));
- currentAST.root = compDocumentConstructor_AST;
- currentAST.child = compDocumentConstructor_AST!=null &&compDocumentConstructor_AST.getFirstChild()!=null ?
- compDocumentConstructor_AST.getFirstChild() : compDocumentConstructor_AST;
- currentAST.advanceChildToEnd();
- }
- compDocumentConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
- returnAST = compDocumentConstructor_AST;
- }
-
- public final void compXmlPI() throws RecognitionException, TokenStreamException, XPathException {
+ public final void compNamespaceConstructor() throws RecognitionException, TokenStreamException, XPathException {
returnAST = null;
ASTPair currentAST = new ASTPair();
- org.exist.xquery.parser.XQueryAST compXmlPI_AST = null;
- org.exist.xquery.parser.XQueryAST e1_AST = null;
- org.exist.xquery.parser.XQueryAST e2_AST = null;
+ org.exist.xquery.parser.XQueryAST compNamespaceConstructor_AST = null;
org.exist.xquery.parser.XQueryAST e3_AST = null;
String qn;
- boolean synPredMatched459 = false;
- if (((LA(1)==185))) {
- int _m459 = mark();
- synPredMatched459 = true;
+ boolean synPredMatched454 = false;
+ if (((LA(1)==LITERAL_namespace))) {
+ int _m454 = mark();
+ synPredMatched454 = true;
inputState.guessing++;
try {
{
- match(185);
+ match(LITERAL_namespace);
match(LCURLY);
}
}
catch (RecognitionException pe) {
- synPredMatched459 = false;
+ synPredMatched454 = false;
}
- rewind(_m459);
+ rewind(_m454);
inputState.guessing--;
}
- if ( synPredMatched459 ) {
- match(185);
+ if ( synPredMatched454 ) {
+ match(LITERAL_namespace);
match(LCURLY);
expr();
- e1_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
astFactory.addASTChild(currentAST, returnAST);
match(RCURLY);
- compConstructorValue();
- e2_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
- astFactory.addASTChild(currentAST, returnAST);
+ match(LCURLY);
+ {
+ switch ( LA(1)) {
+ case LITERAL_xpointer:
+ case LPAREN:
+ case NCNAME:
+ case LITERAL_xquery:
+ case LITERAL_version:
+ case LITERAL_module:
+ case LITERAL_namespace:
+ case STRING_LITERAL:
+ case LITERAL_declare:
+ case LITERAL_default:
+ case 72:
+ case LITERAL_ordering:
+ case LITERAL_construction:
+ case 75:
+ case LITERAL_option:
+ case LITERAL_function:
+ case LITERAL_variable:
+ case MOD:
+ case LITERAL_import:
+ case LITERAL_encoding:
+ case LITERAL_collation:
+ case LITERAL_element:
+ case LITERAL_order:
+ case LITERAL_empty:
+ case LITERAL_preserve:
+ case LITERAL_strip:
+ case LITERAL_ordered:
+ case LITERAL_unordered:
+ case 94:
+ case LITERAL_inherit:
+ case 96:
+ case DOLLAR:
+ case LITERAL_external:
+ case LITERAL_schema:
+ case LITERAL_as:
+ case LITERAL_at:
+ case STAR:
+ case PLUS:
+ case LITERAL_item:
+ case LITERAL_map:
+ case LITERAL_for:
+ case LITERAL_let:
+ case LITERAL_try:
+ case LITERAL_some:
+ case LITERAL_every:
+ case LITERAL_if:
+ case LITERAL_switch:
+ case LITERAL_typeswitch:
+ case LITERAL_update:
+ case LITERAL_replace:
+ case LITERAL_value:
+ case LITERAL_insert:
+ case LITERAL_delete:
+ case LITERAL_rename:
+ case LITERAL_with:
+ case LITERAL_into:
+ case LITERAL_preceding:
+ case LITERAL_following:
+ case LITERAL_catch:
+ case LITERAL_where:
+ case LITERAL_return:
+ case LITERAL_in:
+ case LITERAL_by:
+ case LITERAL_stable:
+ case LITERAL_group:
+ case LITERAL_case:
+ case LITERAL_then:
+ case LITERAL_else:
+ case LITERAL_or:
+ case LITERAL_and:
+ case LITERAL_instance:
+ case LITERAL_of:
+ case LITERAL_treat:
+ case LITERAL_cast:
+ case LITERAL_eq:
+ case LITERAL_ne:
+ case LITERAL_lt:
+ case LITERAL_le:
+ case LITERAL_gt:
+ case LITERAL_ge:
+ case LT:
+ case LITERAL_is:
+ case LITERAL_isnot:
+ case LITERAL_to:
+ case MINUS:
+ case LITERAL_div:
+ case LITERAL_mod:
+ case PRAGMA_START:
+ case LITERAL_union:
+ case LITERAL_intersect:
+ case LITERAL_except:
+ case SLASH:
+ case DSLASH:
+ case LITERAL_text:
+ case LITERAL_node:
+ case LITERAL_attribute:
+ case LITERAL_comment:
+ case 185:
+ case 186:
+ case LITERAL_document:
+ case SELF:
+ case XML_COMMENT:
+ case XML_PI:
+ case AT:
+ case PARENT:
+ case LITERAL_child:
+ case LITERAL_self:
+ case LITERAL_descendant:
+ case 199:
+ case 200:
+ case LITERAL_parent:
+ case LITERAL_ancestor:
+ case 203:
+ case 204:
+ case DOUBLE_LITERAL:
+ case DECIMAL_LITERAL:
+ case INTEGER_LITERAL:
+ case LITERAL_collection:
+ case LITERAL_validate:
+ {
+ expr();
+ astFactory.addASTChild(currentAST, returnAST);
+ break;
+ }
+ case RCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(RCURLY);
if ( inputState.guessing==0 ) {
- compXmlPI_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
- compXmlPI_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(COMP_PI_CONSTRUCTOR)).add(compXmlPI_AST));
- currentAST.root = compXmlPI_AST;
- currentAST.child = compXmlPI_AST!=null &&compXmlPI_AST.getFirstChild()!=null ?
- compXmlPI_AST.getFirstChild() : compXmlPI_AST;
+ compNamespaceConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
+ compNamespaceConstructor_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(COMP_NS_CONSTRUCTOR)).add(compNamespaceConstructor_AST));
+ currentAST.root = compNamespaceConstructor_AST;
+ currentAST.child = compNamespaceConstructor_AST!=null &&compNamespaceConstructor_AST.getFirstChild()!=null ?
+ compNamespaceConstructor_AST.getFirstChild() : compNamespaceConstructor_AST;
currentAST.advanceChildToEnd();
}
- compXmlPI_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
+ compNamespaceConstructor_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
}
- else if ((LA(1)==185)) {
- match(185);
+ else if ((LA(1)==LITERAL_namespace)) {
+ match(LITERAL_namespace);
qn=qName();
astFactory.addASTChild(currentAST, returnAST);
- compConstructorValue();
- e3_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
- astFactory.addASTChild(currentAST, returnAST);
- if ( inputState.guessing==0 ) {
- compXmlPI_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
- compXmlPI_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(3)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(COMP_PI_CONSTRUCTOR,qn)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(STRING_LITERAL,qn)).add(e3_AST));
- currentAST.root = compXmlPI_AST;
- currentAST.child = compXmlPI_AST!=null &&compXmlPI_AST.getFirstChild()!=null ?
- compXmlPI_AST.getFirstChild() : compXmlPI_AST;
- currentAST.advanceChildToEnd();
- }
- compXmlPI_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
- }
- else {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- returnAST = compXmlPI_AST;
- }
-
- public final void compXmlComment() throws RecognitionException, TokenStreamException, XPathException {
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- org.exist.xquery.parser.XQueryAST compXmlComment_AST = null;
- org.exist.xquery.parser.XQueryAST e_AST = null;
-
- org.exist.xquery.parser.XQueryAST tmp419_AST = null;
- tmp419_AST = (org.exist.xquery.parser.XQueryAST)astFactory.create(LT(1));
- astFactory.addASTChild(currentAST, tmp419_AST);
- match(LITERAL_comment);
- match(LCURLY);
- expr();
- e_AST = (org.exist.xquery.parser.XQueryAST)returnAST;
- astFactory.addASTChild(currentAST, returnAST);
- match(RCURLY);
- if ( inputState.guessing==0 ) {
- compXmlComment_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
- compXmlComment_AST = (org.exist.xquery.parser.XQueryAST)astFactory.make( (new ASTArray(2)).add((org.exist.xquery.parser.XQueryAST)astFactory.create(COMP_COMMENT_CONSTRUCTOR,"comment")).add(e_AST));
- currentAST.root = compXmlComment_AST;
- currentAST.child = compXmlComment_AST!=null &&compXmlComment_AST.getFirstChild()!=null ?
- compXmlComment_AST.getFirstChild() : compXmlComment_AST;
- currentAST.advanceChildToEnd();
- }
- compXmlComment_AST = (org.exist.xquery.parser.XQueryAST)currentAST.root;
- returnAST = compXmlComment_AST;
- }
-
- public final void compElemBody() throws RecognitionException, TokenStreamException, XPathException {
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- org.exist.xquery.parser.XQueryAST compElemBody_AST = null;
-
- {
- boolean synPredMatched444 = false;
- if (((LA(1)==LITERAL_namespace))) {
- int _m444 = mark();
- synPredMatched444 = true;
- inputState.guessing++;
- try {
- {
- match(LITERAL_namespace);
- ncnameOrKeyword();
- match(LCURLY);
+ match(LCURLY);
+ {
+ switch ( LA(1)) {
+ case LITERAL_xpointer:
+ case LPAREN:
+ case NCNAME:
+ case LITERAL_xquery:
+ case LITERAL_version:
+ case LITERAL_module:
+ case LITERAL_namespace:
+ case STRING_LITERAL:
+ case LITERAL_declare:
+ case LITERAL_default:
+ case 72:
+ case LITERAL_ordering:
+ case LITERAL_construction:
+ case 75:
+ case LITERAL_option:
+ case LITERAL_function:
+ case LITERAL_variable:
+ case MOD:
+ case LITERAL_import:
+ case LITERAL_encoding:
+ case LITERAL_collation:
+ case LITERAL_element:
+ case LITERAL_order:
+ case LITERAL_empty:
+ case LITERAL_preserve:
+ case LITERAL_strip:
+ case LITERAL_ordered:
+ case LITERAL_unordered:
+ case 94:
+ case LITERAL_inherit:
+ case 96:
+ case DOLLAR:
+ case LITERAL_external:
+ case LITERAL_schema:
+ case LITERAL_as:
+ case LITERAL_at:
+ case STAR:
+ case PLUS:
+ case LITERAL_item:
+ case LITERAL_map:
+ case LITERAL_for:
+ case LITERAL_let:
+ case LITERAL_try:
+ case LITERAL_some:
+ case LITERAL_every:
+ case LITERAL_if:
+ case LITERAL_switch:
+ case LITERAL_typeswitch:
+ case LITERAL_update:
+ case LITERAL_replace:
+ case LITERAL_value:
+ case LITERAL_insert:
+ case LITERAL_delete:
+ case LITERAL_rename:
+ case LITERAL_with:
+ case LITERAL_into:
+ case LITERAL_preceding:
+ case LITERAL_following:
+ case LITERAL_catch:
+ case LITERAL_where:
+ case LITERAL_return:
+ case LITERAL_in:
+ case LITERAL_by:
+ case LITERAL_stable:
+ case LITERAL_group:
+ case LITERAL_case:
+ case LITERAL_then:
+ case LITERAL_else:
+ case LITERAL_or:
+ case LITERAL_and:
+ case LITERAL_instance:
+ case LITERAL_of:
+ case LITERAL_treat:
+ case LITERAL_cast:
+ case LITERAL_eq:
+ case LITERAL_ne:
+ case LITERAL_lt:
+ case LITERAL_le:
+ case LITERAL_gt:
+ case LITERAL_ge:
+ case LT:
+ case LITERAL_is:
+ case LITERAL_isnot:
+ case LITERAL_to:
+ case MINUS:
+ case LITERAL_div:
+ case LITERAL_mod:
+ case PRAGMA_START:
+ case LITERAL_union:
+ case LITERAL_intersect:
+ case LITERAL_except:
+ case SLASH:
+ case DSLASH:
+ case LITERAL_text:
+ case LITERAL_node:
+ case LITERAL_attribute:
+ case LITERAL_comment:
+ case 185:
+ case 186:
+ case LITERAL_document:
+ case SELF:
+ case XML_COMMENT:
+ case XML_PI:
+ case AT:
+ case PARENT:
+ case LITERAL_child:
+ case LITERAL_self:
+ case LITERAL_descendant:
+ case 199:
+ case 200: