Search in sources :

Example 6 with EventBMachine

use of de.prob.model.eventb.EventBMachine in project prob2 by bendisposto.

the class EventBModelTranslator method extractMachineHierarchy.

public List<EventBMachine> extractMachineHierarchy(final AbstractElement mainComponent, EventBModel model) {
    if (mainComponent instanceof Context) {
        return Collections.emptyList();
    }
    List<EventBMachine> machines = new ArrayList<>();
    if (mainComponent instanceof EventBMachine) {
        EventBMachine machine = (EventBMachine) mainComponent;
        machines.add(machine);
        machines.addAll(extractMachines(machine, model));
    }
    return machines;
}
Also used : Context(de.prob.model.eventb.Context) ArrayList(java.util.ArrayList) EventBMachine(de.prob.model.eventb.EventBMachine)

Aggregations

EventBMachine (de.prob.model.eventb.EventBMachine)6 Context (de.prob.model.eventb.Context)3 AbstractElement (de.prob.model.representation.AbstractElement)3 ArrayList (java.util.ArrayList)3 TIdentifierLiteral (de.be4.eventbalg.core.parser.node.TIdentifierLiteral)1 ClassicalBMachine (de.prob.model.classicalb.ClassicalBMachine)1 Operation (de.prob.model.classicalb.Operation)1 Event (de.prob.model.eventb.Event)1 EventBConstant (de.prob.model.eventb.EventBConstant)1 EventBVariable (de.prob.model.eventb.EventBVariable)1 EventParameter (de.prob.model.eventb.EventParameter)1 MachineModifier (de.prob.model.eventb.MachineModifier)1 Machine (de.prob.model.representation.Machine)1 ModelElementList (de.prob.model.representation.ModelElementList)1 File (java.io.File)1 IOException (java.io.IOException)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 SAXParser (javax.xml.parsers.SAXParser)1 SAXParserFactory (javax.xml.parsers.SAXParserFactory)1 SAXException (org.xml.sax.SAXException)1