Commit a09a5d95 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko

Merge branch 'VersionUp' into 'master'

Move from EmbeddedMontiArcMathOpt to EmbeddedMontiArcMath

See merge request !4
parents 6a3d92b2 18766eb9
Pipeline #100990 passed with stage
in 5 minutes and 41 seconds
......@@ -9,15 +9,15 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-opt-generator</artifactId>
<version>0.1.2-SNAPSHOT</version>
<version>0.1.3-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<!-- .. SE-Libraries .................................................. -->
<Embedded-MontiArc-Math-Opt.version>0.1.3-SNAPSHOT</Embedded-MontiArc-Math-Opt.version>
<Embedded-montiarc-math-generator.version>0.1.3-SNAPSHOT</Embedded-montiarc-math-generator.version>
<Embedded-MontiArc-Math.version>0.1.7-SNAPSHOT</Embedded-MontiArc-Math.version>
<Embedded-montiarc-math-generator.version>0.1.5-SNAPSHOT</Embedded-montiarc-math-generator.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
......@@ -62,19 +62,10 @@
</dependency>
<!-- MontiCore Dependencies -->
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-opt</artifactId>
<version>${Embedded-MontiArc-Math-Opt.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-opt</artifactId>
<version>${Embedded-MontiArc-Math-Opt.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
<artifactId>embedded-montiarc-math</artifactId>
<version>${Embedded-MontiArc-Math.version}</version>
</dependency>
<dependency>
......@@ -115,14 +106,6 @@
<version>${jscience.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-opt</artifactId>
<version>${Embedded-MontiArc-Math-Opt.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
</dependencies>
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarcmathopt._symboltable.EMAMOptSymbolTableHelper;
import de.monticore.ModelingLanguageFamily;
import de.monticore.io.paths.ModelPath;
import de.monticore.lang.embeddedmontiarc.LogConfig;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathLanguageFamiliy;
import de.monticore.lang.monticar.Utils;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.optimization.MathOptimizer;
import de.monticore.lang.monticar.generator.optimization.ThreadingOptimizer;
......@@ -12,8 +16,11 @@ import de.monticore.lang.monticar.generator.order.nfp.TagMinMaxTagSchema.TagMinM
import de.monticore.lang.monticar.generator.order.nfp.TagTableTagSchema.TagTableTagSchema;
import de.monticore.lang.monticar.generator.order.nfp.TagThresholdTagSchema.TagThresholdTagSchema;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.GlobalScope;
import de.monticore.symboltable.Scope;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
/**
......@@ -22,15 +29,37 @@ import java.util.Arrays;
*
* @author Christoph Richter
*/
public class EMAMOpt2CPPSymbolTableHelper extends EMAMOptSymbolTableHelper {
public class EMAMOpt2CPPSymbolTableHelper{
private EMAMOpt2CPPSymbolTableHelper() {
}
protected static EMAMOpt2CPPSymbolTableHelper ourInstance;
public static EMAMOpt2CPPSymbolTableHelper getInstance() {
if (ourInstance == null)
ourInstance = new EMAMOpt2CPPSymbolTableHelper();
return (EMAMOpt2CPPSymbolTableHelper) ourInstance;
return ourInstance;
}
public Scope createSymTab(String... modelPath) {
ModelingLanguageFamily fam = new EmbeddedMontiArcMathLanguageFamiliy();
ModelPath mp = getModelPath(modelPath);
GlobalScope scope = new GlobalScope(mp, fam);
Utils.addBuiltInTypes(scope);
LogConfig.init();
return scope;
}
public ModelPath getModelPath(String... modelPath) {
ModelPath mp = new ModelPath(new Path[0]);
String[] var2 = modelPath;
int var3 = modelPath.length;
for (int var4 = 0; var4 < var3; ++var4) {
String m = var2[var4];
mp.addEntry(Paths.get(m));
}
return mp;
}
public TaggingResolver createSymTabAndTaggingResolver(String... modelPath) {
......
......@@ -117,7 +117,7 @@ public class GeneratorEMAMOpt2CppCli {
}
private static EMAComponentInstanceSymbol resolveSymbol(Resolver resolver, String rootModelName) {
EMAComponentInstanceSymbol componentSymbol = (EMAComponentInstanceSymbol) resolver.getEMAComponentInstanceSymbol(rootModelName).orElse(null);
EMAComponentInstanceSymbol componentSymbol = (EMAComponentInstanceSymbol) resolver.getExpandedComponentInstanceSymbol(rootModelName).orElse(null);
if (componentSymbol == null) {
Log.error("could not resolve component " + rootModelName);
return null;
......
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