use of com.avaloq.tools.ddk.xtext.expression.expression.Expression in project dsl-devkit by dsldevkit.
the class ChainExpressionImpl method basicSetNext.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetNext(Expression newNext, NotificationChain msgs) {
Expression oldNext = next;
next = newNext;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.CHAIN_EXPRESSION__NEXT, oldNext, newNext);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.avaloq.tools.ddk.xtext.expression.expression.Expression in project dsl-devkit by dsldevkit.
the class SwitchExpressionImpl method basicSetSwitchExpr.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetSwitchExpr(Expression newSwitchExpr, NotificationChain msgs) {
Expression oldSwitchExpr = switchExpr;
switchExpr = newSwitchExpr;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ExpressionPackage.SWITCH_EXPRESSION__SWITCH_EXPR, oldSwitchExpr, newSwitchExpr);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of com.avaloq.tools.ddk.xtext.expression.expression.Expression in project dsl-devkit by dsldevkit.
the class ExpressionsExtentionsTest method serialize.
@Test
public final void serialize() throws IOException {
Expression e = (Expression) getXtextTestUtil().getModel("test.expression." + getXtextTestUtil().getFileExtension(), "let x = 1 : 0");
assertEquals("Simple serialization works", "let x = 1 : 0", ExpressionExtensions.serialize(e));
}
use of com.avaloq.tools.ddk.xtext.expression.expression.Expression in project dsl-devkit by dsldevkit.
the class ScopeJavaValidator method checkScopeRuleUniqueness.
/**
* Checks that the all local scope rules (i.e. excluding inherited rules) have a unique context (context type, reference,
* guard).
*
* @param context
* scoping section to check
*/
@Check
public void checkScopeRuleUniqueness(final ScopeModel context) {
final Map<String, ScopeRule> profileMap = Maps.newHashMap();
for (ScopeDefinition def : context.getScopes()) {
for (ScopeRule rule : def.getRules()) {
final Expression guard = rule.getContext().getGuard();
// $NON-NLS-1$ //$NON-NLS-2$
final String profile = ScopeUtil.getSignature(rule) + ":" + (guard != null ? serializer.serialize(guard) : "");
final ScopeRule other = profileMap.get(profile);
if (other != null) {
errorOnDuplicate(rule, other, Messages.duplicatedScopeRule, ScopePackage.Literals.SCOPE_RULE__CONTEXT);
} else {
profileMap.put(profile, rule);
}
}
}
}
use of com.avaloq.tools.ddk.xtext.expression.expression.Expression in project dsl-devkit by dsldevkit.
the class GlobalScopeExpressionImpl method basicSetPrefix.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetPrefix(Expression newPrefix, NotificationChain msgs) {
Expression oldPrefix = prefix;
prefix = newPrefix;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ScopePackage.GLOBAL_SCOPE_EXPRESSION__PREFIX, oldPrefix, newPrefix);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
Aggregations