Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2Cpp
Commits
a85db356
Commit
a85db356
authored
Jul 19, 2018
by
Christoph Richter
Browse files
ExecuteMethodGeneratorHandler: Fixed missing colvec initialization if dimesnsion is {n,1}
parent
bb380749
Pipeline
#63769
failed with stage
in 2 minutes and 11 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ExecuteMethodGeneratorHandler.java
View file @
a85db356
...
@@ -8,7 +8,6 @@ import de.monticore.lang.monticar.generator.Variable;
...
@@ -8,7 +8,6 @@ import de.monticore.lang.monticar.generator.Variable;
import
de.monticore.lang.monticar.generator.cpp.MathCommandRegisterCPP
;
import
de.monticore.lang.monticar.generator.cpp.MathCommandRegisterCPP
;
import
de.monticore.lang.monticar.generator.cpp.MathFunctionFixer
;
import
de.monticore.lang.monticar.generator.cpp.MathFunctionFixer
;
import
de.monticore.lang.monticar.generator.cpp.OctaveHelper
;
import
de.monticore.lang.monticar.generator.cpp.OctaveHelper
;
import
de.monticore.lang.monticar.generator.cpp.StringValueListExtractorUtil
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathChainedExpression
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathChainedExpression
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression
;
import
de.monticore.lang.monticar.generator.cpp.symbols.MathStringExpression
;
import
de.monticore.lang.monticar.types2._ast.ASTElementType
;
import
de.monticore.lang.monticar.types2._ast.ASTElementType
;
...
@@ -111,7 +110,7 @@ public class ExecuteMethodGeneratorHandler {
...
@@ -111,7 +110,7 @@ public class ExecuteMethodGeneratorHandler {
result
=
"="
+
TypeConverter
.
getDimensionString
(
TypeConverter
.
getColvecAccessString
(
type
),
dims
,
includeStrings
);
result
=
"="
+
TypeConverter
.
getDimensionString
(
TypeConverter
.
getColvecAccessString
(
type
),
dims
,
includeStrings
);
}
}
}
else
if
(
dims
.
size
()
==
2
)
{
}
else
if
(
dims
.
size
()
==
2
)
{
if
(
type
String
.
equals
(
TypeConverter
.
getMatAccess
String
(
type
)
))
{
if
(
type
IsCompatible
(
type
String
,
type
,
dims
))
{
result
=
"="
+
TypeConverter
.
getDimensionString
(
TypeConverter
.
getMatAccessString
(
type
),
dims
,
includeStrings
);
result
=
"="
+
TypeConverter
.
getDimensionString
(
TypeConverter
.
getMatAccessString
(
type
),
dims
,
includeStrings
);
}
}
}
else
if
(
dims
.
size
()
==
3
)
{
}
else
if
(
dims
.
size
()
==
3
)
{
...
@@ -122,6 +121,14 @@ public class ExecuteMethodGeneratorHandler {
...
@@ -122,6 +121,14 @@ public class ExecuteMethodGeneratorHandler {
return
result
;
return
result
;
}
}
private
static
boolean
typeIsCompatible
(
String
typeString
,
ASTElementType
type
,
List
<
MathExpressionSymbol
>
dims
)
{
boolean
result
=
typeString
.
equals
(
TypeConverter
.
getMatAccessString
(
type
));
if
(!
result
&&
(
dims
.
size
()
==
2
)
&&
(
dims
.
get
(
1
).
getTextualRepresentation
().
contentEquals
(
"1"
)))
{
result
=
typeString
.
contentEquals
(
"colvec"
)
&&
TypeConverter
.
getMatAccessString
(
type
).
contentEquals
(
"mat"
);
}
return
result
;
}
public
static
String
generateExecuteCode
(
MathValueSymbol
mathValueSymbol
,
List
<
String
>
includeStrings
)
{
public
static
String
generateExecuteCode
(
MathValueSymbol
mathValueSymbol
,
List
<
String
>
includeStrings
)
{
String
result
=
""
;
String
result
=
""
;
String
type
=
generateExecuteCode
(
mathValueSymbol
.
getType
(),
includeStrings
);
String
type
=
generateExecuteCode
(
mathValueSymbol
.
getType
(),
includeStrings
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment