use of org.sirix.axis.filter.NameFilter in project sirix by sirixdb.
the class XPathParser method parseElementTest.
// /**
// * Parses the the rule AttributeDeclaration according to the following
// * production rule:
// * <p>
// * [62] AttributeDeclaration ::= AttributeName .
// * </p>
// */
// private String parseAttributeDeclaration() {
//
// return parseAttributeName();
// }
/**
* Parses the the rule ElementTest according to the following production rule:
* <p>
* [63] ElementTest ::= <"element" "("> (ElementNameOrWildcard ("," TypeName "?"?)?)? ")" .
* </p>
*
* @return filter
*/
private Filter parseElementTest() {
consume("element", true);
consume(TokenType.OPEN_BR, true);
Filter filter = new ElementFilter(getTransaction());
if (!(mToken.getType() == TokenType.CLOSE_BR)) {
final String mName = parseElementNameOrWildcard();
if (!mName.equals("*")) {
filter = new NestedFilter(getTransaction(), filter, new NameFilter(getTransaction(), mName));
}
if (is(TokenType.COMMA, true)) {
filter = new NestedFilter(getTransaction(), filter, new TypeFilter(getTransaction(), parseTypeName()));
if (is(TokenType.INTERROGATION, true)) {
// be false
throw new NoSuchElementException("'?' is not supported yet.");
}
}
}
consume(TokenType.CLOSE_BR, true);
return filter;
}
Aggregations