KickJava   Java API By Example, From Geeks To Geeks.

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


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