KickJava   Java API By Example, From Geeks To Geeks.

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


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 Dict extends exprType {
8     public exprType[] keys;
9     public exprType[] values;
10
11     public Dict(exprType[] keys, exprType[] values) {
12         this.keys = keys;
13         this.values = values;
14     }
15
16     public Dict(exprType[] keys, exprType[] values, SimpleNode parent) {
17         this(keys, values);
18         this.beginLine = parent.beginLine;
19         this.beginColumn = parent.beginColumn;
20     }
21
22     public String JavaDoc toString() {
23         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("Dict[");
24         sb.append("keys=");
25         sb.append(dumpThis(this.keys));
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 JavaDoc ostream) throws IOException JavaDoc {
34         pickleThis(32, ostream);
35         pickleThis(this.keys, ostream);
36         pickleThis(this.values, ostream);
37     }
38
39     public Object JavaDoc accept(VisitorIF visitor) throws Exception JavaDoc {
40         return visitor.visitDict(this);
41     }
42
43     public void traverse(VisitorIF visitor) throws Exception JavaDoc {
44         if (keys != null) {
45             for (int i = 0; i < keys.length; i++) {
46                 if (keys[i] != null)
47                     keys[i].accept(visitor);
48             }
49         }
50         if (values != null) {
51             for (int i = 0; i < values.length; i++) {
52                 if (values[i] != null)
53                     values[i].accept(visitor);
54             }
55         }
56     }
57
58 }
59
Popular Tags