qn = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
try {
QName qname= QName.parse(staticContext, qn.getText());
if (axis == Constants.ATTRIBUTE_AXIS) {
//qname.setNamespaceURI(null);
test= new NameTest(Type.ATTRIBUTE, qname);
qname.setNameType(ElementValue.ATTRIBUTE);
} else {
test= new NameTest(Type.ELEMENT, qname);
}
ast = qn;
} catch(XPathException ex1) {
ex1.setLocation(qn.getLine(), qn.getColumn());
throw ex1;
}
break;
}
case PREFIX_WILDCARD:
{
AST __t210 = _t;
org.exist.xquery.parser.XQueryAST tmp92_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,PREFIX_WILDCARD);
_t = _t.getFirstChild();
nc1 = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,NCNAME);
_t = _t.getNextSibling();
_t = __t210;
_t = _t.getNextSibling();
try {
QName qname= new QName(nc1.getText(), null, null);
qname.setNamespaceURI(null);
test= new NameTest(Type.ELEMENT, qname);
if (axis == Constants.ATTRIBUTE_AXIS)
test.setType(Type.ATTRIBUTE);
ast = nc1;
} catch(XPathException ex2) {
ex2.setLocation(nc1.getLine(), nc1.getColumn());
}
break;
}
case NCNAME:
{
AST __t211 = _t;
nc = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
match(_t,NCNAME);
_t = _t.getFirstChild();
org.exist.xquery.parser.XQueryAST tmp93_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,WILDCARD);
_t = _t.getNextSibling();
_t = __t211;
_t = _t.getNextSibling();
try {
String namespaceURI= staticContext.getURIForPrefix(nc.getText());
QName qname= new QName(null, namespaceURI, nc.getText());
test= new NameTest(Type.ELEMENT, qname);
if (axis == Constants.ATTRIBUTE_AXIS)
test.setType(Type.ATTRIBUTE);
ast = nc;
} catch(XPathException ex3) {
ex3.setLocation(nc1.getLine(), nc1.getColumn());
}
break;
}
case WILDCARD:
{
w = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,WILDCARD);
_t = _t.getNextSibling();
if (axis == Constants.ATTRIBUTE_AXIS)
test= new TypeTest(Type.ATTRIBUTE);
else
test= new TypeTest(Type.ELEMENT);
ast = w;
break;
}
case LITERAL_node:
{
n = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,LITERAL_node);
_t = _t.getNextSibling();
if (axis == Constants.ATTRIBUTE_AXIS) {
// throw new XPathException(n, "Cannot test for node() on the attribute axis");
test= new TypeTest(Type.ATTRIBUTE);
} else {
test= new AnyNodeTest();
}
ast = n;
break;
}
case LITERAL_text:
{
t = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,LITERAL_text);
_t = _t.getNextSibling();
if (axis == Constants.ATTRIBUTE_AXIS)
throw new XPathException(t, "Cannot test for text() on the attribute axis");
test= new TypeTest(Type.TEXT);
ast = t;
break;
}
case LITERAL_element:
{
AST __t212 = _t;
e = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
match(_t,LITERAL_element);
_t = _t.getFirstChild();
if (axis == Constants.ATTRIBUTE_AXIS)
throw new XPathException(e, "Cannot test for element() on the attribute axis");
test= new TypeTest(Type.ELEMENT);
ast = e;
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case QNAME:
{
qn2 = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
QName qname= QName.parse(staticContext, qn2.getText());
test= new NameTest(Type.ELEMENT, qname);
break;
}
case WILDCARD:
{
org.exist.xquery.parser.XQueryAST tmp94_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,WILDCARD);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case QNAME:
{
qn21 = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
QName qname= QName.parse(staticContext, qn21.getText());
test = new TypeTest(Type.getType(qname));
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t212;
_t = _t.getNextSibling();
break;
}
case ATTRIBUTE_TEST:
{
AST __t215 = _t;
att = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
match(_t,ATTRIBUTE_TEST);
_t = _t.getFirstChild();
test= new TypeTest(Type.ATTRIBUTE);
ast = att;
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case QNAME:
{
qn3 = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
QName qname= QName.parse(staticContext, qn3.getText());
test= new NameTest(Type.ATTRIBUTE, qname);
qname.setNameType(ElementValue.ATTRIBUTE);
axis= Constants.ATTRIBUTE_AXIS;
break;
}
case WILDCARD:
{
org.exist.xquery.parser.XQueryAST tmp95_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,WILDCARD);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case QNAME:
{
qn31 = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
QName qname= QName.parse(staticContext, qn31.getText());
test = new TypeTest(Type.getType(qname));
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t215;
_t = _t.getNextSibling();
break;
}
case LITERAL_comment:
{
com = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,LITERAL_comment);
_t = _t.getNextSibling();
if (axis == Constants.ATTRIBUTE_AXIS)
throw new XPathException(n, "Cannot test for comment() on the attribute axis");
test= new TypeTest(Type.COMMENT);
ast = com;
break;
}
case 186:
{
AST __t218 = _t;
pi = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
match(_t,186);
_t = _t.getFirstChild();
if (axis == Constants.ATTRIBUTE_AXIS)
throw new XPathException(n, "Cannot test for processing-instruction() on the attribute axis");
test= new TypeTest(Type.PROCESSING_INSTRUCTION);
ast = pi;
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case NCNAME:
{
ncpi = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,NCNAME);
_t = _t.getNextSibling();
QName qname;
qname= new QName(ncpi.getText(), "", null);
test= new NameTest(Type.PROCESSING_INSTRUCTION, qname);
break;
}
case STRING_LITERAL:
{
slpi = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,STRING_LITERAL);
_t = _t.getNextSibling();
QName qname;
qname= new QName(slpi.getText(), "", null);
test= new NameTest(Type.PROCESSING_INSTRUCTION, qname);
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t218;
_t = _t.getNextSibling();
break;
}
case 187:
{
dn = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,187);
_t = _t.getNextSibling();
test= new TypeTest(Type.DOCUMENT);
ast = dn;
{
if (_t==null) _t=ASTNULL;
if ((_t.getType()==LITERAL_element)) {
AST __t221 = _t;
org.exist.xquery.parser.XQueryAST tmp96_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,LITERAL_element);
_t = _t.getFirstChild();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case QNAME:
{
dnqn = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
QName qname= QName.parse(staticContext, dnqn.getText());
test= new NameTest(Type.DOCUMENT, qname);
break;
}
case WILDCARD:
{
org.exist.xquery.parser.XQueryAST tmp97_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,WILDCARD);
_t = _t.getNextSibling();
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case QNAME:
{
dnqn1 = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
QName qname= QName.parse(staticContext, dnqn1.getText());
test= new TypeTest(Type.getType(qname));
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
break;
}
case 3:
{
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
_t = __t221;
_t = _t.getNextSibling();
}
else if ((_t.getType()==209)) {
AST __t224 = _t;
org.exist.xquery.parser.XQueryAST tmp98_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,209);
_t = _t.getFirstChild();
org.exist.xquery.parser.XQueryAST tmp99_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
_t = __t224;
_t = _t.getNextSibling();
}
else if ((_tokenSet_7.member(_t.getType()))) {
}
else {
throw new NoViableAltException(_t);
}
}
break;
}
default:
{
throw new NoViableAltException(_t);
}
}
}
step= new LocationStep(context, axis, test);
path.add(step);
if (ast != null)
step.setASTNode(ast);
{
_loop226:
do {
if (_t==null) _t=ASTNULL;
if ((_t.getType()==PREDICATE)) {
predicate(_t,(LocationStep) step);
_t = _retTree;
}
else {
break _loop226;
}
} while (true);
}
break;
}
case AT:
{
at = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,AT);
_t = _t.getNextSibling();
QName qname= null;
{
if (_t==null) _t=ASTNULL;
switch ( _t.getType()) {
case QNAME:
{
attr = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,QNAME);
_t = _t.getNextSibling();
qname= QName.parse(staticContext, attr.getText(), "");
qname.setNameType(ElementValue.ATTRIBUTE);
break;
}
case PREFIX_WILDCARD:
{
AST __t228 = _t;
org.exist.xquery.parser.XQueryAST tmp100_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,PREFIX_WILDCARD);
_t = _t.getFirstChild();
nc2 = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,NCNAME);
_t = _t.getNextSibling();
_t = __t228;
_t = _t.getNextSibling();
qname= new QName(nc2.getText(), null, null);
qname.setNamespaceURI(null);
qname.setNameType(ElementValue.ATTRIBUTE);
break;
}
case NCNAME:
{
AST __t229 = _t;
nc3 = _t==ASTNULL ? null :(org.exist.xquery.parser.XQueryAST)_t;
match(_t,NCNAME);
_t = _t.getFirstChild();
org.exist.xquery.parser.XQueryAST tmp101_AST_in = (org.exist.xquery.parser.XQueryAST)_t;
match(_t,WILDCARD);
_t = _t.getNextSibling();
_t = __t229;
_t = _t.getNextSibling();
String namespaceURI= staticContext.getURIForPrefix(nc3.getText());
if (namespaceURI == null)
throw new EXistException("No namespace defined for prefix " + nc3.getText());
qname= new QName(null, namespaceURI, null);
qname.setNameType(ElementValue.ATTRIBUTE);
break;
}
case WILDCARD:
{