MCPcopy Create free account
hub / github.com/apache/pig / inlineMacro

Method inlineMacro

src/org/apache/pig/parser/QueryParserDriver.java:297–312  ·  view source on GitHub ↗
(List<CommonTree> inlineNodes,
            List<PigMacro> macroDefs)

Source from the content-addressed store, hash-verified

295 }
296
297 private void inlineMacro(List<CommonTree> inlineNodes,
298 List<PigMacro> macroDefs) throws ParserException {
299 for (CommonTree t : inlineNodes) {
300 Set<String> macroStack = new HashSet<String>();
301 CommonTree newTree = PigMacro.macroInline(t, macroDefs, macroStack, pigContext);
302
303 List<CommonTree> nodes = new ArrayList<CommonTree>();
304 traverseInline(newTree, nodes);
305
306 if (nodes.isEmpty()) {
307 QueryParserUtils.replaceNodeWithNodeList(t, newTree, null);
308 } else {
309 inlineMacro(nodes, macroDefs);
310 }
311 }
312 }
313
314 private void applyRegisters(Tree t) throws ExecException, ParserException {
315 if (t.getText().equalsIgnoreCase(REGISTER_DEF)) {

Callers 1

expandMacroMethod · 0.95

Calls 4

macroInlineMethod · 0.95
traverseInlineMethod · 0.95
isEmptyMethod · 0.45

Tested by

no test coverage detected