Search in sources :

Example 1 with AUnionExpression

use of de.be4.classicalb.core.parser.node.AUnionExpression in project probparsers by bendisposto.

the class CreateFreetypeTest method createSimpleAdd.

private AOperation createSimpleAdd(String name) {
    final ASetExtensionExpression newVal = new ASetExtensionExpression(createIdentifiers(CONS_EMPTY));
    final PSubstitution subst = createAssignment(VAR_NAME, new AUnionExpression(createIdentifier(VAR_NAME), newVal));
    return new AOperation(EMPTY_EXPRS, createIdLits(name), EMPTY_EXPRS, subst);
}
Also used : AUnionExpression(de.be4.classicalb.core.parser.node.AUnionExpression) ASetExtensionExpression(de.be4.classicalb.core.parser.node.ASetExtensionExpression) AOperation(de.be4.classicalb.core.parser.node.AOperation) PSubstitution(de.be4.classicalb.core.parser.node.PSubstitution)

Example 2 with AUnionExpression

use of de.be4.classicalb.core.parser.node.AUnionExpression in project probparsers by bendisposto.

the class CreateFreetypeTest method createAdd.

private AOperation createAdd(String name, String param, PExpression type, String cons) {
    final AMemberPredicate pre = new AMemberPredicate(createIdentifier(param), type);
    final ASetExtensionExpression newVal = new ASetExtensionExpression(Arrays.<PExpression>asList(new AFunctionExpression(createIdentifier(cons), createIdentifiers(param))));
    final PSubstitution subst = new APreconditionSubstitution(pre, createAssignment(VAR_NAME, new AUnionExpression(createIdentifier(VAR_NAME), newVal)));
    return new AOperation(EMPTY_EXPRS, createIdLits(name), createIdentifiers(param), subst);
}
Also used : AUnionExpression(de.be4.classicalb.core.parser.node.AUnionExpression) ASetExtensionExpression(de.be4.classicalb.core.parser.node.ASetExtensionExpression) APreconditionSubstitution(de.be4.classicalb.core.parser.node.APreconditionSubstitution) AOperation(de.be4.classicalb.core.parser.node.AOperation) PSubstitution(de.be4.classicalb.core.parser.node.PSubstitution) AMemberPredicate(de.be4.classicalb.core.parser.node.AMemberPredicate) AFunctionExpression(de.be4.classicalb.core.parser.node.AFunctionExpression)

Aggregations

AOperation (de.be4.classicalb.core.parser.node.AOperation)2 ASetExtensionExpression (de.be4.classicalb.core.parser.node.ASetExtensionExpression)2 AUnionExpression (de.be4.classicalb.core.parser.node.AUnionExpression)2 PSubstitution (de.be4.classicalb.core.parser.node.PSubstitution)2 AFunctionExpression (de.be4.classicalb.core.parser.node.AFunctionExpression)1 AMemberPredicate (de.be4.classicalb.core.parser.node.AMemberPredicate)1 APreconditionSubstitution (de.be4.classicalb.core.parser.node.APreconditionSubstitution)1