Commit 141129f9 authored by Jan Philipp Haller's avatar Jan Philipp Haller
Browse files

Merge branch 'master' into Haller

parents 6011de38 9deb59e4
Pipeline #335900 failed with stage
in 4 minutes
......@@ -2,6 +2,27 @@ stages:
- linux
#- windows
githubjob:
image: maven:3-jdk-8
stage: linux
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- ssh-add <(echo "$GITHUB_SSH_PRIV_KEY")
- echo "$GITHUB_SSH_PRIV_KEY" | tr -d '\r' | ssh-add -
- git config --global user.email "${GIT_EMAIL}"
- git config --global user.name "EMA CI Robot"
- mkdir -p ~/.ssh
# - cat gitlab-known-hosts >> ~/.ssh/known_hosts
- echo -e "Host github.com\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config
script:
- git clone git@github.com:MontiCore/EmbeddedMontiArc.git
- cd EmbeddedMontiArc
- git subtree pull --prefix $PRJ_NAME https://git.rwth-aachen.de/monticore/EmbeddedMontiArc/${PRJ_NAME}.git master --squash
- git push --force
only:
- master
masterJobLinux:
stage: linux
image: maven:3-jdk-8
......
......@@ -5,7 +5,7 @@ call variables.bat
set STREAM_TESTING=%PROJECT_ROOT%\target\generated-sources-cpp\streamtest
set AUTOPILOT_TESTS=%STREAM_TESTING%\target\generated-sources-cpp\streamtest\autopilot
set STREAM_TEST_EXEC_DIR=%STREAM_TESTING%\exec
g++ -version
g++ --version
g++ -std=c++11 ^
-I"%JAVA_HOME%\include_win" ^
......
......@@ -10,16 +10,17 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-generator</artifactId>
<version>0.1.16-SNAPSHOT</version>
<version>0.2.12-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<Embedded-MontiArc-Math.version>0.1.11-SNAPSHOT</Embedded-MontiArc-Math.version>
<!-- .. EMA-Libraries ................................................. -->
<Embedded-MontiArc-Math.version>0.2.12-SNAPSHOT</Embedded-MontiArc-Math.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<guava.version>25.1-jre</guava.version>
<junit.version>4.12</junit.version>
<logback.version>1.1.2</logback.version>
<jscience.version>4.3.1</jscience.version>
......
......@@ -2,7 +2,7 @@
package de.monticore.lang.monticar.generator;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.monticar.generator.cpp.BluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import de.monticore.lang.monticar.pattern.BaseChainOfResponsibility;
import de.se_rwth.commons.logging.Log;
......@@ -10,9 +10,9 @@ public abstract class BaseMathFunctionFixerHandler extends BaseChainOfResponsibi
protected abstract boolean canFixMathSymbol(MathExpressionSymbol symbol);
protected abstract void doFixMathFunction(MathExpressionSymbol symbol, BluePrintCPP bluePrintCPP);
protected abstract void doFixMathFunction(MathExpressionSymbol symbol, EMAMBluePrintCPP bluePrintCPP);
private void handleFixMathFunction(MathExpressionSymbol symbol, BluePrintCPP bluePrintCPP) {
private void handleFixMathFunction(MathExpressionSymbol symbol, EMAMBluePrintCPP bluePrintCPP) {
if (canFixMathSymbol(symbol)) {
doFixMathFunction(symbol, bluePrintCPP);
} else if (getSuccessor() != null) {
......@@ -23,7 +23,7 @@ public abstract class BaseMathFunctionFixerHandler extends BaseChainOfResponsibi
}
}
public void chainHandleFixMathFunction(MathExpressionSymbol symbol, BluePrintCPP bluePrintCPP) {
public void chainHandleFixMathFunction(MathExpressionSymbol symbol, EMAMBluePrintCPP bluePrintCPP) {
((BaseMathFunctionFixerHandler) getChainStart()).handleFixMathFunction(symbol, bluePrintCPP);
}
......
......@@ -11,8 +11,8 @@ import java.util.Optional;
/**
*/
public class BluePrint {
protected Generator generator;//currentGeneratorInstance
public class EMAMBluePrint {
protected EMAMGenerator generator;//currentGeneratorInstance
protected List<Variable> variables = new ArrayList<>();
protected List<Method> methods = new ArrayList<>();
protected List<Variable> genericsVariableList = new ArrayList<>();
......@@ -21,7 +21,7 @@ public class BluePrint {
protected String packageName;
protected EMAComponentInstanceSymbol originalSymbol;
public BluePrint(String name) {
public EMAMBluePrint(String name) {
this.name = name;
}
......@@ -120,7 +120,7 @@ public class BluePrint {
return generator;
}
public void setGenerator(Generator generator) {
public void setGenerator(EMAMGenerator generator) {
this.generator = generator;
}
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
public interface EMAMGenerator extends Generator<EMAComponentInstanceSymbol> {
boolean useAlgebraicOptimizations();
void setUseAlgebraicOptimizations(boolean useAlgebraicOptimizations);
boolean useThreadingOptimizations();
void setUseThreadingOptimization(boolean useThreadingOptimizations);
MathCommandRegister getMathCommandRegister();
void setMathCommandRegister(MathCommandRegister mathCommandRegister);
}
......@@ -2,19 +2,18 @@
package de.monticore.lang.monticar.generator;
import de.monticore.lang.monticar.generator.cpp.GeneralHelperMethods;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
/**
*/
public class ExecuteInstruction implements Instruction {
String componentName;
BluePrint bluePrint;
EMAMBluePrint bluePrint;
String threadName = null;
boolean canBeThreaded = false;
boolean dynamic = false;
public static int threadCounter = 0;
public ExecuteInstruction(String componentName, BluePrint bluePrint, boolean canBeThreaded) {
public ExecuteInstruction(String componentName, EMAMBluePrint bluePrint, boolean canBeThreaded) {
this.bluePrint = bluePrint;
this.canBeThreaded = canBeThreaded;
while (!bluePrint.getVariable(componentName).isPresent() && componentName.contains("_")) {
......
......@@ -3,8 +3,10 @@ package de.monticore.lang.monticar.generator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.monticar.generator.cmake.CMakeConfig;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.Scope;
import de.monticore.symboltable.Symbol;
import java.io.File;
import java.io.IOException;
......@@ -14,34 +16,28 @@ import java.util.List;
* The Generator interface which defines what functionality has to be supported by a Generator independent from the target language
*
*/
public interface Generator {
public interface Generator<T extends Symbol> {
// Cmake
CMakeConfig getCmakeConfig();
boolean isGenerateCMake();
void setGenerateCMake(boolean generateCMake);
String getGenerationTargetPath();
void setGenerationTargetPath(String newPath);
String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol, MathStatementsSymbol mathStatementsSymbol);
/**
* This method should generate the source for the EMAComponentInstanceSymbol and
* add MathStatementsSymbols, accordingly. Does also do this for all of its subcomponents.
*/
List<FileContent> generateStrings(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol, Scope symtab);
List<FileContent> generateStrings(TaggingResolver taggingResolver, T symbol);
/**
* This methods writes the resulting code for the ExpandedComponentInstance and its subcomponents to the corresponding files
*/
List<File> generateFiles(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol, Scope symtab) throws IOException;
boolean useAlgebraicOptimizations();
void setUseAlgebraicOptimizations(boolean useAlgebraicOptimizations);
boolean useThreadingOptimizations();
void setUseThreadingOptimization(boolean useThreadingOptimizations);
MathCommandRegister getMathCommandRegister();
List<File> generateFiles(TaggingResolver taggingResolver, T symbol) throws IOException;
void setMathCommandRegister(MathCommandRegister mathCommandRegister);
}
......@@ -14,10 +14,10 @@ import java.util.Optional;
*/
public abstract class LanguageUnit {
protected List<BluePrint> bluePrints = new ArrayList<>();
protected List<EMAMBluePrint> bluePrints = new ArrayList<>();
protected List<Symbol> symbolsToConvert = new ArrayList<>();
public List<BluePrint> getBluePrints() {
public List<EMAMBluePrint> getBluePrints() {
return bluePrints;
}
......@@ -25,8 +25,8 @@ public abstract class LanguageUnit {
symbolsToConvert.add(symbol);
}
public Optional<BluePrint> getBluePrint(String fullName) {
for (BluePrint bluePrint : bluePrints) {
public Optional<EMAMBluePrint> getBluePrint(String fullName) {
for (EMAMBluePrint bluePrint : bluePrints) {
if (bluePrint.getName().equals(fullName.replaceAll("\\.", "_"))) {
return Optional.of(bluePrint);
}
......
......@@ -4,7 +4,7 @@ package de.monticore.lang.monticar.generator;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.cpp.BluePrintCPP;
import de.monticore.lang.monticar.generator.cpp.EMAMBluePrintCPP;
import java.util.HashSet;
import java.util.List;
......@@ -35,9 +35,9 @@ public abstract class MathCommand {
this.mathCommandName = mathCommandName;
}
protected abstract void convert(MathExpressionSymbol mathExpressionSymbol, BluePrint bluePrint);
protected abstract void convert(MathExpressionSymbol mathExpressionSymbol, EMAMBluePrint bluePrint);
public void convertAndSetTargetLanguageName(MathExpressionSymbol mathExpressionSymbol, BluePrint bluePrint) {
public void convertAndSetTargetLanguageName(MathExpressionSymbol mathExpressionSymbol, EMAMBluePrint bluePrint) {
convert(mathExpressionSymbol, bluePrint);
if (mathExpressionSymbol instanceof MathMatrixNameExpressionSymbol) {
MathMatrixNameExpressionSymbol mathMatrixNameExpressionSymbol = (MathMatrixNameExpressionSymbol) mathExpressionSymbol;
......@@ -65,7 +65,7 @@ public abstract class MathCommand {
return false;
}
public String getTypeOfFirstInput(MathMatrixNameExpressionSymbol mathMatrixNameExpressionSymbol, BluePrintCPP bluePrintCPP){
public String getTypeOfFirstInput(MathMatrixNameExpressionSymbol mathMatrixNameExpressionSymbol, EMAMBluePrintCPP bluePrintCPP){
String nameOfFirstParameter = mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().getMathMatrixAccessSymbols().get(0).getTextualRepresentation();
for(Variable var: bluePrintCPP.getVariables()){
String varName = var.getName();
......@@ -79,7 +79,7 @@ public abstract class MathCommand {
return "";
}
public static void redefineArmaMat(BluePrintCPP bluePrint){
public static void redefineArmaMat(EMAMBluePrintCPP bluePrint){
List<Variable> vars= bluePrint.getVariables();
for(Variable var : vars){
VariableType varType = var.getVariableType();
......@@ -96,7 +96,7 @@ public abstract class MathCommand {
}
}
public static void redefineInit(BluePrintCPP bluePrint){
public static void redefineInit(EMAMBluePrintCPP bluePrint){
Optional<Method> methodOpt = bluePrint.getMethod("init");
Method initMethod = methodOpt.get();
List<Instruction> instructs = initMethod.getInstructions();
......
......@@ -55,6 +55,8 @@ public class CMakeConfig {
private List<String> cmakeCommandListEnd = new ArrayList<>();
private List<String> cmakeLibraryLinkage = new ArrayList<>();
// constructor
public CMakeConfig(String compName) {
cMakeListsViewModel.setCompName(compName);
......@@ -63,6 +65,7 @@ public class CMakeConfig {
// methods
protected void configureCMakeListsViewModel() {
cMakeListsViewModel.setCmakeLibraryLinkageList(cmakeLibraryLinkage);
cMakeListsViewModel.setCmakeCommandList(cmakeCommandList);
cMakeListsViewModel.setCmakeCommandListEnd(cmakeCommandListEnd);
}
......@@ -146,4 +149,7 @@ public class CMakeConfig {
}
public void addCmakeLibraryLinkage(String cmakeLibraryLinkage) {
this.cmakeLibraryLinkage.add(cmakeLibraryLinkage);
}
}
......@@ -25,6 +25,8 @@ public class CMakeListsCPPViewModel extends ViewModelBase {
private List<String> cmakeCommandListEnd = new ArrayList<>();
private List<String> cmakeLibraryLinkageList = new ArrayList<>();
// methods
public String getCompName() {
......@@ -58,4 +60,12 @@ public class CMakeListsCPPViewModel extends ViewModelBase {
public void setCmakeCommandListEnd(List<String> cmakeCommandListEnd) {
this.cmakeCommandListEnd = cmakeCommandListEnd;
}
public List<String> getCmakeLibraryLinkageList() {
return cmakeLibraryLinkageList;
}
public void setCmakeLibraryLinkageList(List<String> cmakeLibraryLinkageList) {
this.cmakeLibraryLinkageList = cmakeLibraryLinkageList;
}
}
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.monticar.generator.BluePrint;
import de.monticore.lang.monticar.generator.EMAMBluePrint;
import de.monticore.lang.monticar.generator.Method;
import de.monticore.lang.monticar.generator.TargetCodeInstruction;
import de.monticore.lang.monticar.generator.Variable;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.se_rwth.commons.logging.Log;
import java.util.*;
......@@ -14,7 +13,7 @@ import java.util.stream.Collectors;
/**
*/
public class BluePrintFixer {
public static void fixBluePrintVariableArrays(BluePrint bluePrint) {
public static void fixBluePrintVariableArrays(EMAMBluePrint bluePrint) {
List<Variable> newVars = new ArrayList<>();
//Group variables of the same array
......@@ -52,7 +51,7 @@ public class BluePrintFixer {
}
protected static Variable addConnectedVariableForVariable(List<Variable> varList, String nameWithoutArray, BluePrint bluePrint){
protected static Variable addConnectedVariableForVariable(List<Variable> varList, String nameWithoutArray, EMAMBluePrint bluePrint){
Log.info("Adding __connected variable for "+nameWithoutArray, "Dynamic Connected Variable");
VariableConstantArray variable = new VariableConstantArray("__"+nameWithoutArray+"_connected");
......@@ -74,7 +73,7 @@ public class BluePrintFixer {
}
public static void fixBluePrintDynamicVariableConnectRequestQueues(BluePrint bluePrint){
public static void fixBluePrintDynamicVariableConnectRequestQueues(EMAMBluePrint bluePrint){
int s = bluePrint.getVariables().size();
for(int i = 0; i < s; ++i){
Variable v = bluePrint.getVariables().get(i);
......@@ -141,7 +140,7 @@ public class BluePrintFixer {
}
}
protected static Variable addConnectedRequestQueueForVariable(String nameWithoutArray, BluePrint bluePrint){
protected static Variable addConnectedRequestQueueForVariable(String nameWithoutArray, EMAMBluePrint bluePrint){
Log.info("Adding __connect_request variable for "+nameWithoutArray, "Dynamic Request Connect Queue for Variable");
Variable variable = new Variable();
variable.setName("__"+nameWithoutArray+"_connect_request");
......@@ -154,7 +153,7 @@ public class BluePrintFixer {
return variable;
}
protected static Variable addFreeRequestQueueForVariable(String nameWithoutArray, BluePrint bluePrint){
protected static Variable addFreeRequestQueueForVariable(String nameWithoutArray, EMAMBluePrint bluePrint){
Log.info("Adding __free_request variable for "+nameWithoutArray, "Dynamic Request Free Queue for Variable");
Variable variable = new Variable();
variable.setName("__"+nameWithoutArray+"_free_request");
......
......@@ -4,7 +4,7 @@ package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.InstanceInformation;
import de.monticore.lang.monticar.generator.BluePrint;
import de.monticore.lang.monticar.generator.EMAMBluePrint;
import de.monticore.lang.monticar.generator.Instruction;
import de.monticore.lang.monticar.generator.Variable;
import de.monticore.lang.monticar.resolution._ast.ASTUnitNumberResolution;
......@@ -16,12 +16,12 @@ import java.util.List;
/**
*/
public class BluePrintCPP extends BluePrint {
public class EMAMBluePrintCPP extends EMAMBluePrint {
public List<String> additionalIncludeStrings = new ArrayList<>();
public List<String> cvIncludeStrings = new ArrayList<>();
public static boolean usedCV = false;
public BluePrintCPP(String name) {
public EMAMBluePrintCPP(String name) {
super(name);
}
......
......@@ -20,7 +20,7 @@ import java.util.*;
/**
*/
public class ExecutionOrderFixer {
public static void fixExecutionOrder(TaggingResolver taggingResolver, BluePrintCPP bluePrintCPP, GeneratorCPP generatorCPP) {
public static void fixExecutionOrder(TaggingResolver taggingResolver, EMAMBluePrintCPP bluePrintCPP, GeneratorCPP generatorCPP) {
Method method = bluePrintCPP.getMethod("execute").get();
......@@ -57,7 +57,7 @@ public class ExecutionOrderFixer {
}
public static void fixSlistExecutionOrder(EMAComponentInstanceSymbol instanceSymbol, List<Instruction> newList, BluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents, GeneratorCPP generatorCPP) {
public static void fixSlistExecutionOrder(EMAComponentInstanceSymbol instanceSymbol, List<Instruction> newList, EMAMBluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents, GeneratorCPP generatorCPP) {
for (EMAComponentInstanceSymbol subComponent : instanceSymbol.getSubComponents()) {
if (!listContainsExecuteInstruction(newList, subComponent.getName())) {
ExecuteInstruction executeInstruction = (ExecuteInstruction) getExecuteInstruction(subComponent.getName(), bluePrintCPP, threadableComponents, generatorCPP);
......@@ -71,13 +71,13 @@ public class ExecutionOrderFixer {
}
}
public static void fixNextInstruction(List<Instruction> newList, BluePrintCPP bluePrintCPP){
public static void fixNextInstruction(List<Instruction> newList, EMAMBluePrintCPP bluePrintCPP){
if(bluePrintCPP.getMethod("next").isPresent()){
newList.add(0, new TargetCodeInstruction("next();\n"));
}
}
public static void fixDynamicInstruction(List<Instruction> newList, BluePrintCPP bluePrintCPP){
public static void fixDynamicInstruction(List<Instruction> newList, EMAMBluePrintCPP bluePrintCPP){
if(bluePrintCPP.getMethod("dynamic").isPresent()){
newList.add(0, new TargetCodeInstruction("dynamic();\n"));
}
......@@ -94,7 +94,7 @@ public class ExecutionOrderFixer {
return false;
}
public static Instruction getExecuteInstruction(String nameToAdd, BluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents, GeneratorCPP generatorCPP) {
public static Instruction getExecuteInstruction(String nameToAdd, EMAMBluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents, GeneratorCPP generatorCPP) {
boolean canBeThreaded = false;
if (generatorCPP.useThreadingOptimizations())
for (EMAComponentInstanceSymbol instanceSymbol : threadableComponents) {
......@@ -107,7 +107,7 @@ public class ExecutionOrderFixer {
return exI;
}
public static Instruction getExecuteInstruction(EMAComponentInstanceSymbol componentInstanceSymbol, BluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents) {
public static Instruction getExecuteInstruction(EMAComponentInstanceSymbol componentInstanceSymbol, EMAMBluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents) {
return getExecuteInstruction(componentInstanceSymbol.getName(), bluePrintCPP, threadableComponents, (GeneratorCPP) bluePrintCPP.getGenerator());
}
......@@ -153,7 +153,7 @@ public class ExecutionOrderFixer {
return otherInstructions;
}
public static List<Instruction> getExecutionOrderInstructionsList(List<EMAComponentInstanceSymbol> exOrder, Map<String, List<Instruction>> map, BluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableSubComponents) {
public static List<Instruction> getExecutionOrderInstructionsList(List<EMAComponentInstanceSymbol> exOrder, Map<String, List<Instruction>> map, EMAMBluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableSubComponents) {
List<Instruction> newList = new ArrayList<>();
for (EMAComponentInstanceSymbol instanceSymbol : exOrder) {
String namey = instanceSymbol.getName();
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.monticar.generator.BluePrint;
import java.util.List;
import de.monticore.lang.monticar.generator.EMAMBluePrint;
/**
*/
......@@ -18,7 +16,7 @@ public class GeneralHelperMethods {
return componentName.replaceFirst(regex, replacement);
}
public static String getTargetLanguageVariableInstanceName(String componentName, BluePrint bluePrint) {
public static String getTargetLanguageVariableInstanceName(String componentName, EMAMBluePrint bluePrint) {
while (!bluePrint.getVariable(componentName).isPresent() && componentName.contains("_")) {
componentName = replaceUnderScoreWithSquareBrackets(componentName, "\\_", "[");
componentName = replaceUnderScoreWithSquareBrackets(componentName, "\\_", "]");
......
......@@ -14,7 +14,6 @@ import de.monticore.lang.monticar.generator.cmake.CMakeFindModule;
import de.monticore.lang.monticar.generator.cpp.Dynamics.DynamicHelper;
import de.monticore.lang.monticar.generator.cpp.Dynamics.EventPortValueCheck;
import de.monticore.lang.monticar.generator.cpp.converter.*;
import de.monticore.lang.monticar.generator.cpp.BluePrintCPP.*;
import de.monticore.lang.monticar.generator.cpp.mathopt.MathOptSolverConfig;
import de.monticore.lang.monticar.generator.cpp.template.AllTemplates;
import de.monticore.lang.monticar.generator.cpp.viewmodel.AutopilotAdapterDataModel;
......@@ -34,14 +33,14 @@ import java.util.*;
/**
*/
public class GeneratorCPP implements Generator {
public class GeneratorCPP implements EMAMGenerator {
public static GeneratorCPP currentInstance;
private Path modelsDirPath;
private boolean isGenerateTests = false;
private boolean isGenerateAutopilotAdapter = false;
private boolean isGenerateServerWrapper = false;
protected boolean isExecutionLoggingActive = false;
private final List<BluePrintCPP> bluePrints = new ArrayList<>();
private final List<EMAMBluePrintCPP> bluePrints = new ArrayList<>();
protected String generationTargetPath = "./target/generated-sources-cpp/";
......@@ -122,11 +121,23 @@ public class GeneratorCPP implements Generator {
//Log.warn("This backend has been deprecated. Armadillo is the recommended backend now.");
}
public String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol, Scope symtab) {
MathStatementsSymbol mathSymbol = Helper.getMathStatementsSymbolFor(componentInstanceSymbol, symtab);
public String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol) {
MathStatementsSymbol mathSymbol = Helper.getMathStatementsSymbolFor(componentInstanceSymbol, taggingResolver);
return generateString(taggingResolver, componentInstanceSymbol, mathSymbol);
}
@Override
public CMakeConfig getCmakeConfig() {
if (cMakeConfig == null)
setupCMake();
return cMakeConfig;
}
@Override
public boolean isGenerateCMake() {
return generateCMake;
}
@Override
public String getGenerationTargetPath() {
return generationTargetPath;
......@@ -137,7 +148,6 @@ public class GeneratorCPP implements Generator {
this.generationTargetPath = newPath;
}
@Override
public String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol, MathStatementsSymbol mathStatementsSymbol) {
StreamTestGenerator streamTestGenerator = new StreamTestGenerator();//only used when creating streamTestsForAComponent
LanguageUnitCPP languageUnitCPP = new LanguageUnitCPP();
......@@ -149,10 +159,10 @@ public class GeneratorCPP implements Generator {
languageUnitCPP.generateBluePrints();
else
streamTestGenerator.createStreamTest(componentSymbol, amountTickValues, testNamePostFix);
BluePrintCPP bluePrintCPP = null;
for (BluePrint bluePrint : languageUnitCPP.getBluePrints()) {
EMAMBluePrintCPP bluePrintCPP = null;
for (EMAMBluePrint bluePrint : languageUnitCPP.getBluePrints()) {
if (bluePrint.getOriginalSymbol().equals(componentSymbol)) {
bluePrintCPP = (BluePrintCPP) bluePrint;
bluePrintCPP = (EMAMBluePrintCPP) bluePrint;
}
}
......@@ -170,7 +180,7 @@ public class GeneratorCPP implements Generator {
public static List<FileContent> currentFileContentList = null;
@Override
public List<FileContent> generateStrings(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol, Scope symtab) {
public List<FileContent> generateStrings(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol) {
List<FileContent> fileContents = new ArrayList<>();
if (componentInstanceSymbol.getFullName().equals("simulator.mainController")) {
setGenerateSimulatorInterface(true);
......@@ -180,9 +190,9 @@ public class GeneratorCPP implements Generator {
currentFileContentList = fileContents;
if (!streamTestGenerationMode)