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