@Override public IProofObligationList defaultPStm(PStm node, IPOContextStack question) throws AnalysisException { return node.apply(pogStmVisitor, question); }
public PExp findExpression(PStm stm, int lineno) { try { return stm.apply(af.getStatementExpressionFinder(), lineno);// FIXME: should we handle exceptions like this } catch (AnalysisException e) { return null; // Most have none } }
private Collection<? extends PType> exitCheck(ATixeStmtAlternative tsa) throws AnalysisException { return tsa.getStatement().apply(THIS); }
@Override public PType caseAApplyExpressionTraceCoreDefinition( AApplyExpressionTraceCoreDefinition node, TypeCheckInfo question) throws AnalysisException { return node.getCallStatement().apply(THIS, question); }
@Override public PExp caseACyclesStm(ACyclesStm stm, Integer lineno) throws AnalysisException { return stm.getStatement().apply(THIS, lineno); }
@Override public PTypeSet caseACaseAlternativeStm(ACaseAlternativeStm statement) throws AnalysisException { return statement.getResult().apply(THIS); }
@Override public PTypeSet caseAForPatternBindStm(AForPatternBindStm statement) throws AnalysisException { return statement.getStatement().apply(THIS); }
@Override public PTypeSet caseALetBeStStm(ALetBeStStm statement) throws AnalysisException { return statement.getStatement().apply(THIS); }
@Override public PTypeSet caseAWhileStm(AWhileStm statement) throws AnalysisException { return statement.getStatement().apply(THIS); }
@Override public PStm caseAForAllStm(AForAllStm stm, Integer lineno) throws AnalysisException { PStm found = findStatementBaseCase(stm, lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno);// PStmAssistantInterpreter.findStatement(stm.getStatement(), // lineno); }
@Override public PStm caseAForPatternBindStm(AForPatternBindStm stm, Integer lineno) throws AnalysisException { PStm found = findStatementBaseCase(stm, lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno);// PStmAssistantInterpreter.findStatement(stm.getStatement(), // lineno); }
@Override public PStm caseAElseIfStm(AElseIfStm stm, Integer lineno) throws AnalysisException { PStm found = findStatementBaseCase(stm, lineno); if (found != null) { return found; } return stm.getThenStm().apply(THIS, lineno);// PStmAssistantInterpreter.findStatement(stm.getThenStm(), lineno); }
@Override public PStm caseAWhileStm(AWhileStm stm, Integer lineno) throws AnalysisException { PStm found = findStatementBaseCase(stm, lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno); // PStmAssistantInterpreter.findStatement(stm.getStatement(), // lineno); }
@Override public LexNameSet caseACyclesStm(ACyclesStm node, FreeVarInfo info) throws AnalysisException { LexNameSet names = node.getCycles().apply(this, info); names.addAll(node.getStatement().apply(this, info)); return names; }
@Override public PExp caseAForAllStm(AForAllStm stm, Integer lineno) throws AnalysisException { PExp found = af.createPExpAssistant().findExpression(stm.getSet(), lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno); }
@Override public PExp caseAForPatternBindStm(AForPatternBindStm stm, Integer lineno) throws AnalysisException { PExp found = af.createPExpAssistant().findExpression(stm.getExp(), lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno); }
@Override public STraceCoreDeclIR caseAApplyExpressionTraceCoreDefinition( AApplyExpressionTraceCoreDefinition node, IRInfo question) throws AnalysisException { PStm callStm = node.getCallStatement(); SStmIR callStmCg = callStm.apply(question.getStmVisitor(), question); AApplyExpTraceCoreDeclIR applyTraceCoreDecl = new AApplyExpTraceCoreDeclIR(); applyTraceCoreDecl.setCallStm(callStmCg); return applyTraceCoreDecl; }
@Override public PTypeSet caseATixeStm(ATixeStm statement) throws AnalysisException { PTypeSet types = new PTypeSet(af); types.addAll(statement.getBody().apply(THIS)); for (ATixeStmtAlternative tsa : statement.getTraps()) { types.addAll(exitCheck(tsa)); } return types; }
@Override public void caseATixeStmtAlternative(ATixeStmtAlternative node) throws AnalysisException { openScope(node.getPatternBind(), node.getPatternBind().getDefs(), node.getStatement()); node.getStatement().apply(this); // End scope for (PDefinition def : node.getPatternBind().getDefs()) { removeLocalDefFromScope(def); } }