/** * Called by the {@link ANotEqualsBinaryExpIR} node from {@link ANotEqualsBinaryExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link ANotEqualsBinaryExpIR} node */ public void caseANotEqualsBinaryExpIR(ANotEqualsBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inANotEqualsBinaryExpIR(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); } outANotEqualsBinaryExpIR(node); }
/** * Called by the {@link ANotEqualsBinaryExpIR} node from {@link ANotEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ANotEqualsBinaryExpIR} node */ public void caseANotEqualsBinaryExpIR(ANotEqualsBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inANotEqualsBinaryExpIR(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); } outANotEqualsBinaryExpIR(node); }
/** * Called by the {@link ANotEqualsBinaryExpIR} node from {@link ANotEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ANotEqualsBinaryExpIR} node */ public void caseANotEqualsBinaryExpIR(ANotEqualsBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inANotEqualsBinaryExpIR(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); } outANotEqualsBinaryExpIR(node, question); }
/** * Called by the {@link ANotEqualsBinaryExpIR} node from {@link ANotEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ANotEqualsBinaryExpIR} node */ public A caseANotEqualsBinaryExpIR(ANotEqualsBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inANotEqualsBinaryExpIR(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,outANotEqualsBinaryExpIR(node)); return retVal; }
/** * Called by the {@link ANotEqualsBinaryExpIR} node from {@link ANotEqualsBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ANotEqualsBinaryExpIR} node */ public A caseANotEqualsBinaryExpIR(ANotEqualsBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inANotEqualsBinaryExpIR(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,outANotEqualsBinaryExpIR(node, question)); return retVal; }
private ANotUnaryExpIR transNotEquals(ANotEqualsBinaryExpIR notEqual) { ANotUnaryExpIR notUnary = new ANotUnaryExpIR(); notUnary.setType(new ABoolBasicTypeIR()); AEqualsBinaryExpIR equal = new AEqualsBinaryExpIR(); equal.setType(new ABoolBasicTypeIR()); equal.setLeft(notEqual.getLeft().clone()); equal.setRight(notEqual.getRight().clone()); notUnary.setExp(equal); // Replace the "notEqual" expression with the transformed expression INode parent = notEqual.parent(); // It may be the case that the parent is null if we execute e.g. [1] <> [1] in isolation if (parent != null) { parent.replaceChild(notEqual, notUnary); notEqual.parent(null); } return notUnary; }