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
48a8523a
Commit
48a8523a
authored
Jun 18, 2018
by
Sascha Niklas Schneiders
Browse files
fixed generator halt if optimizations are only partially supported
parent
4b9e7856
Pipeline
#56124
passed with stage
in 2 minutes and 20 seconds
Changes
8
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/Variable.java
View file @
48a8523a
...
...
@@ -132,7 +132,7 @@ public class Variable {
setVariableType
(
TypeConverter
.
getVariableTypeForMontiCarTypeName
(
this
.
type
.
getTypeNameMontiCar
(),
this
,
type
).
get
());
}
else
{
Log
.
info
(
type
.
getClass
().
getName
(),
"ASTType:"
);
Log
.
error
(
"Case not handled
!
"
);
Log
.
debug
(
"setTypeNameMontiCar"
,
"Case not handled"
);
}
}
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/LinalgBackend.java
View file @
48a8523a
...
...
@@ -61,31 +61,31 @@ public class LinalgBackend implements MathBackend {
@Override
public
String
getPowerOfString
(
MathArithmeticExpressionSymbol
mathExpressionSymbol
,
String
valueListString
)
{
Log
.
error
(
"Not supported yet"
);
Log
.
debug
(
"Not supported yet"
,
"Not Implemented"
);
return
null
;
}
@Override
public
String
getPowerOfString
(
MathArithmeticExpressionSymbol
mathExpressionSymbol
,
String
valueListString
,
String
seperator
)
{
Log
.
error
(
"Not supported yet"
);
Log
.
debug
(
"Not supported yet"
,
"Not Implemented"
);
return
null
;
}
@Override
public
String
getPowerOfString
(
MathMatrixArithmeticExpressionSymbol
mathExpressionSymbol
,
String
valueListString
)
{
Log
.
error
(
"Not supported yet"
);
Log
.
debug
(
"Not supported yet"
,
"Not Implemented"
);
return
null
;
}
@Override
public
String
getPowerOfEEString
(
MathMatrixArithmeticExpressionSymbol
mathExpressionSymbol
,
String
valueListString
)
{
Log
.
error
(
"Not supported yet"
);
Log
.
debug
(
"Not supported yet"
,
"Not Implemented"
);
return
null
;
}
@Override
public
String
getDivisionEEString
(
MathMatrixArithmeticExpressionSymbol
mathExpressionSymbol
,
String
valueListString
)
{
Log
.
error
(
"Not supported yet"
);
Log
.
debug
(
"Not supported yet"
,
"Not Implemented"
);
return
null
;
}
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/MathFunctionFixer.java
View file @
48a8523a
...
...
@@ -66,7 +66,7 @@ public class MathFunctionFixer {
if
(
notHandled
)
{
Log
.
info
(
mathExpressionSymbol
.
getClass
().
getName
(),
"Symbol name:"
);
Log
.
info
(
mathExpressionSymbol
.
getTextualRepresentation
(),
"Symbol:"
);
Log
.
error
(
"Case not handled
!
"
);
Log
.
debug
(
"Not supported yet"
,
"Case not handled"
);
}
}
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/OctaveHelper.java
View file @
48a8523a
...
...
@@ -159,7 +159,8 @@ public class OctaveHelper {
String
typeName
=
variable
.
getVariableType
().
getTypeNameTargetLanguage
();
return
typeName
.
substring
(
0
,
1
).
toUpperCase
()
+
typeName
.
substring
(
1
);
}
else
{
Log
.
error
(
"OctaveHelper Case not handled!"
);
Log
.
debug
(
"Not supported yet"
,
"Case not handled OctaveHelper"
);
}
return
null
;
}
...
...
@@ -172,7 +173,7 @@ public class OctaveHelper {
if
(
mathExpressionSymbol
.
isMatrixNameExpression
())
{
return
getOctaveFunctionTypeName
((
MathMatrixNameExpressionSymbol
)
mathExpressionSymbol
);
}
else
{
Log
.
error
(
"Case not handeld!
"
);
Log
.
debug
(
"Not supported yet"
,
"Case not handled OctaveHelper
"
);
return
null
;
}
}
...
...
@@ -199,7 +200,7 @@ public class OctaveHelper {
}
else
{
Log
.
info
(
mathExpressionSymbol
.
getTextualRepresentation
(),
"Symbol:"
);
Log
.
error
(
"FunctionTypeName not handled!"
);
Log
.
debug
(
"FunctionTypeName not handled!"
,
"Case not handled"
);
}
return
result
;
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ExecuteMethodGenerator.java
View file @
48a8523a
...
...
@@ -57,7 +57,8 @@ public class ExecuteMethodGenerator {
result
=
ExecuteMethodGeneratorHandler
.
generateExecuteCode
((
MathParenthesisExpressionSymbol
)
mathExpressionSymbol
,
includeStrings
);
}
else
{
Log
.
info
(
mathExpressionSymbol
.
getTextualRepresentation
(),
"Symbol:"
);
Log
.
error
(
"Case not handled!"
);
Log
.
debug
(
"ExecuteMethodGenerator"
,
"Case not handled!"
);
}
return
result
;
}
...
...
src/main/java/de/monticore/lang/monticar/generator/cpp/converter/ExecuteMethodGeneratorMatrixExpressionHandler.java
View file @
48a8523a
...
...
@@ -162,12 +162,12 @@ public class ExecuteMethodGeneratorMatrixExpressionHandler {
}
private
static
String
tryFix
(
String
result
,
MathMatrixAccessOperatorSymbol
mathMatrixAccessOperatorSymbol
)
{
result
=
fixDoubleOffset
(
result
,
mathMatrixAccessOperatorSymbol
,
"]"
);
result
=
fixDoubleOffset
(
result
,
mathMatrixAccessOperatorSymbol
,
")"
);
result
=
fixDoubleOffset
(
result
,
mathMatrixAccessOperatorSymbol
,
"]"
);
result
=
fixDoubleOffset
(
result
,
mathMatrixAccessOperatorSymbol
,
")"
);
return
result
;
}
private
static
String
fixDoubleOffset
(
String
result
,
MathMatrixAccessOperatorSymbol
mathMatrixAccessOperatorSymbol
,
String
endPart
){
private
static
String
fixDoubleOffset
(
String
result
,
MathMatrixAccessOperatorSymbol
mathMatrixAccessOperatorSymbol
,
String
endPart
)
{
String
fixingTestString
=
(
result
.
substring
(
0
,
result
.
length
()
-
3
)
+
endPart
);
Log
.
info
(
"Checking Possible Fixing Test String: "
+
fixingTestString
,
"MathMatrixAccessOperatorSymbol"
);
if
(
fixingTestString
.
equals
(
mathMatrixAccessOperatorSymbol
.
getTextualRepresentation
()))
{
...
...
@@ -227,7 +227,7 @@ public class ExecuteMethodGeneratorMatrixExpressionHandler {
}
else
{
Log
.
info
(
mathMatrixExpressionSymbol
.
getTextualRepresentation
(),
"Symbol:"
);
Log
.
info
(
mathMatrixExpressionSymbol
.
getClass
().
getName
(),
"Symbol Name:"
);
Log
.
error
(
"0xMAMAEXSY
Case not handled
!
"
);
Log
.
debug
(
"0xMAMAEXSY
"
,
"
Case not handled"
);
}
return
result
;
}
...
...
src/main/java/de/monticore/lang/monticar/generator/optimization/MathMatrixMultiplicationOrder.java
View file @
48a8523a
...
...
@@ -44,7 +44,7 @@ public class MathMatrixMultiplicationOrder implements MathOptimizationRule {
optimize
((
MathForLoopExpressionSymbol
)
mathExpressionSymbol
,
precedingExpressions
);
}
else
{
Log
.
info
(
mathExpressionSymbol
.
getClass
().
getName
(),
"Symbol name:"
);
Log
.
error
(
"Optimizer Case not handled!"
);
Log
.
debug
(
"Optimizer
case not handled"
,
"
Case not handled!"
);
}
}
...
...
@@ -94,7 +94,7 @@ public class MathMatrixMultiplicationOrder implements MathOptimizationRule {
optimize
((
MathMatrixNameExpressionSymbol
)
matrixExpressionSymbol
,
precedingExpressions
);
}
else
{
Log
.
info
(
matrixExpressionSymbol
.
getClass
().
getName
(),
"Symbol name:"
);
Log
.
error
(
"Optimizer Case not handled!"
);
Log
.
debug
(
"Optimizer
case not handled"
,
"
Case not handled!"
);
}
}
...
...
src/main/java/de/monticore/lang/monticar/generator/optimization/MathMultiplicationAddition.java
View file @
48a8523a
...
...
@@ -42,7 +42,8 @@ public class MathMultiplicationAddition implements MathOptimizationRule {
optimize
((
MathForLoopExpressionSymbol
)
mathExpressionSymbol
,
precedingExpressions
);
}
else
{
Log
.
info
(
mathExpressionSymbol
.
getClass
().
getName
(),
"Symbol name:"
);
Log
.
error
(
"Optimizer Case not handled!"
);
Log
.
debug
(
"Optimizer case not handled"
,
"Case not handled!"
);
}
}
...
...
@@ -86,8 +87,7 @@ public class MathMultiplicationAddition implements MathOptimizationRule {
optimize
((
MathMatrixNameExpressionSymbol
)
matrixExpressionSymbol
,
precedingExpressions
);
}
else
{
Log
.
info
(
matrixExpressionSymbol
.
getClass
().
getName
(),
"Symbol name:"
);
Log
.
error
(
"Optimizer Case not handled!"
);
Log
.
debug
(
"Optimizer case not handled"
,
"Case not handled!"
);
}
}
...
...
@@ -107,7 +107,7 @@ public class MathMultiplicationAddition implements MathOptimizationRule {
public
void
optimizeMatrixAddition
(
MathMatrixArithmeticExpressionSymbol
matrixArithmeticExpressionSymbol
,
List
<
MathExpressionSymbol
>
precedingExpressions
)
{
if
(
MathOptimizer
.
isArithmeticExpression
(
matrixArithmeticExpressionSymbol
.
getLeftExpression
().
getRealMathExpressionSymbol
(),
"*"
,
precedingExpressions
)
&&
MathOptimizer
.
isArithmeticExpression
(
matrixArithmeticExpressionSymbol
.
getRightExpression
().
getRealMathExpressionSymbol
(),
"*"
,
precedingExpressions
))
{
Log
.
error
(
"b
"
);
Log
.
debug
(
"Optimizer case not handled"
,
"Case not handled!
"
);
}
}
...
...
Write
Preview
Markdown
is supported
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