/** * Returns a deep clone of this {@link AModuleExportsIR} node. * @return a deep clone of this {@link AModuleExportsIR} node */ public AModuleExportsIR clone() { return new AModuleExportsIR( _sourceNode, _tag, _metaData, cloneListList(_exports) ); }
/** * Sets the {@code _exports} child of this {@link AModuleDeclIR} node. * @param value the new {@code _exports} child of this {@link AModuleDeclIR} node */ public void setExports(AModuleExportsIR value) { if (this._exports != null) { this._exports.parent(null); } if (value != null) { if (value.parent() != null) { value.parent().removeChild(value); } value.parent(this); } this._exports = value; }
/** * Creates a new tree field only constructor {@code AModuleExportsIR 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 exports_ the {@link NodeListList} node for the {@code exports} child of this {@link AModuleExportsIR} node */ public AModuleExportsIR(Collection<? extends List<SExportIR>> exports_) { super(null,null,null); this.setExports(exports_); }
/** * Called by the {@link AModuleExportsIR} node from {@link AModuleExportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleExportsIR} node */ public void caseAModuleExportsIR(AModuleExportsIR node, Q question) throws AnalysisException { _visitedNodes.add(node); inAModuleExportsIR(node, question); { List<List<SExportIR>> copy = new ArrayList<List<SExportIR>>(node.getExports()); for( List<SExportIR> list : copy) { for( SExportIR e : list) { if(!_visitedNodes.contains(e)) { e.apply(this, question); } } } } outAModuleExportsIR(node, question); }
@Override public SExportsIR caseAModuleExports(AModuleExports node, IRInfo question) throws AnalysisException { AModuleExportsIR moduleExportsCg = new AModuleExportsIR(); for (List<PExport> export : node.getExports()) { List<SExportIR> exportCg = new LinkedList<SExportIR>(); for (PExport exportItem : export) { SExportIR exportItemCg = exportItem.apply(question.getExportVisitor(), question); if (exportItemCg != null) { exportCg.add(exportItemCg); } else { return null; } } moduleExportsCg.getExports().add(exportCg); } return moduleExportsCg; } }
/** * 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); }
/** * Essentially this.toString().equals(o.toString()). **/ @Override public boolean equals(Object o) { if (o != null && o instanceof AModuleExportsIR) { return toString().equals(o.toString()); } return false; }
/** * Called by the {@link AModuleExportsIR} node from {@link AModuleExportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleExportsIR} node */ public void caseAModuleExportsIR(AModuleExportsIR node) throws AnalysisException { _visitedNodes.add(node); inAModuleExportsIR(node); { List<List<SExportIR>> copy = new ArrayList<List<SExportIR>>(node.getExports()); for( List<SExportIR> list : copy) { for( SExportIR e : list) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } } outAModuleExportsIR(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); }
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 AModuleExportsIR} node from {@link AModuleExportsIR#apply(IIsaAnalysis)}. * @param node the calling {@link AModuleExportsIR} node */ public void caseAModuleExportsIR(AModuleExportsIR node) throws AnalysisException { _visitedNodes.add(node); inAModuleExportsIR(node); { List<List<SExportIR>> copy = new ArrayList<List<SExportIR>>(node.getExports()); for( List<SExportIR> list : copy) { for( SExportIR e : list) { if(!_visitedNodes.contains(e)) { e.apply(this); } } } } outAModuleExportsIR(node); }
/** * 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); }
/** * Creates a deep clone of this {@link AModuleExportsIR} 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 AModuleExportsIR} node */ public AModuleExportsIR clone(Map<INode,INode> oldToNewMap) { AModuleExportsIR node = new AModuleExportsIR( _sourceNode, _tag, _metaData, cloneListList(_exports, oldToNewMap) ); oldToNewMap.put(this, node); return node; }
/** * Creates a new complete constructor {@code AModuleExportsIR} 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 exports_ the {@link NodeListList} node for the {@code exports} child of this {@link AModuleExportsIR} node */ public AModuleExportsIR(SourceNode sourceNode_, Object tag_, List<? extends ClonableString> metaData_, Collection<? extends List<SExportIR>> exports_) { super(sourceNode_,tag_,metaData_); this.setExports(exports_); }
/** * Called by the {@link AModuleExportsIR} node from {@link AModuleExportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleExportsIR} node */ public A caseAModuleExportsIR(AModuleExportsIR node, Q question) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node, question); mergeReturns(retVal,inAModuleExportsIR(node, question)); { List<List<SExportIR>> copy = new ArrayList<List<SExportIR>>(node.getExports()); for( List<SExportIR> list : copy) { for( SExportIR e : list) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this, question)); } } } } mergeReturns(retVal,outAModuleExportsIR(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 AModuleExportsIR} node from {@link AModuleExportsIR#apply(IAnalysis)}. * @param node the calling {@link AModuleExportsIR} node */ public A caseAModuleExportsIR(AModuleExportsIR node) throws AnalysisException { _visitedNodes.add(node); A retVal = createNewReturnValue(node); mergeReturns(retVal,inAModuleExportsIR(node)); { List<List<SExportIR>> copy = new ArrayList<List<SExportIR>>(node.getExports()); for( List<SExportIR> list : copy) { for( SExportIR e : list) { if(!_visitedNodes.contains(e)) { mergeReturns(retVal,e.apply(this)); } } } } mergeReturns(retVal,outAModuleExportsIR(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; }