private Node transformBlock(AstNode node) { if (node instanceof Scope) { pushScope((Scope)node); } try { List<Node> kids = new ArrayList<Node>(); for (Node kid : node) { kids.add(transform((AstNode)kid)); } node.removeChildren(); for (Node kid : kids) { node.addChildToBack(kid); } return node; } finally { if (node instanceof Scope) { popScope(); } } }
private Node transformBlock(AstNode node) { if (node instanceof Scope) { pushScope((Scope)node); } try { List<Node> kids = new ArrayList<Node>(); for (Node kid : node) { kids.add(transform((AstNode)kid)); } node.removeChildren(); for (Node kid : kids) { node.addChildToBack(kid); } return node; } finally { if (node instanceof Scope) { popScope(); } } }
private Node transformBlock(AstNode node) { if (node instanceof Scope) { pushScope((Scope)node); } try { List<Node> kids = new ArrayList<Node>(); for (Node kid : node) { kids.add(transform((AstNode)kid)); } node.removeChildren(); for (Node kid : kids) { node.addChildToBack(kid); } return node; } finally { if (node instanceof Scope) { popScope(); } } }
private Node transformBlock(AstNode node) { if (node instanceof Scope) { pushScope((Scope)node); } try { List<Node> kids = new ArrayList<Node>(); for (Node kid : node) { kids.add(transform((AstNode)kid)); } node.removeChildren(); for (Node kid : kids) { node.addChildToBack(kid); } return node; } finally { if (node instanceof Scope) { popScope(); } } }
/** * Adds a child or function to the end of the block. * Sets the parent of the child to this node, and fixes up * the start position of the child to be relative to this node. * Sets the length of this node to include the new child. * @param kid the child * @throws IllegalArgumentException if kid is {@code null} */ public void addChild(AstNode kid) { assertNotNull(kid); int end = kid.getPosition() + kid.getLength(); setLength(end - this.getPosition()); addChildToBack(kid); kid.setParent(this); }
/** * Adds a child or function to the end of the block. * Sets the parent of the child to this node, and fixes up * the start position of the child to be relative to this node. * Sets the length of this node to include the new child. * @param kid the child * @throws IllegalArgumentException if kid is {@code null} */ public void addChild(AstNode kid) { assertNotNull(kid); int end = kid.getPosition() + kid.getLength(); setLength(end - this.getPosition()); addChildToBack(kid); kid.setParent(this); }
/** * Adds a child or function to the end of the block. * Sets the parent of the child to this node, and fixes up * the start position of the child to be relative to this node. * Sets the length of this node to include the new child. * @param kid the child * @throws IllegalArgumentException if kid is {@code null} */ public void addChild(AstNode kid) { assertNotNull(kid); int end = kid.getPosition() + kid.getLength(); setLength(end - this.getPosition()); addChildToBack(kid); kid.setParent(this); }
/** * Adds a child or function to the end of the block. * Sets the parent of the child to this node, and fixes up * the start position of the child to be relative to this node. * Sets the length of this node to include the new child. * @param kid the child * @throws IllegalArgumentException if kid is {@code null} */ public void addChild(AstNode kid) { assertNotNull(kid); int end = kid.getPosition() + kid.getLength(); setLength(end - this.getPosition()); addChildToBack(kid); kid.setParent(this); }