Commit ca597586 authored by Alexander David Hellwig's avatar Alexander David Hellwig
Browse files

Post merge cleanup

parent fb003633
Pipeline #81658 failed with stage
in 16 minutes and 41 seconds
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
......@@ -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 {
String outputPath = cliArgs.getOptionValue(OPTION_OUTPUT_PATH.getOpt());
TaggingResolver symTab = AbstractSymtab.createSymTabAndTaggingResolver(modelsDirPath.toString());
Resolver resolver = new Resolver(symTab);
ExpandedComponentInstanceSymbol componentSymbol = resolveSymbol(resolver, rootModelName);
EMAComponentInstanceSymbol componentSymbol = resolveSymbol(resolver, rootModelName);
GeneratorCPP g = new GeneratorCPP();
g.setUseAlgebraicOptimizations(false);
......@@ -206,8 +206,8 @@ public final class GeneratorCppCli {
}
public static ExpandedComponentInstanceSymbol resolveSymbol(Resolver resolver, String rootModelName) {
ExpandedComponentInstanceSymbol componentSymbol = resolver.getExpandedComponentInstanceSymbol(rootModelName).orElse(null);
public static EMAComponentInstanceSymbol resolveSymbol(Resolver resolver, String rootModelName) {
EMAComponentInstanceSymbol componentSymbol = resolver.getEMAComponentInstanceSymbol(rootModelName).orElse(null);
if (componentSymbol == null) {
Log.error("could not resolve component " + rootModelName);
//System.exit(1);
......
......@@ -25,6 +25,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc.StreamScanner;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAPortInstanceSymbol;
import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.cmake.CMakeConfig;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
......@@ -63,7 +64,7 @@ public final class TestsGeneratorCPP {
this.generator = Log.errorIfNull(generator);
}
public List<FileContent> generateStreamTests(Scope symTab, ExpandedComponentInstanceSymbol componentSymbol) {
public List<FileContent> generateStreamTests(Scope symTab, EMAComponentInstanceSymbol componentSymbol) {
bluePrints = new ArrayList<>(generator.getBluePrints());
findStreams(symTab);
findComponents(symTab);
......@@ -85,7 +86,7 @@ public final class TestsGeneratorCPP {
availableComponents = componentScanner.scan();
}
private List<FileContent> generateFiles(ExpandedComponentInstanceSymbol componentSymbol) {
private List<FileContent> generateFiles(EMAComponentInstanceSymbol componentSymbol) {
testedComponents = new HashSet<>();
files = new ArrayList<>();
viewModelForMain = new TestsMainEntryViewModel();
......@@ -117,7 +118,7 @@ public final class TestsGeneratorCPP {
return files;
}
private void addTestExecutionToCMakeConfig(ExpandedComponentInstanceSymbol componentSymbol) {
private void addTestExecutionToCMakeConfig(EMAComponentInstanceSymbol componentSymbol) {
// executable name
String compName;
final String execuatablePostFix = "_StreamTests";
......@@ -226,9 +227,9 @@ public final class TestsGeneratorCPP {
for (ComponentStreamUnitsSymbol stream : streamsForComponent) {
StreamViewModel svm = new StreamViewModel();
Collection<PortSymbol> outPorts = cs.getOutgoingPorts();
Collection<EMAPortSymbol> outPorts = cs.getOutgoingPorts();
List<String> names = new ArrayList<>();
for (PortSymbol portSymbol : outPorts) {
for (EMAPortSymbol portSymbol : outPorts) {
names.add(portSymbol.getName());
}
svm.outputPortNames = names;
......
......@@ -20,8 +20,8 @@
*/
package de.monticore.lang.monticar.generator.cpp.converter;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAConnectorInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConstantPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.expression.*;
......@@ -36,6 +36,8 @@ import de.monticore.lang.monticar.generator.cpp.MathFunctionFixer;
import de.monticore.lang.monticar.generator.cpp.instruction.ConnectInstructionCPP;
import de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression;
import de.monticore.lang.monticar.generator.optimization.MathOptimizer;
import de.monticore.lang.monticar.ts.MCTypeSymbol;
import de.monticore.lang.monticar.ts.references.MCTypeReference;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......@@ -63,18 +65,18 @@ public class ComponentConverterMethodGeneration {
method.addInstruction(instruction);
} else {
if (connector.getSourcePort().isConstant()) {
EMAConstantPortSymbol constPort = (EMAConstantPortSymbol) connector.getSourcePort().getTypeReference();
EMAPortSymbol constPort = connector.getSourcePort();
Variable v1 = new Variable();
v1.setName(constPort.getConstantValue().getValueAsString());
v1.setName(constPort.getName());
Variable v2 = PortConverter.getVariableForEMAPortInstanceSymbol(connector, connector.getTarget(), bluePrint);
Instruction instruction = new ConnectInstructionCPP(v2, v1);
method.addInstruction(instruction);
} else if (connector.getTargetPort().isConstant()) {
EMAConstantPortSymbol constPort = (EMAConstantPortSymbol) connector.getTargetPort().getTypeReference();
EMAPortSymbol constPort = connector.getTargetPort();
Variable v2 = new Variable();
v2.setName(constPort.getConstantValue().getValueAsString());
v2.setName(constPort.getName());
Variable v1 = PortConverter.getVariableForEMAPortInstanceSymbol(connector, connector.getSource(), bluePrint);
......
......@@ -20,7 +20,6 @@
*/
package de.monticore.lang.monticar.generator.cpp.converter;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConstantPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAConnectorInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAPortInstanceSymbol;
import de.monticore.lang.math._ast.ASTAssignmentType;
......@@ -104,7 +103,7 @@ public class PortConverter {
//name += "Constant" + ++counterConstantPorts;
name += connectName;
variable.setIsConstantVariable(true);
variable.setConstantValue(((EMAConstantPortSymbol) portSymbol.getTypeReference()).getConstantValue().getValueAsString());
variable.setConstantValue(portSymbol.getConstantValue().get().getValueAsString());
// Log.error("0xCOPOSHNOBECRASAAVA Constant Port should not be created as a variable");
} else {
......
......@@ -23,7 +23,6 @@ package de.monticore.lang.monticar.generator.cpp.resolver;
import de.monticore.ModelingLanguageFamily;
import de.monticore.io.paths.ModelPath;
import de.monticore.lang.embeddedmontiarc.LogConfig;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConstantPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathLanguage;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.optimization.ThreadingOptimizer;
......@@ -61,7 +60,6 @@ public class SymTabCreator {
}
public Scope createSymTab() {
EMAConstantPortSymbol.resetLastID();
MathConverter.resetIDs();
ThreadingOptimizer.resetID();
ModelingLanguageFamily fam = new ModelingLanguageFamily();
......
......@@ -20,14 +20,9 @@
*/
package de.monticore.lang.monticar.generator.cpp.viewmodel;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ComponentSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.PortSymbol;
import de.monticore.lang.monticar.generator.cpp.viewmodel.check.ComponentCheckViewModel;
import de.monticore.lang.monticar.streamunits._symboltable.ComponentStreamUnitsSymbol;
import javax.sound.sampled.Port;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.generator.order.nfp.TagThresholdTagSchema;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.tagging._ast.ASTNameScope;
import de.monticore.lang.tagging._ast.ASTScope;
import de.monticore.lang.tagging._ast.ASTTag;
......@@ -114,16 +114,16 @@ public class TagThresholdSymbolCreator implements TagSymbolCreator {
return NumericLiteral.getValue(ast.get().getNumericLiteral());
}
protected ExpandedComponentInstanceSymbol checkKind(Collection<Symbol> symbols) {
ExpandedComponentInstanceSymbol ret = null;
protected EMAComponentInstanceSymbol checkKind(Collection<Symbol> symbols) {
EMAComponentInstanceSymbol ret = null;
for (Symbol symbol : symbols) {
if (symbol.getKind().isSame(ExpandedComponentInstanceSymbol.KIND)) {
if (symbol.getKind().isSame(EMAComponentInstanceSymbol.KIND)) {
if (ret != null) {
Log.error(String.format("0xT0031 Found more than one symbol: '%s' and '%s'",
ret, symbol));
return null;
}
ret = (ExpandedComponentInstanceSymbol) symbol;
ret = (EMAComponentInstanceSymbol) symbol;
}
}
if (ret == null) {
......
......@@ -23,11 +23,10 @@ package de.monticore.lang.monticar.generator.order.simulator;
import de.monticore.ModelingLanguageFamily;
import de.monticore.io.paths.ModelPath;
import de.monticore.lang.embeddedmontiarc.LogConfig;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConstantPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarcmath._symboltable.EmbeddedMontiArcMathLanguage;
import de.monticore.lang.embeddedmontiarc.helper.ConstantPortHelper;
import de.monticore.lang.monticar.enumlang._symboltable.EnumLangLanguage;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
import de.monticore.lang.monticar.generator.optimization.MathOptimizationRule;
import de.monticore.lang.monticar.generator.optimization.MathOptimizer;
import de.monticore.lang.monticar.generator.optimization.ThreadingOptimizer;
import de.monticore.lang.monticar.generator.order.nfp.TagBreakpointsTagSchema.TagBreakpointsTagSchema;
......@@ -42,7 +41,6 @@ import de.monticore.lang.monticar.struct._symboltable.StructLanguage;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.GlobalScope;
import de.monticore.symboltable.Scope;
import de.se_rwth.commons.logging.Log;
import java.nio.file.Paths;
import java.util.Arrays;
......@@ -67,7 +65,7 @@ public class AbstractSymtab {
}
public static Scope createSymTab(String... modelPath) {
EMAConstantPortSymbol.resetLastID();
ConstantPortHelper.resetLastID();
MathConverter.resetIDs();
ThreadingOptimizer.resetID();
MathOptimizer.resetIDs();
......
......@@ -20,7 +20,7 @@
*/
package de.monticore.lang.monticar.generator.testing;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.cpp.GeneratorCPP;
import de.monticore.lang.monticar.generator.order.simulator.AbstractSymtab;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
......@@ -37,9 +37,9 @@ public class AutomaticStreamTestGenerator extends AbstractSymtab {
public void generateTests(String fullComponentInstanceName, String basePath, String targetPath, String testNamePostFix, int amountTickValues) throws Exception {
TaggingResolver symtab = createSymTabAndTaggingResolver(basePath);
ExpandedComponentInstanceSymbol componentSymbol = null;
EMAComponentInstanceSymbol componentSymbol = null;
if (fullComponentInstanceName.length() > 0) {
componentSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve(fullComponentInstanceName, ExpandedComponentInstanceSymbol.KIND).orElse(null);
componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve(fullComponentInstanceName, EMAComponentInstanceSymbol.KIND).orElse(null);
}
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.useStreamTestTestGeneration(testNamePostFix,amountTickValues);
......
......@@ -24,8 +24,8 @@ import alice.tuprolog.Int;
import de.ma2cfg.helper.Names;
import de.monticore.ast.ASTNode;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._ast.ASTPort;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.PortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAPortInstanceSymbol;
import de.monticore.lang.math._ast.ASTNumberExpression;
import de.monticore.lang.monticar.common2._ast.ASTCommonMatrixType;
import de.monticore.lang.monticar.types2._ast.ASTElementType;
......@@ -43,15 +43,15 @@ public class StreamTestGenerator {
double doubleMin, doubleMax;
int intMin, intMax;
public void createStreamTest(ExpandedComponentInstanceSymbol expandedComponentInstanceSymbol, int amountOfValues, String testNamePostFix) {
public void createStreamTest(EMAComponentInstanceSymbol expandedComponentInstanceSymbol, int amountOfValues, String testNamePostFix) {
//TODO remove System.out.printlns
currentGeneratedStreamTest = new StreamTest();
Collection<PortSymbol> inPorts = expandedComponentInstanceSymbol.getIncomingPorts();
Collection<EMAPortInstanceSymbol> inPorts = expandedComponentInstanceSymbol.getIncomingPortInstances();
currentGeneratedStreamTest.setComponentName(Names.FirstUpperCase(expandedComponentInstanceSymbol.getName()));
currentGeneratedStreamTest.setPackageName(expandedComponentInstanceSymbol.getPackageName());
currentGeneratedStreamTest.setName(currentGeneratedStreamTest.getComponentName() + "Test" + testNamePostFix);
System.out.println("Generating StreamTest for component " + currentGeneratedStreamTest.getComponentName());
for (PortSymbol p : inPorts) {
for (EMAPortInstanceSymbol p : inPorts) {
if (p.getAstNode().isPresent()) {
System.out.println(p.getAstNode().get().getClass().getName());
ASTPort astPort = (ASTPort) p.getAstNode().get();
......
......@@ -93,8 +93,8 @@ public class StreamTestModifier {
File streamTest = new File(filePath);
if (!streamTest.exists()) {
File curDir = new File("N:\\target\\generated-sources-cpp\\streamtest\\exec\\");
File curDir2 = new File("N:\\target\\generated-sources-cpp\\streamtest\\");
File curDir = new File("N:/target/generated-sources-cpp/streamtest/exec/");
File curDir2 = new File("N:/target/generated-sources-cpp/streamtest/");
System.out.println("Directories:");
getAllFiles(curDir);
getAllFiles(curDir2);
......
......@@ -79,7 +79,7 @@ public class GenerateCMakeTest extends AbstractSymtabTest {
@Test
public void testCMakeStreamTestGenerationForBasicPortsMath() throws IOException {
ExpandedComponentInstanceSymbol componentSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("test.basicPortsMath", ExpandedComponentInstanceSymbol.KIND).orElse(null);
EMAComponentInstanceSymbol componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve("test.basicPortsMath", EMAComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentSymbol);
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.useArmadilloBackend();
......@@ -115,7 +115,7 @@ public class GenerateCMakeTest extends AbstractSymtabTest {
@Test
public void floatDivisionTest() throws IOException {
ExpandedComponentInstanceSymbol componentSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("test.math.floatDivisionTest", ExpandedComponentInstanceSymbol.KIND).orElse(null);
EMAComponentInstanceSymbol componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve("test.math.floatDivisionTest", EMAComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentSymbol);
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.useArmadilloBackend();
......
......@@ -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.AbstractSymtabTest;
import de.monticore.lang.monticar.generator.testing.AutomaticStreamTestGenerator;
import de.monticore.lang.monticar.generator.testing.StreamTestExecution;
......@@ -154,7 +154,7 @@ public class AutomaticStreamTestGenerationTest extends AbstractSymtabTest {
String restPath = "streamtest/cluster";*/
//TaggingResolver streamSymtab = createSymTabAndTaggingResolver("./target/generated-sources-cpp/streamtest/cluster");
generatorCPP.setGenerateTests(true);
ExpandedComponentInstanceSymbol componentSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("de.rwth.armin.modeling.autopilot.motion.calculatePidError", ExpandedComponentInstanceSymbol.KIND).orElse(null);
EMAComponentInstanceSymbol componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve("de.rwth.armin.modeling.autopilot.motion.calculatePidError", EMAComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentSymbol);
generatorCPP.generateFiles(symtab, componentSymbol, symtab);
//generatorCPP.setModelsDirPath(Paths.get("./target/generated-sources-cpp/streamtest/cluster"));
......
......@@ -20,7 +20,6 @@
*/
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConstantPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.monticar.generator.AbstractSymtabTest;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
......
......@@ -20,8 +20,8 @@
*/
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.cncModel.EMAConstantPortSymbol;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.instanceStructure.EMAComponentInstanceSymbol;
import de.monticore.lang.embeddedmontiarc.helper.ConstantPortHelper;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.monticar.generator.AbstractSymtabTest;
import de.monticore.lang.monticar.generator.Helper;
......@@ -141,7 +141,7 @@ public class GenerationTest extends AbstractSymtabTest {
@Test
public void testBasicPortsConstantConnector() {
EMAConstantPortSymbol.resetLastID();
ConstantPortHelper.resetLastID();
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
EMAComponentInstanceSymbol componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve("test.basicPortsConstantConnector", EMAComponentInstanceSymbol.KIND).orElse(null);
......@@ -474,7 +474,7 @@ public class GenerationTest extends AbstractSymtabTest {
//@Ignore
@Test
public void testSimulatorMainController() throws IOException {
EMAConstantPortSymbol.resetLastID();
ConstantPortHelper.resetLastID();
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
EMAComponentInstanceSymbol componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve("simulator.mainController", EMAComponentInstanceSymbol.KIND).orElse(null);
......@@ -489,7 +489,7 @@ public class GenerationTest extends AbstractSymtabTest {
//@Ignore
@Test
public void testBasicPrecision1() throws IOException {
EMAConstantPortSymbol.resetLastID();
ConstantPortHelper.resetLastID();
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
EMAComponentInstanceSymbol componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve("test.basicPrecisionTest1", EMAComponentInstanceSymbol.KIND).orElse(null);
......
......@@ -275,7 +275,7 @@ public class BasicGenerationArmadilloTest extends AbstractSymtabTest {
@Test
public void testPortInMatrixDefinition() throws IOException {
TaggingResolver symtab = createSymTabAndTaggingResolver("src/test/resources");
ExpandedComponentInstanceSymbol componentSymbol = symtab.<ExpandedComponentInstanceSymbol>resolve("test.portInMatrixDefinition", ExpandedComponentInstanceSymbol.KIND).orElse(null);
EMAComponentInstanceSymbol componentSymbol = symtab.<EMAComponentInstanceSymbol>resolve("test.portInMatrixDefinition", EMAComponentInstanceSymbol.KIND).orElse(null);
assertNotNull(componentSymbol);
GeneratorCPP generatorCPP = new GeneratorCPP();
generatorCPP.useArmadilloBackend();
......
Supports Markdown
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