package org.simantics.scl.compiler.environment;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.function.Consumer;
+import org.simantics.scl.compiler.elaboration.chr.CHRRuleset;
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.TypeConstructor;
+import org.simantics.scl.compiler.elaboration.modules.TypeDescriptor;
import org.simantics.scl.compiler.elaboration.relations.SCLEntityType;
import org.simantics.scl.compiler.elaboration.relations.SCLRelation;
import org.simantics.scl.compiler.elaboration.rules.MappingRelation;
this.module = module;
this.filter = filter;
}
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("ModuleImport \"").append(module).append("\"").append(" with filter ").append(filter);
- return sb.toString();
- }
}
public NamespaceImpl(THashMap<String, Namespace> namespaceMap,
public Namespace getNamespace(String name) {
return namespaceMap.get(name);
}
+
+ @Override
+ public Collection<String> getNamespaces() {
+ return namespaceMap.keySet();
+ }
@Override
public SCLValue getValue(String name) throws AmbiguousNameException {
throw new AmbiguousNameException(conflictingModules, name);
return result;
}
-
+
@Override
public SCLRelation getRelation(String name) throws AmbiguousNameException {
SCLRelation result = null, temp;
}
@Override
- public TypeConstructor getTypeConstructor(String name)
+ public TypeDescriptor getTypeDescriptor(String name)
throws AmbiguousNameException {
- TypeConstructor result = null, temp;
+ TypeDescriptor result = null, temp;
Module resultModule = null;
ArrayList<String> conflictingModules = null;
for(ModuleImport moduleImport : moduleImports) {
Module module = moduleImport.module;
- temp = module.getTypeConstructor(name);
+ temp = module.getTypeDescriptor(name);
if(temp != null) {
if(result != null) {
if(conflictingModules == null) {
}
@Override
- public TypeAlias getTypeAlias(String name) throws AmbiguousNameException {
- TypeAlias result = null, temp;
+ public MappingRelation getMappingRelation(String name) throws AmbiguousNameException {
+ MappingRelation result = null, temp;
Module resultModule = null;
ArrayList<String> conflictingModules = null;
for(ModuleImport moduleImport : moduleImports) {
Module module = moduleImport.module;
- temp = module.getTypeAlias(name);
+ temp = module.getMappingRelation(name);
if(temp != null) {
if(result != null) {
if(conflictingModules == null) {
throw new AmbiguousNameException(conflictingModules, name);
return result;
}
-
+
@Override
- public MappingRelation getMappingRelation(String name) throws AmbiguousNameException {
- MappingRelation result = null, temp;
+ public TransformationRule getRule(String name) throws AmbiguousNameException {
+ TransformationRule result = null, temp;
Module resultModule = null;
ArrayList<String> conflictingModules = null;
for(ModuleImport moduleImport : moduleImports) {
Module module = moduleImport.module;
- temp = module.getMappingRelation(name);
+ temp = module.getRule(name);
if(temp != null) {
if(result != null) {
if(conflictingModules == null) {
}
@Override
- public TransformationRule getRule(String name) throws AmbiguousNameException {
- TransformationRule result = null, temp;
+ public CHRRuleset getRuleset(String name) throws AmbiguousNameException {
+ CHRRuleset result = null, temp;
Module resultModule = null;
ArrayList<String> conflictingModules = null;
for(ModuleImport moduleImport : moduleImports) {
Module module = moduleImport.module;
- temp = module.getRule(name);
+ temp = module.getRuleset(name);
if(temp != null) {
if(result != null) {
if(conflictingModules == null) {