Search in sources :

Example 1 with TimeInterval

use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.

the class WheneverStatementImpl method basicSetInterval.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetInterval(TimeInterval newInterval, NotificationChain msgs) {
    TimeInterval oldInterval = interval;
    interval = newInterval;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHENEVER_STATEMENT__INTERVAL, oldInterval, newInterval);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : TimeInterval(com.rockwellcollins.atc.agree.agree.TimeInterval) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 2 with TimeInterval

use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.

the class WhenHoldsStatementImpl method basicSetEventInterval.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetEventInterval(TimeInterval newEventInterval, NotificationChain msgs) {
    TimeInterval oldEventInterval = eventInterval;
    eventInterval = newEventInterval;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHEN_HOLDS_STATEMENT__EVENT_INTERVAL, oldEventInterval, newEventInterval);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : TimeInterval(com.rockwellcollins.atc.agree.agree.TimeInterval) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 3 with TimeInterval

use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.

the class WhenHoldsStatementImpl method basicSetConditionInterval.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetConditionInterval(TimeInterval newConditionInterval, NotificationChain msgs) {
    TimeInterval oldConditionInterval = conditionInterval;
    conditionInterval = newConditionInterval;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHEN_HOLDS_STATEMENT__CONDITION_INTERVAL, oldConditionInterval, newConditionInterval);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : TimeInterval(com.rockwellcollins.atc.agree.agree.TimeInterval) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 4 with TimeInterval

use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.

the class WhenOccursStatmentImpl method basicSetInterval.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetInterval(TimeInterval newInterval, NotificationChain msgs) {
    TimeInterval oldInterval = interval;
    interval = newInterval;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, AgreePackage.WHEN_OCCURS_STATMENT__INTERVAL, oldInterval, newInterval);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : TimeInterval(com.rockwellcollins.atc.agree.agree.TimeInterval) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 5 with TimeInterval

use of com.rockwellcollins.atc.agree.agree.TimeInterval in project AGREE by loonwerks.

the class AgreeValidator method checkWhenHoldsStatement.

@Check(CheckType.FAST)
public void checkWhenHoldsStatement(WhenHoldsStatement when) {
    Expr condition = when.getCondition();
    Expr event = when.getEvent();
    TimeInterval condInterval = when.getConditionInterval();
    checkExprIsIdentifier(condition);
    checkExprIsIdentifier(event);
    if (condInterval != null) {
        Expr lowExpr = condInterval.getLow();
        if (lowExpr instanceof RealLitExpr) {
            RealLitExpr realExpr = (RealLitExpr) lowExpr;
            if (!realExpr.getVal().equals("0.0")) {
                error(lowExpr, "The lower bound of this interval must be zero");
            }
        }
    } else {
        error(when, "Statement most of a cause interval");
    }
    TypeDef type = AgreeTypeSystem.infer(condition);
    if (!AgreeTypeSystem.typesEqual(AgreeTypeSystem.Prim.BoolTypeDef, type)) {
        error(condition, "The condition of a when statement is of type '" + type + "'" + " but must be of type 'bool'");
    }
    type = AgreeTypeSystem.infer(event);
    if (!AgreeTypeSystem.typesEqual(AgreeTypeSystem.Prim.BoolTypeDef, type)) {
        error(event, "The effect of a when statement is of type '" + type + "'" + " but must be of type 'bool'");
    }
}
Also used : EnumLitExpr(com.rockwellcollins.atc.agree.agree.EnumLitExpr) IndicesExpr(com.rockwellcollins.atc.agree.agree.IndicesExpr) TimeRiseExpr(com.rockwellcollins.atc.agree.agree.TimeRiseExpr) FlatmapExpr(com.rockwellcollins.atc.agree.agree.FlatmapExpr) TimeFallExpr(com.rockwellcollins.atc.agree.agree.TimeFallExpr) RealLitExpr(com.rockwellcollins.atc.agree.agree.RealLitExpr) GetPropertyExpr(com.rockwellcollins.atc.agree.agree.GetPropertyExpr) TimeOfExpr(com.rockwellcollins.atc.agree.agree.TimeOfExpr) PrevExpr(com.rockwellcollins.atc.agree.agree.PrevExpr) FoldRightExpr(com.rockwellcollins.atc.agree.agree.FoldRightExpr) TagExpr(com.rockwellcollins.atc.agree.agree.TagExpr) EventExpr(com.rockwellcollins.atc.agree.agree.EventExpr) LatchedExpr(com.rockwellcollins.atc.agree.agree.LatchedExpr) NamedElmExpr(com.rockwellcollins.atc.agree.agree.NamedElmExpr) SelectionExpr(com.rockwellcollins.atc.agree.agree.SelectionExpr) IfThenElseExpr(com.rockwellcollins.atc.agree.agree.IfThenElseExpr) ArraySubExpr(com.rockwellcollins.atc.agree.agree.ArraySubExpr) PreExpr(com.rockwellcollins.atc.agree.agree.PreExpr) RecordLitExpr(com.rockwellcollins.atc.agree.agree.RecordLitExpr) BinaryExpr(com.rockwellcollins.atc.agree.agree.BinaryExpr) UnaryExpr(com.rockwellcollins.atc.agree.agree.UnaryExpr) ExistsExpr(com.rockwellcollins.atc.agree.agree.ExistsExpr) FoldLeftExpr(com.rockwellcollins.atc.agree.agree.FoldLeftExpr) RecordUpdateExpr(com.rockwellcollins.atc.agree.agree.RecordUpdateExpr) ForallExpr(com.rockwellcollins.atc.agree.agree.ForallExpr) Expr(com.rockwellcollins.atc.agree.agree.Expr) ArrayUpdateExpr(com.rockwellcollins.atc.agree.agree.ArrayUpdateExpr) BoolLitExpr(com.rockwellcollins.atc.agree.agree.BoolLitExpr) NodeBodyExpr(com.rockwellcollins.atc.agree.agree.NodeBodyExpr) IntLitExpr(com.rockwellcollins.atc.agree.agree.IntLitExpr) CallExpr(com.rockwellcollins.atc.agree.agree.CallExpr) ArrayLiteralExpr(com.rockwellcollins.atc.agree.agree.ArrayLiteralExpr) TimeInterval(com.rockwellcollins.atc.agree.agree.TimeInterval) AgreeTypeSystem.nameOfTypeDef(com.rockwellcollins.atc.agree.AgreeTypeSystem.nameOfTypeDef) ArrayTypeDef(com.rockwellcollins.atc.agree.AgreeTypeSystem.ArrayTypeDef) RecordTypeDef(com.rockwellcollins.atc.agree.AgreeTypeSystem.RecordTypeDef) TypeDef(com.rockwellcollins.atc.agree.AgreeTypeSystem.TypeDef) RealLitExpr(com.rockwellcollins.atc.agree.agree.RealLitExpr) Check(org.eclipse.xtext.validation.Check)

Aggregations

TimeInterval (com.rockwellcollins.atc.agree.agree.TimeInterval)5 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)4 ArrayTypeDef (com.rockwellcollins.atc.agree.AgreeTypeSystem.ArrayTypeDef)1 RecordTypeDef (com.rockwellcollins.atc.agree.AgreeTypeSystem.RecordTypeDef)1 TypeDef (com.rockwellcollins.atc.agree.AgreeTypeSystem.TypeDef)1 AgreeTypeSystem.nameOfTypeDef (com.rockwellcollins.atc.agree.AgreeTypeSystem.nameOfTypeDef)1 ArrayLiteralExpr (com.rockwellcollins.atc.agree.agree.ArrayLiteralExpr)1 ArraySubExpr (com.rockwellcollins.atc.agree.agree.ArraySubExpr)1 ArrayUpdateExpr (com.rockwellcollins.atc.agree.agree.ArrayUpdateExpr)1 BinaryExpr (com.rockwellcollins.atc.agree.agree.BinaryExpr)1 BoolLitExpr (com.rockwellcollins.atc.agree.agree.BoolLitExpr)1 CallExpr (com.rockwellcollins.atc.agree.agree.CallExpr)1 EnumLitExpr (com.rockwellcollins.atc.agree.agree.EnumLitExpr)1 EventExpr (com.rockwellcollins.atc.agree.agree.EventExpr)1 ExistsExpr (com.rockwellcollins.atc.agree.agree.ExistsExpr)1 Expr (com.rockwellcollins.atc.agree.agree.Expr)1 FlatmapExpr (com.rockwellcollins.atc.agree.agree.FlatmapExpr)1 FoldLeftExpr (com.rockwellcollins.atc.agree.agree.FoldLeftExpr)1 FoldRightExpr (com.rockwellcollins.atc.agree.agree.FoldRightExpr)1 ForallExpr (com.rockwellcollins.atc.agree.agree.ForallExpr)1