remove the '$' in the C code as tilera does not allow it
authorjzhou <jzhou>
Wed, 4 Jan 2012 01:25:14 +0000 (01:25 +0000)
committerjzhou <jzhou>
Wed, 4 Jan 2012 01:25:14 +0000 (01:25 +0000)
Robust/src/IR/Tree/BuildIR.java
Robust/src/IR/Tree/SemanticCheck.java
Robust/src/IR/TypeDescriptor.java

index ca56794da9a5b32970e0efea9b69f48900c19f7a..c8efb8e7bc29898770e26fdbb7b1bb8a90733140 100644 (file)
@@ -662,8 +662,8 @@ private void addOuterClassParam( ClassDescriptor cn, ClassDescriptor ocn, int de
                for(Iterator method_it=icd.getMethods(); method_it.hasNext(); ) {
                         MethodDescriptor md=(MethodDescriptor)method_it.next();
                         if( md.isConstructor() ){
-                               md.addParameter( theTypeDesc, "surrounding$" + String.valueOf(depth) ); 
-                               initializeOuterMember( md, "this$" + String.valueOf( depth ), "surrounding$" + String.valueOf(depth) );
+                               md.addParameter( theTypeDesc, "surrounding___DOLLAR___" + String.valueOf(depth) );      
+                               initializeOuterMember( md, "this___DOLLAR___" + String.valueOf( depth ), "surrounding___DOLLAR___" + String.valueOf(depth) );
                                //System.out.println( "The added param is " + md.toString() + "\n" );
                        }
                }
@@ -691,7 +691,7 @@ private void addOuterClassReferences( ClassDescriptor cn, ClassDescriptor ocn, i
        tempChildNode.addChild("identifier").addChild ( tempCopy );
        theNode.addChild("type").addChild( theTypeNode );
        ParseNode variableDeclaratorID = new ParseNode("single");
-       String theStr = "this$" + String.valueOf( depth );
+       String theStr = "this___DOLLAR___" + String.valueOf( depth );
        variableDeclaratorID.addChild( theStr );
        ParseNode variableDeclarator = new ParseNode( "variable_declarator" );
        variableDeclarator.addChild( variableDeclaratorID );
index 7851ae38c6b9401bf3fd52023aef4dcba589c68f..4ec6c4badf1435707947bfe30c32360ed4e8b731 100644 (file)
@@ -702,8 +702,8 @@ public class SemanticCheck {
               if(icd.getSurroundingDesc()==ltd.getClassDesc()) {
                   // this is a surrounding class access inside an inner class
                   fan.setExpression(nn);
-                  fan.setFieldName("this$0");
-                  fd = (FieldDescriptor)icd.getFieldTable().get("this$0");
+                  fan.setFieldName("this___DOLLAR___0");
+                  fd = (FieldDescriptor)icd.getFieldTable().get("this___DOLLAR___0");
               } else if(icd==ltd.getClassDesc()) {
                   // this is an inner class this operation 
                   fd = new FieldDescriptor(new Modifiers(),new TypeDescriptor(icd),"this",null,false);
@@ -908,7 +908,7 @@ public class SemanticCheck {
        String composed = "this";
        NameDescriptor runningDesc = new NameDescriptor( "this" );;
        
-       composed = "this$" + String.valueOf(startingDepth-depth-1);
+       composed = "this___DOLLAR___" + String.valueOf(startingDepth-depth-1);
        runningDesc = new NameDescriptor(runningDesc, composed);
        NameDescriptor idDesc = new NameDescriptor( runningDesc, varname );
        
@@ -1242,8 +1242,8 @@ public class SemanticCheck {
                  int index = 0;
                  while(it_fields.hasNext()) {
                    FieldDescriptor fd = (FieldDescriptor)(it_fields.next());
-                   if(fd.getSymbol().startsWith("this$")) {
-                     con.addArgument(new NameNode(new NameDescriptor("this$"+index)));
+                   if(fd.getSymbol().startsWith("this___DOLLAR___")) {
+                     con.addArgument(new NameNode(new NameDescriptor("this___DOLLAR___"+index)));
                      index++;
                    }
                  }
@@ -1316,7 +1316,7 @@ public class SemanticCheck {
       if(cd.getSuperDesc().isInnerClass()&&!cd.getSuperDesc().isStatic()&&!cd.getSuperDesc().getInStaticContext()) {
        // for a super class that is also an inner class with surrounding reference, add the surrounding 
        // instance of the child instance as the parent instance's surrounding instance
-       min.addArgument(new NameNode(new NameDescriptor("surrounding$0")));
+       min.addArgument(new NameNode(new NameDescriptor("surrounding___DOLLAR___0")));
       }
     }
     for(int i = 0 ; i < tdarray.length; i++) {
@@ -1531,11 +1531,11 @@ NextMethod: for (Iterator methodit = methoddescriptorset.iterator(); methodit.ha
        NameDescriptor runningDesc = new NameDescriptor( "this" );;
        
        for ( int index = startingDepth; index > depth; --index ) {
-               composed = "this$" + String.valueOf( index - 1  );      
+               composed = "this___DOLLAR___" + String.valueOf( index - 1  );   
                runningDesc = new NameDescriptor( runningDesc, composed );
        }
        if( false == cd.isInnerClass() )
-               runningDesc = new NameDescriptor( runningDesc, "this$" + String.valueOf(0) ); //all the way up.
+               runningDesc = new NameDescriptor( runningDesc, "this___DOLLAR___" + String.valueOf(0) ); //all the way up.
 
        return new NameNode(runningDesc);
 }
@@ -1606,9 +1606,9 @@ NextMethod: for (Iterator methodit = methoddescriptorset.iterator(); methodit.ha
        // for a super class that is also an inner class with surrounding reference, add the surrounding 
        // instance of the child instance as the parent instance's surrounding instance
        if(((MethodDescriptor)md).isConstructor()) {
-         min.addArgument(new NameNode(new NameDescriptor("surrounding$0")));
+         min.addArgument(new NameNode(new NameDescriptor("surrounding___DOLLAR___0")));
        } else if(((MethodDescriptor)md).getClassDesc().isInnerClass()&&!((MethodDescriptor)md).getClassDesc().isStatic()&&!((MethodDescriptor)md).getClassDesc().getInStaticContext()) {
-         min.addArgument(new NameNode(new NameDescriptor("this$0")));
+         min.addArgument(new NameNode(new NameDescriptor("this___DOLLAR___0")));
        }
       }
       tdarray=new TypeDescriptor[min.numArgs()];
index dfaf3550e600cad9dc908bf117b5426e09883713..431d964dc0d1d76572f17fb2b2951506890ce7ef 100644 (file)
@@ -150,6 +150,8 @@ public class TypeDescriptor extends Descriptor {
       return "float";
     else if (isOffset())
       return "short";
+    else if (isNull())
+      return "null";
     else
       throw new Error("Error Type: "+type);
   }