1 package org.python.parser.ast; 3 import org.python.parser.SimpleNode; 4 import java.io.DataOutputStream ; 5 import java.io.IOException ; 6 7 public class Yield extends stmtType { 8 public exprType value; 9 10 public Yield(exprType value) { 11 this.value = value; 12 } 13 14 public Yield(exprType value, SimpleNode parent) { 15 this(value); 16 this.beginLine = parent.beginLine; 17 this.beginColumn = parent.beginColumn; 18 } 19 20 public String toString() { 21 StringBuffer sb = new StringBuffer ("Yield["); 22 sb.append("value="); 23 sb.append(dumpThis(this.value)); 24 sb.append("]"); 25 return sb.toString(); 26 } 27 28 public void pickle(DataOutputStream ostream) throws IOException { 29 pickleThis(8, ostream); 30 pickleThis(this.value, ostream); 31 } 32 33 public Object accept(VisitorIF visitor) throws Exception { 34 return visitor.visitYield(this); 35 } 36 37 public void traverse(VisitorIF visitor) throws Exception { 38 if (value != null) 39 value.accept(visitor); 40 } 41 42 } 43 | Popular Tags |