/** * Returns a deep clone of this {@link AAssignmentStmIR} node. * @return a deep clone of this {@link AAssignmentStmIR} node */ public AAssignmentStmIR clone() { return new AAssignmentStmIR( _sourceNode, _tag, _metaData, cloneNode(_target), cloneNode(_exp) ); }
/** * Creates a new tree field only constructor {@code AAssignmentStmIR TAG=assignment} 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 target_ the {@link SStateDesignatorIR} node for the {@code target} child of this {@link AAssignmentStmIR} node * @param exp_ the {@link SExpIR} node for the {@code exp} child of this {@link AAssignmentStmIR} node */ public AAssignmentStmIR(SStateDesignatorIR target_, SExpIR exp_) { super(null,null,null); this.setTarget(target_); this.setExp(exp_); }
/** * Called by the {@link AAssignmentStmIR} node from {@link AAssignmentStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignmentStmIR} node */ public void caseAAssignmentStmIR(AAssignmentStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAAssignmentStmIR(node, question); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { node.getTarget().apply(this, question); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this, question); } outAAssignmentStmIR(node, question); }
if (node.getTarget() instanceof AMapSeqStateDesignatorIR) AMapSeqStateDesignatorIR target = (AMapSeqStateDesignatorIR) node.getTarget(); SExpIR value = node.getExp(); mapSeqUpd.setIndex(index.clone()); mapSeqUpd.setValue(value.clone()); mapSeqUpd.setSourceNode(node.getSourceNode()); mapSeqUpd.setTag(node.getTag()); assign.setTarget(node.getTarget().apply(converter)); assign.setExp(node.getExp().clone()); assign.setSourceNode(node.getSourceNode()); assign.setTag(node.getTag()); if (node.parent() != null) node.parent().replaceChild(node, newNode); } else
@Override public SStmIR caseAAssignmentStm(AAssignmentStm node, IRInfo question) throws AnalysisException { PStateDesignator target = node.getTarget(); PExp exp = node.getExp(); SStateDesignatorIR targetCg = target.apply(question.getStateDesignatorVisitor(), question); SExpIR expCg = exp.apply(question.getExpVisitor(), question); AAssignmentStmIR assignment = new AAssignmentStmIR(); assignment.setTarget(targetCg); assignment.setExp(expCg); return assignment; }
@Override public void caseAAssignmentStmIR(AAssignmentStmIR node) throws AnalysisException { if(transAssistant.getInfo().getDeclAssistant().parentIsTest(node.getAncestor(ADefaultClassDeclIR.class))) { return; } if(transAssistant.getInfo().getDeclAssistant().isFullyAbstract(transAssistant.getInfo().getDeclAssistant().getSourceClass(node), transAssistant.getInfo())) { return; } handleStateUpdate(node); }
/** * Called by the {@link AAssignmentStmIR} node from {@link AAssignmentStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignmentStmIR} node */ public void caseAAssignmentStmIR(AAssignmentStmIR node) throws AnalysisException { _visitedNodes.add(node); inAAssignmentStmIR(node); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { node.getTarget().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAAssignmentStmIR(node); }
/** * Called by the {@link AAssignmentStmIR} node from {@link AAssignmentStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link AAssignmentStmIR} node */ public void caseAAssignmentStmIR(AAssignmentStmIR node) throws AnalysisException { _visitedNodes.add(node); inAAssignmentStmIR(node); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { node.getTarget().apply(this); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { node.getExp().apply(this); } outAAssignmentStmIR(node); }
/** * Creates a new complete constructor {@code AAssignmentStmIR} 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 target_ the {@link SStateDesignatorIR} node for the {@code target} child of this {@link AAssignmentStmIR} node * @param exp_ the {@link SExpIR} node for the {@code exp} child of this {@link AAssignmentStmIR} node */ public AAssignmentStmIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, SStateDesignatorIR target_, SExpIR exp_) { super(sourceNode_,tag_,metaData_); this.setTarget(target_); this.setExp(exp_); }
/** * Creates a deep clone of this {@link AAssignmentStmIR} 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 AAssignmentStmIR} node */ public AAssignmentStmIR clone(Map<INode,INode> oldToNewMap) { AAssignmentStmIR node = new AAssignmentStmIR( _sourceNode, _tag, _metaData, cloneNode(_target, oldToNewMap), cloneNode(_exp, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AAssignmentStmIR} node from {@link AAssignmentStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignmentStmIR} node */ public A caseAAssignmentStmIR(AAssignmentStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAAssignmentStmIR(node)); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { mergeReturns(retVal,node.getTarget().apply(this)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this)); } mergeReturns(retVal,outAAssignmentStmIR(node)); return retVal; }
/** * Called by the {@link AAssignmentStmIR} node from {@link AAssignmentStmIR#apply(IAnalysis)}. * @param node the calling {@link AAssignmentStmIR} node */ public A caseAAssignmentStmIR(AAssignmentStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAAssignmentStmIR(node, question)); if(node.getTarget() != null && !_visitedNodes.contains(node.getTarget())) { mergeReturns(retVal,node.getTarget().apply(this, question)); } if(node.getExp() != null && !_visitedNodes.contains(node.getExp())) { mergeReturns(retVal,node.getExp().apply(this, question)); } mergeReturns(retVal,outAAssignmentStmIR(node, question)); return retVal; }