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