KickJava   Java API By Example, From Geeks To Geeks.

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


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