/** * Creates a deep clone of this {@link AForAllStmIR} 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 AForAllStmIR} node */ public AForAllStmIR clone(Map<INode,INode> oldToNewMap) { AForAllStmIR node = new AForAllStmIR( _sourceNode, _tag, _metaData, cloneNode(_pattern, oldToNewMap), cloneNode(_exp, oldToNewMap), cloneNode(_body, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Returns a deep clone of this {@link AForAllStmIR} node. * @return a deep clone of this {@link AForAllStmIR} node */ public AForAllStmIR clone() { return new AForAllStmIR( _sourceNode, _tag, _metaData, cloneNode(_pattern), cloneNode(_exp), cloneNode(_body) ); }
@Override public SStmIR caseAForAllStm(AForAllStm node, IRInfo question) throws AnalysisException { // Example: for all x in set {1,2,3} do skip; PPattern pattern = node.getPattern(); PExp set = node.getSet(); PStm body = node.getStatement(); SPatternIR patternCg = pattern.apply(question.getPatternVisitor(), question); SExpIR setExpCg = set.apply(question.getExpVisitor(), question); SStmIR bodyCg = body.apply(question.getStmVisitor(), question); AForAllStmIR forAll = new AForAllStmIR(); forAll.setPattern(patternCg); forAll.setExp(setExpCg); forAll.setBody(bodyCg); return forAll; }
SStmIR stmCg = stm.apply(question.getStmVisitor(), question); AForAllStmIR forAll = new AForAllStmIR(); forAll.setPattern(patternCg); forAll.setBody(stmCg);