// Autogenerated AST node package org.python.pydev.parser.jython.ast; import org.python.pydev.parser.jython.SimpleNode; import java.util.Arrays; public final class Yield extends exprType { public exprType value; public boolean yield_from; public Yield(exprType value, boolean yield_from) { this.value = value; this.yield_from = yield_from; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((value == null) ? 0 : value.hashCode()); result = prime * result + (yield_from ? 17 : 137); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Yield other = (Yield) obj; if (value == null) { if (other.value != null) return false;} else if (!value.equals(other.value)) return false; if(this.yield_from != other.yield_from) return false; return true; } @Override public Yield createCopy() { return createCopy(true); } @Override public Yield createCopy(boolean copyComments) { Yield temp = new Yield(value!=null?(exprType)value.createCopy(copyComments):null, yield_from); temp.beginLine = this.beginLine; temp.beginColumn = this.beginColumn; if(this.specialsBefore != null && copyComments){ for(Object o:this.specialsBefore){ if(o instanceof commentType){ commentType commentType = (commentType) o; temp.getSpecialsBefore().add(commentType.createCopy(copyComments)); } } } if(this.specialsAfter != null && copyComments){ for(Object o:this.specialsAfter){ if(o instanceof commentType){ commentType commentType = (commentType) o; temp.getSpecialsAfter().add(commentType.createCopy(copyComments)); } } } return temp; } @Override public String toString() { StringBuffer sb = new StringBuffer("Yield["); sb.append("value="); sb.append(dumpThis(this.value)); sb.append(", "); sb.append("yield_from="); sb.append(dumpThis(this.yield_from)); sb.append("]"); return sb.toString(); } @Override public Object accept(VisitorIF visitor) throws Exception { return visitor.visitYield(this); } @Override public void traverse(VisitorIF visitor) throws Exception { if (value != null) { value.accept(visitor); } } }