public XQueryModule parse(Reader r) throws XQueryException {
return parse(r, null);
}
public XQueryModule parse(Reader r, URI baseUri) throws XQueryException {
final XQueryParser parser;
try {
parser = new XQueryParser(r);
} catch (TokenMgrError e) {
throw new SyntaxError("err:XPST0003", e);
}
if(_statEnv != null) {
parser.setStaticContext(_statEnv);
} else {
this._statEnv = parser.getStaticContext();
}
if(baseUri != null) {
_statEnv.setSystemBaseURI(baseUri);
}
if(_module != null) {
parser.setCurrentModule(_module);
}
XQueryModule m = parser.parse();
return m;
}