/** * 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_); }
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; }
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; }