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

Method compile

basex-core/src/main/java/org/basex/query/expr/path/Path.java:130–151  ·  view source on GitHub ↗
(final CompileContext cc)

Source from the content-addressed store, hash-verified

128 }
129
130 @Override
131 public final Expr compile(final CompileContext cc) throws QueryException {
132 final Expr rt;
133 if(root != null) {
134 root = root.compile(cc);
135 rt = root;
136 } else {
137 rt = cc.qc.focus.value;
138 }
139
140 cc.get(rt, true, () -> {
141 final int sl = steps.length;
142 for(int s = 0; s < sl; s++) {
143 final Expr step = cc.compileOrError(steps[s], root == null && s == 0);
144 steps[s] = step;
145 cc.updateFocus(step, true);
146 }
147 return null;
148 });
149
150 return optimize(cc);
151 }
152
153 @Override
154 public final Expr optimize(final CompileContext cc) throws QueryException {

Callers

nothing calls this directly

Calls 5

optimizeMethod · 0.95
compileOrErrorMethod · 0.80
updateFocusMethod · 0.80
compileMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected