Commit f9cc0507 authored by danielkisov's avatar danielkisov
Browse files

Passing strings in place of hashmap

parent 17ae6b33
Pipeline #456495 failed with stage
in 31 seconds
......@@ -26,8 +26,8 @@ import java.util.*;
public class EMADLLanguage extends EmbeddingModelingLanguage {
public static final String FILE_ENDING = "emadl";
private HashMap<String, ArrayList<String>> customLayers = null;
private String customPythonFilesPath = "";
private String customFilesPath = "";
private String backend = "";
public static final EmbeddedMontiArcDynamicLanguage HOST_LANGUAGE = new EmbeddedMontiArcDynamicLanguage();
public static final CNNArchLanguage CNNARCH_LANGUAGE = new CNNArchLanguage();
......@@ -40,29 +40,29 @@ public class EMADLLanguage extends EmbeddingModelingLanguage {
Arrays.asList(CNNARCH_LANGUAGE, MATH_LANGUAGE));
}
public EMADLLanguage(HashMap<String, ArrayList<String>> customLayers, String customPythonFilesPath) {
public EMADLLanguage(String customFilesPath, String backend) {
super("Embedded MontiArc Deep Learning Language",
FILE_ENDING,
HOST_LANGUAGE,
Arrays.asList(CNNARCH_LANGUAGE, MATH_LANGUAGE));
setCustomLayers(customLayers);
setCustomPythonFilesPath(customPythonFilesPath);
setBackend(backend);
setCustomFilesPath(customFilesPath);
}
private void setCustomLayers(HashMap<String, ArrayList<String>> customLayers){
this.customLayers = customLayers;
private void setBackend(String backend){
this.backend = backend;
}
public HashMap<String, ArrayList<String>> getCustomLayers(){
return this.customLayers;
public String getBackend(){
return this.backend;
}
private void setCustomPythonFilesPath(String customPythonFilesPath){
this.customPythonFilesPath = customPythonFilesPath;
private void setCustomFilesPath(String customPythonFilesPath){
this.customFilesPath = customPythonFilesPath;
}
public String getCustomPythonFilesPath(){
return this.customPythonFilesPath;
public String getCustomFilesPath(){
return this.customFilesPath;
}
......@@ -92,7 +92,7 @@ public class EMADLLanguage extends EmbeddingModelingLanguage {
@Override
public Optional<EMADLSymbolTableCreator> getSymbolTableCreator(ResolvingConfiguration resolvingConfiguration, MutableScope enclosingScope) {
return Optional.of(new EMADLSymbolTableCreator(
resolvingConfiguration, enclosingScope, getCustomLayers(), getCustomPythonFilesPath()));
resolvingConfiguration, enclosingScope,getCustomFilesPath(), getBackend()));
}
}
......@@ -47,9 +47,9 @@ public class EMADLSymbolTableCreator extends de.monticore.symboltable.CommonSymb
public EMADLSymbolTableCreator(
final ResolvingConfiguration resolvingConfig, final MutableScope enclosingScope,
HashMap<String, ArrayList<String>> customLayers, String customPythonFilesPath) {
String customFilesPath, String backend) {
super(resolvingConfig, enclosingScope);
initSuperSTC(resolvingConfig, customLayers, customPythonFilesPath);
initSuperSTC(resolvingConfig, customFilesPath, backend);
}
public EMADLSymbolTableCreator(final ResolvingConfiguration resolvingConfig, final Deque<MutableScope> scopeStack) {
......@@ -58,9 +58,9 @@ public class EMADLSymbolTableCreator extends de.monticore.symboltable.CommonSymb
}
public EMADLSymbolTableCreator(final ResolvingConfiguration resolvingConfig, final Deque<MutableScope> scopeStack,
HashMap<String, ArrayList<String>> customLayers, String customPythonFilesPath) {
String customFilesPath, String backend) {
super(resolvingConfig, scopeStack);
initSuperSTC(resolvingConfig, customLayers, customPythonFilesPath);
initSuperSTC(resolvingConfig, customFilesPath, backend);
}
private void initSuperSTC(final ResolvingConfiguration resolvingConfig) {
......@@ -90,8 +90,8 @@ public class EMADLSymbolTableCreator extends de.monticore.symboltable.CommonSymb
visitor.setCommon2Visitor(emamSTC);
}
private void initSuperSTC(final ResolvingConfiguration resolvingConfig, HashMap<String, ArrayList<String>> customLayers, String customPythonFilesPath) {
this.cnnArchSTC = new CNNArchSymbolTableCreator(resolvingConfig, scopeStack, customLayers, customPythonFilesPath);
private void initSuperSTC(final ResolvingConfiguration resolvingConfig, String customFilesPath, String backend) {
this.cnnArchSTC = new CNNArchSymbolTableCreator(resolvingConfig, scopeStack, customFilesPath, backend);
this.emamSTC = new EmbeddedMontiArcMathSymbolTableCreatorTOP(resolvingConfig, scopeStack);
this.mathOptSTC = new MathOptSymbolTableCreator(resolvingConfig, scopeStack);
this.emadSTC = new ModifiedEMADynamicSymbolTableCreator(resolvingConfig, scopeStack);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment