Commit 8e741133 authored by dbarbera's avatar dbarbera
Browse files

Improved test13 to use all basic binary expressions

parent a532b25d
......@@ -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"
})
})
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
/* 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, -258), (100, 50) */
/* CIF STATE (-86, -158), (100, 50) */
STATE Wait;
/* CIF INPUT (-85, -188), (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;
TASTE-Dataview DEFINITIONS ::=
BEGIN
Number ::= INTEGER (0..255)
Int ::= INTEGER
Bool ::= BOOLEAN
Float ::= REAL
END
/* 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;
......
extern void adder_run();
extern void basic_run();
int main() {
math_run();
basic_run();
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment