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

Method compile

basex-core/src/main/java/org/basex/query/expr/Preds.java:38–55  ·  view source on GitHub ↗
(final CompileContext cc)

Source from the content-addressed store, hash-verified

36 }
37
38 @Override
39 public Expr compile(final CompileContext cc) throws QueryException {
40 // called at an early stage as it affects the optimization of predicates
41 final Expr root = assignType(cc.qc.focus.value);
42 final int el = exprs.length;
43 if(el != 0) cc.get(this, true, () -> {
44 if(root != null) {
45 final long size = root.size();
46 if(size != -1) cc.qc.focus.size = size;
47 }
48 for(int e = 0; e < el; ++e) {
49 exprs[e] = cc.compileOrError(exprs[e], false);
50 cc.qc.focus.size = 1;
51 }
52 return null;
53 });
54 return optimize(cc);
55 }
56
57 /**
58 * Assigns the expression type.

Callers

nothing calls this directly

Calls 5

assignTypeMethod · 0.95
sizeMethod · 0.95
optimizeMethod · 0.95
compileOrErrorMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected