private PatternInfo extractPatternInfo(AVarDeclIR decl) { STypeIR type = decl.getType(); SPatternIR pattern = decl.getPattern(); SExpIR actualValue = decl.getExp(); return new PatternInfo(type, pattern, actualValue); }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public void caseAVarDeclIR(AVarDeclIR node) throws AnalysisException { _visitedNodes.add(node); inAVarDeclIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAVarDeclIR(node); }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IIsaAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public void caseAVarDeclIR(AVarDeclIR node) throws AnalysisException { _visitedNodes.add(node); inAVarDeclIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getPattern() != null && !_visitedNodes.contains(node.getPattern())) { node.getPattern().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAVarDeclIR(node); }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public void caseAVarDeclIR(AVarDeclIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAVarDeclIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, 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); } outAVarDeclIR(node, question); }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public A caseAVarDeclIR(AVarDeclIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAVarDeclIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, 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)); } mergeReturns(retVal,outAVarDeclIR(node, question)); return retVal; }
/** * Called by the {@link AVarDeclIR} node from {@link AVarDeclIR#apply(IAnalysis)}. * @param node the calling {@link AVarDeclIR} node */ public A caseAVarDeclIR(AVarDeclIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAVarDeclIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } 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)); } mergeReturns(retVal,outAVarDeclIR(node)); return retVal; }
nextElementDecl.getPattern().apply(typeFinder, elemType); } catch (AnalysisException e) + nextElementDecl.getPattern()); e.printStackTrace();
if (successVarDecl != null) SPatternIR successVarDeclPattern = successVarDecl.getPattern(); if (successVarDeclPattern instanceof AIdentifierPatternIR) } else SPatternIR nextDeclPattern = nextDeclCopy.getPattern(); if (nextDeclPattern instanceof AIdentifierPatternIR)
SPatternIR pattern = nextElementDecl.getPattern();
dec.getPattern().apply(typeFinder, dec.getType());
@Override public void caseALocalPatternAssignmentStmIR( ALocalPatternAssignmentStmIR node) throws AnalysisException { AVarDeclIR nextElementDecl = node.getNextElementDecl(); SPatternIR pattern = nextElementDecl.getPattern(); if (pattern instanceof AIdentifierPatternIR) { return; } if (pattern instanceof AIgnorePatternIR) { AIdentifierPatternIR idPattern = getIdPattern(config.getIgnorePatternPrefix()); transAssistant.replaceNodeWith(node.getTarget(), idPattern); transAssistant.replaceNodeWith(pattern, idPattern.clone()); return; } DeclarationTag tag = fetchTag(node); ABlockStmIR replacementBlock = consPatternHandlingInIterationBlock(nextElementDecl, tag, node.getExp()); transAssistant.replaceNodeWith(node, replacementBlock); }
String name = decorator.getJmlGen().getUtil().getName(node.getPattern());