private static void oclAtomConstraintVisitor(TCGOCLAtomImpl tcgOCLAtomConstraint){
if (tcgOCLAtomConstraint.getElement() instanceof Property) { //class property
Property oProp = (Property) tcgOCLAtomConstraint.getElement();
TCGVariable toBeAdd = new TCGVariable();
toBeAdd.setName(oProp.getName());
toBeAdd.setType(typeOfVariable(oProp.getType()));
toBeAdd.setIsParameter(false);
if(!((PropertyCallExp)(tcgOCLAtomConstraint.getOclReference())).isMarkedPre()){
//Add property
if(!propertyThatHasNotAtPre.contains(toBeAdd))
propertyThatHasNotAtPre.add(toBeAdd);
}
}
else if (tcgOCLAtomConstraint.getElement() instanceof Variable) { //input parameter
Variable oVar = (Variable)tcgOCLAtomConstraint.getElement();
if (oVar != null) {
//add variable
TCGVariable toBeAdd = new TCGVariable();
if(oVar.getRepresentedParameter() != null && oVar.getRepresentedParameter().getDefaultValue() != null)
toBeAdd.setInitialValue(oVar.getRepresentedParameter().getDefaultValue().stringValue());
toBeAdd.setName(oVar.getName());
toBeAdd.setType(typeOfVariable(oVar.getType()));
toBeAdd.setIsParameter(true);
if(toBeAdd.getType() != null && !propertyThatHasNotAtPre.contains(toBeAdd))
propertyThatHasNotAtPre.add(toBeAdd);
}
}
}