X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Fenvironment%2FNamespace.java;h=792734c5d80255ce42b6b073fdafb4dfe74db42c;hb=HEAD;hp=dc388a72c2ebfe2392cd58d8172113f7c9137baa;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/Namespace.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/Namespace.java index dc388a72c..792734c5d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/Namespace.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/environment/Namespace.java @@ -1,13 +1,12 @@ package org.simantics.scl.compiler.environment; -import gnu.trove.procedure.TObjectProcedure; - +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; @@ -16,6 +15,8 @@ import org.simantics.scl.compiler.environment.filter.NamespaceFilter; import org.simantics.scl.compiler.internal.codegen.effects.EffectConstructor; import org.simantics.scl.compiler.types.TCon; +import gnu.trove.procedure.TObjectProcedure; + public interface Namespace { /** * Find a sub-namespace with a given name @@ -24,6 +25,8 @@ public interface Namespace { */ Namespace getNamespace(String name); + Collection getNamespaces(); + /** * Get an SCLValue for a given name. The same instance is returned on each call. * @param name the name of a defined value @@ -52,13 +55,13 @@ public interface Namespace { SCLEntityType getEntityType(String name) throws AmbiguousNameException; /** - * Get a TypeConstructor for a given name. The same instance is returned on each call. + * Get a TypeDescriptor for a given name. The same instance is returned on each call. * @param name the name of a defined entity type - * @return The return value is a TypeConstructor provided by any source included in the namespace, + * @return The return value is a TypeDescriptor provided by any source included in the namespace, * or null if the name is not found. * @exception AmbiguousNameException if the name matches with multiple imported modules. */ - TypeConstructor getTypeConstructor(String name) throws AmbiguousNameException; + TypeDescriptor getTypeDescriptor(String name) throws AmbiguousNameException; /** * Get an EffectConstructor for a given name. The same instance is returned on each call. @@ -69,6 +72,8 @@ public interface Namespace { */ EffectConstructor getEffectConstructor(String name) throws AmbiguousNameException; + CHRRuleset getRuleset(String name) throws AmbiguousNameException; + /** * Get a TypeClass for a given name. The same instance is returned on each call. * @param name the name of a defined entity type @@ -78,15 +83,6 @@ public interface Namespace { */ TypeClass getTypeClass(String name) throws AmbiguousNameException; - /** - * Get a TypeAlias for a given name. The same instance is returned on each call. - * @param name the name of a defined entity type - * @return The return value is a TypeAlias provided by any source included in the namespace, - * or null if the name is not found. - * @exception AmbiguousNameException if the name matches with multiple imported modules. - */ - TypeAlias getTypeAlias(String name) throws AmbiguousNameException; - TransformationRule getRule(String name) throws AmbiguousNameException; MappingRelation getMappingRelation(String name) throws AmbiguousNameException;