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
EMAM2RosCpp
Commits
8337a0ef
Commit
8337a0ef
authored
Sep 22, 2019
by
Lennart Bucher
Browse files
update the generation, as the old code did not make sense
parent
d2cca7cc
Pipeline
#186116
failed with stages
in 2 minutes and 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/de/monticore/lang/monticar/generator/roscpp/instructions/SetStructPortInstruction.java
View file @
8337a0ef
...
...
@@ -89,19 +89,15 @@ public class SetStructPortInstruction{
lowerBound
=
boundExists
?
split
[
0
].
replaceAll
(
"[^0-9]"
,
""
)
:
"0"
;
boundExists
=
!
split
[
1
].
replaceAll
(
"[^0-9]"
,
""
).
isEmpty
();
upperBound
=
boundExists
?
split
[
1
].
replaceAll
(
"[^0-9]"
,
""
)
:
String
.
valueOf
(
Integer
.
valueOf
(
dimSizes
.
get
(
dimSizes
.
size
()-
1
)
)
-
1
)
;
upperBound
=
boundExists
?
split
[
1
].
replaceAll
(
"[^0-9]"
,
""
)
:
dimSizes
.
get
(
dimSizes
.
size
()-
1
)
+
"
-1
"
;
}
else
{
lowerBound
=
"0"
;
if
(
dimSizes
.
get
(
dimSizes
.
size
()-
1
).
equals
(
"n"
)){
upperBound
=
""
;
}
else
{
upperBound
=
String
.
valueOf
(
Integer
.
valueOf
(
dimSizes
.
get
(
dimSizes
.
size
()-
1
))-
1
);
}
upperBound
=
dimSizes
.
get
(
dimSizes
.
size
()-
1
)+
"-1"
;
}
if
(!
upperBound
.
equals
(
""
)){
if
(
Integer
.
parseInt
(
lowerBound
)
>
Integer
.
parseInt
(
upperBound
))
{
Log
.
error
(
" ArrayBoundsHandler: lowerBound > upperBound!"
);
}
//
if (Integer.parseInt(lowerBound) > Integer.parseInt(upperBound)) {
If
//
Log.error(" ArrayBoundsHandler: lowerBound > upperBound!");
//
}
inst
+=
"if("
+
lowerBound
+
" <= counter && counter <= "
+
upperBound
+
"){\n"
;
}
String
tmp
;
...
...
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