From: jjenista Date: Thu, 19 Feb 2009 19:28:20 +0000 (+0000) Subject: A start for array initializers. THIS IS NOT A WORKING IMPLEMENTATION\! I checked... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fef1c1937bb59847b3be3820dcf65c51ea6c0213;p=IRC.git A start for array initializers. THIS IS NOT A WORKING IMPLEMENTATION\! I checked in a short circuit to bomb out in BuildIR.java until I have time to go back and finish it. --- diff --git a/Robust/src/IR/Flat/BuildFlat.java b/Robust/src/IR/Flat/BuildFlat.java index f964dd12..df775be2 100644 --- a/Robust/src/IR/Flat/BuildFlat.java +++ b/Robust/src/IR/Flat/BuildFlat.java @@ -792,6 +792,9 @@ public class BuildFlat { case Kind.InstanceOfNode: return flattenInstanceOfNode((InstanceOfNode)en,out_temp); + + case Kind.ArrayInitializerNode: + return flattenArrayInitializerNode((ArrayInitializerNode)en,out_temp); } throw new Error(); } @@ -1090,6 +1093,46 @@ public class BuildFlat { return new NodePair(cond.getBegin(),fion); } + private NodePair flattenArrayInitializerNode(ArrayInitializerNode ain, TempDescriptor out_temp) { + /* + TempDescriptor expr_temp=TempDescriptor.tempFactory("arry_init",ain.getType()); + + // create a new array of size equal to the array initializer + //FlatNode first=null; + //FlatNode last=null; + TempDescriptor[] temps=new TempDescriptor[ain.numVarInitializers()]; + + for (int i=0; i