From 6d6b20517a21187198abf7a56f07d4146963ee1d Mon Sep 17 00:00:00 2001 From: bdemsky Date: Fri, 13 Feb 2009 06:59:39 +0000 Subject: [PATCH] forgotten classes --- Robust/src/IR/Flat/FlatInstanceOfNode.java | 42 ++++++++++++++++++++++ Robust/src/IR/Tree/InstanceOfNode.java | 33 +++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 Robust/src/IR/Flat/FlatInstanceOfNode.java create mode 100644 Robust/src/IR/Tree/InstanceOfNode.java diff --git a/Robust/src/IR/Flat/FlatInstanceOfNode.java b/Robust/src/IR/Flat/FlatInstanceOfNode.java new file mode 100644 index 00000000..8389bea6 --- /dev/null +++ b/Robust/src/IR/Flat/FlatInstanceOfNode.java @@ -0,0 +1,42 @@ +package IR.Flat; +import IR.TypeDescriptor; + +public class FlatInstanceOfNode extends FlatNode { + TempDescriptor src; + TempDescriptor dst; + TypeDescriptor t; + + public FlatInstanceOfNode(TypeDescriptor t, TempDescriptor src, TempDescriptor dst) { + this.t=t; + this.src=src; + this.dst=dst; + } + + public TypeDescriptor getType() { + return t; + } + + public TempDescriptor getSrc() { + return src; + } + + public TempDescriptor getDst() { + return dst; + } + + public String toString() { + return "FlatInstanceNode_"+dst.toString()+"="+src.toString()+".instanceof "+t.getSymbol(); + } + + public int kind() { + return FKind.FlatInstanceOfNode; + } + + public TempDescriptor [] writesTemps() { + return new TempDescriptor[] {dst}; + } + + public TempDescriptor [] readsTemps() { + return new TempDescriptor[] {src}; + } +} diff --git a/Robust/src/IR/Tree/InstanceOfNode.java b/Robust/src/IR/Tree/InstanceOfNode.java new file mode 100644 index 00000000..95d55ddb --- /dev/null +++ b/Robust/src/IR/Tree/InstanceOfNode.java @@ -0,0 +1,33 @@ +package IR.Tree; +import IR.TypeDescriptor; +import IR.TypeUtil; + +public class InstanceOfNode extends ExpressionNode { + ExpressionNode e; + TypeDescriptor t; + + public InstanceOfNode(ExpressionNode e, TypeDescriptor t) { + this.e=e; + this.t=t; + } + + public String printNode(int indent) { + return (e.printNode(indent)+" instanceof "+t.toString()); + } + + public ExpressionNode getExpr() { + return e; + } + + public TypeDescriptor getExprType() { + return t; + } + + public TypeDescriptor getType() { + return new TypeDescriptor(TypeDescriptor.BOOLEAN); + } + + public int kind() { + return Kind.InstanceOfNode; + } +} -- 2.34.1