protected String getInvokedModule(SStmIR stm) { if (stm instanceof APlainCallStmIR) { APlainCallStmIR call = (APlainCallStmIR) stm; STypeIR type = call.getClassType(); if (type instanceof AClassTypeIR) { return ((AClassTypeIR) type).getName(); } } return traceEnclosingClass; }
/** * Called by the {@link APlainCallStmIR} node from {@link APlainCallStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link APlainCallStmIR} node */ public void caseAPlainCallStmIR(APlainCallStmIR node) throws AnalysisException { _visitedNodes.add(node); inAPlainCallStmIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getClassType() != null && !_visitedNodes.contains(node.getClassType())) { node.getClassType().apply(this); } outAPlainCallStmIR(node); }
/** * Called by the {@link APlainCallStmIR} node from {@link APlainCallStmIR#apply(IAnalysis)}. * @param node the calling {@link APlainCallStmIR} node */ public void caseAPlainCallStmIR(APlainCallStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAPlainCallStmIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } if(node.getClassType() != null && !_visitedNodes.contains(node.getClassType())) { node.getClassType().apply(this, question); } outAPlainCallStmIR(node, question); }
/** * Called by the {@link APlainCallStmIR} node from {@link APlainCallStmIR#apply(IAnalysis)}. * @param node the calling {@link APlainCallStmIR} node */ public void caseAPlainCallStmIR(APlainCallStmIR node) throws AnalysisException { _visitedNodes.add(node); inAPlainCallStmIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } if(node.getClassType() != null && !_visitedNodes.contains(node.getClassType())) { node.getClassType().apply(this); } outAPlainCallStmIR(node); }
@Override public void caseAPlainCallStmIR(APlainCallStmIR node) throws AnalysisException { STypeIR classType = node.getClassType(); String className = classType instanceof AClassTypeIR ? ((AClassTypeIR) classType).getName() : node.getAncestor(ADefaultClassDeclIR.class).getName(); handleCallStm(node, className); }
@Override public void caseAPlainCallStmIR(APlainCallStmIR node) throws AnalysisException { // Example: IO`println(...) STypeIR classType = node.getClassType(); if(classType instanceof AClassTypeIR) { String className = ((AClassTypeIR) classType).getName(); String methodName = node.getName(); // VDMUtil does not contain operations if(isUnsupportedIO(className, methodName)){ warn(node); } } }
/** * Called by the {@link APlainCallStmIR} node from {@link APlainCallStmIR#apply(IAnalysis)}. * @param node the calling {@link APlainCallStmIR} node */ public A caseAPlainCallStmIR(APlainCallStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAPlainCallStmIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } if(node.getClassType() != null && !_visitedNodes.contains(node.getClassType())) { mergeReturns(retVal,node.getClassType().apply(this, question)); } mergeReturns(retVal,outAPlainCallStmIR(node, question)); return retVal; }
/** * Called by the {@link APlainCallStmIR} node from {@link APlainCallStmIR#apply(IAnalysis)}. * @param node the calling {@link APlainCallStmIR} node */ public A caseAPlainCallStmIR(APlainCallStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAPlainCallStmIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } if(node.getClassType() != null && !_visitedNodes.contains(node.getClassType())) { mergeReturns(retVal,node.getClassType().apply(this)); } mergeReturns(retVal,outAPlainCallStmIR(node)); return retVal; }
STypeIR type = plainCall.getClassType(); String name = plainCall.getName(); LinkedList<SExpIR> args = plainCall.getArgs();
STypeIR classType = callStmIR.getClassType(); String name = callStmIR.getName();