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 listcompType extends SimpleNode {
09: public exprType target;
10: public exprType iter;
11: public exprType[] ifs;
12:
13: public listcompType(exprType target, exprType iter, exprType[] ifs) {
14: this .target = target;
15: this .iter = iter;
16: this .ifs = ifs;
17: }
18:
19: public listcompType(exprType target, exprType iter, exprType[] ifs,
20: SimpleNode parent) {
21: this (target, iter, ifs);
22: this .beginLine = parent.beginLine;
23: this .beginColumn = parent.beginColumn;
24: }
25:
26: public String toString() {
27: StringBuffer sb = new StringBuffer("listcomp[");
28: sb.append("target=");
29: sb.append(dumpThis(this .target));
30: sb.append(", ");
31: sb.append("iter=");
32: sb.append(dumpThis(this .iter));
33: sb.append(", ");
34: sb.append("ifs=");
35: sb.append(dumpThis(this .ifs));
36: sb.append("]");
37: return sb.toString();
38: }
39:
40: public void pickle(DataOutputStream ostream) throws IOException {
41: pickleThis(48, ostream);
42: pickleThis(this .target, ostream);
43: pickleThis(this .iter, ostream);
44: pickleThis(this .ifs, ostream);
45: }
46:
47: public Object accept(VisitorIF visitor) throws Exception {
48: traverse(visitor);
49: return null;
50: }
51:
52: public void traverse(VisitorIF visitor) throws Exception {
53: if (target != null)
54: target.accept(visitor);
55: if (iter != null)
56: iter.accept(visitor);
57: if (ifs != null) {
58: for (int i = 0; i < ifs.length; i++) {
59: if (ifs[i] != null)
60: ifs[i].accept(visitor);
61: }
62: }
63: }
64:
65: }
|