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 Raise extends stmtType { 8 public exprType type; 9 public exprType inst; 10 public exprType tback; 11 12 public Raise(exprType type, exprType inst, exprType tback) { 13 this.type = type; 14 this.inst = inst; 15 this.tback = tback; 16 } 17 18 public Raise(exprType type, exprType inst, exprType tback, SimpleNode 19 parent) { 20 this(type, inst, tback); 21 this.beginLine = parent.beginLine; 22 this.beginColumn = parent.beginColumn; 23 } 24 25 public String toString() { 26 StringBuffer sb = new StringBuffer ("Raise["); 27 sb.append("type="); 28 sb.append(dumpThis(this.type)); 29 sb.append(", "); 30 sb.append("inst="); 31 sb.append(dumpThis(this.inst)); 32 sb.append(", "); 33 sb.append("tback="); 34 sb.append(dumpThis(this.tback)); 35 sb.append("]"); 36 return sb.toString(); 37 } 38 39 public void pickle(DataOutputStream ostream) throws IOException { 40 pickleThis(16, ostream); 41 pickleThis(this.type, ostream); 42 pickleThis(this.inst, ostream); 43 pickleThis(this.tback, ostream); 44 } 45 46 public Object accept(VisitorIF visitor) throws Exception { 47 return visitor.visitRaise(this); 48 } 49 50 public void traverse(VisitorIF visitor) throws Exception { 51 if (type != null) 52 type.accept(visitor); 53 if (inst != null) 54 inst.accept(visitor); 55 if (tback != null) 56 tback.accept(visitor); 57 } 58 59 } 60 | Popular Tags |