TCGOCLExpression in_oTCGOCLExpression) {
// TODO die Funktionalit�t in den einzelnen ValueTypes implementieren ... ?
if (in_oTCGOCLExpression instanceof TCGOCLOperation) {
TCGOCLOperation oOpExp = (TCGOCLOperation) in_oTCGOCLExpression;
// if operation name is not in list -> do not change it (e.g.
// addition, subtraction, ...) -> this is no negation
String sNewName = sm_colNameMatching.get(oOpExp.getOperationName());
if (sNewName != null) {
TCGOCLOperation oNewOp = GeneratedFactory.eINSTANCE.createTCGOCLOperation();
if(sNewName.equals("not removed")) {
if(oOpExp.getLeft() != null)
return oOpExp.getLeft();
return oOpExp.getRight();
}
else
oNewOp.setOperationName(sNewName);
if (oOpExp.getLeft() != null)
{
if(TCGOCLExpressionHelperClass.isBooleanOperation(oOpExp))
oNewOp.setLeft(negateLogicalTCGOCLExpression(
oOpExp.getLeft()));
else
oNewOp.setLeft(oOpExp.getLeft());
}
if (oOpExp.getRight() != null)
{
if(TCGOCLExpressionHelperClass.isBooleanOperation(oOpExp))
oNewOp.setRight(negateLogicalTCGOCLExpression(
oOpExp.getRight()));
else
oNewOp.setRight(oOpExp.getRight());
}
oNewOp.setClassification(oOpExp.getClassification());
oNewOp.setOclReference(oOpExp.getOclReference());
oNewOp.setOperation(oOpExp.getOperation());
oNewOp.setPositiveAssignmentOfOriginal(!oOpExp.isPositiveAssignmentOfOriginal());
return oNewOp;
}
}
else if(in_oTCGOCLExpression instanceof TCGOCLAtom) {
if(TCGOCLExpressionHelperClass.isBooleanAtom(in_oTCGOCLExpression)) {
TCGOCLOperation oOperation = GeneratedFactory.eINSTANCE.createTCGOCLOperation();
oOperation.setLeft(null);
oOperation.setRight(in_oTCGOCLExpression);
oOperation.setPositiveAssignmentOfOriginal(!in_oTCGOCLExpression.isPositiveAssignmentOfOriginal());
oOperation.setOperationName("not");
return oOperation;
}
}
return in_oTCGOCLExpression;
}