KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > parser > ast > Assign


1 // Autogenerated AST node
2
package org.python.parser.ast;
3 import org.python.parser.SimpleNode;
4 import java.io.DataOutputStream JavaDoc;
5 import java.io.IOException JavaDoc;
6
7 public class Assign extends stmtType {
8     public exprType[] targets;
9     public exprType value;
10
11     public Assign(exprType[] targets, exprType value) {
12         this.targets = targets;
13         this.value = value;
14     }
15
16     public Assign(exprType[] targets, exprType value, SimpleNode parent) {
17         this(targets, value);
18         this.beginLine = parent.beginLine;
19         this.beginColumn = parent.beginColumn;
20     }
21
22     public String JavaDoc toString() {
23         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("Assign[");
24         sb.append("targets=");
25         sb.append(dumpThis(this.targets));
26         sb.append(", ");
27         sb.append("value=");
28         sb.append(dumpThis(this.value));
29         sb.append("]");
30         return sb.toString();
31     }
32
33     public void pickle(DataOutputStream JavaDoc ostream) throws IOException JavaDoc {
34         pickleThis(10, ostream);
35         pickleThis(this.targets, ostream);
36         pickleThis(this.value, ostream);
37     }
38
39     public Object JavaDoc accept(VisitorIF visitor) throws Exception JavaDoc {
40         return visitor.visitAssign(this);
41     }
42
43     public void traverse(VisitorIF visitor) throws Exception JavaDoc {
44         if (targets != null) {
45             for (int i = 0; i < targets.length; i++) {
46                 if (targets[i] != null)
47                     targets[i].accept(visitor);
48             }
49         }
50         if (value != null)
51             value.accept(visitor);
52     }
53
54 }
55
Popular Tags