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