1
// Autogenerated AST node
2
package org.python.pydev.parser.jython.ast;
3
import org.python.pydev.parser.jython.SimpleNode;
4
import java.io.DataOutputStream;
5
import java.io.IOException;
7
public class If extends stmtType {
9
public stmtType[] body;
10
public stmtType[] orelse;
12
public If(exprType test, stmtType[] body, stmtType[] orelse) {
18
public If(exprType test, stmtType[] body, stmtType[] orelse, SimpleNode
20
this(test, body, orelse);
21
this.beginLine = parent.beginLine;
22
this.beginColumn = parent.beginColumn;
25
public String toString() {
26
StringBuffer sb = new StringBuffer("If[");
28
sb.append(dumpThis(this.test));
31
sb.append(dumpThis(this.body));
34
sb.append(dumpThis(this.orelse));
39
public void pickle(DataOutputStream ostream) throws IOException {
40
pickleThis(17, ostream);
41
pickleThis(this.test, ostream);
42
pickleThis(this.body, ostream);
43
pickleThis(this.orelse, ostream);
46
public Object accept(VisitorIF visitor) throws Exception {
47
return visitor.visitIf(this);
50
public void traverse(VisitorIF visitor) throws Exception {
54
for (int i = 0; i < body.length; i++) {
56
body[i].accept(visitor);
60
for (int i = 0; i < orelse.length; i++) {
61
if (orelse[i] != null)
62
orelse[i].accept(visitor);