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 BinOp extends exprType implements operatorType {
09: public exprType left;
10: public int op;
11: public exprType right;
12:
13: public BinOp(exprType left, int op, exprType right) {
14: this .left = left;
15: this .op = op;
16: this .right = right;
17: }
18:
19: public BinOp(exprType left, int op, exprType right,
20: SimpleNode parent) {
21: this (left, op, right);
22: this .beginLine = parent.beginLine;
23: this .beginColumn = parent.beginColumn;
24: }
25:
26: public String toString() {
27: StringBuffer sb = new StringBuffer("BinOp[");
28: sb.append("left=");
29: sb.append(dumpThis(this .left));
30: sb.append(", ");
31: sb.append("op=");
32: sb.append(dumpThis(this .op, operatorType.operatorTypeNames));
33: sb.append(", ");
34: sb.append("right=");
35: sb.append(dumpThis(this .right));
36: sb.append("]");
37: return sb.toString();
38: }
39:
40: public void pickle(DataOutputStream ostream) throws IOException {
41: pickleThis(29, ostream);
42: pickleThis(this .left, ostream);
43: pickleThis(this .op, ostream);
44: pickleThis(this .right, ostream);
45: }
46:
47: public Object accept(VisitorIF visitor) throws Exception {
48: return visitor.visitBinOp(this );
49: }
50:
51: public void traverse(VisitorIF visitor) throws Exception {
52: if (left != null)
53: left.accept(visitor);
54: if (right != null)
55: right.accept(visitor);
56: }
57:
58: }
|