01: // Autogenerated AST node
02: package org.python.parser.ast;
03:
04: import org.python.parser.SimpleNode;
05: import java.io.DataOutputStream;
06: import java.io.IOException;
07:
08: public class Attribute extends exprType implements expr_contextType {
09: public exprType value;
10: public String attr;
11: public int ctx;
12:
13: public Attribute(exprType value, String attr, int ctx) {
14: this .value = value;
15: this .attr = attr;
16: this .ctx = ctx;
17: }
18:
19: public Attribute(exprType value, String attr, int ctx,
20: SimpleNode parent) {
21: this (value, attr, ctx);
22: this .beginLine = parent.beginLine;
23: this .beginColumn = parent.beginColumn;
24: }
25:
26: public String toString() {
27: StringBuffer sb = new StringBuffer("Attribute[");
28: sb.append("value=");
29: sb.append(dumpThis(this .value));
30: sb.append(", ");
31: sb.append("attr=");
32: sb.append(dumpThis(this .attr));
33: sb.append(", ");
34: sb.append("ctx=");
35: sb.append(dumpThis(this .ctx,
36: expr_contextType.expr_contextTypeNames));
37: sb.append("]");
38: return sb.toString();
39: }
40:
41: public void pickle(DataOutputStream ostream) throws IOException {
42: pickleThis(39, ostream);
43: pickleThis(this .value, ostream);
44: pickleThis(this .attr, ostream);
45: pickleThis(this .ctx, ostream);
46: }
47:
48: public Object accept(VisitorIF visitor) throws Exception {
49: return visitor.visitAttribute(this );
50: }
51:
52: public void traverse(VisitorIF visitor) throws Exception {
53: if (value != null)
54: value.accept(visitor);
55: }
56:
57: }
|