1 package org.simantics.scl.compiler.environment;
3 import java.util.Collection;
5 import org.simantics.scl.compiler.elaboration.rules.TransformationRule;
6 import org.simantics.scl.compiler.module.Module;
8 import gnu.trove.map.hash.THashMap;
10 public class ConcreteEnvironment extends AbstractEnvironment {
12 private final THashMap<String, Module> moduleMap;
13 private final Namespace localNamespace;
15 public ConcreteEnvironment(THashMap<String, Module> moduleMap,
16 Namespace localNamespace) {
17 this.moduleMap = moduleMap;
18 this.localNamespace = localNamespace;
22 public Namespace getLocalNamespace() {
23 return localNamespace;
27 protected Module getModule(String name) {
28 return moduleMap.get(name);
32 protected Collection<Module> getModules() {
33 return moduleMap.values();
37 public void collectRules(Collection<TransformationRule> rules) {
38 for(Module module : moduleMap.values())