import org.simantics.scl.compiler.elaboration.chr.CHRRuleset;
import org.simantics.scl.compiler.elaboration.modules.Documentation;
import org.simantics.scl.compiler.elaboration.modules.SCLValue;
+import org.simantics.scl.compiler.elaboration.modules.TypeAlias;
import org.simantics.scl.compiler.elaboration.modules.TypeClass;
import org.simantics.scl.compiler.elaboration.modules.TypeClassInstance;
import org.simantics.scl.compiler.elaboration.modules.TypeDescriptor;
import org.simantics.scl.compiler.environment.filter.NamespaceFilter;
import org.simantics.scl.compiler.errors.CompilationError;
import org.simantics.scl.compiler.internal.codegen.effects.EffectConstructor;
+import org.simantics.scl.compiler.module.debug.ModuleDebugInfo;
import org.simantics.scl.compiler.top.ModuleInitializer;
import org.simantics.scl.compiler.types.TCon;
+import org.simantics.scl.compiler.types.TVar;
+import org.simantics.scl.compiler.types.Type;
+import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.runtime.profiling.BranchPoint;
import gnu.trove.map.hash.THashMap;
public class ConcreteModule implements Module {
String moduleName;
String defaultLocalName;
+ String deprecation;
THashMap<String, TypeDescriptor> typeDescriptors = new THashMap<String, TypeDescriptor>();
THashMap<String, EffectConstructor> effectConstructors = new THashMap<String, EffectConstructor>();
THashMap<String, TypeClass> typeClasses = new THashMap<String, TypeClass>();
ModuleInitializer moduleInitializer;
protected Documentation documentation;
+
+ public ModuleDebugInfo moduleDebugInfo;
public ConcreteModule(String moduleName) {
this.moduleName = moduleName;
return effectConstructors.put(name, effectConstructor) != null;
}
+ public void addTypeAlias(String name, TVar[] parameters, Type body) {
+ typeDescriptors.put(name, new TypeAlias(Types.con(moduleName, name), parameters, body));
+ }
+
public boolean addTypeClass(String name, TypeClass typeClass) {
return typeClasses.put(name, typeClass) != null;
}
this.values.forEachEntry(new TObjectObjectProcedure<String,SCLValue>() {
@Override
public boolean execute(String name, SCLValue value) {
- if(value.isPrivate())
+ if(value.isPrivateOrDerived())
return true;
String lowerPrefix = prefix.toLowerCase();
String lowerName = name.toLowerCase();
consumer.accept(value);
});
}
+
+ @Override
+ public List<String> getValueNames() {
+ return new ArrayList<String>(values.keySet());
+ }
public Collection<SCLRelation> getRelations() {
return relations.values();
public void addRuleset(String name, CHRRuleset ruleset) {
rulesets.put(name, ruleset);
}
+
+ @Override
+ public String getDeprecation() {
+ return deprecation;
+ }
+
+ public void setDeprecation(String deprecation) {
+ this.deprecation = deprecation;
+ }
+
+ @Override
+ public ModuleDebugInfo getModuleDebugInfo() {
+ return moduleDebugInfo;
+ }
}