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
7f41f2e7
Commit
7f41f2e7
authored
Apr 10, 2019
by
Malte Heithoff
Browse files
Bug with test
parent
7bfc64ed
Pipeline
#117631
failed with stages
in 9 minutes and 44 seconds
Changes
80
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/de/monticore/lang/monticar/generator/heithoff/SListBug.java
0 → 100644
View file @
7f41f2e7
package
de.monticore.lang.monticar.generator.heithoff
;
import
de.monticore.lang.monticar.generator.cpp.GeneratorCppCli
;
import
org.junit.Test
;
public
class
SListBug
{
@Test
public
void
testSListBug
()
{
String
[]
args
=
{
"--models-dir=src/test/resources"
,
"--root-model=de.rwth.pacman.pacManWrapper"
,
"--output-dir=./target/generated-sources-cpp/de/rwth/pacman/PacManWrapper"
};
GeneratorCppCli
.
main
(
args
);
}
}
src/test/resources/de/rwth/pacman/PacManControllerSimple.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
;
import
de
.
rwth
.
pacman
.
basicLibrary
.
Fallback
;
//
UP
=
0
//
DOWN
=
1
//
LEFT
=
2
//
RIGHT
=
3
component
PacManControllerSimple
{
ports
in
Q
(
0
m
:
18
m
)
ghostX
[
4
],
in
Q
(
0
m
:
21
m
)
ghostY
[
4
],
in
Z
(
0
:
1
:
3
)
ghostDirection
[
4
],
in
B
ghostEatable
[
4
],
in
B
ghostEaten
[
4
],
in
Q
(
0
m
:
18
m
)
pacManX
,
in
Q
(
0
m
:
21
m
)
pacManY
,
in
B
pacManEaten
,
in
Z
(
1
:
oo
)
pacManLives
,
in
Z
(
0
:
oo
)
pacManScore
,
in
Z
^{
22
,
19
}
map
,
out
Z
(
0
:
1
:
3
)
newPacManDirection
;
instance
Fallback
fallback
;
connect
fallback
.
out1
->
newPacManDirection
;
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/PacManWrapper.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
;
import
de
.
rwth
.
pacman
.
heithoff2
.
Controller
;
import
de
.
rwth
.
pacman
.
structs
.
Ghost
;
//
UP
=
0
//
DOWN
=
1
//
LEFT
=
2
//
RIGHT
=
3
//
Pacman
.
WALL
=
0
;
//
Pacman
.
BISCUIT
=
1
;
//
Pacman
.
EMPTY
=
2
;
//
Pacman
.
BLOCK
=
3
;
//
Pacman
.
PILL
=
4
;
component
PacManWrapper
{
ports
in
Q
(-
1
m
:
19
m
)
ghostX
[
4
],
//
x
-
position
of
all
ghosts
,
can
be
-
1
and
19
when
exiting
and
reentering
the
map
in
Q
(
0
m
:
21
m
)
ghostY
[
4
],
//
y
-
position
of
all
ghosts
in
Z
(
0
:
1
:
3
)
ghostDirection
[
4
],
//
the
directions
of
all
ghosts
encoded
in
the
pattern
above
in
B
ghostEatable
[
4
],
//
ghosts
are
eatable
when
pacman
collects
a
coin
in
B
ghostEaten
[
4
],
//
ghosts
enter
a
non
-
eatable
state
after
this
one
in
Q
(-
1
m
:
19
m
)
pacManX
,
//
x
-
position
of
pacman
,
can
be
-
1
and
19
when
exiting
and
reenting
the
map
in
Q
(
0
m
:
21
m
)
pacManY
,
//
y
-
position
of
pacman
in
B
pacManEaten
,
in
Z
(
0
:
oo
)
pacManLives
,
in
Z
(
0
:
oo
)
pacManScore
,
in
Z
^{
22
,
19
}
map
,
//
the
map
encoded
in
the
pattern
above
.
x
raises
to
the
right
,
y
raises
to
the
bottom
out
Z
(
0
:
1
:
3
)
newPacManDirection
;
//
Replace
this
with
your
own
custom
controller
instance
Controller
controller
;
connect
ghostX
[:]
->
controller
.
ghostX
[:];
connect
ghostY
[:]
->
controller
.
ghostY
[:];
connect
ghostDirection
[:]
->
controller
.
ghostDirection
[:];
connect
ghostEatable
[:]
->
controller
.
ghostEatable
[:];
connect
ghostEaten
[:]
->
controller
.
ghostEaten
[:];
connect
pacManX
->
controller
.
pacManX
;
connect
pacManY
->
controller
.
pacManY
;
connect
pacManEaten
->
controller
.
pacManEaten
;
connect
pacManLives
->
controller
.
pacManLives
;
connect
pacManScore
->
controller
.
pacManScore
;
connect
map
->
controller
.
map
;
connect
controller
.
newPacManDirection
->
newPacManDirection
;
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/basicLibrary/Fallback.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
basicLibrary
;
//
UP
=
0
//
DOWN
=
1
//
LEFT
=
2
//
RIGHT
=
3
component
Fallback
{
port
out
Z
out1
;
implementation
Math
{
out1
=
3
;
}
}
src/test/resources/de/rwth/pacman/common/Abs.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Abs
{
ports
in
Q
in1
,
out
Q
out1
;
implementation
Math
{
out1
=
abs
(
in1
);
}
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/common/And.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
And
<
N1
n
=
2
>
{
port
in
B
in1
[
n
],
out
B
out1
;
implementation
Math
{
out1
=
and
(
in1
);
/*
B
val
=
true
;
for
i
=
1
:
n
val
=
and
(
val
,
in1
[
n
]);
out1
=
val
;*/
}
}
src/test/resources/de/rwth/pacman/common/BoolToNumber.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
BoolToNumber
{
ports
in
B
in1
,
out
N1
out1
;
implementation
Math
{
if
in1
==
0
out1
=
0
;
else
out1
=
1
;
end
}
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/common/Constant.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Constant
<
Q
n
=
0
>
{
port
out
Q
out1
;
implementation
Math
{
out1
=
n
;
}
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/common/ConstantBoolean.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
ConstantBoolean
<
N1
n
>
{
ports
out
B
out1
;
implementation
Math
{
if
n
==
0
out1
=
0
;
else
out1
=
1
;
end
}
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/common/Delay.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Delay
<
Q
val
=
0
>
{
port
in
Q
in1
,
out
Q
out1
;
implementation
Math
{
static
Q
prev
=
val
;
out1
=
prev
;
prev
=
in1
;
}
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/common/Difference.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Difference
<
N1
n
=
2
>
{
port
in
Q
in1
[
n
],
out
Q
out1
;
implementation
Math
{
Q
outVal
=
in1
(
1
);
for
i
=
2
:
n
outVal
=
outVal
-
in1
(
i
);
end
out1
=
outVal
;
}
}
src/test/resources/de/rwth/pacman/common/Division.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Division
{
port
in
Q
in1
,
in
Q
in2
,
out
Q
out1
;
implementation
Math
{
out1
=
in1
/
in2
;
}
}
src/test/resources/de/rwth/pacman/common/Equals.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Equals
{
port
in
Q
in1
,
in
Q
in2
,
out
B
out1
;
implementation
Math
{
out1
=
equal
(
in1
,
in2
);
}
}
src/test/resources/de/rwth/pacman/common/EqualsBoolean.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
EqualsBoolean
{
port
in
B
in1
,
in
B
in2
,
out
B
out1
;
implementation
Math
{
out1
=
equal
(
in1
,
in2
);
}
}
src/test/resources/de/rwth/pacman/common/Greater.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Greater
{
port
in
Q
in1
,
in
Q
in2
,
out
B
out1
;
implementation
Math
{
out1
=
in1
>
in2
;
}
}
src/test/resources/de/rwth/pacman/common/GreaterEquals.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
GreaterEquals
{
port
in
Q
in1
,
in
Q
in2
,
out
B
out1
;
implementation
Math
{
out1
=
in1
>=
in2
;
}
}
src/test/resources/de/rwth/pacman/common/Indexes.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Indexes
<
N1
n
=
1
>
{
ports
out
N1
out1
[
n
];
implementation
Math
{
for
i
=
1
:
n
out1
(
i
)
=
i
;
end
}
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/common/JoinArray.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
JoinArray
<
N1
n
=
1
>
{
ports
in
Q
in1
[
n
],
out
Q
^{
1
,
n
}
out1
;
implementation
Math
{
for
i
=
1
:
n
out1
(
1
,
i
)
=
in1
(
i
);
end
}
}
\ No newline at end of file
src/test/resources/de/rwth/pacman/common/Less.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Less
{
port
in
Q
in1
,
in
Q
in2
,
out
B
out1
;
implementation
Math
{
out1
=
in1
<
in2
;
}
}
src/test/resources/de/rwth/pacman/common/Max.emam
0 → 100644
View file @
7f41f2e7
package
de
.
rwth
.
pacman
.
common
;
component
Max
<
N1
n
=
2
>
{
port
in
Q
in1
[
n
],
out
Q
out1
;
implementation
Math
{
Q
maxVal
=
in1
(
1
);
for
i
=
2
:
n
maxVal
=
max
(
maxVal
,
in1
(
i
));
end
out1
=
maxVal
;
}
}
Prev
1
2
3
4
Next
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