/** Add a fired exception. * @param type the fully qualified name of the event. */ public void addFiredEvent(String type) { this.sarlAction.getFiredEvents().add(newTypeRef(this.container, type)); }
@Override public boolean isEarlyExitOperation(SarlAction operation) { if (operation != null) { final Iterator<JvmTypeReference> eventIterator = operation.getFiredEvents().iterator(); while (eventIterator.hasNext()) { if (isEarlyExitEvent(eventIterator.next())) { return true; } } } return false; }
/** Emit a warning when the "fires" keyword is used. * * @param action the action to check. */ @Check public void checkFiresKeywordUse(SarlAction action) { if (!action.getFiredEvents().isEmpty()) { warning(MessageFormat.format( Messages.SARLValidator_1, this.grammarAccess.getFiresKeyword()), action, SarlPackage.eINSTANCE.getSarlAction_FiredEvents()); } }
if (!signature.getFiredEvents().isEmpty()) { textRepresentation.append(' '); textRepresentation.append(grammarAccess.getFiresKeyword()); textRepresentation.append(' '); boolean addComa = false; for (final JvmTypeReference eventType : signature.getFiredEvents()) { if (addComa) { textRepresentation.append(grammarAccess.getCommaKeyword());
/** Check the types of the parameters of the "fires" statement. * * @param action the signature that contains the "fires" statement. */ @Check(CheckType.FAST) public void checkActionFires(SarlAction action) { for (final JvmTypeReference event : action.getFiredEvents()) { final LightweightTypeReference ref = toLightweightTypeReference(event); if (ref != null && !this.inheritanceHelper.isSarlEvent(ref)) { error(MessageFormat.format( Messages.SARLValidator_57, event.getQualifiedName(), Messages.SARLValidator_62, this.grammarAccess.getFiresKeyword()), event, null, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, INVALID_FIRING_EVENT_TYPE, event.getSimpleName()); } } }
if (source instanceof SarlAction) { final SarlAction action = (SarlAction) source; firedEvents = action.getFiredEvents(); isEarlyExit = this.earlyExitComputer.isEarlyExitOperation(action); if (isEarlyExit) {
final EList<JvmTypeReference> events = ((SarlAction) function).getFiredEvents(); if (!events.isEmpty()) { document.surround(regionFor.keyword(this.keywords.getFiresKeyword()), ONE_SPACE);