/** * 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); }