Commit a6cfa99d authored by dbarbera's avatar dbarbera
Browse files

Extended test13 to include math expressions

parent 3c0e946d
all: compile
generate-ada:
../../../opengeode.py adder.pr system_structure.pr --check --toAda
../../../opengeode.py math.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 adder.ali
gnatlink -o testcase test.o adder.ali -lgnat -lm
./testcase | diff expected - && echo 'All OK!'
gnatbind -n math.ali
gnatlink -o testcase test.o math.ali -lgnat -lm
./testcase && echo 'All OK!'
generate-llvm:
../../../opengeode.py adder.pr system_structure.pr --check --llvm
../../../opengeode.py math.pr system_structure.pr --check --llvm
parse:
../../../opengeode.py adder.pr system_structure.pr --check
../../../opengeode.py math.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 adder;
PROCESS math;
/* CIF TEXT (176, -127), (198, 140) */
-- Declare your variables
DCL n Number;
/* CIF ENDTEXT */
/* CIF START (-86, -394), (100, 50) */
START;
......@@ -16,11 +15,15 @@ NEXTSTATE Wait;
STATE Wait;
/* CIF INPUT (-85, -188), (100, 50) */
INPUT run;
/* CIF TASK (-117, -123), (164, 49) */
/* CIF TASK (-80, -123), (91, 35) */
TASK n := n + 1;
/* CIF PROCEDURECALL (-85, -59), (100, 35) */
CALL writeln(n);
/* CIF NEXTSTATE (-85, -9), (100, 50) */
/* 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) */
NEXTSTATE Wait;
ENDSTATE;
ENDPROCESS adder;
ENDPROCESS math;
\ No newline at end of file
/* CIF Keep Specific Geode ASNFilename 'dataview-uniq.asn' */
USE Datamodel;
SYSTEM adder;
SYSTEM math;
SIGNAL run;
CHANNEL c
FROM ENV TO adder WITH run;
FROM ENV TO math WITH run;
ENDCHANNEL;
BLOCK adder;
BLOCK math;
SIGNALROUTE r
FROM ENV TO adder WITH run;
FROM ENV TO math WITH run;
CONNECT c and r;
PROCESS adder REFERENCED;
PROCESS math REFERENCED;
ENDBLOCK;
......
extern void adder_run();
int main() {
adder_run();
adder_run();
adder_run();
math_run();
return 0;
}
Supports Markdown
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