use of de.be4.classicalb.core.parser.node.AConjunctPredicate in project probparsers by bendisposto.
the class SyntaxExtensionTranslator method outAIfPredicatePredicate.
@Override
public void outAIfPredicatePredicate(AIfPredicatePredicate node) {
// IF P THE P2 ELSE P3 END
// will be translated into
// (p => p2) & (not(p) => p3)
AImplicationPredicate imp1 = new AImplicationPredicate((PPredicate) cloneNode(node.getCondition()), (PPredicate) cloneNode(node.getThen()));
AImplicationPredicate imp2 = new AImplicationPredicate(new ANegationPredicate((PPredicate) cloneNode(node.getCondition())), (PPredicate) cloneNode(node.getElse()));
AConjunctPredicate con = new AConjunctPredicate(imp1, imp2);
con.setStartPos(node.getStartPos());
con.setEndPos(node.getEndPos());
node.replaceBy(con);
}
Aggregations