~vil/pydev/upstream

« back to all changes in this revision

Viewing changes to org.python.pydev.parser/src/org/python/pydev/parser/jython/ast/While.java

  • Committer: Vladimír Lapáček
  • Date: 2006-08-30 18:38:44 UTC
  • Revision ID: vladimir.lapacek@gmail.com-20060830183844-f4d82c1239a7770a
Initial import of upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;
 
6
 
 
7
public class While extends stmtType {
 
8
    public exprType test;
 
9
    public stmtType[] body;
 
10
    public suiteType orelse;
 
11
 
 
12
    public While(exprType test, stmtType[] body, suiteType orelse) {
 
13
        this.test = test;
 
14
        this.body = body;
 
15
        this.orelse = orelse;
 
16
    }
 
17
 
 
18
    public While(exprType test, stmtType[] body, suiteType orelse,
 
19
    SimpleNode parent) {
 
20
        this(test, body, orelse);
 
21
        this.beginLine = parent.beginLine;
 
22
        this.beginColumn = parent.beginColumn;
 
23
    }
 
24
 
 
25
    public String toString() {
 
26
        StringBuffer sb = new StringBuffer("While[");
 
27
        sb.append("test=");
 
28
        sb.append(dumpThis(this.test));
 
29
        sb.append(", ");
 
30
        sb.append("body=");
 
31
        sb.append(dumpThis(this.body));
 
32
        sb.append(", ");
 
33
        sb.append("orelse=");
 
34
        sb.append(dumpThis(this.orelse));
 
35
        sb.append("]");
 
36
        return sb.toString();
 
37
    }
 
38
 
 
39
    public void pickle(DataOutputStream ostream) throws IOException {
 
40
        pickleThis(16, ostream);
 
41
        pickleThis(this.test, ostream);
 
42
        pickleThis(this.body, ostream);
 
43
        pickleThis(this.orelse, ostream);
 
44
    }
 
45
 
 
46
    public Object accept(VisitorIF visitor) throws Exception {
 
47
        return visitor.visitWhile(this);
 
48
    }
 
49
 
 
50
    public void traverse(VisitorIF visitor) throws Exception {
 
51
        if (test != null)
 
52
            test.accept(visitor);
 
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 (orelse != null)
 
60
            orelse.accept(visitor);
 
61
    }
 
62
 
 
63
}