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