import java.util.*;
import java.math.BigInteger;
import MCC.State;
+import MCC.Compiler;
public class SemanticChecker {
return null;
}
+ rd.addUsage(RelationDescriptor.IMAGE);
rq.setRelation(rd);
vd1.setType(rd.getDomain().getType());
vd1.setSet(rd.getDomain());
public IRErrorReporter getErrorReporter() { return er; }
public SymbolTable getSymbolTable() { return stGlobals; }
});
+ if (Compiler.REJECTLENGTH) {
+ analyze_length(indexbound);
+ }
+
if (indextype == null) {
ok = false;
return ok;
}
+ private void analyze_length(Expr indexbound) {
+ Set descriptors=indexbound.getRequiredDescriptors();
+ for(Iterator it=descriptors.iterator();it.hasNext();) {
+ Descriptor d=(Descriptor)it.next();
+ if (d instanceof FieldDescriptor) {
+ state.noupdate.add(d);
+ } else if (d instanceof ArrayDescriptor) {
+ state.noupdate.add(d);
+ } else if (d instanceof VarDescriptor) {
+ state.noupdate.add(d);
+ }
+ }
+ }
+
private boolean parse_global(ParseNode pn) {
if (!precheck(pn, "global")) {
return false;
dCurrentType = type;
// parse the labels and fields
- if (!parse_labelsandfields(pn.getChild("lf"))) {
+ if (pn.getChild("lf")!=null && !parse_labelsandfields(pn.getChild("lf"))) {
ok = false;
}