KickJava   Java API By Example, From Geeks To Geeks.

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


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 UnaryOp extends exprType implements unaryopType {
8     public int op;
9     public exprType operand;
10
11     public UnaryOp(int op, exprType operand) {
12         this.op = op;
13         this.operand = operand;
14     }
15
16     public UnaryOp(int op, exprType operand, SimpleNode parent) {
17         this(op, operand);
18         this.beginLine = parent.beginLine;
19         this.beginColumn = parent.beginColumn;
20     }
21
22     public String JavaDoc toString() {
23         StringBuffer JavaDoc sb = new StringBuffer JavaDoc("UnaryOp[");
24         sb.append("op=");
25         sb.append(dumpThis(this.op, unaryopType.unaryopTypeNames));
26         sb.append(", ");
27         sb.append("operand=");
28         sb.append(dumpThis(this.operand));
29         sb.append("]");
30         return sb.toString();
31     }
32
33     public void pickle(DataOutputStream JavaDoc ostream) throws IOException JavaDoc {
34         pickleThis(30, ostream);
35         pickleThis(this.op, ostream);
36         pickleThis(this.operand, ostream);
37     }
38
39     public Object JavaDoc accept(VisitorIF visitor) throws Exception JavaDoc {
40         return visitor.visitUnaryOp(this);
41     }
42
43     public void traverse(VisitorIF visitor) throws Exception JavaDoc {
44         if (operand != null)
45             operand.accept(visitor);
46     }
47
48 }
49
Popular Tags