@Override public PExp caseAAlwaysStm(AAlwaysStm stm, Integer lineno) throws AnalysisException { PExp found = stm.getAlways().apply(THIS, lineno); if (found != null) { return found; } return stm.getBody().apply(THIS, lineno); }
/** * Called by the {@link AAlwaysStm} node from {@link AAlwaysStm#apply(IAnalysis)}. * @param node the calling {@link AAlwaysStm} node */ public void caseAAlwaysStm(AAlwaysStm node) throws AnalysisException { _visitedNodes.add(node); inAAlwaysStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getAlways() != null && !_visitedNodes.contains(node.getAlways())) { node.getAlways().apply(this); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { node.getBody().apply(this); } outAAlwaysStm(node); }
/** * Called by the {@link AAlwaysStm} node from {@link AAlwaysStm#apply(IAnalysis)}. * @param node the calling {@link AAlwaysStm} node */ public void caseAAlwaysStm(AAlwaysStm node, Q question) throws AnalysisException { _visitedNodes.add(node); inAAlwaysStm(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getAlways() != null && !_visitedNodes.contains(node.getAlways())) { node.getAlways().apply(this, question); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { node.getBody().apply(this, question); } outAAlwaysStm(node, question); }
/** * Called by the {@link AAlwaysStm} node from {@link AAlwaysStm#apply(IPOFAnalysis)}. * @param node the calling {@link AAlwaysStm} node */ public void caseAAlwaysStm(AAlwaysStm node) throws AnalysisException { _visitedNodes.add(node); inAAlwaysStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getAlways() != null && !_visitedNodes.contains(node.getAlways())) { node.getAlways().apply(this); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { node.getBody().apply(this); } outAAlwaysStm(node); }
@Override public IProofObligationList caseAAlwaysStm(AAlwaysStm node, IPOContextStack question) throws AnalysisException { try { IProofObligationList obligations = node.getAlways().apply(mainVisitor, question); obligations.addAll(node.getBody().apply(mainVisitor, question)); return obligations; } catch (Exception e) { throw new POException(node, e.getMessage()); } }
@Override public PStm caseAAlwaysStm(AAlwaysStm stm, Integer lineno) throws AnalysisException { PStm found = findStatementBaseCase(stm, lineno); if (found != null) { return found; } found = stm.getAlways().apply(THIS, lineno);// PStmAssistantInterpreter.findStatement(stm.getAlways(), lineno); if (found != null) { return found; } return stm.getBody().apply(THIS, lineno);// PStmAssistantInterpreter.findStatement(stm.getBody(), lineno); }
@Override public PType caseAAlwaysStm(AAlwaysStm node, TypeCheckInfo question) throws AnalysisException { node.getAlways().apply(THIS, question); node.setType(node.getBody().apply(THIS, question)); return node.getType(); }
/** * Called by the {@link AAlwaysStm} node from {@link AAlwaysStm#apply(IAnalysis)}. * @param node the calling {@link AAlwaysStm} node */ public A caseAAlwaysStm(AAlwaysStm node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAAlwaysStm(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getAlways() != null && !_visitedNodes.contains(node.getAlways())) { mergeReturns(retVal,node.getAlways().apply(this)); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { mergeReturns(retVal,node.getBody().apply(this)); } mergeReturns(retVal,outAAlwaysStm(node)); return retVal; }
/** * Called by the {@link AAlwaysStm} node from {@link AAlwaysStm#apply(IAnalysis)}. * @param node the calling {@link AAlwaysStm} node */ public A caseAAlwaysStm(AAlwaysStm node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAAlwaysStm(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getAlways() != null && !_visitedNodes.contains(node.getAlways())) { mergeReturns(retVal,node.getAlways().apply(this, question)); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { mergeReturns(retVal,node.getBody().apply(this, question)); } mergeReturns(retVal,outAAlwaysStm(node, question)); return retVal; }
@Override public PTypeSet caseAAlwaysStm(AAlwaysStm statement) throws AnalysisException { PTypeSet types = new PTypeSet(af); types.addAll(statement.getBody().apply(THIS)); types.addAll(statement.getAlways().apply(THIS)); return types; }
/************************* Statements ***************************/ @Override public LexNameSet caseAAlwaysStm(AAlwaysStm node, FreeVarInfo info) throws AnalysisException { LexNameSet names = new LexNameSet(); names.addAll(node.getAlways().apply(this, info)); names.addAll(node.getBody().apply(this, info)); return names; }
@Override public Value caseAAlwaysStm(AAlwaysStm node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); Value rv = null; ExitException bodyRaised = null; try { rv = node.getBody().apply(VdmRuntime.getStatementEvaluator(), ctxt); } catch (ExitException e) { // Finally clause executes the "always" statement, but we // re-throw this exception, unless the always clause raises one. bodyRaised = e; } finally { node.getAlways().apply(VdmRuntime.getStatementEvaluator(), ctxt); if (bodyRaised != null) { throw bodyRaised; } } return rv; }