~vil/pydev/upstream

« back to all changes in this revision

Viewing changes to org.python.pydev.parser/src/org/python/pydev/parser/jython/ast/listcompType.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 java.io.DataOutputStream;
 
4
import java.io.IOException;
 
5
 
 
6
import org.python.pydev.parser.jython.SimpleNode;
 
7
 
 
8
public class listcompType extends SimpleNode {
 
9
        /**
 
10
     * 
 
11
     */
 
12
    private static final long serialVersionUID = 971434004466657577L;
 
13
    public exprType target;
 
14
        public exprType iter;
 
15
        public exprType[] ifs;
 
16
 
 
17
        public listcompType(exprType target, exprType iter, exprType[] ifs) {
 
18
                this.target = target;
 
19
                this.iter = iter;
 
20
                this.ifs = ifs;
 
21
        }
 
22
 
 
23
        public listcompType(exprType target, exprType iter, exprType[] ifs,
 
24
        SimpleNode parent) {
 
25
                this(target, iter, ifs);
 
26
                this.beginLine = parent.beginLine;
 
27
                this.beginColumn = parent.beginColumn;
 
28
        }
 
29
 
 
30
        public String toString() {
 
31
                StringBuffer sb = new StringBuffer("listcomp[");
 
32
                sb.append("target=");
 
33
                sb.append(dumpThis(this.target));
 
34
                sb.append(", ");
 
35
                sb.append("iter=");
 
36
                sb.append(dumpThis(this.iter));
 
37
                sb.append(", ");
 
38
                sb.append("ifs=");
 
39
                sb.append(dumpThis(this.ifs));
 
40
                sb.append("]");
 
41
                return sb.toString();
 
42
        }
 
43
 
 
44
        public void pickle(DataOutputStream ostream) throws IOException {
 
45
                pickleThis(48, ostream);
 
46
                pickleThis(this.target, ostream);
 
47
                pickleThis(this.iter, ostream);
 
48
                pickleThis(this.ifs, ostream);
 
49
        }
 
50
 
 
51
        public Object accept(VisitorIF visitor) throws Exception {
 
52
                traverse(visitor);
 
53
                return null;
 
54
        }
 
55
 
 
56
        public void traverse(VisitorIF visitor) throws Exception {
 
57
                if (target != null)
 
58
                        target.accept(visitor);
 
59
                if (iter != null)
 
60
                        iter.accept(visitor);
 
61
                if (ifs != null) {
 
62
                        for (int i = 0; i < ifs.length; i++) {
 
63
                                if (ifs[i] != null)
 
64
                                        ifs[i].accept(visitor);
 
65
                        }
 
66
                }
 
67
        }
 
68
 
 
69
}