Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
OpenGEODE
Commits
8e741133
Commit
8e741133
authored
Jun 05, 2014
by
dbarbera
Browse files
Improved test13 to use all basic binary expressions
parent
a532b25d
Changes
6
Hide whitespace changes
Inline
Side-by-side
tests/regression/test13/DataView.py
View file @
8e741133
...
...
@@ -6,13 +6,25 @@ exportedTypes = {}
exportedVariables
=
{}
importedModules
=
{}
types
=
{}
asn1Files
.
append
(
"
./
dataview-uniq.asn"
)
asn1Files
.
append
(
"dataview-uniq.asn"
)
asn1Modules
.
append
(
"TASTE-Dataview"
)
exportedTypes
[
"TASTE-Dataview"
]
=
[
"
Number
"
]
exportedTypes
[
"TASTE-Dataview"
]
=
[
"
Int"
,
"Bool"
,
"Float
"
]
exportedVariables
[
"TASTE-Dataview"
]
=
[]
importedModules
[
"TASTE-Dataview"
]
=
[]
types
[
"Number"
]
=
type
(
"Number"
,
(
object
,),
{
"Line"
:
4
,
"CharPositionInLine"
:
0
,
"type"
:
type
(
"Number_type"
,
(
object
,),
{
"Line"
:
4
,
"CharPositionInLine"
:
14
,
"kind"
:
"IntegerType"
,
"Min"
:
"0"
,
"Max"
:
"255"
types
[
"Int"
]
=
type
(
"Int"
,
(
object
,),
{
"Line"
:
4
,
"CharPositionInLine"
:
0
,
"type"
:
type
(
"Int_type"
,
(
object
,),
{
"Line"
:
4
,
"CharPositionInLine"
:
8
,
"kind"
:
"IntegerType"
,
"Min"
:
"MIN"
,
"Max"
:
"MAX"
})
})
types
[
"Bool"
]
=
type
(
"Bool"
,
(
object
,),
{
"Line"
:
5
,
"CharPositionInLine"
:
0
,
"type"
:
type
(
"Bool_type"
,
(
object
,),
{
"Line"
:
5
,
"CharPositionInLine"
:
9
,
"kind"
:
"BooleanType"
})
})
types
[
"Float"
]
=
type
(
"Float"
,
(
object
,),
{
"Line"
:
6
,
"CharPositionInLine"
:
0
,
"type"
:
type
(
"Float_type"
,
(
object
,),
{
"Line"
:
6
,
"CharPositionInLine"
:
10
,
"kind"
:
"RealType"
,
"Min"
:
"MIN"
,
"Max"
:
"MAX"
})
})
tests/regression/test13/Makefile
View file @
8e741133
all
:
compile
generate-ada
:
../../../opengeode.py
math
.pr system_structure.pr
--check
--toAda
../../../opengeode.py
basic
.pr system_structure.pr
--check
--toAda
compile-ada
:
generate-ada
asn1.exe
-Ada
dataview-uniq.asn
-typePrefix
asn1Scc
-equal
gnatmake
-c
*
.adb
gcc
-c
test.c
gnatbind
-n
math
.ali
gnatlink
-o
testcase test.o
math
.ali
-lgnat
-lm
gnatbind
-n
basic
.ali
gnatlink
-o
testcase test.o
basic
.ali
-lgnat
-lm
./testcase
&&
echo
'All OK!'
generate-llvm
:
../../../opengeode.py
math
.pr system_structure.pr
--check
--llvm
../../../opengeode.py
basic
.pr system_structure.pr
--check
--llvm
parse
:
../../../opengeode.py
math
.pr system_structure.pr
--check
../../../opengeode.py
basic
.pr system_structure.pr
--check
clean
:
rm
-rf
*
.adb
*
.ads
*
.pyc runSpark.sh spark.idx
*
.o
*
.ali gnat.cfg examiner bin
*
.wrn
*
.gpr testcase
tests/regression/test13/
math
.pr
→
tests/regression/test13/
basic
.pr
View file @
8e741133
/* CIF PROCESS (150, 150), (150, 75) */
PROCESS
math
;
PROCESS
basic
;
/* CIF TEXT (176, -127), (198, 140) */
-- Declare your variables
DCL n Number;
DCL i Int;
DCL f Float;
DCL b Bool;
/* CIF ENDTEXT */
/* CIF START (-86, -394), (100, 50) */
START;
/* CIF TASK (-102, -323), (133, 50) */
TASK n := 1;
/* CIF NEXTSTATE (-86, -258), (100, 50) */
TASK i := 1;
/* CIF TASK (-84, -258), (97, 35) */
TASK b := false;
/* CIF TASK (-75, -208), (78, 35) */
TASK f := 1.0;
/* CIF NEXTSTATE (-86, -158), (100, 50) */
NEXTSTATE Wait;
/* CIF STATE (-86, -
2
58), (100, 50) */
/* CIF STATE (-86, -
1
58), (100, 50) */
STATE Wait;
/* CIF INPUT (-85, -
1
88), (100, 50) */
/* CIF INPUT (-85, -88), (100, 50) */
INPUT run;
/* CIF TASK (-80, -123), (91, 35) */
TASK n := n + 1;
/* CIF TASK (-78, -73), (87, 35) */
TASK n := n - 1;
/* CIF TASK (-90, -23), (111, 35) */
TASK n := n * 1;
/* CIF TASK (-90, 27), (111, 35) */
TASK n := n mod 1;
/* CIF NEXTSTATE (-85, 77), (100, 50) */
/* CIF TASK (-124, -23), (179, 35) */
TASK i := ((i + 1) - 1) * 1 / 1 mod 1;
/* CIF TASK (-128, 27), (186, 35) */
TASK b := (b or false) and true xor false;
/* CIF TASK (-118, 77), (166, 35) */
TASK f := (f + 3.0) * 0.5 / 2.0;
/* CIF NEXTSTATE (-85, 127), (100, 50) */
NEXTSTATE Wait;
ENDSTATE;
ENDPROCESS math;
\ No newline at end of file
ENDPROCESS basic;
tests/regression/test13/dataview-uniq.asn
View file @
8e741133
TASTE-Dataview DEFINITIONS ::=
BEGIN
Number ::= INTEGER (0..255)
Int ::= INTEGER
Bool ::= BOOLEAN
Float ::= REAL
END
tests/regression/test13/system_structure.pr
View file @
8e741133
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM
math
;
SYSTEM
basic
;
SIGNAL run;
CHANNEL c
FROM ENV TO
math
WITH run;
FROM ENV TO
basic
WITH run;
ENDCHANNEL;
BLOCK
math
;
BLOCK
basic
;
SIGNALROUTE r
FROM ENV TO
math
WITH run;
FROM ENV TO
basic
WITH run;
CONNECT c and r;
PROCESS
math
REFERENCED;
PROCESS
basic
REFERENCED;
ENDBLOCK;
...
...
tests/regression/test13/test.c
View file @
8e741133
extern
void
adder
_run
();
extern
void
basic
_run
();
int
main
()
{
math
_run
();
basic
_run
();
return
0
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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