use of com.rockwellcollins.atc.agree.agree.MNSynchStatement in project AGREE by loonwerks.
the class AgreeValidator method checkSynchStatement.
@Check(CheckType.FAST)
public void checkSynchStatement(SynchStatement sync) {
Classifier container = sync.getContainingClassifier();
if (!(container instanceof ComponentImplementation)) {
error(sync, "Synchrony statements can appear only in component implementations");
}
if (sync instanceof CalenStatement || sync instanceof MNSynchStatement || sync instanceof AsynchStatement || sync instanceof LatchedStatement) {
return;
}
// So this may be redundant
if (Integer.valueOf(sync.getVal()) < 0) {
error(sync, "The value of synchrony statments must be positive");
}
String val2 = sync.getVal2();
if (val2 != null) {
if (Integer.valueOf(val2) <= 0) {
error(sync, "The second value of a synchrony statment must be greater than zero");
}
if (Integer.valueOf(sync.getVal()) <= Integer.valueOf(val2)) {
error(sync, "The second value of a synchrony argument must be less than the first");
}
}
}
Aggregations