Search in sources :

Example 1 with Procedure

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());
}
Also used : Context(de.prob.model.eventb.Context) Procedure(de.prob.model.eventb.algorithm.Procedure) TIdentifierLiteral(de.be4.eventbalg.core.parser.node.TIdentifierLiteral)

Aggregations

TIdentifierLiteral (de.be4.eventbalg.core.parser.node.TIdentifierLiteral)1 Context (de.prob.model.eventb.Context)1 Procedure (de.prob.model.eventb.algorithm.Procedure)1