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

Method hasFreeVars

basex-core/src/main/java/org/basex/query/expr/Expr.java:441–455  ·  view source on GitHub ↗

Checks if this expression has free variables. @return true if there are variables which are used but not declared in this expression, false otherwise

()

Source from the content-addressed store, hash-verified

439 * {@code false} otherwise
440 */
441 public boolean hasFreeVars() {
442 final BitSet declared = new BitSet();
443 return !accept(new ASTVisitor() {
444 @Override
445 public boolean declared(final Var var) {
446 declared.set(var.id);
447 return true;
448 }
449
450 @Override
451 public boolean used(final VarRef ref) {
452 return declared.get(ref.var.id);
453 }
454 });
455 }
456
457 /**
458 * Tries to merge two expressions that are part of an EBV test.

Callers 2

CmpHashGMethod · 0.80
initMethod · 0.80

Calls 1

acceptMethod · 0.95

Tested by

no test coverage detected