use of de.prob.model.eventb.ContextModifier in project prob2 by bendisposto.
the class ComponentExtractor method caseAContextParseUnit.
@Override
public void caseAContextParseUnit(final AContextParseUnit node) {
String name = node.getName().getText();
ContextModifier contextM = new ContextModifier(new Context(name), typeEnv);
if (node.getExtendsNames().size() == 1) {
String cName = node.getExtendsNames().getFirst().getText();
Context ctx = getContext(cName);
contextM = contextM.setExtends(ctx);
} else if (node.getExtendsNames().size() > 1) {
throw new IllegalArgumentException("Contexts can only refine one abstract context. Found " + node.getExtendsNames().size() + " extended machines");
}
contextM = contextM.addComment(getComment(node.getComments()));
ContextExtractor cE = new ContextExtractor(contextM, typeEnv);
node.apply(cE);
modelM = modelM.addContext(cE.getContext());
}
Aggregations