private String handleEquals(AEqualsBinaryExpIR valueType) throws AnalysisException { return String.format("%s.equals(%s, %s)", UTILS_FILE, format(valueType.getLeft()), format(valueType.getRight())); }
public String formatEqualsBinaryExp(AEqualsBinaryExpIR node) throws AnalysisException { STypeIR leftNodeType = node.getLeft().getType(); if (leftNodeType instanceof SSeqTypeIR || leftNodeType instanceof SSetTypeIR || leftNodeType instanceof SMapTypeIR) { return handleCollectionComparison(node); } else { return handleEquals(node); } }
/** * Called by the {@link AEqualsBinaryExpIR} node from {@link AEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AEqualsBinaryExpIR} node */ public void caseAEqualsBinaryExpIR(AEqualsBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAEqualsBinaryExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAEqualsBinaryExpIR(node); }
/** * Called by the {@link AEqualsBinaryExpIR} node from {@link AEqualsBinaryExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link AEqualsBinaryExpIR} node */ public void caseAEqualsBinaryExpIR(AEqualsBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAEqualsBinaryExpIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this); } outAEqualsBinaryExpIR(node); }
/** * Called by the {@link AEqualsBinaryExpIR} node from {@link AEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AEqualsBinaryExpIR} node */ public void caseAEqualsBinaryExpIR(AEqualsBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAEqualsBinaryExpIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { node.getLeft().apply(this, question); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { node.getRight().apply(this, question); } outAEqualsBinaryExpIR(node, question); }
/** * Called by the {@link AEqualsBinaryExpIR} node from {@link AEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AEqualsBinaryExpIR} node */ public A caseAEqualsBinaryExpIR(AEqualsBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAEqualsBinaryExpIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this)); } mergeReturns(retVal,outAEqualsBinaryExpIR(node)); return retVal; }
/** * Called by the {@link AEqualsBinaryExpIR} node from {@link AEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AEqualsBinaryExpIR} node */ public A caseAEqualsBinaryExpIR(AEqualsBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAEqualsBinaryExpIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getLeft() != null && !_visitedNodes.contains(node.getLeft())) { mergeReturns(retVal,node.getLeft().apply(this, question)); } if(node.getRight() != null && !_visitedNodes.contains(node.getRight())) { mergeReturns(retVal,node.getRight().apply(this, question)); } mergeReturns(retVal,outAEqualsBinaryExpIR(node, question)); return retVal; }