use of org.yakindu.sct.model.stext.stext.EventValueReferenceExpression in project statecharts by Yakindu.
the class STextJavaValidator method checkValueOfNoEvent.
@Check(CheckType.FAST)
public void checkValueOfNoEvent(EventValueReferenceExpression exp) {
Expression eventExpr = exp.getValue();
EObject element = null;
if (eventExpr instanceof ElementReferenceExpression) {
element = ((ElementReferenceExpression) eventExpr).getReference();
} else if (eventExpr instanceof FeatureCall) {
element = ((FeatureCall) eventExpr).getFeature();
}
if (element != null && (!(element instanceof Event))) {
String elementName = "";
if (element instanceof NamedElement) {
elementName = "'" + ((NamedElement) element).getName() + "' ";
}
error(elementName + "is no event.", StextPackage.Literals.EVENT_VALUE_REFERENCE_EXPRESSION__VALUE, 0, VALUE_OF_REQUIRES_EVENT);
}
}
Aggregations