]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/module/ConcreteModule.java
(refs #7105) Added defaultLocalName property to SCL modules
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / module / ConcreteModule.java
index 2f6d52bdba63298ad51c6de3e4f2c8fe3c5b6b89..55ee202f7d78d9b56f189bee8df90d96920f03b7 100644 (file)
@@ -19,6 +19,7 @@ import org.simantics.scl.compiler.elaboration.relations.SCLRelation;
 import org.simantics.scl.compiler.elaboration.rules.MappingRelation;
 import org.simantics.scl.compiler.elaboration.rules.TransformationRule;
 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.top.ModuleInitializer;
 import org.simantics.scl.compiler.types.TCon;
@@ -30,6 +31,7 @@ import gnu.trove.procedure.TObjectProcedure;
 
 public class ConcreteModule implements Module {
     String moduleName;
+    String defaultLocalName;
     THashMap<String, TypeDescriptor> typeDescriptors = new THashMap<String, TypeDescriptor>();
     THashMap<String, EffectConstructor> effectConstructors = new THashMap<String, EffectConstructor>();
     THashMap<String, TypeClass> typeClasses = new THashMap<String, TypeClass>();
@@ -41,8 +43,10 @@ public class ConcreteModule implements Module {
     THashMap<String, MappingRelation> mappingRelations = new THashMap<String, MappingRelation>();
     ArrayList<ImportDeclaration> dependencies = new ArrayList<ImportDeclaration>();
     THashMap<String, BranchPoint[]> branchPoints;
-
+    CompilationError[] warnings = CompilationError.EMPTY_ARRAY;
+    
     Map<String, byte[]> classes = Collections.emptyMap();
+    ClassLoader parentClassLoader;
     ModuleInitializer moduleInitializer;
 
     protected Documentation documentation;
@@ -51,6 +55,15 @@ public class ConcreteModule implements Module {
         this.moduleName = moduleName;
     }
 
+    @Override
+    public String getDefaultLocalName() {
+       return defaultLocalName;
+    }
+    
+    public void setDefaultLocalName(String defaultLocalName) {
+               this.defaultLocalName = defaultLocalName;
+       }
+    
     public boolean addTypeDescriptor(String name, TypeDescriptor typeConstructor) {
         return typeDescriptors.put(name, typeConstructor) != null;
     }
@@ -267,6 +280,24 @@ public class ConcreteModule implements Module {
 
     @Override
     public void dispose() {
-        
+    }
+    
+    public void setWarnings(CompilationError[] warnings) {
+        this.warnings = warnings;
+    }
+    
+    public CompilationError[] getWarnings() {
+        return warnings;
+    }
+    
+    @Override
+    public ClassLoader getParentClassLoader() {
+        return parentClassLoader;
+    }
+    
+    public void setParentClassLoader(ClassLoader parentClassLoader) {
+        if(parentClassLoader == null)
+            throw new NullPointerException();
+        this.parentClassLoader = parentClassLoader;
     }
 }