Search in sources :

Example 1 with AMemberPredicate

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

the class CreateFreetypeTest method createMachine.

private Start createMachine(String name) {
    final AFreetypesMachineClause freetypes = createFreetype();
    final AConstantsMachineClause variables = new AConstantsMachineClause(createIdentifiers(VAR_NAME));
    final AMemberPredicate member = new AMemberPredicate(createIdentifier(VAR_NAME), new APowSubsetExpression(createIdentifier(FREETYPE_NAME)));
    final AInvariantMachineClause inv = new AInvariantMachineClause(member);
    final AInitialisationMachineClause init = new AInitialisationMachineClause(createAssignment(VAR_NAME, new AEmptySetExpression()));
    final AOperationsMachineClause operations = createOperations();
    final AMachineHeader header = new AMachineHeader(createIdLits(name), EMPTY_EXPRS);
    final AAbstractMachineParseUnit machine = new AAbstractMachineParseUnit(new AMachineMachineVariant(), header, Arrays.asList(freetypes, variables, inv, init, operations));
    return new Start(machine, new EOF());
}
Also used : AMachineMachineVariant(de.be4.classicalb.core.parser.node.AMachineMachineVariant) AInitialisationMachineClause(de.be4.classicalb.core.parser.node.AInitialisationMachineClause) AMachineHeader(de.be4.classicalb.core.parser.node.AMachineHeader) AConstantsMachineClause(de.be4.classicalb.core.parser.node.AConstantsMachineClause) Start(de.be4.classicalb.core.parser.node.Start) AMemberPredicate(de.be4.classicalb.core.parser.node.AMemberPredicate) AAbstractMachineParseUnit(de.be4.classicalb.core.parser.node.AAbstractMachineParseUnit) AOperationsMachineClause(de.be4.classicalb.core.parser.node.AOperationsMachineClause) AInvariantMachineClause(de.be4.classicalb.core.parser.node.AInvariantMachineClause) AFreetypesMachineClause(de.be4.classicalb.core.parser.node.AFreetypesMachineClause) APowSubsetExpression(de.be4.classicalb.core.parser.node.APowSubsetExpression) AEmptySetExpression(de.be4.classicalb.core.parser.node.AEmptySetExpression) EOF(de.be4.classicalb.core.parser.node.EOF)

Example 2 with AMemberPredicate

use of de.be4.classicalb.core.parser.node.AMemberPredicate 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

AMemberPredicate (de.be4.classicalb.core.parser.node.AMemberPredicate)2 AAbstractMachineParseUnit (de.be4.classicalb.core.parser.node.AAbstractMachineParseUnit)1 AConstantsMachineClause (de.be4.classicalb.core.parser.node.AConstantsMachineClause)1 AEmptySetExpression (de.be4.classicalb.core.parser.node.AEmptySetExpression)1 AFreetypesMachineClause (de.be4.classicalb.core.parser.node.AFreetypesMachineClause)1 AFunctionExpression (de.be4.classicalb.core.parser.node.AFunctionExpression)1 AInitialisationMachineClause (de.be4.classicalb.core.parser.node.AInitialisationMachineClause)1 AInvariantMachineClause (de.be4.classicalb.core.parser.node.AInvariantMachineClause)1 AMachineHeader (de.be4.classicalb.core.parser.node.AMachineHeader)1 AMachineMachineVariant (de.be4.classicalb.core.parser.node.AMachineMachineVariant)1 AOperation (de.be4.classicalb.core.parser.node.AOperation)1 AOperationsMachineClause (de.be4.classicalb.core.parser.node.AOperationsMachineClause)1 APowSubsetExpression (de.be4.classicalb.core.parser.node.APowSubsetExpression)1 APreconditionSubstitution (de.be4.classicalb.core.parser.node.APreconditionSubstitution)1 ASetExtensionExpression (de.be4.classicalb.core.parser.node.ASetExtensionExpression)1 AUnionExpression (de.be4.classicalb.core.parser.node.AUnionExpression)1 EOF (de.be4.classicalb.core.parser.node.EOF)1 PSubstitution (de.be4.classicalb.core.parser.node.PSubstitution)1 Start (de.be4.classicalb.core.parser.node.Start)1