public boolean isScoped(ABlockSimpleBlockStm block) { return appearsInRightContext(block); }
@Override public void caseASuperCallStmIR(ASuperCallStmIR node) throws AnalysisException { handleCallStm(node, transAssistant.getInfo().getStmAssistant().getSuperClassName(node)); }
public void caseALetDefExpIR(ALetDefExpIR node) throws AnalysisException { SStmIR enclosingStm = transAssistant.getEnclosingStm(node, "let def expression"); SExpIR exp = node.getExp(); transAssistant.replaceNodeWith(node, exp); ABlockStmIR topBlock = new ABlockStmIR(); ABlockStmIR current = topBlock; for (AVarDeclIR local : node.getLocalDefs()) { ABlockStmIR tmp = new ABlockStmIR(); tmp.getLocalDefs().add(local.clone()); current.getStatements().add(tmp); current = tmp; } transAssistant.replaceNodeWith(enclosingStm, topBlock); topBlock.getStatements().add(enclosingStm); exp.apply(this); topBlock.apply(this); topBlock.setScoped(transAssistant.getInfo().getStmAssistant().isScoped(topBlock)); }
private boolean contains(AMetaStmIR check) { for (AMetaStmIR as : recVarChecks) { if (jmlGen.getJavaGen().getInfo().getStmAssistant().equal(as, check)) { return true; } } return false; }
public AssistantManager() { this.nodeAssistant = new NodeAssistantIR(this); this.expAssistant = new ExpAssistantIR(this); this.declAssistant = new DeclAssistantIR(this); this.stmAssistant = new StmAssistantIR(this); this.typeAssistant = new TypeAssistantIR(this); this.locationAssistant = new LocationAssistantIR(this); this.bindAssistant = new BindAssistantIR(this); this.patternAssistant = new PatternAssistantIR(this); }
public boolean simpleRecSetCallOutsideAtomic(ACallObjectExpStmIR node) { if (handler.getInvTrans().getJmlGen().getJavaGen().getInfo().getStmAssistant().inAtomic(node)) { return false; } SExpIR obj = node.getObj(); if (!(obj.getType() instanceof ARecordTypeIR)) { return false; } if (obj instanceof SVarExpIR) { return true; } if (obj instanceof ACastUnaryExpIR && ((ACastUnaryExpIR) obj).getExp() instanceof SVarExpIR) { return true; } return false; }
@Override public SStmIR caseACasesStm(ACasesStm node, IRInfo question) throws AnalysisException { PExp exp = node.getExp(); PStm others = node.getOthers(); LinkedList<ACaseAlternativeStm> cases = node.getCases(); SExpIR expCg = exp.apply(question.getExpVisitor(), question); SStmIR othersCg = others != null ? others.apply(question.getStmVisitor(), question) : null; ACasesStmIR casesStmCg = new ACasesStmIR(); casesStmCg.setExp(expCg); casesStmCg.setOthers(othersCg); question.getStmAssistant().handleAlternativesCasesStm(question, exp, cases, casesStmCg.getCases()); return casesStmCg; }
@Override public SStmIR caseALetStm(ALetStm node, IRInfo question) throws AnalysisException { ABlockStmIR block = new ABlockStmIR(); block.setScoped(question.getStmAssistant().isScoped(node)); question.getDeclAssistant().setFinalLocalDefs(node.getLocalDefs(), block.getLocalDefs(), question); SStmIR stm = node.getStatement().apply(question.getStmVisitor(), question); if (stm != null) { block.getStatements().add(stm); } return block; }
blockStm.setScoped(question.getStmAssistant().isScoped(node));
public boolean isScoped(ALetStm let) { return appearsInRightContext(let); }
outerBlock.setScoped(transAssistant.getInfo().getStmAssistant().isScoped(outerBlock));
outerBlock.apply(this); outerBlock.setScoped(transAssistant.getInfo().getStmAssistant().isScoped(outerBlock));