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

Method check

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

Checks function calls, variable references and updating semantics. @param main main module; null for library modules @throws QueryException query exception

(final MainModule main)

Source from the content-addressed store, hash-verified

271 * @throws QueryException query exception
272 */
273 private void check(final MainModule main) throws QueryException {
274 // resolve function calls
275 qc.functions.resolve();
276 // resolve variable references
277 qc.vars.resolve();
278
279 if(qc.contextValue != null) {
280 final Expr ctx = qc.contextValue.expr;
281 if(!sc.mixUpdates && ctx.has(Flag.UPD)) throw error(UPCTX, ctx);
282 }
283
284 if(qc.updating) {
285 // check updating semantics if updating expressions exist
286 if(!sc.mixUpdates) {
287 qc.functions.checkUp();
288 qc.vars.checkUp();
289 if(main != null) main.expr.checkUp();
290 }
291 // check if main expression is updating
292 qc.updating = main != null && main.expr.has(Flag.UPD);
293 }
294 }
295
296 /**
297 * Parses the "VersionDecl" rule.

Callers 15

parseMainMethod · 0.95
parseLibraryMethod · 0.95
prolog1Method · 0.95
prolog2Method · 0.95
contextValueDeclMethod · 0.95
varDeclMethod · 0.95
namedRecordTypeDeclMethod · 0.95
flworMethod · 0.95
forClauseMethod · 0.95
letValueBindingMethod · 0.95
letStructBindingMethod · 0.95
windowClauseMethod · 0.95

Calls 7

hasMethod · 0.95
errorMethod · 0.95
foundMethod · 0.80
resolveMethod · 0.65
checkUpMethod · 0.45
hasMethod · 0.45
consumeMethod · 0.45

Tested by

no test coverage detected