added tertiary expression
[IRC.git] / Robust / src / IR / Tree / BuildIR.java
index d577cbb115e6a9eded0a984449ac9160af9c8bdc..deb48958b54ee370040eea360b02bdb385a9fabe 100644 (file)
@@ -398,7 +398,11 @@ public class BuildIR {
       TypeDescriptor td=parseTypeDescriptor(pn);
       Vector args=parseArgumentList(pn);
       boolean isglobal=pn.getChild("global")!=null;
-      CreateObjectNode con=new CreateObjectNode(td, isglobal);
+      String disjointId=null;
+      if( pn.getChild("disjoint") != null) {
+       disjointId = pn.getChild("disjoint").getTerminal();
+      }
+      CreateObjectNode con=new CreateObjectNode(td, isglobal, disjointId);
       for(int i=0; i<args.size(); i++) {
        con.addArgument((ExpressionNode)args.get(i));
       }
@@ -417,6 +421,10 @@ public class BuildIR {
     } else if (isNode(pn,"createarray")) {
       //System.out.println(pn.PPrint(3,true));
       boolean isglobal=pn.getChild("global")!=null;
+      String disjointId=null;
+      if( pn.getChild("disjoint") != null) {
+       disjointId = pn.getChild("disjoint").getTerminal();
+      }
       TypeDescriptor td=parseTypeDescriptor(pn);
       Vector args=parseDimExprs(pn);
       int num=0;
@@ -424,7 +432,7 @@ public class BuildIR {
        num=((Integer)pn.getChild("dims_opt").getLiteral()).intValue();
       for(int i=0; i<(args.size()+num); i++)
        td=td.makeArray(state);
-      CreateObjectNode con=new CreateObjectNode(td, isglobal);
+      CreateObjectNode con=new CreateObjectNode(td, isglobal, disjointId);
       for(int i=0; i<args.size(); i++) {
        con.addArgument((ExpressionNode)args.get(i));
       }
@@ -472,6 +480,10 @@ public class BuildIR {
       String fieldname = pn.getChild("field").getTerminal();
       //System.out.println("Checking the values of: "+ " td.toString()= " + td.toString()+ "  fieldname= " + fieldname);
       return new OffsetNode(td, fieldname);
+    } else if (isNode(pn, "tert")) {
+      return new TertiaryNode(parseExpression(pn.getChild("cond").getFirstChild()),
+                             parseExpression(pn.getChild("trueexpr").getFirstChild()),
+                             parseExpression(pn.getChild("falseexpr").getFirstChild()) );
     } else {
       System.out.println("---------------------");
       System.out.println(pn.PPrint(3,true));
@@ -702,6 +714,11 @@ public class BuildIR {
       blockstatements.add(start);
       blockstatements.addAll(parseSESEBlock(blockstatements,pn.getChild("body").getFirstChild()));
       blockstatements.add(end);
+    } else if (isNode(pn,"continue")) {
+       blockstatements.add(new ContinueBreakNode(false));
+    } else if (isNode(pn,"break")) {
+       blockstatements.add(new ContinueBreakNode(true));
+
     } else {
       System.out.println("---------------");
       System.out.println(pn.PPrint(3,true));