/** * Returns a deep clone of this {@link AMapIterationBinaryExpIR} node. * @return a deep clone of this {@link AMapIterationBinaryExpIR} node */ public AMapIterationBinaryExpIR clone() { return new AMapIterationBinaryExpIR( _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 AMapIterationBinaryExpIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AMapIterationBinaryExpIR} node from {@link AMapIterationBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapIterationBinaryExpIR} node */ public void caseAMapIterationBinaryExpIR(AMapIterationBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAMapIterationBinaryExpIR(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); } outAMapIterationBinaryExpIR(node); }
@Override public SExpIR caseAStarStarBinaryExp(AStarStarBinaryExp node, IRInfo question) throws AnalysisException { PTypeAssistantTC assist = question.getTcFactory().createPTypeAssistant(); PType lType = node.getLeft().getType(); if(assist.isMap(lType)) { return question.getExpAssistant().handleBinaryExp(node, new AMapIterationBinaryExpIR(), question); } else if(assist.isFunction(lType)) { return question.getExpAssistant().handleBinaryExp(node, new AFuncIterationBinaryExpIR(), question); } else { // So it must be numeric return question.getExpAssistant().handleBinaryExp(node, new APowerNumericBinaryExpIR(), question); } }
/** * Called by the {@link AMapIterationBinaryExpIR} node from {@link AMapIterationBinaryExpIR#apply(IIsaAnalysis)}. * @param node the calling {@link AMapIterationBinaryExpIR} node */ public void caseAMapIterationBinaryExpIR(AMapIterationBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); inAMapIterationBinaryExpIR(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); } outAMapIterationBinaryExpIR(node); }
/** * Called by the {@link AMapIterationBinaryExpIR} node from {@link AMapIterationBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapIterationBinaryExpIR} node */ public void caseAMapIterationBinaryExpIR(AMapIterationBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAMapIterationBinaryExpIR(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); } outAMapIterationBinaryExpIR(node, question); }
/** * Creates a deep clone of this {@link AMapIterationBinaryExpIR} 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 AMapIterationBinaryExpIR} node */ public AMapIterationBinaryExpIR clone(Map<INode,INode> oldToNewMap) { AMapIterationBinaryExpIR node = new AMapIterationBinaryExpIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_left, oldToNewMap), cloneNode(_right, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AMapIterationBinaryExpIR} node from {@link AMapIterationBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapIterationBinaryExpIR} node */ public A caseAMapIterationBinaryExpIR(AMapIterationBinaryExpIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAMapIterationBinaryExpIR(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,outAMapIterationBinaryExpIR(node, question)); return retVal; }
/** * Called by the {@link AMapIterationBinaryExpIR} node from {@link AMapIterationBinaryExpIR#apply(IAnalysis)}. * @param node the calling {@link AMapIterationBinaryExpIR} node */ public A caseAMapIterationBinaryExpIR(AMapIterationBinaryExpIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAMapIterationBinaryExpIR(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,outAMapIterationBinaryExpIR(node)); return retVal; }