@Check(CheckType.FAST) public void checkReactionEffectActionExpression(ReactionEffect effect) { EList<Expression> actions = effect.getActions(); for (Expression expression : actions) { try { report(typeInferrer.inferType(expression), null); } catch (IllegalArgumentException e) { // ignore unknown literals here, as this also happens when a // linking problem occurred, which is handled in other locations } } }
@Check(CheckType.FAST) public void checkTimeEventSpecValueExpression(TimeEventSpec spec) { try { InferenceResult result = typeInferrer.inferType(spec.getValue()); if (result.getType() == null || !typeSystem.isIntegerType(result.getType())) { error(TIME_EXPRESSION, null); } report(result, StextPackage.Literals.TIME_EVENT_SPEC__VALUE); } catch (IllegalArgumentException e) { // ignore unknown literals here, as this also happens when a // linking problem occurred, which is handled in other locations } }
@Check(CheckType.FAST) public void checkVariableDefinition(final VariableDefinition definition) { try { InferenceResult result = typeInferrer.inferType(definition); if (result.getType() != null && typeSystem.isVoidType(result.getType())) { error(VARIABLE_VOID_TYPE, null); } else { report(result, null); } } catch (IllegalArgumentException e) { // ignore unknown literals here, as this also happens when a // linking problem occurred, which is handled in other locations } }
@Check(CheckType.FAST) public void checkGuardExpression(ReactionTrigger trigger) { if (trigger.getGuardExpression() == null) { return; } try { InferenceResult result = typeInferrer.inferType(trigger.getGuardExpression()); if (result.getType() == null || !typeSystem.isBooleanType(result.getType())) { error(GUARD_EXPRESSION, StextPackage.Literals.REACTION_TRIGGER__GUARD_EXPRESSION); } report(result, null); } catch (IllegalArgumentException e) { // ignore unknown literals here, as this also happens when a // linking problem occurred, which is handled in other locations } }