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