01: // Autogenerated AST node
02: package org.python.parser.ast;
03:
04: import org.python.parser.SimpleNode;
05: import java.io.DataOutputStream;
06: import java.io.IOException;
07:
08: public class Dict extends exprType {
09: public exprType[] keys;
10: public exprType[] values;
11:
12: public Dict(exprType[] keys, exprType[] values) {
13: this .keys = keys;
14: this .values = values;
15: }
16:
17: public Dict(exprType[] keys, exprType[] values, SimpleNode parent) {
18: this (keys, values);
19: this .beginLine = parent.beginLine;
20: this .beginColumn = parent.beginColumn;
21: }
22:
23: public String toString() {
24: StringBuffer sb = new StringBuffer("Dict[");
25: sb.append("keys=");
26: sb.append(dumpThis(this .keys));
27: sb.append(", ");
28: sb.append("values=");
29: sb.append(dumpThis(this .values));
30: sb.append("]");
31: return sb.toString();
32: }
33:
34: public void pickle(DataOutputStream ostream) throws IOException {
35: pickleThis(32, ostream);
36: pickleThis(this .keys, ostream);
37: pickleThis(this .values, ostream);
38: }
39:
40: public Object accept(VisitorIF visitor) throws Exception {
41: return visitor.visitDict(this );
42: }
43:
44: public void traverse(VisitorIF visitor) throws Exception {
45: if (keys != null) {
46: for (int i = 0; i < keys.length; i++) {
47: if (keys[i] != null)
48: keys[i].accept(visitor);
49: }
50: }
51: if (values != null) {
52: for (int i = 0; i < values.length; i++) {
53: if (values[i] != null)
54: values[i].accept(visitor);
55: }
56: }
57: }
58:
59: }
|