public void visitForLoop(JCForLoop tree) { ListBuffer<PendingExit> prevPendingExits = pendingExits; scanStats(tree.init); pendingExits = new ListBuffer<>(); if (tree.cond != null) { scan(tree.cond); alive = !tree.cond.type.isFalse(); } else { alive = true; } scanStat(tree.body); alive |= resolveContinues(tree); scan(tree.step); alive = resolveBreaks(tree, prevPendingExits) || tree.cond != null && !tree.cond.type.isTrue(); }
public void visitForLoop(JCForLoop tree) { ListBuffer<PendingExit> prevPendingExits = pendingExits; scanStats(tree.init); pendingExits = new ListBuffer<PendingExit>(); if (tree.cond != null) { scan(tree.cond); alive = !tree.cond.type.isFalse(); } else { alive = true; } scanStat(tree.body); alive |= resolveContinues(tree); scan(tree.step); alive = resolveBreaks(tree, prevPendingExits) || tree.cond != null && !tree.cond.type.isTrue(); }
public void visitDoLoop(JCDoWhileLoop tree) { ListBuffer<PendingExit> prevPendingExits = pendingExits; pendingExits = new ListBuffer<>(); scanStat(tree.body); alive |= resolveContinues(tree); scan(tree.cond); alive = alive && !tree.cond.type.isTrue(); alive |= resolveBreaks(tree, prevPendingExits); }
public void visitWhileLoop(JCWhileLoop tree) { ListBuffer<PendingExit> prevPendingExits = pendingExits; pendingExits = new ListBuffer<>(); scan(tree.cond); alive = !tree.cond.type.isFalse(); scanStat(tree.body); alive |= resolveContinues(tree); alive = resolveBreaks(tree, prevPendingExits) || !tree.cond.type.isTrue(); }
public void visitDoLoop(JCDoWhileLoop tree) { ListBuffer<PendingExit> prevPendingExits = pendingExits; pendingExits = new ListBuffer<PendingExit>(); scanStat(tree.body); alive |= resolveContinues(tree); scan(tree.cond); alive = alive && !tree.cond.type.isTrue(); alive |= resolveBreaks(tree, prevPendingExits); }
public void visitForeachLoop(JCEnhancedForLoop tree) { visitVarDef(tree.var); ListBuffer<PendingExit> prevPendingExits = pendingExits; scan(tree.expr); pendingExits = new ListBuffer<PendingExit>(); scanStat(tree.body); alive |= resolveContinues(tree); resolveBreaks(tree, prevPendingExits); alive = true; }
public void visitWhileLoop(JCWhileLoop tree) { ListBuffer<PendingExit> prevPendingExits = pendingExits; pendingExits = new ListBuffer<PendingExit>(); scan(tree.cond); alive = !tree.cond.type.isFalse(); scanStat(tree.body); alive |= resolveContinues(tree); alive = resolveBreaks(tree, prevPendingExits) || !tree.cond.type.isTrue(); }
public void visitForeachLoop(JCEnhancedForLoop tree) { visitVarDef(tree.var); ListBuffer<PendingExit> prevPendingExits = pendingExits; scan(tree.expr); pendingExits = new ListBuffer<>(); scanStat(tree.body); alive |= resolveContinues(tree); resolveBreaks(tree, prevPendingExits); alive = true; }