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 Subscript extends exprType implements expr_contextType {
09: public exprType value;
10: public sliceType slice;
11: public int ctx;
12:
13: public Subscript(exprType value, sliceType slice, int ctx) {
14: this .value = value;
15: this .slice = slice;
16: this .ctx = ctx;
17: }
18:
19: public Subscript(exprType value, sliceType slice, int ctx,
20: SimpleNode parent) {
21: this (value, slice, ctx);
22: this .beginLine = parent.beginLine;
23: this .beginColumn = parent.beginColumn;
24: }
25:
26: public String toString() {
27: StringBuffer sb = new StringBuffer("Subscript[");
28: sb.append("value=");
29: sb.append(dumpThis(this .value));
30: sb.append(", ");
31: sb.append("slice=");
32: sb.append(dumpThis(this .slice));
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(40, ostream);
43: pickleThis(this .value, ostream);
44: pickleThis(this .slice, ostream);
45: pickleThis(this .ctx, ostream);
46: }
47:
48: public Object accept(VisitorIF visitor) throws Exception {
49: return visitor.visitSubscript(this );
50: }
51:
52: public void traverse(VisitorIF visitor) throws Exception {
53: if (value != null)
54: value.accept(visitor);
55: if (slice != null)
56: slice.accept(visitor);
57: }
58:
59: }
|