/** * Returns a deep clone of this {@link AModuleImportsIR} node. * @return a deep clone of this {@link AModuleImportsIR} node */ public AModuleImportsIR clone() { return new AModuleImportsIR( _sourceNode, _tag, _metaData, _name, cloneList(_imports) ); }
/** * Creates a new tree field only constructor {@code AModuleImportsIR TAG=module} 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 name_ the {@link String} node for the {@code name} child of this {@link AModuleImportsIR} node * @param imports_ the {@link NodeList} node for the {@code imports} child of this {@link AModuleImportsIR} node */ public AModuleImportsIR(String name_, List<? extends AFromModuleImportsIR> imports_) { super(null,null,null); this.setName(name_); this.setImports(imports_); }
/** * Sets the {@code _import} child of this {@link AModuleDeclIR} node. * @param value the new {@code _import} child of this {@link AModuleDeclIR} node */ public void setImport(AModuleImportsIR value) { if (this._import != null) { this._import.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._import = value; }
@Override public SImportsIR caseAModuleImports(AModuleImports node, IRInfo question) throws AnalysisException { String name = node.getName() != null ? node.getName().getName() : null; AModuleImportsIR moduleImportsCg = new AModuleImportsIR(); moduleImportsCg.setName(name); for (AFromModuleImports fromModuleImport : node.getImports()) { SImportsIR fromModuleImportCg = fromModuleImport.apply(question.getImportsVisitor(), question); if (fromModuleImportCg instanceof AFromModuleImportsIR) { moduleImportsCg.getImports().add((AFromModuleImportsIR) fromModuleImportCg); } else { log.error("Expected fromModuleImportCg to be of type '" + AFromModuleImportsIR.class.getSimpleName() + "'. Got: " + fromModuleImportCg); return null; } } return moduleImportsCg; }
/** * Called by the {@link AModuleImportsIR} node from {@link AModuleImportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleImportsIR} node */ public void caseAModuleImportsIR(AModuleImportsIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAModuleImportsIR(node, question); { List<AFromModuleImportsIR> copy = new ArrayList<AFromModuleImportsIR>(node.getImports()); for( AFromModuleImportsIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outAModuleImportsIR(node, question); }
/** * Called by the {@link AModuleDeclIR} node from {@link AModuleDeclIR#apply(IAnalysis)}. * @param node the calling {@link AModuleDeclIR} node */ public void caseAModuleDeclIR(AModuleDeclIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAModuleDeclIR(node, question); if(node.getImport() != null && !_visitedNodes.contains(node.getImport())) { node.getImport().apply(this, question); } if(node.getExports() != null && !_visitedNodes.contains(node.getExports())) { node.getExports().apply(this, question); } { List<SDeclIR> copy = new ArrayList<SDeclIR>(node.getDecls()); for( SDeclIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } outAModuleDeclIR(node, question); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AModuleImportsIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AModuleImportsIR} node from {@link AModuleImportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleImportsIR} node */ public void caseAModuleImportsIR(AModuleImportsIR node) throws AnalysisException { _visitedNodes.add(node); inAModuleImportsIR(node); { List<AFromModuleImportsIR> copy = new ArrayList<AFromModuleImportsIR>(node.getImports()); for( AFromModuleImportsIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAModuleImportsIR(node); }
/** * Called by the {@link AModuleDeclIR} node from {@link AModuleDeclIR#apply(IAnalysis)}. * @param node the calling {@link AModuleDeclIR} node */ public void caseAModuleDeclIR(AModuleDeclIR node) throws AnalysisException { _visitedNodes.add(node); inAModuleDeclIR(node); if(node.getImport() != null && !_visitedNodes.contains(node.getImport())) { node.getImport().apply(this); } if(node.getExports() != null && !_visitedNodes.contains(node.getExports())) { node.getExports().apply(this); } { List<SDeclIR> copy = new ArrayList<SDeclIR>(node.getDecls()); for( SDeclIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAModuleDeclIR(node); }
public String toString() { return (_name!=null?_name.toString():this.getClass().getSimpleName())+ (_import!=null?_import.toString():this.getClass().getSimpleName())+ (_exports!=null?_exports.toString():this.getClass().getSimpleName())+ (_decls!=null?_decls.toString():this.getClass().getSimpleName())+ (_isFlat!=null?_isFlat.toString():this.getClass().getSimpleName())+ (_isDLModule!=null?_isDLModule.toString():this.getClass().getSimpleName()); }
/** * Called by the {@link AModuleImportsIR} node from {@link AModuleImportsIR#apply(IIsaAnalysis)}. * @param node the calling {@link AModuleImportsIR} node */ public void caseAModuleImportsIR(AModuleImportsIR node) throws AnalysisException { _visitedNodes.add(node); inAModuleImportsIR(node); { List<AFromModuleImportsIR> copy = new ArrayList<AFromModuleImportsIR>(node.getImports()); for( AFromModuleImportsIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAModuleImportsIR(node); }
/** * Called by the {@link AModuleDeclIR} node from {@link AModuleDeclIR#apply(IIsaAnalysis)}. * @param node the calling {@link AModuleDeclIR} node */ public void caseAModuleDeclIR(AModuleDeclIR node) throws AnalysisException { _visitedNodes.add(node); inAModuleDeclIR(node); if(node.getImport() != null && !_visitedNodes.contains(node.getImport())) { node.getImport().apply(this); } if(node.getExports() != null && !_visitedNodes.contains(node.getExports())) { node.getExports().apply(this); } { List<SDeclIR> copy = new ArrayList<SDeclIR>(node.getDecls()); for( SDeclIR e : copy) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } outAModuleDeclIR(node); }
/** * Creates a new complete constructor {@code AModuleImportsIR} 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 name_ the {@link String} node for the {@code name} child of this {@link AModuleImportsIR} node * @param imports_ the {@link NodeList} node for the {@code imports} child of this {@link AModuleImportsIR} node */ public AModuleImportsIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, String name_, List<? extends AFromModuleImportsIR> imports_) { super(sourceNode_,tag_,metaData_); this.setName(name_); this.setImports(imports_); }
/** * Creates a deep clone of this {@link AModuleImportsIR} 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 AModuleImportsIR} node */ public AModuleImportsIR clone(Map<INode,INode> oldToNewMap) { AModuleImportsIR node = new AModuleImportsIR( _sourceNode, _tag, _metaData, _name, cloneList(_imports, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Called by the {@link AModuleImportsIR} node from {@link AModuleImportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleImportsIR} node */ public A caseAModuleImportsIR(AModuleImportsIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAModuleImportsIR(node, question)); { List<AFromModuleImportsIR> copy = new ArrayList<AFromModuleImportsIR>(node.getImports()); for( AFromModuleImportsIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outAModuleImportsIR(node, question)); return retVal; }
/** * Called by the {@link AModuleDeclIR} node from {@link AModuleDeclIR#apply(IAnalysis)}. * @param node the calling {@link AModuleDeclIR} node */ public A caseAModuleDeclIR(AModuleDeclIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAModuleDeclIR(node, question)); if(node.getImport() != null && !_visitedNodes.contains(node.getImport())) { mergeReturns(retVal,node.getImport().apply(this, question)); } if(node.getExports() != null && !_visitedNodes.contains(node.getExports())) { mergeReturns(retVal,node.getExports().apply(this, question)); } { List<SDeclIR> copy = new ArrayList<SDeclIR>(node.getDecls()); for( SDeclIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } mergeReturns(retVal,outAModuleDeclIR(node, question)); return retVal; }
/** * Called by the {@link AModuleImportsIR} node from {@link AModuleImportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleImportsIR} node */ public A caseAModuleImportsIR(AModuleImportsIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAModuleImportsIR(node)); { List<AFromModuleImportsIR> copy = new ArrayList<AFromModuleImportsIR>(node.getImports()); for( AFromModuleImportsIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outAModuleImportsIR(node)); return retVal; }
/** * Called by the {@link AModuleDeclIR} node from {@link AModuleDeclIR#apply(IAnalysis)}. * @param node the calling {@link AModuleDeclIR} node */ public A caseAModuleDeclIR(AModuleDeclIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAModuleDeclIR(node)); if(node.getImport() != null && !_visitedNodes.contains(node.getImport())) { mergeReturns(retVal,node.getImport().apply(this)); } if(node.getExports() != null && !_visitedNodes.contains(node.getExports())) { mergeReturns(retVal,node.getExports().apply(this)); } { List<SDeclIR> copy = new ArrayList<SDeclIR>(node.getDecls()); for( SDeclIR e : copy) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } mergeReturns(retVal,outAModuleDeclIR(node)); return retVal; }
for (AFromModuleImportsIR fromImports : moduleImports.getImports())