/** * 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; }
/** * 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) ); }
@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); } }