KickJava   Java API By Example, From Geeks To Geeks.

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


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