/** * Called by the {@link AForAllStmIR} node from {@link AForAllStmIR#apply(IAnalysis)}. * @param node the calling {@link AForAllStmIR} node */ public void caseAForAllStmIR(AForAllStmIR node) throws AnalysisException { _visitedNodes.add(node); inAForAllStmIR(node); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { node.getBody().apply(this); } outAForAllStmIR(node); }
/** * Called by the {@link AForAllStmIR} node from {@link AForAllStmIR#apply(IAnalysis)}. * @param node the calling {@link AForAllStmIR} node */ public void caseAForAllStmIR(AForAllStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAForAllStmIR(node, question); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { node.getBody().apply(this, question); } outAForAllStmIR(node, question); }
/** * Called by the {@link AForAllStmIR} node from {@link AForAllStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link AForAllStmIR} node */ public void caseAForAllStmIR(AForAllStmIR node) throws AnalysisException { _visitedNodes.add(node); inAForAllStmIR(node); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { node.getBody().apply(this); } outAForAllStmIR(node); }
/** * Called by the {@link AForAllStmIR} node from {@link AForAllStmIR#apply(IAnalysis)}. * @param node the calling {@link AForAllStmIR} node */ public A caseAForAllStmIR(AForAllStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAForAllStmIR(node)); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { mergeReturns(retVal,node.getPattern().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { mergeReturns(retVal,node.getBody().apply(this)); } mergeReturns(retVal,outAForAllStmIR(node)); return retVal; }
/** * Called by the {@link AForAllStmIR} node from {@link AForAllStmIR#apply(IAnalysis)}. * @param node the calling {@link AForAllStmIR} node */ public A caseAForAllStmIR(AForAllStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAForAllStmIR(node, question)); if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { mergeReturns(retVal,node.getPattern().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } if(node.getBody() != null && !_visitedNodes.contains(node.getBody())) { mergeReturns(retVal,node.getBody().apply(this, question)); } mergeReturns(retVal,outAForAllStmIR(node, question)); return retVal; }
@Override public void caseAForAllStmIR(AForAllStmIR node) throws AnalysisException { SPatternIR pattern = node.getPattern(); if (pattern instanceof AIdentifierPatternIR) { node.getExp().apply(this); node.getBody().apply(this); return; } if (pattern instanceof AIgnorePatternIR) { AIdentifierPatternIR idPattern = getIdPattern(config.getIgnorePatternPrefix()); transAssistant.replaceNodeWith(pattern, idPattern); } PatternBlockData patternData = new PatternBlockData(MismatchHandling.LOOP_CONTINUE); patternData.setPattern(pattern); ABlockStmIR declBlock = new ABlockStmIR(); patternData.setDeclBlock(declBlock); ABlockStmIR patternHandlingBlock = consPatternCheck(false, pattern, transAssistant.getInfo().getTypeAssistant().findElementType(node.getExp().getType().clone()), patternData, null); if (patternHandlingBlock != null) { declBlock.getStatements().addFirst(patternHandlingBlock); } declBlock.getStatements().add(node.getBody().clone()); transAssistant.replaceNodeWith(node.getBody(), declBlock); node.getExp().apply(this); node.getBody().apply(this); }
@Override public void caseAForAllStmIR(AForAllStmIR node) throws AnalysisException { if (node.getExp().getType() instanceof AStringTypeIR) { ASeqSeqTypeIR seqType = new ASeqSeqTypeIR(); seqType.setEmpty(false); seqType.setSeq1(false); seqType.setOptional(false); seqType.setSeqOf(new ACharBasicTypeIR()); correctExpToSeq(node.getExp(), seqType); } node.getBody().apply(this); }