Search in sources :

Example 26 with Expression

use of org.eclipse.n4js.n4JS.Expression in project n4js by eclipse.

the class BinaryLogicalExpressionImpl method basicSetLhs.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetLhs(Expression newLhs, NotificationChain msgs) {
    Expression oldLhs = lhs;
    lhs = newLhs;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4JSPackage.BINARY_LOGICAL_EXPRESSION__LHS, oldLhs, newLhs);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : BinaryLogicalExpression(org.eclipse.n4js.n4JS.BinaryLogicalExpression) Expression(org.eclipse.n4js.n4JS.Expression) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 27 with Expression

use of org.eclipse.n4js.n4JS.Expression in project n4js by eclipse.

the class CaseClauseImpl method basicSetExpression.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetExpression(Expression newExpression, NotificationChain msgs) {
    Expression oldExpression = expression;
    expression = newExpression;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4JSPackage.CASE_CLAUSE__EXPRESSION, oldExpression, newExpression);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : Expression(org.eclipse.n4js.n4JS.Expression) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 28 with Expression

use of org.eclipse.n4js.n4JS.Expression in project n4js by eclipse.

the class FormalParameterImpl method basicSetInitializer.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetInitializer(Expression newInitializer, NotificationChain msgs) {
    Expression oldInitializer = initializer;
    initializer = newInitializer;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4JSPackage.FORMAL_PARAMETER__INITIALIZER, oldInitializer, newInitializer);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : Expression(org.eclipse.n4js.n4JS.Expression) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 29 with Expression

use of org.eclipse.n4js.n4JS.Expression in project n4js by eclipse.

the class PrettyPrinterSwitch method caseTemplateSegment.

@Override
public Boolean caseTemplateSegment(TemplateSegment original) {
    if (out.getIndentLevel() != 0) {
        // resetting the indent level, we can here simply rely on our parent having already done this.
        throw new IllegalStateException("parent TemplateLiteral did not reset the indent level to 0");
    }
    final TemplateLiteral parent = (TemplateLiteral) original.eContainer();
    final List<Expression> segments = parent.getSegments();
    final int len = segments.size();
    final Expression first = segments.get(0);
    final Expression last = segments.get(len - 1);
    if (original == first) {
        write("`");
    } else {
        write("}");
    }
    if (original.getRawValue() != null) {
        write(original.getRawValue());
    } else {
        write(quote(original.getValueAsString()));
    }
    if (original == last) {
        write("`");
    } else {
        write("${");
    }
    return DONE;
}
Also used : BinaryBitwiseExpression(org.eclipse.n4js.n4JS.BinaryBitwiseExpression) AssignmentExpression(org.eclipse.n4js.n4JS.AssignmentExpression) IndexedAccessExpression(org.eclipse.n4js.n4JS.IndexedAccessExpression) FunctionExpression(org.eclipse.n4js.n4JS.FunctionExpression) UnaryExpression(org.eclipse.n4js.n4JS.UnaryExpression) ParenExpression(org.eclipse.n4js.n4JS.ParenExpression) ParameterizedCallExpression(org.eclipse.n4js.n4JS.ParameterizedCallExpression) AdditiveExpression(org.eclipse.n4js.n4JS.AdditiveExpression) PostfixExpression(org.eclipse.n4js.n4JS.PostfixExpression) YieldExpression(org.eclipse.n4js.n4JS.YieldExpression) ConditionalExpression(org.eclipse.n4js.n4JS.ConditionalExpression) RelationalExpression(org.eclipse.n4js.n4JS.RelationalExpression) NewExpression(org.eclipse.n4js.n4JS.NewExpression) AwaitExpression(org.eclipse.n4js.n4JS.AwaitExpression) CommaExpression(org.eclipse.n4js.n4JS.CommaExpression) Expression(org.eclipse.n4js.n4JS.Expression) CastExpression(org.eclipse.n4js.n4JS.CastExpression) BinaryLogicalExpression(org.eclipse.n4js.n4JS.BinaryLogicalExpression) EqualityExpression(org.eclipse.n4js.n4JS.EqualityExpression) ShiftExpression(org.eclipse.n4js.n4JS.ShiftExpression) ParameterizedPropertyAccessExpression(org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression) MultiplicativeExpression(org.eclipse.n4js.n4JS.MultiplicativeExpression) TemplateLiteral(org.eclipse.n4js.n4JS.TemplateLiteral)

Example 30 with Expression

use of org.eclipse.n4js.n4JS.Expression in project n4js by eclipse.

the class ParameterizedPropertyAccessExpressionImpl method basicSetTarget.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetTarget(Expression newTarget, NotificationChain msgs) {
    Expression oldTarget = target;
    target = newTarget;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4JSPackage.PARAMETERIZED_PROPERTY_ACCESS_EXPRESSION__TARGET, oldTarget, newTarget);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ParameterizedPropertyAccessExpression(org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression) Expression(org.eclipse.n4js.n4JS.Expression) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Aggregations

Expression (org.eclipse.n4js.n4JS.Expression)111 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)58 ConditionalExpression (org.eclipse.n4js.n4JS.ConditionalExpression)40 BinaryLogicalExpression (org.eclipse.n4js.n4JS.BinaryLogicalExpression)38 ParameterizedCallExpression (org.eclipse.n4js.n4JS.ParameterizedCallExpression)37 AssignmentExpression (org.eclipse.n4js.n4JS.AssignmentExpression)35 ParameterizedPropertyAccessExpression (org.eclipse.n4js.n4JS.ParameterizedPropertyAccessExpression)33 EqualityExpression (org.eclipse.n4js.n4JS.EqualityExpression)31 ParenExpression (org.eclipse.n4js.n4JS.ParenExpression)31 RelationalExpression (org.eclipse.n4js.n4JS.RelationalExpression)31 UnaryExpression (org.eclipse.n4js.n4JS.UnaryExpression)31 AdditiveExpression (org.eclipse.n4js.n4JS.AdditiveExpression)27 BinaryBitwiseExpression (org.eclipse.n4js.n4JS.BinaryBitwiseExpression)27 IndexedAccessExpression (org.eclipse.n4js.n4JS.IndexedAccessExpression)27 MultiplicativeExpression (org.eclipse.n4js.n4JS.MultiplicativeExpression)27 ShiftExpression (org.eclipse.n4js.n4JS.ShiftExpression)27 AwaitExpression (org.eclipse.n4js.n4JS.AwaitExpression)26 CastExpression (org.eclipse.n4js.n4JS.CastExpression)26 FunctionExpression (org.eclipse.n4js.n4JS.FunctionExpression)26 NewExpression (org.eclipse.n4js.n4JS.NewExpression)26