use of de.be4.classicalb.core.parser.node.PExpression in project probparsers by bendisposto.
the class TranslatingVisitor method listToSet.
private java.util.Set<BObject> listToSet(LinkedList<PExpression> elements) {
java.util.Set<BObject> s = de.prob.translator.types.Set.newStorage();
for (PExpression p : elements) {
p.apply(this);
s.add(this.getResult());
}
return s;
}
use of de.be4.classicalb.core.parser.node.PExpression in project probparsers by bendisposto.
the class EnumeratedSetElement method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
TIdentifierLiteral literal = new TIdentifierLiteral(name);
ArrayList<TIdentifierLiteral> idList = new ArrayList<TIdentifierLiteral>();
idList.add(literal);
AIdentifierExpression id = new AIdentifierExpression(idList);
typechecker.setType(id, new SetType(this));
return id;
}
use of de.be4.classicalb.core.parser.node.PExpression in project probparsers by bendisposto.
the class IntegerType method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
AIntegerSetExpression node = new AIntegerSetExpression();
typechecker.setType(node, new SetType(this));
return node;
}
use of de.be4.classicalb.core.parser.node.PExpression in project probparsers by bendisposto.
the class PairType method createASTNode.
public PExpression createASTNode(Typechecker typechecker) {
ACartesianProductExpression node = new ACartesianProductExpression(first.createASTNode(typechecker), second.createASTNode(typechecker));
typechecker.setType(node, new SetType(this));
return node;
}
use of de.be4.classicalb.core.parser.node.PExpression in project prob2 by bendisposto.
the class DependencyWalker method registerMachineNames.
private void registerMachineNames(final List<PExpression> machineNames, final ERefType depType) {
for (final PExpression machineName : machineNames) {
if (machineName instanceof AIdentifierExpression) {
final AIdentifierExpression identifier = (AIdentifierExpression) machineName;
final String dest = extractMachineName(identifier.getIdentifier());
// TODO test this
addMachine(dest, depType == ERefType.USES ? dest : prefix, depType);
}
}
}
Aggregations