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