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 BoolOp extends exprType implements boolopType { 8 public int op; 9 public exprType[] values; 10 11 public BoolOp(int op, exprType[] values) { 12 this.op = op; 13 this.values = values; 14 } 15 16 public BoolOp(int op, exprType[] values, SimpleNode parent) { 17 this(op, values); 18 this.beginLine = parent.beginLine; 19 this.beginColumn = parent.beginColumn; 20 } 21 22 public String toString() { 23 StringBuffer sb = new StringBuffer ("BoolOp["); 24 sb.append("op="); 25 sb.append(dumpThis(this.op, boolopType.boolopTypeNames)); 26 sb.append(", "); 27 sb.append("values="); 28 sb.append(dumpThis(this.values)); 29 sb.append("]"); 30 return sb.toString(); 31 } 32 33 public void pickle(DataOutputStream ostream) throws IOException { 34 pickleThis(28, ostream); 35 pickleThis(this.op, ostream); 36 pickleThis(this.values, ostream); 37 } 38 39 public Object accept(VisitorIF visitor) throws Exception { 40 return visitor.visitBoolOp(this); 41 } 42 43 public void traverse(VisitorIF visitor) throws Exception { 44 if (values != null) { 45 for (int i = 0; i < values.length; i++) { 46 if (values[i] != null) 47 values[i].accept(visitor); 48 } 49 } 50 } 51 52 } 53 | Popular Tags |