String (Lexer lexer) { String type = parseQName(lexer); if (type == null) { if (lexer.getTokenType() == XPath2TokenTypes.ITEM || lexer.getTokenType() == XPathTokenTypes.FUNCTION_NAME || lexer.getTokenType() == XPathTokenTypes.NODE_TYPE) { type = lexer.getTokenText(); lexer.advance(); match(lexer, XPathTokenTypes.LPAREN); match(lexer, XPathTokenTypes.RPAREN); type += "()"; } else { assert false : "unexpected token: " + lexer.getTokenType(); } } return type; }