KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > python > parser > ast > Attribute


1 // Autogenerated AST node
2
package org.python.parser.ast;
3 import org.python.parser.SimpleNode;
4 import java.io.DataOutputStream JavaDoc;
5 import java.io.IOException JavaDoc;
6
7 public class Attribute extends exprType implements expr_contextType {
8     public exprType value;
9     public String JavaDoc attr;
10     public int ctx;
11
12     public Attribute(exprType value, String JavaDoc attr, int ctx) {
13         this.value = value;
14         this.attr = attr;
15         this.ctx = ctx;
16     }
17
18     public Attribute(exprType value, String JavaDoc 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 JavaDoc toString() {
26         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("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 JavaDoc ostream) throws IOException JavaDoc {
41         pickleThis(39, ostream);
42         pickleThis(this.value, ostream);
43         pickleThis(this.attr, ostream);
44         pickleThis(this.ctx, ostream);
45     }
46
47     public Object JavaDoc accept(VisitorIF visitor) throws Exception JavaDoc {
48         return visitor.visitAttribute(this);
49     }
50
51     public void traverse(VisitorIF visitor) throws Exception JavaDoc {
52         if (value != null)
53             value.accept(visitor);
54     }
55
56 }
57
Popular Tags