use of org.eclipse.n4js.n4JS.Statement in project n4js by eclipse.
the class MethodDeclarationImpl method existsExplicitSuperCall.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean existsExplicitSuperCall() {
final Function1<ExpressionStatement, Expression> _function = new Function1<ExpressionStatement, Expression>() {
public Expression apply(final ExpressionStatement it) {
return it.getExpression();
}
};
final Function1<ParameterizedCallExpression, Boolean> _function_1 = new Function1<ParameterizedCallExpression, Boolean>() {
public Boolean apply(final ParameterizedCallExpression it) {
Expression _target = it.getTarget();
return Boolean.valueOf((_target instanceof SuperLiteral));
}
};
final boolean existsSuperCall = IteratorExtensions.<ParameterizedCallExpression>exists(Iterators.<ParameterizedCallExpression>filter(IteratorExtensions.<ExpressionStatement, Expression>map(Iterators.<ExpressionStatement>filter(EcoreUtilN4.<Statement>getAllDirectlyFoundContentsOfType(this.getBody(), Statement.class), ExpressionStatement.class), _function), ParameterizedCallExpression.class), _function_1);
return existsSuperCall;
}
use of org.eclipse.n4js.n4JS.Statement in project n4js by eclipse.
the class IterationStatementImpl method basicSetStatement.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStatement(Statement newStatement, NotificationChain msgs) {
Statement oldStatement = statement;
statement = newStatement;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4JSPackage.ITERATION_STATEMENT__STATEMENT, oldStatement, newStatement);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.n4js.n4JS.Statement in project n4js by eclipse.
the class LabelledStatementImpl method basicSetStatement.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetStatement(Statement newStatement, NotificationChain msgs) {
Statement oldStatement = statement;
statement = newStatement;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4JSPackage.LABELLED_STATEMENT__STATEMENT, oldStatement, newStatement);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.n4js.n4JS.Statement in project n4js by eclipse.
the class IfStatementImpl method basicSetIfStmt.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetIfStmt(Statement newIfStmt, NotificationChain msgs) {
Statement oldIfStmt = ifStmt;
ifStmt = newIfStmt;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, N4JSPackage.IF_STATEMENT__IF_STMT, oldIfStmt, newIfStmt);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.eclipse.n4js.n4JS.Statement in project n4js by eclipse.
the class GuardFactory method createGuardForTruthy.
private static Guard createGuardForTruthy(EObject topContainer, Expression expr, boolean negateTree) {
if (SymbolFactory.canCreate(expr)) {
EObject parent = expr.eContainer();
boolean isTruthy = false;
isTruthy |= parent instanceof Statement;
isTruthy |= parent instanceof ParenExpression;
isTruthy |= parent instanceof ConditionalExpression;
isTruthy |= parent instanceof BinaryLogicalExpression;
isTruthy |= parent instanceof UnaryExpression && ((UnaryExpression) parent).getOp() == UnaryOperator.NOT;
if (isTruthy) {
GuardAssertion asserts = FlowAssertionFactory.getGuard(topContainer, expr, negateTree, false);
Guard guard = createIsTruthyGuard(expr, asserts);
return guard;
}
}
return null;
}
Aggregations