/** * Returns a deep clone of this {@link ATimesNumericBinaryExpIR} node. * @return a deep clone of this {@link ATimesNumericBinaryExpIR} node */ public ATimesNumericBinaryExpIR clone() { return new ATimesNumericBinaryExpIR( _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 ATimesNumericBinaryExpIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link ATimesNumericBinaryExpIR} node from {@link ATimesNumericBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ATimesNumericBinaryExpIR} node */ public void caseATimesNumericBinaryExpIR(ATimesNumericBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inATimesNumericBinaryExpIR(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); } outATimesNumericBinaryExpIR(node); }
@Override public void caseADivideNumericBinaryExpIR(ADivideNumericBinaryExpIR node) throws AnalysisException { SExpIR leftExp = node.getLeft(); leftExp.apply(this); SExpIR rightExp = node.getRight(); rightExp.apply(this); if (info.getExpAssistant().isIntegerType(leftExp) && info.getExpAssistant().isIntegerType(rightExp)) { ARealLiteralExpIR one = new ARealLiteralExpIR(); ARealNumericBasicTypeIR realTypeCg = new ARealNumericBasicTypeIR(); realTypeCg.setSourceNode(new SourceNode(new ARealNumericBasicType())); one.setType(realTypeCg); one.setValue(1.0); ATimesNumericBinaryExpIR neutralMul = new ATimesNumericBinaryExpIR(); neutralMul.setType(realTypeCg.clone()); neutralMul.setLeft(one); neutralMul.setRight(leftExp); node.setLeft(info.getExpAssistant().isolateExpression(neutralMul)); } } }
@Override public SExpIR caseATimesNumericBinaryExp(ATimesNumericBinaryExp node, IRInfo question) throws AnalysisException { return question.getExpAssistant().handleBinaryExp(node, new ATimesNumericBinaryExpIR(), question); }
/** * Called by the {@link ATimesNumericBinaryExpIR} node from {@link ATimesNumericBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ATimesNumericBinaryExpIR} node */ public void caseATimesNumericBinaryExpIR(ATimesNumericBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inATimesNumericBinaryExpIR(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); } outATimesNumericBinaryExpIR(node, question); }
/** * Called by the {@link ATimesNumericBinaryExpIR} node from {@link ATimesNumericBinaryExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link ATimesNumericBinaryExpIR} node */ public void caseATimesNumericBinaryExpIR(ATimesNumericBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inATimesNumericBinaryExpIR(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); } outATimesNumericBinaryExpIR(node); }
/** * Creates a deep clone of this {@link ATimesNumericBinaryExpIR} 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 ATimesNumericBinaryExpIR} node */ public ATimesNumericBinaryExpIR clone(Map<INode,INode> oldToNewMap) { ATimesNumericBinaryExpIR node = new ATimesNumericBinaryExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_left, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ATimesNumericBinaryExpIR} node from {@link ATimesNumericBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ATimesNumericBinaryExpIR} node */ public A caseATimesNumericBinaryExpIR(ATimesNumericBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inATimesNumericBinaryExpIR(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,outATimesNumericBinaryExpIR(node)); return retVal; }
/** * Called by the {@link ATimesNumericBinaryExpIR} node from {@link ATimesNumericBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link ATimesNumericBinaryExpIR} node */ public A caseATimesNumericBinaryExpIR(ATimesNumericBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inATimesNumericBinaryExpIR(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,outATimesNumericBinaryExpIR(node, question)); return retVal; }