/** * Returns a deep clone of this {@link ANotEqualsBinaryExpIR} node. * @return a deep clone of this {@link ANotEqualsBinaryExpIR} node */ public ANotEqualsBinaryExpIR clone() { return new ANotEqualsBinaryExpIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneNode(_left), cloneNode(_right) ); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof ANotEqualsBinaryExpIR) { return toString().equals(o.toString()); } return false; }
/** * 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); }
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; }
@Override public SExpIR caseANotEqualBinaryExp(ANotEqualBinaryExp node, IRInfo question) throws AnalysisException { return question.getExpAssistant().handleBinaryExp(node, new ANotEqualsBinaryExpIR(), question); }
/** * 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); }
/** * Creates a deep clone of this {@link ANotEqualsBinaryExpIR} node while putting all * old node-new node relations in the map {@code oldToNewMap}. * @param oldToNewMap the map filled with the old node-new node relation * @return a deep clone of this {@link ANotEqualsBinaryExpIR} node */ public ANotEqualsBinaryExpIR clone(Map<INode,INode> oldToNewMap) { ANotEqualsBinaryExpIR node = new ANotEqualsBinaryExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_left, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * 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; }
/** * 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; }