/** * Returns a deep clone of this {@link ACallObjectStmIR} node. * @return a deep clone of this {@link ACallObjectStmIR} node */ public ACallObjectStmIR clone() { return new ACallObjectStmIR( _sourceNode, _tag, _metaData, cloneNode(_type), cloneNode(_designator), _fieldName, cloneList(_args) ); }
/** * Creates a new tree field only constructor {@code ACallObjectStmIR TAG=callObject} 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 type_ the {@link STypeIR} node for the {@code type} child of this {@link ACallObjectStmIR} node * @param designator_ the {@link SObjectDesignatorIR} node for the {@code designator} child of this {@link ACallObjectStmIR} node * @param fieldName_ the {@link String} node for the {@code fieldName} child of this {@link ACallObjectStmIR} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link ACallObjectStmIR} node */ public ACallObjectStmIR(STypeIR type_, SObjectDesignatorIR designator_, String fieldName_, List<? extends SExpIR> args_) { super(null,null,null); this.setType(type_); this.setDesignator(designator_); this.setFieldName(fieldName_); this.setArgs(args_); }
/** * Called by the {@link ACallObjectStmIR} node from {@link ACallObjectStmIR#apply(IIsaAnalysis)}. * @param node the calling {@link ACallObjectStmIR} node */ public void caseACallObjectStmIR(ACallObjectStmIR node) throws AnalysisException { _visitedNodes.add(node); inACallObjectStmIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) { node.getDesignator().apply(this); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outACallObjectStmIR(node); }
@Override public void caseACallObjectStmIR(ACallObjectStmIR node) throws AnalysisException { ACallObjectExpStmIR callObjExpStm = new ACallObjectExpStmIR(); callObjExpStm.setArgs(node.getArgs()); callObjExpStm.setObj(node.getDesignator().apply(converter)); callObjExpStm.setFieldName(node.getFieldName()); callObjExpStm.setSourceNode(node.getSourceNode()); callObjExpStm.setTag(node.getTag()); callObjExpStm.setType(node.getType()); if (node.parent() != null) { node.parent().replaceChild(node, callObjExpStm); } else { log.error("Could not find parent of " + node); } } }
ACallObjectStmIR callObject = new ACallObjectStmIR(); callObject.setType(typeCg); callObject.setDesignator(objectDesignatorCg); callObject.setFieldName(fieldNameCg); callObject.getArgs().add(argCg); } else
/** * Called by the {@link ACallObjectStmIR} node from {@link ACallObjectStmIR#apply(IAnalysis)}. * @param node the calling {@link ACallObjectStmIR} node */ public void caseACallObjectStmIR(ACallObjectStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inACallObjectStmIR(node, question); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this, question); } if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) { node.getDesignator().apply(this, question); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outACallObjectStmIR(node, question); }
/** * Called by the {@link ACallObjectStmIR} node from {@link ACallObjectStmIR#apply(IAnalysis)}. * @param node the calling {@link ACallObjectStmIR} node */ public void caseACallObjectStmIR(ACallObjectStmIR node) throws AnalysisException { _visitedNodes.add(node); inACallObjectStmIR(node); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { node.getType().apply(this); } if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) { node.getDesignator().apply(this); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outACallObjectStmIR(node); }
/** * Creates a new complete constructor {@code ACallObjectStmIR} 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 type_ the {@link STypeIR} node for the {@code type} child of this {@link ACallObjectStmIR} node * @param designator_ the {@link SObjectDesignatorIR} node for the {@code designator} child of this {@link ACallObjectStmIR} node * @param fieldName_ the {@link String} node for the {@code fieldName} child of this {@link ACallObjectStmIR} node * @param args_ the {@link NodeList} node for the {@code args} child of this {@link ACallObjectStmIR} node */ public ACallObjectStmIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, STypeIR type_, SObjectDesignatorIR designator_, String fieldName_, List<? extends SExpIR> args_) { super(sourceNode_,tag_,metaData_); this.setType(type_); this.setDesignator(designator_); this.setFieldName(fieldName_); this.setArgs(args_); }
/** * Creates a deep clone of this {@link ACallObjectStmIR} 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 ACallObjectStmIR} node */ public ACallObjectStmIR clone(Map<INode,INode> oldToNewMap) { ACallObjectStmIR node = new ACallObjectStmIR( _sourceNode, _tag, _metaData, cloneNode(_type, oldToNewMap), cloneNode(_designator, oldToNewMap), _fieldName, cloneList(_args, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link ACallObjectStmIR} node from {@link ACallObjectStmIR#apply(IAnalysis)}. * @param node the calling {@link ACallObjectStmIR} node */ public A caseACallObjectStmIR(ACallObjectStmIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inACallObjectStmIR(node, question)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this, question)); } if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) { mergeReturns(retVal,node.getDesignator().apply(this, question)); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outACallObjectStmIR(node, question)); return retVal; }
/** * Called by the {@link ACallObjectStmIR} node from {@link ACallObjectStmIR#apply(IAnalysis)}. * @param node the calling {@link ACallObjectStmIR} node */ public A caseACallObjectStmIR(ACallObjectStmIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inACallObjectStmIR(node)); if(node.getType() != null && !_visitedNodes.contains(node.getType())) { mergeReturns(retVal,node.getType().apply(this)); } if(node.getDesignator() != null && !_visitedNodes.contains(node.getDesignator())) { mergeReturns(retVal,node.getDesignator().apply(this)); } { List<SExpIR> copy = new ArrayList<SExpIR>(node.getArgs()); for( SExpIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outACallObjectStmIR(node)); return retVal; }