/** * Returns a deep clone of this {@link ASeqCompAddStmIR} node. * @return a deep clone of this {@link ASeqCompAddStmIR} node */ public ASeqCompAddStmIR clone() { return new ASeqCompAddStmIR( _sourceNode, _tag, _metaData, cloneNode(_seq), cloneNode(_element) ); }
/** * Creates a new complete constructor {@code ASeqCompAddStmIR} 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 seq_ the {@link SExpIR} node for the {@code seq} child of this {@link ASeqCompAddStmIR} node * @param element_ the {@link SExpIR} node for the {@code element} child of this {@link ASeqCompAddStmIR} node */ public ASeqCompAddStmIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, SExpIR seq_, SExpIR element_) { super(sourceNode_,tag_,metaData_); this.setSeq(seq_); this.setElement(element_); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof ASeqCompAddStmIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link ASeqCompAddStmIR} node from {@link ASeqCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASeqCompAddStmIR} node */ public void caseASeqCompAddStmIR(ASeqCompAddStmIR node) throws AnalysisException { _visitedNodes.add(node); inASeqCompAddStmIR(node); if(node.getSeq() != null && !_visitedNodes.contains(node.getSeq())) { node.getSeq().apply(this); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { node.getElement().apply(this); } outASeqCompAddStmIR(node); }
@Override protected List<SStmIR> getConditionalAdd(AIdentifierVarExpIR setVar, List<SPatternIR> patterns, SPatternIR pattern) { AIdentifierVarExpIR seqCompResult = new AIdentifierVarExpIR(); seqCompResult.setType(compType.clone()); seqCompResult.setName(idPattern.getName()); seqCompResult.setIsLambda(false); seqCompResult.setIsLocal(true); ASeqCompAddStmIR add = new ASeqCompAddStmIR(); add.setSeq(seqCompResult); add.setElement(first.clone()); return consConditionalAdd(seqCompResult, 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 ASeqCompAddStmIR} node from {@link ASeqCompAddStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link ASeqCompAddStmIR} node */ public void caseASeqCompAddStmIR(ASeqCompAddStmIR node) throws AnalysisException { _visitedNodes.add(node); inASeqCompAddStmIR(node); if(node.getSeq() != null && !_visitedNodes.contains(node.getSeq())) { node.getSeq().apply(this); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { node.getElement().apply(this); } outASeqCompAddStmIR(node); }
/** * Called by the {@link ASeqCompAddStmIR} node from {@link ASeqCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASeqCompAddStmIR} node */ public void caseASeqCompAddStmIR(ASeqCompAddStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inASeqCompAddStmIR(node, question); if(node.getSeq() != null && !_visitedNodes.contains(node.getSeq())) { node.getSeq().apply(this, question); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { node.getElement().apply(this, question); } outASeqCompAddStmIR(node, question); }
/** * Creates a new tree field only constructor {@code ASeqCompAddStmIR TAG=seqCompAdd} 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 seq_ the {@link SExpIR} node for the {@code seq} child of this {@link ASeqCompAddStmIR} node * @param element_ the {@link SExpIR} node for the {@code element} child of this {@link ASeqCompAddStmIR} node */ public ASeqCompAddStmIR(SExpIR seq_, SExpIR element_) { super(null,null,null); this.setSeq(seq_); this.setElement(element_); }
/** * Creates a deep clone of this {@link ASeqCompAddStmIR} 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 ASeqCompAddStmIR} node */ public ASeqCompAddStmIR clone(Map<INode,INode> oldToNewMap) { ASeqCompAddStmIR node = new ASeqCompAddStmIR( _sourceNode, _tag, _metaData, cloneNode(_seq, oldToNewMap), cloneNode(_element, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ASeqCompAddStmIR} node from {@link ASeqCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASeqCompAddStmIR} node */ public A caseASeqCompAddStmIR(ASeqCompAddStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inASeqCompAddStmIR(node)); if(node.getSeq() != null && !_visitedNodes.contains(node.getSeq())) { mergeReturns(retVal,node.getSeq().apply(this)); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { mergeReturns(retVal,node.getElement().apply(this)); } mergeReturns(retVal,outASeqCompAddStmIR(node)); return retVal; }
/** * Called by the {@link ASeqCompAddStmIR} node from {@link ASeqCompAddStmIR#apply(IAnalysis)}. * @param node the calling {@link ASeqCompAddStmIR} node */ public A caseASeqCompAddStmIR(ASeqCompAddStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inASeqCompAddStmIR(node, question)); if(node.getSeq() != null && !_visitedNodes.contains(node.getSeq())) { mergeReturns(retVal,node.getSeq().apply(this, question)); } if(node.getElement() != null && !_visitedNodes.contains(node.getElement())) { mergeReturns(retVal,node.getElement().apply(this, question)); } mergeReturns(retVal,outASeqCompAddStmIR(node, question)); return retVal; }