Commit b4b7b30d authored by Evgeny Kusmenko's avatar Evgeny Kusmenko
Browse files

Merge branch 'BreakingSymbolUpdate' into 'master'

Breaking symbol update

See merge request !23
parents 517a2aa7 a7e39f5e
Pipeline #91839 failed with stage
in 14 seconds
......@@ -38,7 +38,9 @@ stages:
masterJobWindows:
stage: windows
script:
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
- mvn -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean deploy --settings settings.xml-U
only:
- master
tags:
- Windows10
......@@ -54,7 +56,7 @@ masterJobWindows:
BranchJobWindows:
stage: windows
script:
- mvn -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
- mvn -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml -U
- cat target/site/jacoco/index.html
except:
- master
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -31,30 +31,22 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-generator</artifactId>
<version>0.0.27-SNAPSHOT</version>
<version>0.1.2-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>5.0.0</monticore.version>
<se-commons.version>1.7.7</se-commons.version>
<mc.grammars.assembly.version>0.0.6-SNAPSHOT</mc.grammars.assembly.version>
<Common-MontiCar.version>0.0.14-SNAPSHOT</Common-MontiCar.version>
<Embedded-MontiArc.version>0.0.18-SNAPSHOT</Embedded-MontiArc.version>
<Embedded-MontiArc-Behaviour.version>0.0.14-SNAPSHOT</Embedded-MontiArc-Behaviour.version>
<Math.version>0.0.19-SNAPSHOT</Math.version>
<Embedded-MontiArc-Math.version>0.0.19-SNAPSHOT</Embedded-MontiArc-Math.version>
<tagging.version>0.0.4</tagging.version>
<Embedded-MontiArc-Math.version>0.1.4-SNAPSHOT</Embedded-MontiArc-Math.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
<logback.version>1.1.2</logback.version>
<jscience.version>4.3.1</jscience.version>
<!-- .. Plugins ....................................................... -->
<monticore.plugin>4.5.3.1</monticore.plugin>
<assembly.plugin>2.5.4</assembly.plugin>
<compiler.plugin>3.8.0</compiler.plugin>
<source.plugin>2.4</source.plugin>
......@@ -80,11 +72,6 @@
<version>4.7.1</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>Tagging</artifactId>
<version>${tagging.version}</version>
</dependency>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-logging</artifactId>
......@@ -98,26 +85,6 @@
</dependency>
<!-- MontiCore Dependencies -->
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.version}</version>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.version}</version>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-grammar</artifactId>
<version>${monticore.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.se_rwth.commons</groupId>
<artifactId>se-commons-groovy</artifactId>
......@@ -126,49 +93,6 @@
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>common-monticar</artifactId>
<version>${Common-MontiCar.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>common-monticar</artifactId>
<version>${Common-MontiCar.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc</artifactId>
<version>${Embedded-MontiArc.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc</artifactId>
<version>${Embedded-MontiArc.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-behaviour</artifactId>
<version>${Embedded-MontiArc-Behaviour.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-behaviour</artifactId>
<version>${Embedded-MontiArc-Behaviour.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math</artifactId>
<version>${Embedded-MontiArc-Math.version}</version>
</dependency>
......@@ -181,22 +105,6 @@
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>math</artifactId>
<version>${Math.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>math</artifactId>
<version>${Math.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>montiarc.verification</groupId>
<artifactId>montiarc-execution-order</artifactId>
......@@ -223,27 +131,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.monticore</groupId>
<artifactId>monticore-runtime</artifactId>
<version>${monticore.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
</dependency>
<dependency>
<groupId>org.jscience</groupId>
<artifactId>jscience</artifactId>
<version>${jscience.version}</version>
</dependency>
</dependencies>
......@@ -366,6 +259,7 @@
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
......
......@@ -20,8 +20,7 @@
*/
package de.monticore.lang.monticar.generator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceBuilder;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.optimization.MathInformationRegister;
import java.util.ArrayList;
......@@ -39,7 +38,7 @@ public class BluePrint {
MathInformationRegister mathInformationRegister = new MathInformationRegister(this);
protected String name;
protected String packageName;
protected ExpandedComponentInstanceSymbol originalSymbol;
protected EMAComponentInstanceSymbol originalSymbol;
public BluePrint(String name) {
this.name = name;
......@@ -113,11 +112,11 @@ public class BluePrint {
return genericsVariableList;
}
public ExpandedComponentInstanceSymbol getOriginalSymbol() {
public EMAComponentInstanceSymbol getOriginalSymbol() {
return originalSymbol;
}
public void setOriginalSymbol(ExpandedComponentInstanceSymbol originalSymbol) {
public void setOriginalSymbol(EMAComponentInstanceSymbol originalSymbol) {
this.originalSymbol = originalSymbol;
}
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.generator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.cpp.GeneralHelperMethods;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
......@@ -35,7 +35,7 @@ public class FileContent {
}
public FileContent(String fileContent, ExpandedComponentInstanceSymbol instanceSymbol) {
public FileContent(String fileContent, EMAComponentInstanceSymbol instanceSymbol) {
this.fileContent = fileContent;
fileName = GeneralHelperMethods.getTargetLanguageComponentName(instanceSymbol.getFullName())+".h";
}
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.generator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.Scope;
......@@ -40,18 +40,18 @@ public interface Generator {
void setGenerationTargetPath(String newPath);
String generateString(TaggingResolver taggingResolver, ExpandedComponentInstanceSymbol componentSymbol, MathStatementsSymbol mathStatementsSymbol);
String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol, MathStatementsSymbol mathStatementsSymbol);
/**
* This method should generate the source for the ExpandedComponentInstanceSymbol and
* 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, ExpandedComponentInstanceSymbol componentInstanceSymbol, Scope symtab);
List<FileContent> generateStrings(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol, Scope symtab);
/**
* This methods writes the resulting code for the ExpandedComponentInstance and its subcomponents to the corresponding files
*/
List<File> generateFiles(TaggingResolver taggingResolver, ExpandedComponentInstanceSymbol componentSymbol, Scope symtab) throws IOException;
List<File> generateFiles(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol, Scope symtab) throws IOException;
boolean useAlgebraicOptimizations();
......
......@@ -21,8 +21,8 @@
package de.monticore.lang.monticar.generator;
import de.ma2cfg.helper.Names;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.types.TypesPrinter;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.symboltable.Scope;
......@@ -32,12 +32,12 @@ import de.se_rwth.commons.logging.Log;
* @author Sascha Schneiders
*/
public class Helper {
public static MathStatementsSymbol getMathStatementsSymbolFor(ExpandedComponentInstanceSymbol instanceSymbol, Scope symtab) {
public static MathStatementsSymbol getMathStatementsSymbolFor(EMAComponentInstanceSymbol instanceSymbol, Scope symtab) {
String resolveName = instanceSymbol.getPackageName() + "." + Names.FirstUpperCase(instanceSymbol.getName()) + ".MathStatements";
MathStatementsSymbol mathSymbol = symtab.<MathStatementsSymbol>resolve(resolveName, MathStatementsSymbol.KIND).orElse(null);
if (mathSymbol == null) {
ComponentSymbol symbol = instanceSymbol.getComponentType().getReferencedSymbol();
EMAComponentSymbol symbol = instanceSymbol.getComponentType().getReferencedSymbol();
resolveName = symbol.getPackageName() + "." + symbol.getName() + ".MathStatements";
mathSymbol = symtab.<MathStatementsSymbol>resolve(resolveName, MathStatementsSymbol.KIND).orElse(null);
}
......
......@@ -20,8 +20,8 @@
*/
package de.monticore.lang.monticar.generator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.symboltable.Symbol;
......
......@@ -21,8 +21,8 @@
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTSubComponent;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.InstanceInformation;
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;
......@@ -70,7 +70,7 @@ public class BluePrintCPP extends BluePrint {
return consts;
}
public void addDefineGenerics(ExpandedComponentInstanceSymbol componentSymbol) {
public void addDefineGenerics(EMAComponentInstanceSymbol componentSymbol) {
if (componentSymbol.getInstanceInformation().isPresent()) {
int index = 0;
Log.info(componentSymbol.getName(), "HasInstanceInformation:");
......@@ -102,8 +102,8 @@ public class BluePrintCPP extends BluePrint {
}
}
public void fixSubComponentInstanceNumbers(ExpandedComponentInstanceSymbol componentInstanceSymbol, String nameToResolve, int numberToSet, int index) {
for (ExpandedComponentInstanceSymbol instanceSymbol : componentInstanceSymbol.getSubComponents()) {
public void fixSubComponentInstanceNumbers(EMAComponentInstanceSymbol componentInstanceSymbol, String nameToResolve, int numberToSet, int index) {
for (EMAComponentInstanceSymbol instanceSymbol : componentInstanceSymbol.getSubComponents()) {
for (ResolutionDeclarationSymbol resolutionDeclarationSymbol : instanceSymbol.getResolutionDeclarationSymbols()) {
Log.info(resolutionDeclarationSymbol.getNameToResolve(), "ResDeclFix:");
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.ConnectInstruction;
import de.monticore.lang.monticar.generator.ExecuteInstruction;
import de.monticore.lang.monticar.generator.Instruction;
......@@ -44,9 +44,9 @@ public class ExecutionOrderFixer {
Method method = bluePrintCPP.getMethod("execute").get();
Map<String, List<Instruction>> map = new HashMap<>();
List<ExpandedComponentInstanceSymbol> threadableSubComponents = bluePrintCPP.getOriginalSymbol().getIndependentSubComponents();
List<EMAComponentInstanceSymbol> threadableSubComponents = bluePrintCPP.getOriginalSymbol().getIndependentSubComponents();
List<Instruction> otherInstructions = computeOtherInstructions(map, method);
List<ExpandedComponentInstanceSymbol> exOrder = ImplementExecutionOrder.exOrder(taggingResolver, bluePrintCPP.getOriginalSymbol());
List<EMAComponentInstanceSymbol> exOrder = ImplementExecutionOrder.exOrder(taggingResolver, bluePrintCPP.getOriginalSymbol());
List<Instruction> newList = getExecutionOrderInstructionsList(exOrder, map, bluePrintCPP, threadableSubComponents);
fixSlistExecutionOrder(bluePrintCPP.getOriginalSymbol(), newList, bluePrintCPP, threadableSubComponents, generatorCPP);
List<TargetCodeInstruction> joinInstructions = new ArrayList<>();
......@@ -66,8 +66,8 @@ public class ExecutionOrderFixer {
method.setInstructions(newList);
}
public static void fixSlistExecutionOrder(ExpandedComponentInstanceSymbol instanceSymbol, List<Instruction> newList, BluePrintCPP bluePrintCPP, List<ExpandedComponentInstanceSymbol> threadableComponents, GeneratorCPP generatorCPP) {
for (ExpandedComponentInstanceSymbol subComponent : instanceSymbol.getSubComponents()) {
public static void fixSlistExecutionOrder(EMAComponentInstanceSymbol instanceSymbol, List<Instruction> newList, BluePrintCPP 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);
int insertionIndex = getIndexOfLastConnectInstruction(newList, subComponent.getName());
......@@ -88,10 +88,10 @@ public class ExecutionOrderFixer {
}
public static Instruction getExecuteInstruction(String nameToAdd, BluePrintCPP bluePrintCPP, List<ExpandedComponentInstanceSymbol> threadableComponents, GeneratorCPP generatorCPP) {
public static Instruction getExecuteInstruction(String nameToAdd, BluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents, GeneratorCPP generatorCPP) {
boolean canBeThreaded = false;
if (generatorCPP.useThreadingOptimizations())
for (ExpandedComponentInstanceSymbol instanceSymbol : threadableComponents) {
for (EMAComponentInstanceSymbol instanceSymbol : threadableComponents) {
if (nameToAdd.equals(instanceSymbol.getName()))
canBeThreaded = true;
}
......@@ -100,7 +100,7 @@ public class ExecutionOrderFixer {
return new ExecuteInstruction(name, bluePrintCPP, canBeThreaded);
}
public static Instruction getExecuteInstruction(ExpandedComponentInstanceSymbol componentInstanceSymbol, BluePrintCPP bluePrintCPP, List<ExpandedComponentInstanceSymbol> threadableComponents) {
public static Instruction getExecuteInstruction(EMAComponentInstanceSymbol componentInstanceSymbol, BluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableComponents) {
return getExecuteInstruction(componentInstanceSymbol.getName(), bluePrintCPP, threadableComponents, (GeneratorCPP) bluePrintCPP.getGenerator());
}
......@@ -129,9 +129,9 @@ public class ExecutionOrderFixer {
return otherInstructions;
}
public static List<Instruction> getExecutionOrderInstructionsList(List<ExpandedComponentInstanceSymbol> exOrder, Map<String, List<Instruction>> map, BluePrintCPP bluePrintCPP, List<ExpandedComponentInstanceSymbol> threadableSubComponents) {
public static List<Instruction> getExecutionOrderInstructionsList(List<EMAComponentInstanceSymbol> exOrder, Map<String, List<Instruction>> map, BluePrintCPP bluePrintCPP, List<EMAComponentInstanceSymbol> threadableSubComponents) {
List<Instruction> newList = new ArrayList<>();
for (ExpandedComponentInstanceSymbol instanceSymbol : exOrder) {
for (EMAComponentInstanceSymbol instanceSymbol : exOrder) {
String namey = instanceSymbol.getName();
Log.info(namey, "Trying to add:");
if (map.containsKey(namey)) {
......@@ -147,7 +147,7 @@ public class ExecutionOrderFixer {
newList.add(executeInstruction);
}
}
for (ExpandedComponentInstanceSymbol subComponent : bluePrintCPP.getOriginalSymbol().getSubComponents()) {
for (EMAComponentInstanceSymbol subComponent : bluePrintCPP.getOriginalSymbol().getSubComponents()) {
String namey = subComponent.getName();
if (map.containsKey(namey)) {
List<Instruction> instructionsToAdd = map.get(namey);
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.BluePrint;
import java.util.List;
......
......@@ -22,7 +22,7 @@ package de.monticore.lang.monticar.generator.cpp;
import de.ma2cfg.helper.Names;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.ComponentScanner;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cmake.CMakeConfig;
......@@ -124,7 +124,7 @@ public class GeneratorCPP implements Generator {
//Log.warn("This backend has been deprecated. Armadillo is the recommended backend now.");
}
public String generateString(TaggingResolver taggingResolver, ExpandedComponentInstanceSymbol componentInstanceSymbol, Scope symtab) {
public String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol, Scope symtab) {
MathStatementsSymbol mathSymbol = Helper.getMathStatementsSymbolFor(componentInstanceSymbol, symtab);
return generateString(taggingResolver, componentInstanceSymbol, mathSymbol);
......@@ -141,7 +141,7 @@ public class GeneratorCPP implements Generator {
}
@Override
public String generateString(TaggingResolver taggingResolver, ExpandedComponentInstanceSymbol componentSymbol, MathStatementsSymbol mathStatementsSymbol) {
public String generateString(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol, MathStatementsSymbol mathStatementsSymbol) {
StreamTestGenerator streamTestGenerator = new StreamTestGenerator();//only used when creating streamTestsForAComponent
LanguageUnitCPP languageUnitCPP = new LanguageUnitCPP();
languageUnitCPP.setGeneratorCPP(this);
......@@ -173,7 +173,7 @@ public class GeneratorCPP implements Generator {
public static List<FileContent> currentFileContentList = null;
@Override
public List<FileContent> generateStrings(TaggingResolver taggingResolver, ExpandedComponentInstanceSymbol componentInstanceSymbol, Scope symtab) {
public List<FileContent> generateStrings(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentInstanceSymbol, Scope symtab) {
List<FileContent> fileContents = new ArrayList<>();
if (componentInstanceSymbol.getFullName().equals("simulator.mainController")) {
setGenerateSimulatorInterface(true);
......@@ -188,7 +188,7 @@ public class GeneratorCPP implements Generator {
componentInstanceSymbol.getPackageName().replaceAll("\\.", "\\/") + "/" + Names.FirstUpperCase(componentInstanceSymbol.getName()) + "Test" + testNamePostFix + ".stream"));
String lastNameWithoutArrayPart = "";
if (!streamTestGenerationMode) {
for (ExpandedComponentInstanceSymbol instanceSymbol : componentInstanceSymbol.getSubComponents()) {
for (EMAComponentInstanceSymbol instanceSymbol : componentInstanceSymbol.getSubComponents()) {
//fileContents.add(new FileContent(generateString(instanceSymbol, symtab), instanceSymbol));
int arrayBracketIndex = instanceSymbol.getName().indexOf("[");
boolean generateComponentInstance = true;
......@@ -218,7 +218,7 @@ public class GeneratorCPP implements Generator {
}
//TODO add incremental generation based on described concept
public List<File> generateFiles(TaggingResolver taggingResolver, ExpandedComponentInstanceSymbol componentSymbol,
public List<File> generateFiles(TaggingResolver taggingResolver, EMAComponentInstanceSymbol componentSymbol,
Scope symtab) throws IOException {
List<FileContent> fileContents = new ArrayList<>();
if (componentSymbol == null) {
......@@ -227,9 +227,9 @@ public class GeneratorCPP implements Generator {
for (String componentFullName : availableComponents) {
componentFullName = Names.getExpandedComponentInstanceSymbolName(componentFullName);
if (symtab.resolve(componentFullName,
ExpandedComponentInstanceSymbol.KIND).isPresent()) {
ExpandedComponentInstanceSymbol componentInstanceSymbol = (ExpandedComponentInstanceSymbol) symtab.resolve(componentFullName,
ExpandedComponentInstanceSymbol.KIND).get();
EMAComponentInstanceSymbol.KIND).isPresent()) {
EMAComponentInstanceSymbol componentInstanceSymbol = (EMAComponentInstanceSymbol) symtab.resolve(componentFullName,
EMAComponentInstanceSymbol.KIND).get();
fileContents.addAll(generateStrings(taggingResolver, componentInstanceSymbol, symtab));
}
}
......@@ -255,7 +255,7 @@ public class GeneratorCPP implements Generator {
return files;
}
protected List<File> generateCMakeFiles(ExpandedComponentInstanceSymbol componentInstanceSymbol) {
protected List<File> generateCMakeFiles(EMAComponentInstanceSymbol componentInstanceSymbol) {
List<File> files = new ArrayList<>();
cMakeConfig.getCMakeListsViewModel().setCompName(componentInstanceSymbol.getFullName().replace('.', '_').replace('[', '_').replace(']', '_'));
List<FileContent> contents = cMakeConfig.generateCMakeFiles();
......@@ -276,7 +276,7 @@ public class GeneratorCPP implements Generator {
return files;
}
public List<FileContent> handleTestAndCheckDir(Scope symtab, ExpandedComponentInstanceSymbol componentSymbol) {
public List<FileContent> handleTestAndCheckDir(Scope symtab, EMAComponentInstanceSymbol componentSymbol) {
List<FileContent> fileContents = new ArrayList<>();
if (isGenerateTests() || isCheckModelDir()) {
TestsGeneratorCPP g = new TestsGeneratorCPP(this);
......@@ -286,7 +286,7 @@ public class GeneratorCPP implements Generator {
return fileContents;
}
public List<File> generateFiles(ExpandedComponentInstanceSymbol componentSymbol,
public List<File> generateFiles(EMAComponentInstanceSymbol componentSymbol,
TaggingResolver taggingResolver) throws IOException {
return generateFiles(taggingResolver, componentSymbol, taggingResolver);
}
......@@ -317,7 +317,7 @@ public class GeneratorCPP implements Generator {
return f;
}
public FileContent getMainClassFileContent(ExpandedComponentInstanceSymbol instanceSymbol, FileContent fileContent) {
public FileContent getMainClassFileContent(EMAComponentInstanceSymbol instanceSymbol, FileContent fileContent) {
FileContent newFileContent = new FileContent();
newFileContent.setFileName("main.cpp");
......@@ -437,14 +437,14 @@ public class GeneratorCPP implements Generator {
return tg.generateTypes(typeSymbols);
}
private static List<FileContent> getAutopilotAdapterFiles(ExpandedComponentInstanceSymbol componentSymbol) {
private static List<FileContent> getAutopilotAdapterFiles(EMAComponentInstanceSymbol componentSymbol) {
List<FileContent> result = new ArrayList<>();
result.add(FileUtil.getResourceAsFile("/template/autopilotadapter/AutopilotAdapter.h", "AutopilotAdapter.h"));
result.add(generateAutopilotAdapter(componentSymbol));
return result;
}
private static FileContent generateAutopilotAdapter(ExpandedComponentInstanceSymbol componentSymbol) {
private static FileContent generateAutopilotAdapter(EMAComponentInstanceSymbol componentSymbol) {
AutopilotAdapterViewModel vm = new AutopilotAdapterViewModel();
vm.setMainModelName(GeneralHelperMethods.getTargetLanguageComponentName(componentSymbol.getFullName()));
String fileContents = AllTemplates.generateAutopilotAdapter(vm);
......@@ -471,7 +471,7 @@ public class GeneratorCPP implements Generator {
cmake.addCMakeCommandEnd("export(TARGETS AutopilotAdapter FILE de_rwth_armin_modeling_autopilot_autopilotAdapter.cmake)");
}
private static List<FileContent> getServerWrapperFiles(ExpandedComponentInstanceSymbol componentSymbol) {
private static List<FileContent> getServerWrapperFiles(EMAComponentInstanceSymbol componentSymbol) {
List<FileContent> result = new ArrayList<>();
String[] filesToCopy = new String[]{
"Makefile",
......@@ -485,11 +485,11 @@ public class GeneratorCPP implements Generator {
return result;
}
private static FileContent generateServerWrapper(ExpandedComponentInstanceSymbol componentSymbol) {
private static FileContent generateServerWrapper(EMAComponentInstanceSymbol componentSymbol) {
return generateWrapper(componentSymbol, "server.cc");
}
private static FileContent generateWrapper(ExpandedComponentInstanceSymbol componentSymbol, String name) {
private static FileContent generateWrapper(EMAComponentInstanceSymbol componentSymbol, String name) {
ServerWrapperViewModel vm = new ServerWrapperViewModel();
vm.setMainModelName(GeneralHelperMethods.getTargetLanguageComponentName(componentSymbol.getFullName()));
String fileContents = AllTemplates.generateServerWrapper(vm);
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.cpp.resolver.Resolver;
import de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
......@@ -174,7 +174,7 @@ public final class GeneratorCppCli {