use of de.be4.classicalb.core.parser.node.AConstantsMachineClause 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());
}
use of de.be4.classicalb.core.parser.node.AConstantsMachineClause in project probparsers by bendisposto.
the class MachineContext method caseAConstantsMachineClause.
@Override
public void caseAConstantsMachineClause(AConstantsMachineClause node) {
hasConstants = true;
List<PExpression> copy = new ArrayList<PExpression>(node.getIdentifiers());
for (PExpression e : copy) {
AIdentifierExpression c = (AIdentifierExpression) e;
String name = Utils.getTIdentifierListAsString(c.getIdentifier());
exist(c.getIdentifier());
constants.put(name, c);
}
}
Aggregations