/** Do the recursive work for visit */ private static void _visit(Object t, Object parent, int childIndex, ContextVisitor visitor) { if (t == null) { return; } visitor.visit(t, parent, childIndex, null); int n = ParseDriver.adaptor.getChildCount(t); for (int i = 0; i < n; i++) { Object child = ParseDriver.adaptor.getChild(t, i); _visit(child, t, i, visitor); } }
/** Do the recursive work for visit */ private static void _visit(Object t, Object parent, int childIndex, ContextVisitor visitor) { if (t == null) { return; } visitor.visit(t, parent, childIndex, null); int n = ParseDriver.adaptor.getChildCount(t); for (int i = 0; i < n; i++) { Object child = ParseDriver.adaptor.getChild(t, i); _visit(child, t, i, visitor); } }
ASTNode func = (ASTNode) ParseDriver.adaptor.getChild(root, 0); if (func.getText().equals("grouping") && func.getChildCount() == 0) { int numberOperands = ParseDriver.adaptor.getChildCount(root); if (numberOperands + 1 != ParseDriver.adaptor.getChildCount(newRoot)) { throw new RuntimeException(ErrorMsg.HIVE_GROUPING_FUNCTION_EXPR_NOT_IN_GROUPBY.getMsg());
@Override public int getChildCount(Object parent) { return adaptor.getChildCount(parent); }
@Override public int getChildCount(Object parent) { return adaptor.getChildCount(parent); }
@Override public int getChildCount(Object parent) { return adaptor.getChildCount(parent); }
@Override public int getChildCount(Object parent) { return adaptor.getChildCount(parent); }
@Override public boolean hasNext() { if ( firstTime ) return root!=null; if ( nodes!=null && nodes.size()>0 ) return true; if ( tree==null ) return false; if ( adaptor.getChildCount(tree)>0 ) return true; return adaptor.getParent(tree)!=null; // back at root? }
@Override public boolean hasNext() { if ( firstTime ) return root!=null; if ( nodes!=null && nodes.size()>0 ) return true; if ( tree==null ) return false; if ( adaptor.getChildCount(tree)>0 ) return true; return adaptor.getParent(tree)!=null; // back at root? }
@Override public boolean hasNext() { if ( firstTime ) return root!=null; if ( nodes!=null && nodes.size()>0 ) return true; if ( tree==null ) return false; if ( adaptor.getChildCount(tree)>0 ) return true; return adaptor.getParent(tree)!=null; // back at root? }
@Override public boolean hasNext() { if ( firstTime ) return root!=null; if ( nodes!=null && nodes.size()>0 ) return true; if ( tree==null ) return false; if ( adaptor.getChildCount(tree)>0 ) return true; return adaptor.getParent(tree)!=null; // back at root? }
@Override public boolean hasNext() { if ( firstTime ) return root!=null; if ( nodes!=null && nodes.size()>0 ) return true; if ( tree==null ) return false; if ( adaptor.getChildCount(tree)>0 ) return true; return adaptor.getParent(tree)!=null; // back at root? }
public boolean hasNext() { if ( firstTime ) return root!=null; if ( nodes!=null && nodes.size()>0 ) return true; if ( tree==null ) return false; if ( adaptor.getChildCount(tree)>0 ) return true; return adaptor.getParent(tree)!=null; // back at root? }
/** Do the recursive work for visit */ private static void _visit(Object t, Object parent, int childIndex, ContextVisitor visitor) { if (t == null) { return; } visitor.visit(t, parent, childIndex, null); int n = ParseDriver.adaptor.getChildCount(t); for (int i = 0; i < n; i++) { Object child = ParseDriver.adaptor.getChild(t, i); _visit(child, t, i, visitor); } }
/** ^(A B C): emit create A, create B, add child, ...*/ protected void simulateTreeConstruction(Object t) { dbg.createNode(t); int n = adaptor.getChildCount(t); for (int i=0; i<n; i++) { Object child = adaptor.getChild(t, i); simulateTreeConstruction(child); dbg.addChild(t, child); } }
/** ^(A B C): emit create A, create B, add child, ...*/ protected void simulateTreeConstruction(Object t) { dbg.createNode(t); int n = adaptor.getChildCount(t); for (int i=0; i<n; i++) { Object child = adaptor.getChild(t, i); simulateTreeConstruction(child); dbg.addChild(t, child); } }
/** ^(A B C): emit create A, create B, add child, ...*/ protected void simulateTreeConstruction(Object t) { dbg.createNode(t); int n = adaptor.getChildCount(t); for (int i=0; i<n; i++) { Object child = adaptor.getChild(t, i); simulateTreeConstruction(child); dbg.addChild(t, child); } }
/** ^(A B C): emit create A, create B, add child, ...*/ protected void simulateTreeConstruction(Object t) { dbg.createNode(t); int n = adaptor.getChildCount(t); for (int i=0; i<n; i++) { Object child = adaptor.getChild(t, i); simulateTreeConstruction(child); dbg.addChild(t, child); } }
/** ^(A B C): emit create A, create B, add child, ...*/ protected void simulateTreeConstruction(Object t) { dbg.createNode(t); int n = adaptor.getChildCount(t); for (int i=0; i<n; i++) { Object child = adaptor.getChild(t, i); simulateTreeConstruction(child); dbg.addChild(t, child); } }
/** ^(A B C): emit create A, create B, add child, ...*/ protected void simulateTreeConstruction(Object t) { dbg.createNode(t); int n = adaptor.getChildCount(t); for (int i=0; i<n; i++) { Object child = adaptor.getChild(t, i); simulateTreeConstruction(child); dbg.addChild(t, child); } }