Random small changes...
authorbdemsky <bdemsky>
Thu, 6 May 2004 06:09:55 +0000 (06:09 +0000)
committerbdemsky <bdemsky>
Thu, 6 May 2004 06:09:55 +0000 (06:09 +0000)
Repair/RepairCompiler/MCC/IR/Sources.java
Repair/RepairCompiler/MCC/IR/Termination.java
Repair/RepairCompiler/MCC/TDL.cup

index e119936..bde5cc9 100755 (executable)
@@ -10,11 +10,12 @@ public class Sources {
     }
 
     public boolean setSource(SetDescriptor sd) {
-       if (sd.getSymbol().equals("InodeBitmapBlock"))
-           return true;
-       if (sd.getSymbol().equals("InodeTableBlock"))
+       SetDescriptor usedblock=(SetDescriptor)state.stSets.get("UsedBlock");
+       SetDescriptor usedinode=(SetDescriptor)state.stSets.get("UsedInode");
+
+       if (usedblock.isSubset(sd))
            return true;
-       if (sd.getSymbol().equals("RootDirectoryInode"))
+       if (usedinode.isSubset(sd))
            return true;
 
        return false;
@@ -23,12 +24,14 @@ public class Sources {
        return !setSource(sd);
     }
     public SetDescriptor getSourceSet(SetDescriptor sd) {
-       if (sd.getSymbol().equals("InodeBitmapBlock"))
-           return (SetDescriptor)state.stSets.get("FreeBlock");
-       if (sd.getSymbol().equals("InodeTableBlock"))
+       SetDescriptor usedblock=(SetDescriptor)state.stSets.get("UsedBlock");
+       SetDescriptor usedinode=(SetDescriptor)state.stSets.get("UsedInode");
+
+       if (usedblock.isSubset(sd))
            return (SetDescriptor)state.stSets.get("FreeBlock");
-       if (sd.getSymbol().equals("RootDirectoryInode"))
+       if (usedinode.isSubset(sd))
            return (SetDescriptor)state.stSets.get("FreeInode");
+
        return null;
     }
 
index da03dac..24617a3 100755 (executable)
@@ -882,7 +882,7 @@ public class Termination {
                // We have an ArrayDescriptor!
                Expr index=de.getIndex();
                if (!index.isValue()) {/* Not assignable */
-                   System.out.println("ERROR:Index is assignable");
+                   System.out.println("ERROR:Index isn't assignable");
                    return false;
                }
                Updates updates=new Updates(index,i,ap,lexpr,slotnumber);
index 25ba2dd..5fbed22 100755 (executable)
@@ -454,7 +454,7 @@ expr ::=
        RESULT = expr;
        :}     
     
-       | LITERAL OPENPAREN literal:literal CLOSEPAREN       
+       | literal:literal
        {:
        debugMessage(PRODSTRING);
        ParseNode expr = new ParseNode("expr", parser.curLine(4));
@@ -534,7 +534,7 @@ literal ::=
        RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("char").addChild(chr).getRoot();
        :}
         
-       | ID:literal
+       | LITERAL OPENPAREN ID:literal CLOSEPAREN
        {:
        debugMessage(PRODSTRING);
        RESULT = (new ParseNode("literal", parser.curLine(1))).addChild("token").addChild(literal).getRoot();