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