Search in sources :

Example 1 with APropertiesMachineClause

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

the class BMachine method addPropertiesPredicates.

public void addPropertiesPredicates(Map<String, String> constantStringValues) {
    if (constantStringValues.size() == 0) {
        return;
    }
    APropertiesMachineClause clause = new APropertiesMachineClause();
    this.parseUnit.getMachineClauses().add(clause);
    List<PPredicate> predList = new ArrayList<>();
    for (Entry<String, String> entry : constantStringValues.entrySet()) {
        AIdentifierExpression identifier = createIdentifier(entry.getKey());
        AStringExpression value = new AStringExpression(new TStringLiteral(entry.getValue()));
        AEqualPredicate equal = new AEqualPredicate(identifier, value);
        predList.add(equal);
    }
    clause.setPredicates(createConjunction(predList));
}
Also used : AEqualPredicate(de.be4.classicalb.core.parser.node.AEqualPredicate) AIdentifierExpression(de.be4.classicalb.core.parser.node.AIdentifierExpression) ArrayList(java.util.ArrayList) AStringExpression(de.be4.classicalb.core.parser.node.AStringExpression) TStringLiteral(de.be4.classicalb.core.parser.node.TStringLiteral) PPredicate(de.be4.classicalb.core.parser.node.PPredicate) APropertiesMachineClause(de.be4.classicalb.core.parser.node.APropertiesMachineClause)

Aggregations

AEqualPredicate (de.be4.classicalb.core.parser.node.AEqualPredicate)1 AIdentifierExpression (de.be4.classicalb.core.parser.node.AIdentifierExpression)1 APropertiesMachineClause (de.be4.classicalb.core.parser.node.APropertiesMachineClause)1 AStringExpression (de.be4.classicalb.core.parser.node.AStringExpression)1 PPredicate (de.be4.classicalb.core.parser.node.PPredicate)1 TStringLiteral (de.be4.classicalb.core.parser.node.TStringLiteral)1 ArrayList (java.util.ArrayList)1