/** * Sets the parent to this for all children. * * @since 3.0 */ protected void connectChildren() { if (children != null) { for (int i = 0; i < children.length; i++) { children[i].jjtSetParent(this); } } }
/** * Sets the parent to this for all children. * * @since 3.0 */ protected void connectChildren() { if (children != null) { for (Node child : children) { // although nulls are expected to be wrapped in scalar, // still doing a check here to make it more robust if (child != null) { child.jjtSetParent(this); } } } }
public void setOperand(int index, Object value) { Node node = (value == null || value instanceof Node) ? (Node) value : new ASTScalar(value); jjtAddChild(node, index); // set the parent, as jjtAddChild doesn't do it... if (node != null) { node.jjtSetParent(this); } }
public ASTFullObject(Expression expression) { this(); Node node = wrapChild(expression); jjtAddChild(node, 0); node.jjtSetParent(this); }
@Override public void setOperand(int index, Object value) { Node node = (value == null || value instanceof Node) ? (Node) value : new ASTScalar(value); jjtAddChild(node, index); // set the parent, as jjtAddChild doesn't do it... if (node != null) { node.jjtSetParent(this); } }
public void closeNodeScope(Node n, int num) { mk = marks.remove(marks.size()-1); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; }
void closeNodeScope(Node n, int num) { mk = ((Integer)marks.pop()).intValue(); while (num-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, num); } n.jjtClose(); pushNode(n); node_created = true; }
public void closeNodeScope(Node n, boolean condition) { if (condition) { int a = nodeArity(); mk = marks.remove(marks.size()-1); while (a-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, a); } n.jjtClose(); pushNode(n); node_created = true; } else { mk = marks.remove(marks.size()-1); node_created = false; } } }
void closeNodeScope(Node n, boolean condition) { if (condition) { int a = nodeArity(); mk = ((Integer)marks.pop()).intValue(); while (a-- > 0) { Node c = popNode(); c.jjtSetParent(n); n.jjtAddChild(c, a); } n.jjtClose(); pushNode(n); node_created = true; } else { mk = ((Integer)marks.pop()).intValue(); node_created = false; } } }