@Override public PTypeSet caseAWhileStm(AWhileStm statement) throws AnalysisException { return statement.getStatement().apply(THIS); }
@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); }
/** * Called by the {@link AWhileStm} node from {@link AWhileStm#apply(IAnalysis)}. * @param node the calling {@link AWhileStm} node */ public void caseAWhileStm(AWhileStm node) throws AnalysisException { _visitedNodes.add(node); inAWhileStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this); } outAWhileStm(node); }
/** * Called by the {@link AWhileStm} node from {@link AWhileStm#apply(IAnalysis)}. * @param node the calling {@link AWhileStm} node */ public void caseAWhileStm(AWhileStm node, Q question) throws AnalysisException { _visitedNodes.add(node); inAWhileStm(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this, question); } outAWhileStm(node, question); }
/** * Called by the {@link AWhileStm} node from {@link AWhileStm#apply(IPOFAnalysis)}. * @param node the calling {@link AWhileStm} node */ public void caseAWhileStm(AWhileStm node) throws AnalysisException { _visitedNodes.add(node); inAWhileStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { node.getStatement().apply(this); } outAWhileStm(node); }
@Override public PExp caseAWhileStm(AWhileStm stm, Integer lineno) throws AnalysisException { PExp found = af.createPExpAssistant().findExpression(stm.getExp(), lineno); if (found != null) { return found; } return stm.getStatement().apply(THIS, lineno);// PStmAssistantInterpreter.findExpression(stm.getStatement(), // lineno); }
/** * Called by the {@link AWhileStm} node from {@link AWhileStm#apply(IAnalysis)}. * @param node the calling {@link AWhileStm} node */ public A caseAWhileStm(AWhileStm node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAWhileStm(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { mergeReturns(retVal,node.getStatement().apply(this)); } mergeReturns(retVal,outAWhileStm(node)); return retVal; }
/** * Called by the {@link AWhileStm} node from {@link AWhileStm#apply(IAnalysis)}. * @param node the calling {@link AWhileStm} node */ public A caseAWhileStm(AWhileStm node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAWhileStm(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } if(node.getStatement() != null && !_visitedNodes.contains(node.getStatement())) { mergeReturns(retVal,node.getStatement().apply(this, question)); } mergeReturns(retVal,outAWhileStm(node, question)); return retVal; }
@Override public IProofObligationList caseAWhileStm(AWhileStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = new ProofObligationList(); obligations.add(new WhileLoopObligation(node, question, aF)); obligations.addAll(node.getExp().apply(rootVisitor, question)); obligations.addAll(node.getStatement().apply(mainVisitor, question)); return obligations; } catch (Exception e) { throw new POException(node, e.getMessage()); } }
@Override public SStmIR caseAWhileStm(AWhileStm node, IRInfo question) throws AnalysisException { PStm stm = node.getStatement(); PExp exp = node.getExp(); SStmIR bodyCg = stm.apply(question.getStmVisitor(), question); SExpIR expCg = exp.apply(question.getExpVisitor(), question); AWhileStmIR whileStm = new AWhileStmIR(); whileStm.setExp(expCg); whileStm.setBody(bodyCg); return whileStm; }
PType stype = node.getStatement().apply(THIS, question);
@Override public Value caseAWhileStm(AWhileStm node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); try { while (node.getExp().apply(VdmRuntime.getStatementEvaluator(), ctxt).boolValue(ctxt)) { Value rv = node.getStatement().apply(VdmRuntime.getStatementEvaluator(), ctxt); if (!rv.isVoid()) { return rv; } } } catch (ValueException e) { VdmRuntimeError.abort(node.getLocation(), e); } return new VoidValue(); }