}
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;
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;
}
// 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);
RESULT = expr;
:}
- | LITERAL OPENPAREN literal:literal CLOSEPAREN
+ | literal:literal
{:
debugMessage(PRODSTRING);
ParseNode expr = new ParseNode("expr", parser.curLine(4));
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();