use of de.prob.model.eventb.algorithm.Procedure in project prob2 by bendisposto.
the class ComponentExtractor method caseAProcedureParseUnit.
@Override
public void caseAProcedureParseUnit(final AProcedureParseUnit node) {
String name = node.getName().getText();
LinkedList<TIdentifierLiteral> seen = node.getSeen();
Context ctx = null;
if (node.getSeen().size() == 1) {
String cName = seen.getFirst().getText();
ctx = getContext(cName);
} else if (node.getSeen().size() > 1) {
throw new IllegalArgumentException("Error in " + name + " definition: " + node.getStartPos() + " only one context may be seen by a procedure");
}
Procedure procedure = new Procedure(name, ctx, typeEnv);
ProcedureExtractor pE = new ProcedureExtractor(procedure, node, typeEnv);
modelM = modelM.addProcedure(pE.getProcedure());
}
Aggregations