Commit 4b9e7856 authored by Evgeny Kusmenko's avatar Evgeny Kusmenko
Browse files

Merge branch 'richter-dev' into 'master'

Richter dev

See merge request !2
parents 39e9f574 0331328d
Pipeline #55813 passed with stage
in 2 minutes and 16 seconds
stages:
- windows
#- windows
- linux
masterJobLinux:
......@@ -10,12 +10,12 @@ masterJobLinux:
only:
- master
masterJobWindows:
stage: windows
script:
- mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
tags:
- Windows10
#masterJobWindows:
# stage: windows
# script:
# - mvn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -B clean install --settings settings.xml
# tags:
# - Windows10
BranchJobLinux:
stage: linux
......
......@@ -8,23 +8,22 @@
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>embedded-montiarc-math-generator</artifactId>
<version>0.0.12-SNAPSHOT</version>
<version>0.0.14-SNAPSHOT</version>
<!-- == PROJECT DEPENDENCIES ============================================= -->
<properties>
<!-- .. SE-Libraries .................................................. -->
<monticore.version>4.5.4.08.11.2017</monticore.version>
<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>
<SIUnit.version>0.0.10-SNAPSHOT</SIUnit.version>
<Common-MontiCar.version>0.0.13-SNAPSHOT</Common-MontiCar.version>
<Embedded-MontiArc.version>0.0.17-SNAPSHOT</Embedded-MontiArc.version>
<Embedded-MontiArc-Behaviour.version>0.0.11</Embedded-MontiArc-Behaviour.version>
<Math.version>0.0.11</Math.version>
<Embedded-MontiArc-Math.version>0.0.14-SNAPSHOT</Embedded-MontiArc-Math.version>
<tagging.version>0.0.2</tagging.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.14-SNAPSHOT</Math.version>
<Embedded-MontiArc-Math.version>0.0.15-SNAPSHOT</Embedded-MontiArc-Math.version>
<tagging.version>0.0.3-SNAPSHOT</tagging.version>
<!-- .. Libraries .................................................. -->
<guava.version>18.0</guava.version>
<junit.version>4.12</junit.version>
......@@ -101,21 +100,6 @@
<version>${se-commons.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>NumberUnit</artifactId>
<version>${SIUnit.version}</version>
</dependency>
<dependency>
<groupId>de.monticore.lang</groupId>
<artifactId>NumberUnit</artifactId>
<version>${SIUnit.version}</version>
<classifier>${grammars.classifier}</classifier>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>de.monticore.lang.monticar</groupId>
<artifactId>common-monticar</artifactId>
......
......@@ -20,7 +20,7 @@
package de.monticore.lang.monticar.generator;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.math.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.tagging._symboltable.TaggingResolver;
import de.monticore.symboltable.Scope;
......
......@@ -4,7 +4,7 @@ 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.types.TypesPrinter;
import de.monticore.lang.math.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.symboltable.Scope;
import de.se_rwth.commons.logging.Log;
......
......@@ -21,7 +21,7 @@ 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.math.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.symboltable.Symbol;
import de.monticore.symboltable.SymbolKind;
......
package de.monticore.lang.monticar.generator;
import de.monticore.lang.math.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
/**
* @author Sascha Schneiders
......
package de.monticore.lang.monticar.generator;
import de.monticore.lang.math.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import java.util.HashSet;
......
package de.monticore.lang.monticar.generator;
import de.monticore.lang.math.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import java.util.ArrayList;
import java.util.List;
......
package de.monticore.lang.monticar.generator;
import de.monticore.lang.monticar.generator.cpp.GeneralHelperMethods;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.TypeConverter;
import de.monticore.lang.monticar.printtype._ast.ASTPrintType;
import de.monticore.lang.monticar.types2._ast.ASTElementType;
import de.monticore.lang.monticar.types2._ast.ASTPrintType;
import de.monticore.lang.monticar.types2._ast.ASTType;
import de.monticore.types.types._ast.ASTType;
import de.se_rwth.commons.logging.Log;
import java.util.ArrayList;
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.math.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
import de.monticore.lang.monticar.generator.MathBackend;
import de.monticore.lang.monticar.generator.cpp.converter.ExecuteMethodGenerator;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
......
......@@ -6,6 +6,7 @@ import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.Instance
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;
......@@ -61,9 +62,14 @@ public class BluePrintCPP extends BluePrint {
Log.info(subComponent.toString(), "InfoKK:");
//}
if (number == -1) {
Log.info(subComponent.toString(), "No number added for" + resolutionDeclarationSymbol.getNameToResolve());
++index;
break;
// try with ast
if (resolutionDeclarationSymbol.getASTResolution() instanceof ASTUnitNumberResolution) {
number = ((ASTUnitNumberResolution) resolutionDeclarationSymbol.getASTResolution()).getNumber().get().intValue();
} else {
Log.info(subComponent.toString(), "No number added for" + resolutionDeclarationSymbol.getNameToResolve());
++index;
break;
}
}
fixSubComponentInstanceNumbers(componentSymbol, resolutionDeclarationSymbol.getNameToResolve(), number, index);
Variable constVar = new Variable();
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.math.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.monticar.generator.BluePrint;
import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.Generator;
......
......@@ -20,7 +20,7 @@
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.math.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.monticar.generator.*;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
import de.monticore.lang.monticar.generator.cpp.converter.MathConverter;
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.math.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
import de.monticore.lang.monticar.generator.MathBackend;
import de.se_rwth.commons.logging.Log;
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.math.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.monticar.generator.MathCommandRegister;
import de.monticore.lang.monticar.generator.cpp.commands.*;
import de.se_rwth.commons.logging.Log;
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.PortSymbol;
import de.monticore.lang.math.math._symboltable.expression.*;
import de.monticore.lang.math.math._symboltable.matrix.*;
import de.monticore.lang.math._symboltable.expression.*;
import de.monticore.lang.math._symboltable.matrix.*;
import de.monticore.lang.monticar.generator.MathCommand;
import de.monticore.lang.monticar.generator.Variable;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.embeddedmontiarc.embeddedmontiarc._symboltable.ExpandedComponentInstanceSymbol;
import de.monticore.lang.math.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathValueExpressionSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathValueSymbol;
import de.monticore.lang.math._symboltable.MathStatementsSymbol;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathValueExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathValueSymbol;
import de.monticore.lang.monticar.generator.Variable;
import de.monticore.lang.monticar.generator.cpp.converter.TypeConverter;
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.math.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixArithmeticExpressionSymbol;
import de.monticore.lang.monticar.generator.MathBackend;
import de.se_rwth.commons.logging.Log;
......
package de.monticore.lang.monticar.generator.cpp;
import de.monticore.lang.math.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathNameExpressionSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathParenthesisExpressionSymbol;
import de.monticore.lang.math.math._symboltable.expression.MathValueExpressionSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixExpressionSymbol;
import de.monticore.lang.math.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathArithmeticExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathNameExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathParenthesisExpressionSymbol;
import de.monticore.lang.math._symboltable.expression.MathValueExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixAccessSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixExpressionSymbol;
import de.monticore.lang.math._symboltable.matrix.MathMatrixNameExpressionSymbol;
import de.monticore.lang.monticar.generator.FileContent;
import de.monticore.lang.monticar.generator.Variable;
import de.monticore.lang.monticar.generator.cpp.converter.ComponentConverter;
......
......@@ -22,28 +22,28 @@ public class TestConverter {
fileContentString += getDefaultContent(symbol);
ASTComponentStreamUnits ast = (ASTComponentStreamUnits) symbol.getAstNode().get();
int executionCounter = 0;
int executionAmount = ast.getNamedStreamUnitss().get(0).getStream().getStreamInstructions().size();
int executionAmount = ast.getNamedStreamUnitsList().get(0).getStream().getStreamInstructionList().size();
while (executionCounter < executionAmount) {
for (ASTNamedStreamUnits astNamedStreamUnit : ast.getNamedStreamUnitss()) {
for (ASTNamedStreamUnits astNamedStreamUnit : ast.getNamedStreamUnitsList()) {
fileContentString += getFileContentStringFor(instanceSymbol, astNamedStreamUnit, executionCounter);
}
fileContentString += "testInstance.execute();\n";
for (ASTNamedStreamUnits astNamedStreamUnit : ast.getNamedStreamUnitss()) {
for (ASTNamedStreamUnits astNamedStreamUnit : ast.getNamedStreamUnitsList()) {
String portName = astNamedStreamUnit.getName();
if (!instanceSymbol.getPort(portName).get().isIncoming()) {
if (astNamedStreamUnit.getStream().getStreamInstructions().size() > 0) {
ASTStreamInstruction streamInstruction = astNamedStreamUnit.getStream().getStreamInstructions().get(executionCounter);
if (streamInstruction.getStreamValue().isPresent() && streamInstruction.getStreamValue().get().getPrecisionNumber().isPresent()) {
ASTPrecisionNumber precisionNumber = streamInstruction.getStreamValue().get().getPrecisionNumber().get();
if (precisionNumber.getPrecision().isPresent()) {
fileContentString += "if(testInstance." + portName + ">" + "(" + MathConverter.getConvertedUnitNumber(precisionNumber.getUnitNumber()) + "-" + MathConverter.getConvertedUnitNumber(precisionNumber.getPrecision().get().getUnitNumber()) + ")";
fileContentString += "&& testInstance." + portName + "<" + "(" + MathConverter.getConvertedUnitNumber(precisionNumber.getUnitNumber()) + "+" + MathConverter.getConvertedUnitNumber(precisionNumber.getPrecision().get().getUnitNumber()) + ")";
if (astNamedStreamUnit.getStream().getStreamInstructionList().size() > 0) {
ASTStreamInstruction streamInstruction = astNamedStreamUnit.getStream().getStreamInstructionList().get(executionCounter);
if (streamInstruction.getStreamValueOpt().isPresent() && streamInstruction.getStreamValueOpt().get().getPrecisionNumberOpt().isPresent()) {
ASTPrecisionNumber precisionNumber = streamInstruction.getStreamValueOpt().get().getPrecisionNumberOpt().get();
if (precisionNumber.getPrecisionOpt().isPresent()) {
fileContentString += "if(testInstance." + portName + ">" + "(" + MathConverter.getConvertedUnitNumber(precisionNumber.getNumberWithUnit()) + "-" + MathConverter.getConvertedUnitNumber(precisionNumber.getPrecisionOpt().get().getNumberWithUnit()) + ")";
fileContentString += "&& testInstance." + portName + "<" + "(" + MathConverter.getConvertedUnitNumber(precisionNumber.getNumberWithUnit()) + "+" + MathConverter.getConvertedUnitNumber(precisionNumber.getPrecisionOpt().get().getNumberWithUnit()) + ")";
fileContentString += "){";
fileContentString += "printf(\"Mismatch at executionStep " + executionCounter + "\");\n";
fileContentString += "octave_quit();\n";
fileContentString += "}\n";
} else {
fileContentString += "if(testInstance." + portName + "!=" + MathConverter.getConvertedUnitNumber(precisionNumber.getUnitNumber()) + "){";
fileContentString += "if(testInstance." + portName + "!=" + MathConverter.getConvertedUnitNumber(precisionNumber.getNumberWithUnit()) + "){";
fileContentString += "printf(\"Mismatch at executionStep " + executionCounter + "\");\n";
fileContentString += "octave_quit();\n";
fileContentString += "}\n";
......@@ -88,11 +88,11 @@ public class TestConverter {
String fileContentString = "";
String portName = astNamedStreamUnit.getName();
if (instanceSymbol.getPort(portName).get().isIncoming()) {
if (astNamedStreamUnit.getStream().getStreamInstructions().size() > 0) {
ASTStreamInstruction streamInstruction = astNamedStreamUnit.getStream().getStreamInstructions().get(executionCounter);
if (streamInstruction.getStreamValue().isPresent() && streamInstruction.getStreamValue().get().getPrecisionNumber().isPresent())
if (astNamedStreamUnit.getStream().getStreamInstructionList().size() > 0) {
ASTStreamInstruction streamInstruction = astNamedStreamUnit.getStream().getStreamInstructionList().get(executionCounter);
if (streamInstruction.getStreamValueOpt().isPresent() && streamInstruction.getStreamValueOpt().get().getPrecisionNumberOpt().isPresent())
fileContentString += "testInstance." + portName + "=" + MathConverter.getConvertedUnitNumber(streamInstruction.
getStreamValue().get().getPrecisionNumber().get().getUnitNumber()) + ";";
getStreamValueOpt().get().getPrecisionNumberOpt().get().getNumberWithUnit()) + ";";
}
}
return fileContentString;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment