use of de.be4.classicalb.core.parser.node.POperation in project probparsers by bendisposto.
the class MachineContext method caseAOperationsMachineClause.
@Override
public void caseAOperationsMachineClause(AOperationsMachineClause node) {
this.operationMachineClause = node;
this.contextTable = new ArrayList<LinkedHashMap<String, Node>>();
ArrayList<MachineContext> list = lookupReferencedMachines();
for (int i = 0; i < list.size(); i++) {
MachineContext s = list.get(i);
this.contextTable.add(s.getSetParamter());
this.contextTable.add(s.getScalarParameter());
this.contextTable.add(s.getDeferredSets());
this.contextTable.add(s.getEnumeratedSets());
this.contextTable.add(s.getEnumValues());
this.contextTable.add(s.getConstants());
this.contextTable.add(s.getDefinitions());
this.contextTable.add(s.getVariables());
}
List<POperation> copy = new ArrayList<POperation>(node.getOperations());
// first collect all operations
for (POperation e : copy) {
AOperation op = (AOperation) e;
String name = Utils.getTIdentifierListAsString(op.getOpName());
// existString(name);
if (operations.keySet().contains(name)) {
throw new ScopeException(String.format("Duplicate operation: '%s'", name));
}
operations.put(name, op);
}
// visit all operations
for (POperation e : copy) {
e.apply(this);
}
}
use of de.be4.classicalb.core.parser.node.POperation in project probparsers by bendisposto.
the class CreateFreetypeTest method createOperations.
private AOperationsMachineClause createOperations() {
final AOperation op1 = createAdd("addBool", "b", new ABoolSetExpression(), CONS_BOOL);
final AOperation op2 = createAdd("addInt", "i", new AIntSetExpression(), CONS_INT);
final AOperation op3 = createSimpleAdd("addEmpty");
final AOperationsMachineClause operations = new AOperationsMachineClause(Arrays.<POperation>asList(op1, op2, op3));
return operations;
}
Aggregations