/** * Returns a deep clone of this {@link AInterfaceTypeIR} node. * @return a deep clone of this {@link AInterfaceTypeIR} node */ public AInterfaceTypeIR clone() { return new AInterfaceTypeIR( _sourceNode, _tag, _metaData, _optional, cloneNode(_namedInvType), cloneList(_types), _name ); }
/** * Creates a new complete constructor {@code AInterfaceTypeIR} 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 types_ the {@link NodeList} node for the {@code types} child of this {@link AInterfaceTypeIR} node * @param name_ the {@link String} node for the {@code name} child of this {@link AInterfaceTypeIR} node */ public AInterfaceTypeIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, Boolean optional_, ANamedTypeDeclIR namedInvType_, List<? extends STypeIR> types_, String name_) { super(sourceNode_,tag_,metaData_,optional_,namedInvType_); this.setTypes(types_); this.setName(name_); }
public String format(AMethodTypeIR methodType) throws AnalysisException { final String OBJ = "Object"; if (funcValAssist == null) { return OBJ; } AInterfaceDeclIR methodTypeInterface = funcValAssist.findInterface(methodType); if (methodTypeInterface == null) { return OBJ; // Should not happen } AInterfaceTypeIR methodClass = new AInterfaceTypeIR(); methodClass.setName(methodTypeInterface.getName()); LinkedList<STypeIR> params = methodType.getParams(); for (STypeIR param : params) { methodClass.getTypes().add(param.clone()); } methodClass.getTypes().add(methodType.getResult().clone()); return methodClass != null ? format(methodClass) : OBJ; }
/** * Called by the {@link AInterfaceTypeIR} node from {@link AInterfaceTypeIR#apply(IIsaAnalysis)}. * @param node the calling {@link AInterfaceTypeIR} node */ public void caseAInterfaceTypeIR(AInterfaceTypeIR node) throws AnalysisException { _visitedNodes.add(node); inAInterfaceTypeIR(node); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { node.getNamedInvType().apply(this); } { List<STypeIR> copy = new ArrayList<STypeIR>(node.getTypes()); for( STypeIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAInterfaceTypeIR(node); }
AInterfaceTypeIR classType = new AInterfaceTypeIR(); classType.setName(lambdaInterface.getName()); SPatternIR pattern = paramLocalDeclIR.getPattern(); classType.getTypes().add(paramType.clone()); lambdaDecl.getFormalParams().get(i).setType(paramType.clone()); lambdaDecl.getFormalParams().get(i).setPattern(pattern.clone()); classType.getTypes().add(methodType.getResult().clone()); lambdaDecl.getMethodType().setResult(methodType.getResult().clone());
/** * Called by the {@link AInterfaceTypeIR} node from {@link AInterfaceTypeIR#apply(IAnalysis)}. * @param node the calling {@link AInterfaceTypeIR} node */ public void caseAInterfaceTypeIR(AInterfaceTypeIR node) throws AnalysisException { _visitedNodes.add(node); inAInterfaceTypeIR(node); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { node.getNamedInvType().apply(this); } { List<STypeIR> copy = new ArrayList<STypeIR>(node.getTypes()); for( STypeIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAInterfaceTypeIR(node); }
/** * Called by the {@link AInterfaceTypeIR} node from {@link AInterfaceTypeIR#apply(IAnalysis)}. * @param node the calling {@link AInterfaceTypeIR} node */ public void caseAInterfaceTypeIR(AInterfaceTypeIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAInterfaceTypeIR(node, question); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { node.getNamedInvType().apply(this, question); } { List<STypeIR> copy = new ArrayList<STypeIR>(node.getTypes()); for( STypeIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outAInterfaceTypeIR(node, question); }
/** * Creates a deep clone of this {@link AInterfaceTypeIR} 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 AInterfaceTypeIR} node */ public AInterfaceTypeIR clone(Map<INode,INode> oldToNewMap) { AInterfaceTypeIR node = new AInterfaceTypeIR( _sourceNode, _tag, _metaData, _optional, cloneNode(_namedInvType, oldToNewMap), cloneList(_types, oldToNewMap), _name ); oldToNewMap.put(this, node); return node; }
/** * Creates a new tree field only constructor {@code AInterfaceTypeIR TAG=interface} 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 types_ the {@link NodeList} node for the {@code types} child of this {@link AInterfaceTypeIR} node * @param name_ the {@link String} node for the {@code name} child of this {@link AInterfaceTypeIR} node */ public AInterfaceTypeIR(Boolean optional_, ANamedTypeDeclIR namedInvType_, List<? extends STypeIR> types_, String name_) { super(null,null,null,optional_,namedInvType_); this.setTypes(types_); this.setName(name_); }
/** * Called by the {@link AInterfaceTypeIR} node from {@link AInterfaceTypeIR#apply(IAnalysis)}. * @param node the calling {@link AInterfaceTypeIR} node */ public A caseAInterfaceTypeIR(AInterfaceTypeIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAInterfaceTypeIR(node)); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { mergeReturns(retVal,node.getNamedInvType().apply(this)); } { List<STypeIR> copy = new ArrayList<STypeIR>(node.getTypes()); for( STypeIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outAInterfaceTypeIR(node)); return retVal; }
/** * Called by the {@link AInterfaceTypeIR} node from {@link AInterfaceTypeIR#apply(IAnalysis)}. * @param node the calling {@link AInterfaceTypeIR} node */ public A caseAInterfaceTypeIR(AInterfaceTypeIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAInterfaceTypeIR(node, question)); if(node.getNamedInvType() != null && !_visitedNodes.contains(node.getNamedInvType())) { mergeReturns(retVal,node.getNamedInvType().apply(this, question)); } { List<STypeIR> copy = new ArrayList<STypeIR>(node.getTypes()); for( STypeIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outAInterfaceTypeIR(node, question)); return retVal; }