Commit 91150513 authored by Malte Heithoff's avatar Malte Heithoff
Browse files

Renamed BluePrint to EMAMBluePrint

parent cd7d6677
......@@ -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 EMAGenerator 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(EMAGenerator generator) {
this.generator = generator;
}
......
......@@ -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("_")) {
......
......@@ -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();
......
/* (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;
......@@ -41,7 +40,7 @@ public class GeneratorCPP implements EMAGenerator {
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/";
......@@ -160,10 +159,10 @@ public class GeneratorCPP implements EMAGenerator {
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;
}
}
......@@ -215,9 +214,9 @@ public class GeneratorCPP implements EMAGenerator {
fileContents.add(OctaveHelper.getOctaveHelperFileContent());
if (MathConverter.curBackend.getBackendName().equals("ArmadilloBackend")) {
fileContents.add(ArmadilloHelper.getArmadilloHelperFileContent(isGenerateTests));
if (BluePrintCPP.usedCV) {
if (EMAMBluePrintCPP.usedCV) {
fileContents.add(ConversionHelper.getConversionHelperFileContent(isGenerateTests));
BluePrintCPP.usedCV = false;
EMAMBluePrintCPP.usedCV = false;
}
}
if (shouldGenerateMainClass()) {
......@@ -465,7 +464,7 @@ public class GeneratorCPP implements EMAGenerator {
this.checkModelDir = checkModelDir;
}
public List<BluePrintCPP> getBluePrints() {
public List<EMAMBluePrintCPP> getBluePrints() {
return Collections.unmodifiableList(bluePrints);
}
......
......@@ -3,13 +3,9 @@ package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.expression.MathAssignmentExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.MathCommand;
import de.monticore.lang.monticar.generator.cpp.instruction.ConnectInstructionCPP;
import de.monticore.lang.monticar.generator.cpp.template.AllTemplates;
import de.monticore.lang.monticar.generator.cpp.viewmodel.LoggingViewModel;
......@@ -18,7 +14,6 @@ import de.monticore.symboltable.Symbol;
import de.se_rwth.commons.logging.Log;
import java.util.*;
import java.util.stream.Collectors;
/**
*/
......@@ -59,14 +54,14 @@ public class LanguageUnitCPP extends LanguageUnit {
if (nextSymbol.isKindOf(MathStatementsSymbol.KIND)) {
BluePrint bluePrint = ComponentConverter.convertComponentSymbolToBluePrint((EMAComponentInstanceSymbol) symbol, (MathStatementsSymbol) nextSymbol, includeStrings, generatorCPP);
EMAMBluePrint bluePrint = ComponentConverter.convertComponentSymbolToBluePrint((EMAComponentInstanceSymbol) symbol, (MathStatementsSymbol) nextSymbol, includeStrings, generatorCPP);
bluePrints.add(bluePrint);
++i;
}
} else {
BluePrint bluePrint = ComponentConverter.convertComponentSymbolToBluePrint((EMAComponentInstanceSymbol) symbol, includeStrings, generatorCPP);
EMAMBluePrint bluePrint = ComponentConverter.convertComponentSymbolToBluePrint((EMAComponentInstanceSymbol) symbol, includeStrings, generatorCPP);
bluePrints.add(bluePrint);
}
}
......@@ -74,7 +69,7 @@ public class LanguageUnitCPP extends LanguageUnit {
}
}
public String getGeneratedHeader(TaggingResolver taggingResolver, BluePrintCPP bluePrint) {
public String getGeneratedHeader(TaggingResolver taggingResolver, EMAMBluePrintCPP bluePrint) {
ExecutionOrderFixer.fixExecutionOrder(taggingResolver, bluePrint, (GeneratorCPP) bluePrint.getGenerator());
String resultString = "";
//guard defines
......@@ -222,7 +217,7 @@ public class LanguageUnitCPP extends LanguageUnit {
}
}
protected String generateMethod(Method method, BluePrint bluePrint){
protected String generateMethod(Method method, EMAMBluePrint bluePrint){
int counter = 0;
String resultString = method.getReturnTypeName() + " " + method.getName() + "(";
......
/* (c) https://github.com/MontiCore/monticore */
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.Instruction;
import de.monticore.lang.monticar.generator.Variable;
import de.monticore.lang.monticar.resolution._ast.ASTUnitNumberResolution;
import de.monticore.lang.monticar.si._symboltable.ResolutionDeclarationSymbol;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
import java.util.List;
/**
* @author Ahmed Diab
*/
......
......@@ -55,7 +55,7 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
}
@Override
protected void doFixMathFunction(MathExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
protected void doFixMathFunction(MathExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
boolean notHandled = true;
if (mathExpressionSymbol == null) {
notHandled = false;
......@@ -112,15 +112,15 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
}
}
public static void fixMathFunctions(MathExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
getInstance().chainHandleFixMathFunction(mathExpressionSymbol, bluePrintCPP);
}
public static void fixMathFunctions(MathPreOperatorExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathPreOperatorExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
fixMathFunctions(mathExpressionSymbol.getMathExpressionSymbol(), bluePrintCPP);
}
public static void fixMathFunctions(MathChainedExpression mathChainedExpression, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathChainedExpression mathChainedExpression, EMAMBluePrintCPP bluePrintCPP) {
if (mathChainedExpression.getFirstExpressionSymbol().isMatrixExpression()) {
MathMatrixExpressionSymbol mathMatrixExpressionSymbol = (MathMatrixExpressionSymbol) mathChainedExpression.getFirstExpressionSymbol();
if (mathMatrixExpressionSymbol.isMatrixAccessExpression()) {
......@@ -134,7 +134,7 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
fixMathFunctions(mathChainedExpression.getFirstExpressionSymbol(), bluePrintCPP);
}
public static void fixMathFunctions(MathConditionalExpressionsSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathConditionalExpressionsSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
fixMathFunctions(mathExpressionSymbol.getIfConditionalExpression(), bluePrintCPP);
for (MathConditionalExpressionSymbol mathConditionalExpressionSymbol : mathExpressionSymbol.getIfElseConditionalExpressions())
fixMathFunctions(mathConditionalExpressionSymbol, bluePrintCPP);
......@@ -142,20 +142,20 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
fixMathFunctions(mathExpressionSymbol.getElseConditionalExpression().get(), bluePrintCPP);
}
public static void fixMathFunctions(MathConditionalExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathConditionalExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
if (mathExpressionSymbol.getCondition().isPresent())
fixMathFunctions(mathExpressionSymbol.getCondition().get(), bluePrintCPP);
for (MathExpressionSymbol bodyExpression : mathExpressionSymbol.getBodyExpressions())
fixMathFunctions(bodyExpression, bluePrintCPP);
}
public static void fixMathFunctions(MathValueSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathValueSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
bluePrintCPP.getMathInformationRegister().addVariable(mathExpressionSymbol);
if (mathExpressionSymbol.getValue() != null)
fixMathFunctions(mathExpressionSymbol.getValue(), bluePrintCPP);
}
public static void fixMathFunctions(MathAssignmentExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathAssignmentExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
if (mathExpressionSymbol.getMathMatrixAccessOperatorSymbol() != null && fixForLoopAccess(mathExpressionSymbol.getNameOfMathValue(), bluePrintCPP)) {
for (MathMatrixAccessSymbol mathMatrixAccessSymbol : mathExpressionSymbol.getMathMatrixAccessOperatorSymbol().getMathMatrixAccessSymbols())
//fixMathFunctionsForLoopAccess(mathMatrixAccessSymbol, bluePrintCPP);
......@@ -166,7 +166,7 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
}
//TODO find function which does not pass fixMathFunction/debug MathSumCommand
public static void fixMathFunctions(MathMatrixExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathMatrixExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
if (mathExpressionSymbol.isMatrixNameExpression()) {
fixMathFunctions((MathMatrixNameExpressionSymbol) mathExpressionSymbol, bluePrintCPP);
} else if (mathExpressionSymbol.isMatrixVectorExpression()) {
......@@ -184,13 +184,13 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
}
}
public static void fixMathFunctions(MathMatrixArithmeticExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathMatrixArithmeticExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
fixMathFunctions(mathExpressionSymbol.getLeftExpression(), bluePrintCPP);
if (mathExpressionSymbol.getRightExpression() != null)
fixMathFunctions(mathExpressionSymbol.getRightExpression(), bluePrintCPP);
}
public static void fixMathFunctions(MathMatrixNameExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathMatrixNameExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
String name = EMAPortSymbol.getNameWithoutArrayBracketPart(mathExpressionSymbol.getNameToAccess());
Variable variable = bluePrintCPP.getVariable(name).orElse(null);
//change () to [] if it is a variable and no function
......@@ -221,7 +221,7 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
}
}
public static void fixMathFunctions(MathMatrixAccessSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathMatrixAccessSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
if (mathExpressionSymbol.getMathExpressionSymbol().isPresent()) {
fixMathFunctions(mathExpressionSymbol.getMathExpressionSymbol().get(), bluePrintCPP);
MathExpressionSymbol mathExp = mathExpressionSymbol.getMathExpressionSymbol().get();
......@@ -239,7 +239,7 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
}
}
public static void fixMathFunctionsForLoopAccess(MathMatrixAccessSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctionsForLoopAccess(MathMatrixAccessSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
if (mathExpressionSymbol.getMathExpressionSymbol().isPresent()) {
fixMathFunctions(mathExpressionSymbol.getMathExpressionSymbol().get(), bluePrintCPP);
MathExpressionSymbol mathExp = mathExpressionSymbol.getMathExpressionSymbol().get();
......@@ -264,51 +264,51 @@ public class MathFunctionFixer extends BaseMathFunctionFixerHandler {
}
public static void fixMathFunctions(MathParenthesisExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathParenthesisExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
fixMathFunctions(mathExpressionSymbol.getMathExpressionSymbol(), bluePrintCPP);
}
public static void fixMathFunctions(MathArithmeticExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathArithmeticExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
fixMathFunctions(mathExpressionSymbol.getLeftExpression(), bluePrintCPP);
fixMathFunctions(mathExpressionSymbol.getRightExpression(), bluePrintCPP);
}
public static void fixMathFunctions(MathForLoopExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathForLoopExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
ComponentConverter.currentBluePrint.getMathInformationRegister().addVariable(new Variable(mathExpressionSymbol.getForLoopHead().getNameLoopVariable(), Variable.FORLOOPINFO));
fixMathFunctions(mathExpressionSymbol.getForLoopHead().getMathExpression(), bluePrintCPP);
for (MathExpressionSymbol mathExpressionSymbol1 : mathExpressionSymbol.getForLoopBody())
fixMathFunctions(mathExpressionSymbol1, bluePrintCPP);
}
public static void fixMathFunctions(MathCompareExpressionSymbol mathExpressionSymbol, BluePrintCPP bluePrintCPP) {
public static void fixMathFunctions(MathCompareExpressionSymbol mathExpressionSymbol, EMAMBluePrintCPP bluePrintCPP) {
fixMathFunctions(mathExpressionSymbol.getLeftExpression(), bluePrintCPP);
fixMathFunctions(mathExpressionSymbol.getRightExpression(), bluePrintCPP);
}