use of org.eclipse.ceylon.model.typechecker.model.ControlBlock in project ceylon by eclipse.
the class DeclarationVisitor method visit.
@Override
public void visit(Tree.SwitchStatement that) {
ControlBlock cb = new ControlBlock();
cb.setId(id++);
that.setControlBlock(cb);
visitElement(that, cb);
Scope o = enterScope(cb);
super.visit(that);
exitScope(o);
}
use of org.eclipse.ceylon.model.typechecker.model.ControlBlock in project ceylon by eclipse.
the class DefiniteAssignmentVisitor method visit.
public void visit(Tree.AnyClass that) {
ControlBlock prevControlBlock = forBlock;
forBlock = null;
super.visit(that);
forBlock = prevControlBlock;
}
use of org.eclipse.ceylon.model.typechecker.model.ControlBlock in project ceylon by eclipse.
the class DefiniteAssignmentVisitor method visit.
public void visit(Tree.SpecifierStatement stmt) {
Tree.Term bme = stmt.getBaseMemberExpression();
if (bme instanceof Tree.MemberOrTypeExpression) {
Declaration decl = ((Tree.MemberOrTypeExpression) bme).getDeclaration();
if (// non-variable and deferred
tracked.containsKey(decl) && // specification is in a for/else
forBlock != null && !forBlock.equals(tracked.get(decl))) {
// not declared in *this* for/else
if (elseBlock == null) {
((Value) decl).setSpecifiedInForElse(true);
}
ControlBlock assigningBlock = elseBlock != null ? elseBlock : forBlock;
addSpecified(decl, assigningBlock);
}
}
super.visit(stmt);
}
use of org.eclipse.ceylon.model.typechecker.model.ControlBlock in project ceylon by eclipse.
the class DeclarationVisitor method visit.
@Override
public void visit(Tree.SwitchExpression that) {
ControlBlock cb = new ControlBlock();
cb.setId(id++);
visitElement(that, cb);
Scope o = enterScope(cb);
super.visit(that);
exitScope(o);
}
use of org.eclipse.ceylon.model.typechecker.model.ControlBlock in project ceylon by eclipse.
the class DeclarationVisitor method visit.
@Override
public void visit(Tree.ControlClause that) {
ControlBlock cb = new ControlBlock();
cb.setLet(that instanceof Tree.LetClause);
cb.setId(id++);
that.setControlBlock(cb);
visitElement(that, cb);
Scope o = enterScope(cb);
super.visit(that);
exitScope(o);
}
Aggregations