use of de.prob.model.representation.Machine in project prob2 by bendisposto.
the class EventBModelTranslator method printPragmas.
private void printPragmas(final IPrologTermOutput pto) {
for (Machine machine : model.getChildrenOfType(Machine.class)) {
EventBMachine ebM = (EventBMachine) machine;
for (EventBVariable var : ebM.getVariables()) {
if (var.hasUnit()) {
pto.openTerm("pragma");
pto.printAtom("unit");
pto.printAtom(machine.getName());
pto.printAtom(var.getName());
pto.openList();
pto.printAtom(var.getUnit());
pto.closeList();
pto.closeTerm();
}
}
}
for (Context context : model.getChildrenOfType(Context.class)) {
for (EventBConstant constant : context.getConstants()) {
if (constant.hasUnit()) {
pto.openTerm("pragma");
pto.printAtom("unit");
pto.printAtom(context.getName());
pto.printAtom(constant.getName());
pto.openList();
pto.printAtom(constant.getUnit());
pto.closeList();
pto.closeTerm();
}
}
}
}
Aggregations