public static AOperationExport newAOperationExport(ILexLocation location, List<ILexNameToken> nameList, PType type) { AOperationExport result = new AOperationExport(); result.setLocation(location); result.setNameList(nameList); result.setExportType(type); return result; }
/** * Returns a deep clone of this {@link AOperationExport} node. * @return a deep clone of this {@link AOperationExport} node */ public AOperationExport clone() { return new AOperationExport( _location, cloneList(_definition), cloneList(_nameList), _exportType ); }
/** * Creates a new complete constructor {@code AOperationExport} 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 nameList_ the {@link NodeList} node for the {@code nameList} child of this {@link AOperationExport} node * @param exportType_ the {@link PType} <b>graph</a> node for the {@code exportType} child of this {@link AOperationExport} node. * <i>The parent of this {@code exportType } will not be changed by adding it to this node.</i> */ public AOperationExport(ILexLocation location_, List<? extends PDefinition> definition_, List<? extends ILexNameToken> nameList_, PType exportType_) { super(location_,definition_); this.setNameList(nameList_); this.setExportType(exportType_); }
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) node.getExportType().apply(this, question);
@Override public Collection<? extends PDefinition> caseAOperationExport( AOperationExport exp) throws AnalysisException { List<PDefinition> list = new Vector<PDefinition>(); for (ILexNameToken name : exp.getNameList()) { list.add(AstFactory.newALocalDefinition(name.getLocation(), name.clone(), NameScope.GLOBAL, exp.getExportType())); // new ALocalDefinition(name.location, NameScope.GLOBAL,true,null, // new AAccessSpecifierAccessSpecifier(new APublicAccess(),new TStatic(),null), // ((AOperationExport)exp).getExportType(),false,name.clone())); } return list; }
public PType caseAOperationExport(AOperationExport exp, TypeCheckInfo question) throws AnalysisException { ITypeCheckerAssistantFactory af = question.assistantFactory; ModuleEnvironment menv = (ModuleEnvironment)question.env; for (ILexNameToken name : exp.getNameList()) { PDefinition def = af.createPDefinitionListAssistant().findName(menv.getDefinitions(), name, NameScope.NAMES); if (def == null) { TypeCheckerErrors.report(3185, "Exported operation " + name + " not defined in module", name.getLocation(), exp); } else { PType act = def.getType(); PType type = question.assistantFactory.createPTypeAssistant().typeResolve(exp.getExportType(), null, THIS, question); exp.setExportType(type); if (act != null && !af.createPTypeAssistant().equals(act, type)) { TypeCheckerErrors.report(3186, "Exported operation type does not match actual type", name.getLocation(), exp); TypeCheckerErrors.detail2("Exported", type, "Actual", act); } } } return null; }
@Override public Collection<? extends PDefinition> caseAOperationExport( AOperationExport exp, LinkedList<PDefinition> actualDefs) throws AnalysisException { List<PDefinition> list = new Vector<PDefinition>(); for (ILexNameToken name : ((AOperationExport) exp).getNameList()) { PDefinition def = af.createPDefinitionListAssistant().findName(actualDefs, name, NameScope.NAMES); if (def != null) { list.add(def); } } return list; }
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) node.getExportType().apply(this);
@Override public SExportIR caseAOperationExport(AOperationExport node, IRInfo question) throws AnalysisException { AOperationExportIR opExportCg = new AOperationExportIR(); opExportCg.setNameList(consNames(node.getNameList())); opExportCg.setExportType(consExportType(node.getExportType(), question)); return addDecl(node, opExportCg, question); }
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) node.getExportType().apply(this);
/** * Creates a deep clone of this {@link AOperationExport} 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 AOperationExport} node */ public AOperationExport clone(Map<INode,INode> oldToNewMap) { AOperationExport node = new AOperationExport( _location, cloneList(_definition, oldToNewMap), cloneList(_nameList, oldToNewMap), _exportType ); oldToNewMap.put(this, node); return node; }
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) mergeReturns(retVal,node.getExportType().apply(this, question));
List<PDefinition> copy = new ArrayList<PDefinition>(node.getDefinition()); for( PDefinition e : copy) List<ILexNameToken> copy = new ArrayList<ILexNameToken>(node.getNameList()); for( ILexNameToken e : copy) if(node.getExportType() != null && !_visitedNodes.contains(node.getExportType())) mergeReturns(retVal,node.getExportType().apply(this));