/** * Called by the {@link ACasesStmIR} node from {@link ACasesStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link ACasesStmIR} node */ public void caseACasesStmIR(ACasesStmIR node) throws AnalysisException { _visitedNodes.add(node); inACasesStmIR(node); if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } { List<ACaseAltStmStmIR> copy = new ArrayList<ACaseAltStmStmIR>(node.getCases()); for( ACaseAltStmStmIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getOthers() != null && !_visitedNodes.contains(node.getOthers())) { node.getOthers().apply(this); } outACasesStmIR(node); }
/** * Called by the {@link ACasesStmIR} node from {@link ACasesStmIR#apply(IAnalysis)}. * @param node the calling {@link ACasesStmIR} node */ public void caseACasesStmIR(ACasesStmIR node) throws AnalysisException { _visitedNodes.add(node); inACasesStmIR(node); if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } { List<ACaseAltStmStmIR> copy = new ArrayList<ACaseAltStmStmIR>(node.getCases()); for( ACaseAltStmStmIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getOthers() != null && !_visitedNodes.contains(node.getOthers())) { node.getOthers().apply(this); } outACasesStmIR(node); }
/** * Called by the {@link ACasesStmIR} node from {@link ACasesStmIR#apply(IAnalysis)}. * @param node the calling {@link ACasesStmIR} node */ public void caseACasesStmIR(ACasesStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inACasesStmIR(node, question); if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } { List<ACaseAltStmStmIR> copy = new ArrayList<ACaseAltStmStmIR>(node.getCases()); for( ACaseAltStmStmIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getOthers() != null && !_visitedNodes.contains(node.getOthers())) { node.getOthers().apply(this, question); } outACasesStmIR(node, question); }
/** * Called by the {@link ACasesStmIR} node from {@link ACasesStmIR#apply(IAnalysis)}. * @param node the calling {@link ACasesStmIR} node */ public A caseACasesStmIR(ACasesStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inACasesStmIR(node, question)); if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } { List<ACaseAltStmStmIR> copy = new ArrayList<ACaseAltStmStmIR>(node.getCases()); for( ACaseAltStmStmIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getOthers() != null && !_visitedNodes.contains(node.getOthers())) { mergeReturns(retVal,node.getOthers().apply(this, question)); } mergeReturns(retVal,outACasesStmIR(node, question)); return retVal; }
/** * Called by the {@link ACasesStmIR} node from {@link ACasesStmIR#apply(IAnalysis)}. * @param node the calling {@link ACasesStmIR} node */ public A caseACasesStmIR(ACasesStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inACasesStmIR(node)); if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } { List<ACaseAltStmStmIR> copy = new ArrayList<ACaseAltStmStmIR>(node.getCases()); for( ACaseAltStmStmIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getOthers() != null && !_visitedNodes.contains(node.getOthers())) { mergeReturns(retVal,node.getOthers().apply(this)); } mergeReturns(retVal,outACasesStmIR(node)); return retVal; }
String expName = transAssistant.getInfo().getTempVarNameGen().nextVarName(casesExpNamePrefix); SExpIR exp = node.getExp(); if (!(node.getExp() instanceof SVarExpIR)) AVarDeclIR expVarDecl = transAssistant.getInfo().getDeclAssistant().consLocalVarDecl(node.getExp().getType().clone(), transAssistant.getInfo().getPatternAssistant().consIdPattern(expName), node.getExp().clone()); replacementBlock.getLocalDefs().add(expVarDecl); exp = transAssistant.getInfo().getExpAssistant().consIdVar(expName, node.getExp().getType().clone());