KickJava   Java API By Example, From Geeks To Geeks.

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


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