use of de.prob.model.eventb.EventBVariable 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();
}
}
}
}
use of de.prob.model.eventb.EventBVariable in project prob2 by bendisposto.
the class MachineXmlHandler method addVariable.
private void addVariable(final Attributes attributes) {
String name = attributes.getValue("name");
boolean concrete = "true".equals(attributes.getValue("org.eventb.core.concrete"));
String unit = attributes.getValue("de.prob.units.unitPragmaAttribute");
if (concrete) {
variables.add(new EventBVariable(name, unit));
}
}
Aggregations