Commit 60227903 authored by Ahmed's avatar Ahmed

fix name to be ArgumentNoReturn

parent 4d4fc707
......@@ -62,7 +62,7 @@ public abstract class MathCommand {
return false;
}
public boolean isArgumentReturnMathCommand() {
public boolean isArgumentNoReturnMathCommand() {
return false;
}
......
/* (c) https://github.com/MontiCore/monticore */
package de.monticore.lang.monticar.generator;
import de.monticore.lang.monticar.generator.cpp.commands.ArgumentReturnMathCommand;
import de.monticore.lang.monticar.generator.cpp.commands.ArgumentNoReturnMathCommand;
import java.util.ArrayList;
import java.util.List;
......@@ -10,7 +10,7 @@ import java.util.List;
*/
public abstract class MathCommandRegister {
public List<MathCommand> mathCommands = new ArrayList<>();
public List<ArgumentReturnMathCommand> argumentReturnMathCommands = new ArrayList<>();
public List<ArgumentNoReturnMathCommand> argumentNoReturnMathCommands = new ArrayList<>();
public MathCommandRegister() {
init();
......@@ -18,8 +18,8 @@ public abstract class MathCommandRegister {
public void registerMathCommand(MathCommand mathCommand) {
mathCommands.add(mathCommand);
if(mathCommand.isArgumentReturnMathCommand()){
argumentReturnMathCommands.add((ArgumentReturnMathCommand) mathCommand);
if(mathCommand.isArgumentNoReturnMathCommand()){
argumentNoReturnMathCommands.add((ArgumentNoReturnMathCommand) mathCommand);
}
}
......
......@@ -6,17 +6,17 @@ import de.monticore.lang.monticar.generator.MathCommand;
/**
* @author Ahmed Diab.
*/
public abstract class ArgumentReturnMathCommand extends MathCommand{
public ArgumentReturnMathCommand() {
public abstract class ArgumentNoReturnMathCommand extends MathCommand{
public ArgumentNoReturnMathCommand() {
}
public ArgumentReturnMathCommand(String argumentReturnMathCommandName) {
super(argumentReturnMathCommandName);
public ArgumentNoReturnMathCommand(String argumentNoReturnMathCommandName) {
super(argumentNoReturnMathCommandName);
}
@Override
public boolean isArgumentReturnMathCommand() {
public boolean isArgumentNoReturnMathCommand() {
return true;
}
}
......@@ -19,7 +19,7 @@ import java.util.List;
* @author Ahmed Diab
*/
public class CvtColorCommand extends ArgumentReturnMathCommand{
public class CvtColorCommand extends ArgumentNoReturnMathCommand{
public CvtColorCommand() {
setMathCommandName("cvtColor");
}
......
......@@ -18,7 +18,7 @@ import java.util.List;
* @author Ahmed Diab
*/
public class DilateCommand extends ArgumentReturnMathCommand{
public class DilateCommand extends ArgumentNoReturnMathCommand{
public DilateCommand() {
setMathCommandName("dilate");
}
......
......@@ -18,7 +18,7 @@ import java.util.List;
* @author Ahmed Diab
*/
public class ErodeCommand extends ArgumentReturnMathCommand{
public class ErodeCommand extends ArgumentNoReturnMathCommand{
public ErodeCommand() {
setMathCommandName("erode");
}
......
......@@ -19,7 +19,7 @@ import java.util.List;
* @author Ahmed Diab
*/
public class FindContoursCommand extends ArgumentReturnMathCommand{
public class FindContoursCommand extends ArgumentNoReturnMathCommand{
public FindContoursCommand() {
setMathCommandName("findContours");
}
......
......@@ -19,7 +19,7 @@ import java.util.List;
* @author Ahmed Diab
*/
public class GaussianBlurCommand extends ArgumentReturnMathCommand{
public class GaussianBlurCommand extends ArgumentNoReturnMathCommand{
public GaussianBlurCommand() {
setMathCommandName("gaussianBlur");
}
......
......@@ -18,7 +18,7 @@ import java.util.List;
* @author Ahmed Diab
*/
public class InRangeCommand extends ArgumentReturnMathCommand{
public class InRangeCommand extends ArgumentNoReturnMathCommand{
public InRangeCommand() {
setMathCommandName("inRange");
}
......
......@@ -42,18 +42,17 @@ public class MathCeilCommand extends MathCommand {
mathMatrixNameExpressionSymbol.setNameToAccess("");
String valueListString = "";
for (MathMatrixAccessSymbol accessSymbol : mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().getMathMatrixAccessSymbols())
for (MathMatrixAccessSymbol accessSymbol : mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().
getMathMatrixAccessSymbols())
MathFunctionFixer.fixMathFunctions(accessSymbol, (BluePrintCPP) bluePrint);
valueListString += ExecuteMethodGenerator.generateExecuteCode(mathExpressionSymbol, new ArrayList<String>());
List<MathMatrixAccessSymbol> newMatrixAccessSymbols = new ArrayList<>();
MathStringExpression stringExpression = new MathStringExpression("std::ceil"+valueListString,mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().getMathMatrixAccessSymbols());
MathStringExpression stringExpression = new MathStringExpression("std::ceil"+valueListString,
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().getMathMatrixAccessSymbols());
newMatrixAccessSymbols.add(new MathMatrixAccessSymbol(stringExpression));
mathMatrixNameExpressionSymbol.getMathMatrixAccessOperatorSymbol().setMathMatrixAccessSymbols(newMatrixAccessSymbols);
}
}
......@@ -197,10 +197,10 @@ public class ComponentConverterMethodGeneration {
String outputName = "";
for (MathCommand mathCommand : ComponentConverter.usedMathCommand)
if(mathCommand != null) {
String argumentReturnFunctionName = mathCommand.getMathCommandName();
if (mathCommand.isArgumentReturnMathCommand() && result.contains(argumentReturnFunctionName)) {
String argumentNoReturnFunctionName = mathCommand.getMathCommandName();
if (mathCommand.isArgumentNoReturnMathCommand() && result.contains(argumentNoReturnFunctionName)) {
outputName = getNameOfOutput(mathExpressionSymbol);
result = fixArgumentReturnInstruction(result, outputName);
result = fixArgumentNoReturnInstruction(result, outputName);
}
}
TargetCodeMathInstruction instruction = new TargetCodeMathInstruction(result, mathExpressionSymbol);
......@@ -346,7 +346,7 @@ public class ComponentConverterMethodGeneration {
if (beginIndex != currentGenerationIndex) swapNextInstructions = true;
}
private static String fixArgumentReturnInstruction(String instruction, String outputName){
private static String fixArgumentNoReturnInstruction(String instruction, String outputName){
String newInstruction = "";
if(instruction.contains("=")){
int indexOfEqualOperator = instruction.indexOf("=");
......
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