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