~vil/pydev/upstream

« back to all changes in this revision

Viewing changes to org.python.pydev.parser/src/org/python/pydev/parser/jython/ast/Attribute.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 Attribute extends exprType implements expr_contextType {
 
8
    public exprType value;
 
9
    public NameTokType attr;
 
10
    public int ctx;
 
11
 
 
12
    public Attribute(exprType value, NameTokType attr, int ctx) {
 
13
        this.value = value;
 
14
        this.attr = attr;
 
15
        this.ctx = ctx;
 
16
    }
 
17
 
 
18
    public Attribute(exprType value, NameTokType attr, int ctx, SimpleNode
 
19
    parent) {
 
20
        this(value, attr, ctx);
 
21
        this.beginLine = parent.beginLine;
 
22
        this.beginColumn = parent.beginColumn;
 
23
    }
 
24
 
 
25
    public String toString() {
 
26
        StringBuffer sb = new StringBuffer("Attribute[");
 
27
        sb.append("value=");
 
28
        sb.append(dumpThis(this.value));
 
29
        sb.append(", ");
 
30
        sb.append("attr=");
 
31
        sb.append(dumpThis(this.attr));
 
32
        sb.append(", ");
 
33
        sb.append("ctx=");
 
34
        sb.append(dumpThis(this.ctx,
 
35
        expr_contextType.expr_contextTypeNames));
 
36
        sb.append("]");
 
37
        return sb.toString();
 
38
    }
 
39
 
 
40
    public void pickle(DataOutputStream ostream) throws IOException {
 
41
        pickleThis(43, ostream);
 
42
        pickleThis(this.value, ostream);
 
43
        pickleThis(this.attr, ostream);
 
44
        pickleThis(this.ctx, ostream);
 
45
    }
 
46
 
 
47
    public Object accept(VisitorIF visitor) throws Exception {
 
48
        return visitor.visitAttribute(this);
 
49
    }
 
50
 
 
51
    public void traverse(VisitorIF visitor) throws Exception {
 
52
        if (value != null)
 
53
            value.accept(visitor);
 
54
        if (attr != null)
 
55
            attr.accept(visitor);
 
56
    }
 
57
 
 
58
}