/** * Returns a deep clone of this {@link ASetCompAddStmIR} node. * @return a deep clone of this {@link ASetCompAddStmIR} node */ public ASetCompAddStmIR clone() { return new ASetCompAddStmIR( _sourceNode, _tag, _metaData, cloneNode(_set), cloneNode(_element) ); }
/** * Creates a new tree field only constructor {@code ASetCompAddStmIR TAG=setCompAdd} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param set_ the {@link SExpIR} node for the {@code set} child of this {@link ASetCompAddStmIR} node * @param element_ the {@link SExpIR} node for the {@code element} child of this {@link ASetCompAddStmIR} node */ public ASetCompAddStmIR(SExpIR set_, SExpIR element_) { super(null,null,null); this.setSet(set_); this.setElement(element_); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof ASetCompAddStmIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link ASetCompAddStmIR} node from {@link ASetCompAddStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link ASetCompAddStmIR} node */ public void caseASetCompAddStmIR(ASetCompAddStmIR node) throws AnalysisException { _visitedNodes.add(node); inASetCompAddStmIR(node); if(node.getSet() != null && !_visitedNodes.contains(node.getSet())) { node.getSet().apply(this); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { node.getElement().apply(this); } outASetCompAddStmIR(node); }
@Override protected List<SStmIR> getConditionalAdd(AIdentifierVarExpIR setVar, List<SPatternIR> patterns, SPatternIR pattern) { AIdentifierVarExpIR setCompResult = new AIdentifierVarExpIR(); setCompResult.setType(compType.clone()); setCompResult.setName(idPattern.getName()); setCompResult.setIsLambda(false); setCompResult.setIsLocal(true); ASetCompAddStmIR add = new ASetCompAddStmIR(); add.setSet(setCompResult); add.setElement(first.clone()); return consConditionalAdd(setCompResult, add); } }
private boolean compAdd(SExpIR exp) { INode parent = exp.parent(); if (parent instanceof ASeqCompAddStmIR) { ASeqCompAddStmIR add = (ASeqCompAddStmIR) parent; return add.getSeq() == exp; } if (parent instanceof ASetCompAddStmIR) { ASetCompAddStmIR add = (ASetCompAddStmIR) parent; return add.getSet() == exp; } if (parent instanceof AMapCompAddStmIR) { AMapCompAddStmIR add = (AMapCompAddStmIR) parent; return add.getMap() == exp; } return false; }
/** * Called by the {@link ASetCompAddStmIR} node from {@link ASetCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASetCompAddStmIR} node */ public void caseASetCompAddStmIR(ASetCompAddStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inASetCompAddStmIR(node, question); if(node.getSet() != null && !_visitedNodes.contains(node.getSet())) { node.getSet().apply(this, question); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { node.getElement().apply(this, question); } outASetCompAddStmIR(node, question); }
/** * Called by the {@link ASetCompAddStmIR} node from {@link ASetCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASetCompAddStmIR} node */ public void caseASetCompAddStmIR(ASetCompAddStmIR node) throws AnalysisException { _visitedNodes.add(node); inASetCompAddStmIR(node); if(node.getSet() != null && !_visitedNodes.contains(node.getSet())) { node.getSet().apply(this); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { node.getElement().apply(this); } outASetCompAddStmIR(node); }
/** * Creates a new complete constructor {@code ASetCompAddStmIR} node with the given nodes as children. * @deprecated This method should not be used, use AstFactory instead. * The basic child nodes are removed from their previous parents. * @param set_ the {@link SExpIR} node for the {@code set} child of this {@link ASetCompAddStmIR} node * @param element_ the {@link SExpIR} node for the {@code element} child of this {@link ASetCompAddStmIR} node */ public ASetCompAddStmIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, SExpIR set_, SExpIR element_) { super(sourceNode_,tag_,metaData_); this.setSet(set_); this.setElement(element_); }
/** * Creates a deep clone of this {@link ASetCompAddStmIR} 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 ASetCompAddStmIR} node */ public ASetCompAddStmIR clone(Map<INode,INode> oldToNewMap) { ASetCompAddStmIR node = new ASetCompAddStmIR( _sourceNode, _tag, _metaData, cloneNode(_set, oldToNewMap), cloneNode(_element, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ASetCompAddStmIR} node from {@link ASetCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASetCompAddStmIR} node */ public A caseASetCompAddStmIR(ASetCompAddStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inASetCompAddStmIR(node)); if(node.getSet() != null && !_visitedNodes.contains(node.getSet())) { mergeReturns(retVal,node.getSet().apply(this)); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { mergeReturns(retVal,node.getElement().apply(this)); } mergeReturns(retVal,outASetCompAddStmIR(node)); return retVal; }
/** * Called by the {@link ASetCompAddStmIR} node from {@link ASetCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASetCompAddStmIR} node */ public A caseASetCompAddStmIR(ASetCompAddStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inASetCompAddStmIR(node, question)); if(node.getSet() != null && !_visitedNodes.contains(node.getSet())) { mergeReturns(retVal,node.getSet().apply(this, question)); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { mergeReturns(retVal,node.getElement().apply(this, question)); } mergeReturns(retVal,outASetCompAddStmIR(node, question)); return retVal; }