MCPcopy Create free account
hub / github.com/BaseXdb/basex / dirPI

Method dirPI

basex-core/src/main/java/org/basex/query/QueryParser.java:3318–3333  ·  view source on GitHub ↗

Parses the "DirPIConstructor" rule. Parses the "DirPIContents" rule. @return query expression @throws QueryException query exception

()

Source from the content-addressed store, hash-verified

3316 * @throws QueryException query exception
3317 */
3318 private Expr dirPI() throws QueryException {
3319 final byte[] name = ncName(NOPINAME, false);
3320 if(eq(lc(name), XML)) throw error(PIXML_X, name);
3321
3322 final boolean space = skipWs();
3323 final TokenBuilder tb = new TokenBuilder();
3324 while(true) {
3325 final int cp = consume();
3326 if(cp == 0) throw error(NOPI);
3327 if(cp == '?' && consume('>')) {
3328 return new CPI(info(), false, Str.get(name), Str.get(tb.finish()));
3329 }
3330 if(!space) throw error(NOPI);
3331 tb.add(cp);
3332 }
3333 }
3334
3335 /**
3336 * Parses the "CDataSection" rule.

Callers 1

dirConstructorMethod · 0.95

Calls 10

ncNameMethod · 0.95
errorMethod · 0.95
skipWsMethod · 0.95
infoMethod · 0.95
getMethod · 0.95
finishMethod · 0.95
addMethod · 0.95
eqMethod · 0.65
lcMethod · 0.45
consumeMethod · 0.45

Tested by

no test coverage detected