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