/** * Returns a deep clone of this {@link ANonDeterministicSimpleBlockStm} node. * @return a deep clone of this {@link ANonDeterministicSimpleBlockStm} node */ public ANonDeterministicSimpleBlockStm clone() { return new ANonDeterministicSimpleBlockStm( _location, _type, cloneList(_statements) ); }
public static ANonDeterministicSimpleBlockStm newANonDeterministicSimpleBlockStm( ILexLocation token) { ANonDeterministicSimpleBlockStm result = new ANonDeterministicSimpleBlockStm(); initStatement(result, token); result.setStatements(new Vector<PStm>()); return result; }
/** * Called by the {@link ANonDeterministicSimpleBlockStm} node from {@link ANonDeterministicSimpleBlockStm#apply(IAnalysis)}. * @param node the calling {@link ANonDeterministicSimpleBlockStm} node */ public void caseANonDeterministicSimpleBlockStm(ANonDeterministicSimpleBlockStm node, Q question) throws AnalysisException { _visitedNodes.add(node); inANonDeterministicSimpleBlockStm(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } { List<PStm> copy = new ArrayList<PStm>(node.getStatements()); for( PStm e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outANonDeterministicSimpleBlockStm(node, question); }
node.getLocation(), node); int rcount = 0; for (PStm stmt : node.getStatements()) TypeCheckerErrors.warning(5016, "Some statements will not be reached", node.getLocation(), node); node.setType(rtypes.isEmpty() ? AstFactory.newAVoidType(node.getLocation()) : rtypes.getType(node.getLocation())); return node.getType();
private PStm readNonDetStatement(ILexLocation token) throws ParserException, LexException { checkFor(VDMToken.PIPEPIPE, 2200, "Expecting '||'"); checkFor(VDMToken.BRA, 2201, "Expecting '(' after '||'"); ANonDeterministicSimpleBlockStm block = AstFactory.newANonDeterministicSimpleBlockStm(token); block.getStatements().add(readStatement()); // Must be one while (ignore(VDMToken.COMMA)) { block.getStatements().add(readStatement()); } checkFor(VDMToken.KET, 2202, "Expecting ')' at end of '||' block"); return block; }
@Override public Value caseANonDeterministicSimpleBlockStm( ANonDeterministicSimpleBlockStm node, Context ctxt) throws AnalysisException { BreakpointManager.getBreakpoint(node).check(node.getLocation(), ctxt); return this.evalBlock(node, ctxt); }
/** * Called by the {@link ANonDeterministicSimpleBlockStm} node from {@link ANonDeterministicSimpleBlockStm#apply(IAnalysis)}. * @param node the calling {@link ANonDeterministicSimpleBlockStm} node */ public void caseANonDeterministicSimpleBlockStm(ANonDeterministicSimpleBlockStm node) throws AnalysisException { _visitedNodes.add(node); inANonDeterministicSimpleBlockStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<PStm> copy = new ArrayList<PStm>(node.getStatements()); for( PStm e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outANonDeterministicSimpleBlockStm(node); }
@Override public SStmIR caseANonDeterministicSimpleBlockStm(ANonDeterministicSimpleBlockStm node, IRInfo question) throws AnalysisException { ANonDeterministicBlockStmIR nonDetStmCg = new ANonDeterministicBlockStmIR(); for(PStm stm : node.getStatements()) { SStmIR stmCg = stm.apply(question.getStmVisitor(), question); if(stmCg != null) { nonDetStmCg.getStatements().add(stmCg); } else { return null; } } return nonDetStmCg; }
/** * Called by the {@link ANonDeterministicSimpleBlockStm} node from {@link ANonDeterministicSimpleBlockStm#apply(IPOFAnalysis)}. * @param node the calling {@link ANonDeterministicSimpleBlockStm} node */ public void caseANonDeterministicSimpleBlockStm(ANonDeterministicSimpleBlockStm node) throws AnalysisException { _visitedNodes.add(node); inANonDeterministicSimpleBlockStm(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<PStm> copy = new ArrayList<PStm>(node.getStatements()); for( PStm e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outANonDeterministicSimpleBlockStm(node); }
/** * Creates a deep clone of this {@link ANonDeterministicSimpleBlockStm} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link ANonDeterministicSimpleBlockStm} node */ public ANonDeterministicSimpleBlockStm clone(Map<INode,INode> oldToNewMap) { ANonDeterministicSimpleBlockStm node = new ANonDeterministicSimpleBlockStm( _location, _type, cloneList(_statements, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ANonDeterministicSimpleBlockStm} node from {@link ANonDeterministicSimpleBlockStm#apply(IAnalysis)}. * @param node the calling {@link ANonDeterministicSimpleBlockStm} node */ public A caseANonDeterministicSimpleBlockStm(ANonDeterministicSimpleBlockStm node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inANonDeterministicSimpleBlockStm(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } { List<PStm> copy = new ArrayList<PStm>(node.getStatements()); for( PStm e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outANonDeterministicSimpleBlockStm(node)); return retVal; }
/** * Called by the {@link ANonDeterministicSimpleBlockStm} node from {@link ANonDeterministicSimpleBlockStm#apply(IAnalysis)}. * @param node the calling {@link ANonDeterministicSimpleBlockStm} node */ public A caseANonDeterministicSimpleBlockStm(ANonDeterministicSimpleBlockStm node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inANonDeterministicSimpleBlockStm(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } { List<PStm> copy = new ArrayList<PStm>(node.getStatements()); for( PStm e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outANonDeterministicSimpleBlockStm(node, question)); return retVal; }