3 import IR.TypeDescriptor;
5 public class OpNode extends ExpressionNode {
10 TypeDescriptor lefttype;
11 TypeDescriptor righttype;
13 public OpNode(ExpressionNode l, ExpressionNode r, Operation o) {
19 public OpNode(ExpressionNode l, Operation o) {
25 public ExpressionNode getLeft() {
29 public ExpressionNode getRight() {
33 public Operation getOp() {
37 public String printNode(int indent) {
39 return op.toString()+"("+left.printNode(indent)+")";
41 return left.printNode(indent)+" "+op.toString()+" "+right.printNode(indent);
44 public void setLeftType(TypeDescriptor argtype) {
45 this.lefttype=argtype;
48 public TypeDescriptor getLeftType() {
52 public void setRightType(TypeDescriptor argtype) {
53 this.righttype=argtype;
56 public TypeDescriptor getRightType() {
60 public TypeDescriptor getType() {
64 public void setType(TypeDescriptor td) {