Commit a4b478ac authored by Maxime Perrotin's avatar Maxime Perrotin

Complete support for "exist" operator

And remove -lgnat from Makefiles, this is not needed anymore with recent
GNAT versions
parent 69453dd9
This diff is collapsed.
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: challenge.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n challenge.ali
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lgnat -lm
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lm
./test_ada
test-c: challenge.c test_c.o dataview-uniq.o
......
......@@ -49,7 +49,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o -lgnat
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit(); test.og_for_a(); test.og_for_b(); test.og_for_a(); test.og_for_b()"
......
......@@ -21,7 +21,7 @@ test-qgen-ada:
mono $(ASN1SCC) -c -typePrefix asn1Scc -equal ../dataview-uniq.asn; \
$(GNATBIND) -n obj_ada/challenge.ali; \
$(CC) -O$(O) -c -g test_qgen_ada.c ; \
$(GNATLINK) -o test_qgen_ada test_qgen_ada.o obj_ada/challenge.ali -lgnat -lm; \
$(GNATLINK) -o test_qgen_ada test_qgen_ada.o obj_ada/challenge.ali -lm; \
./test_qgen_ada
test-qgen-c:
......@@ -49,7 +49,7 @@ test-qgen-c-asn:
test-ada: challenge.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n challenge.ali
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lgnat -lm
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lm
./test_ada
test-c: challenge.c test_c.o dataview-uniq.o
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
......@@ -43,7 +43,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -c *.adb
$(GNATBIND) -n -Lliborchestrator orchestrator
$(GNATMAKE) -c -gnat2012 b~orchestrator.adb
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o -lgnat
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o
python -c "from ctypes import *; test=CDLL('./liborchestrator.so'); test.liborchestratorinit()"
test-vhdl : test-c
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: controlflow.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n controlflow.ali
$(GNATLINK) test_ada.o controlflow.ali -lgnat -lm -o test_ada
$(GNATLINK) test_ada.o controlflow.ali -o test_ada
./test_ada | diff expected -
test-c: controlflow.c test_c.o dataview-uniq.o
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
......@@ -43,7 +43,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -c -fPIC *.adb
$(GNATBIND) -n -Lliborchestrator orchestrator
$(GNATMAKE) -c -fPIC -gnat2012 b~orchestrator.adb
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o -lgnat
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o
python -c "from ctypes import *; test=CDLL('./liborchestrator.so'); test.liborchestratorinit()"
test-vhdl : test-c
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: og.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n og.ali
$(GNATLINK) -o test_ada test_ada.o og.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o og.ali
./test_ada | diff expected -
test-c: og.c test_c.o dataview-uniq.o
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: challenge.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n challenge.ali
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lgnat -lm
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lm
./test_ada | diff expected -
test-c: challenge.c test_c.o dataview-uniq.o
......
......@@ -18,7 +18,7 @@ test-qgen-ada:
cd generated_ada && cp ../test_qgen_ada.c test_qgen_ada.c; \
$(GNATBIND) -n obj_ada/expressions.ali; \
$(CC) -O$(O) -c -g test_qgen_ada.c ; \
$(GNATLINK) -o test_qgen_ada test_qgen_ada.o obj_ada/expressions.ali -lgnat -lm; \
$(GNATLINK) -o test_qgen_ada test_qgen_ada.o obj_ada/expressions.ali -lm; \
./test_qgen_ada
test-qgen-c:
......@@ -40,7 +40,7 @@ test-qgen-gt-c:
test-ada: expressions.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n expressions.ali
$(GNATLINK) test_ada.o expressions.ali -lgnat -lm -o test_ada
$(GNATLINK) test_ada.o expressions.ali -lm -o test_ada
./test_ada
test-c: expressions.c test_c.o dataview-uniq.o
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: og.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n og.ali
$(GNATLINK) -o test_ada test_ada.o dataview-uniq.o og.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o dataview-uniq.o og.ali
./test_ada
#gcov og.adb
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
......
......@@ -19,7 +19,7 @@ test-qgen-ada:
mono $(ASN1SCC) -c -typePrefix asn1Scc -equal ../dataview-uniq.asn; \
$(GNATBIND) -n obj_ada/expressions.ali; \
$(CC) -O$(O) -c -g test_qgen_ada.c ; \
$(GNATLINK) -o test_qgen_ada test_qgen_ada.o obj_ada/expressions.ali -lgnat -lm; \
$(GNATLINK) -o test_qgen_ada test_qgen_ada.o obj_ada/expressions.ali -lm; \
./test_qgen_ada
test-qgen-c:
......@@ -41,7 +41,7 @@ test-qgen-gt-c:
test-ada: expressions.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n expressions.ali
$(GNATLINK) test_ada.o expressions.ali -lgnat -lm -o test_ada
$(GNATLINK) test_ada.o expressions.ali -lm -o test_ada
./test_ada
test-c: expressions.c test_c.o dataview-uniq.o
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali
./test_ada
test-c: orchestrator.c test_c.o dataview-uniq.o
......@@ -43,7 +43,7 @@ test-python:
$(GNATMAKE) -O$(O) -c *.adb
$(GNATBIND) -n -Lliborchestrator orchestrator
$(GNATMAKE) -c b~orchestrator.adb
$(CC) -shared -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o -lgnat
$(CC) -shared -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o
python -c "from ctypes import *; test=CDLL('./liborchestrator.so'); test.liborchestratorinit()"
coverage:
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: operators.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n operators.ali
$(GNATLINK) test_ada.o operators.ali -lgnat -lm -o test_ada
$(GNATLINK) test_ada.o operators.ali -lm -o test_ada
./test_ada | diff expected -
test-c: operators.c test_c.o dataview-uniq.o
......
......@@ -28,7 +28,7 @@ test-qgen-gt-c:
test-ada:
$(OPENGEODE) og.pr --toAda
mono $(ASN1SCC) -Ada -typePrefix asn1Scc -equal dataview.asn
cp test_ada.ada test_ada.adb && gnat make test_ada.adb && ./test_ada
cp test_ada.ada test_ada.adb && gnat make test_ada.adb -g && ./test_ada
test-c:
$(OPENGEODE) og.pr --toC
......@@ -42,7 +42,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o taste_dataview.o adaasn1rtl.o -lgnat
$(CC) -shared -fPIC -o libog.so b~og.o og.o taste_dataview.o adaasn1rtl.o
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit()"
simu:
......
......@@ -19,7 +19,7 @@ system og;
connect c and r;
/* CIF PROCESS (225, 50), (150, 75) */
process og;
/* CIF TEXT (531, 266), (448, 158) */
/* CIF TEXT (706, 266), (448, 158) */
dcl s1 Seq := { a TRUE };
dcl s2 Seq;
......@@ -31,54 +31,56 @@ system og;
dcl def2 SeqDef := { b 19, c 42 };
/* CIF ENDTEXT */
/* CIF START (269, 259), (70, 35) */
/* CIF START (381, 267), (70, 35) */
START;
/* CIF task (239, 309), (130, 35) */
/* CIF task (351, 317), (130, 35) */
task s2 := { a FALSE};
/* CIF decision (261, 364), (85, 48) */
/* CIF decision (373, 372), (85, 48) */
decision exist (s2.a)
/* CIF comment (366, 370), (122, 38) */
/* CIF comment (478, 378), (122, 38) */
comment 'test presence of
optional field';
/* CIF ANSWER (224, 432), (70, 23) */
/* CIF ANSWER (336, 440), (70, 23) */
(true):
/* CIF ANSWER (314, 432), (70, 23) */
/* CIF ANSWER (426, 440), (70, 23) */
(false):
enddecision;
/* CIF decision (249, 470), (110, 50) */
/* CIF decision (361, 478), (110, 50) */
decision exist (s2.b.b_c);
/* CIF ANSWER (224, 540), (70, 23) */
/* CIF ANSWER (336, 548), (70, 23) */
(true):
/* CIF ANSWER (314, 540), (70, 23) */
/* CIF ANSWER (426, 548), (70, 23) */
(false):
enddecision;
/* CIF task (247, 578), (114, 35) */
/* CIF PROCEDURECALL (279, 586), (273, 35) */
call writeln (exist(s2.a), ' and ', exist(s2.b));
/* CIF task (359, 636), (114, 35) */
task s2.a := TRUE;
/* CIF task (234, 628), (139, 35) */
/* CIF task (346, 686), (139, 35) */
task s2.b.b_c := TRUE;
/* CIF task (224, 678), (159, 35) */
/* CIF task (336, 736), (159, 35) */
task s2 :={ b { b_c TRUE }};
/* CIF PROCEDURECALL (244, 733), (119, 35) */
/* CIF PROCEDURECALL (356, 791), (119, 35) */
call writeln (def.b)
/* CIF comment (383, 733), (201, 35) */
/* CIF comment (495, 791), (201, 35) */
comment 'Uninitialized, expect garbage';
/* CIF PROCEDURECALL (244, 788), (120, 35) */
/* CIF PROCEDURECALL (356, 846), (120, 35) */
call writeln (def2.b)
/* CIF comment (384, 788), (145, 35) */
/* CIF comment (496, 846), (145, 35) */
comment 'Should display 19';
/* CIF task (258, 843), (92, 35) */
/* CIF task (370, 901), (92, 35) */
task def2.b := 16;
/* CIF PROCEDURECALL (244, 893), (120, 35) */
/* CIF PROCEDURECALL (356, 951), (120, 35) */
call writeln (def2.b)
/* CIF comment (384, 893), (145, 35) */
/* CIF comment (496, 951), (145, 35) */
comment 'Should display 16';
/* CIF NEXTSTATE (269, 943), (70, 35) */
/* CIF NEXTSTATE (381, 1001), (70, 35) */
NEXTSTATE wait;
/* CIF state (269, 943), (70, 35) */
/* CIF state (381, 1001), (70, 35) */
state wait;
/* CIF input (261, 998), (84, 35) */
/* CIF input (373, 1056), (84, 35) */
input run;
/* CIF NEXTSTATE (259, 1048), (88, 35) */
/* CIF NEXTSTATE (371, 1106), (88, 35) */
NEXTSTATE wait;
endstate;
endprocess og;
......
......@@ -49,7 +49,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o -lgnat
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit();"
......
......@@ -49,7 +49,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o -lgnat
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit();"
......
......@@ -49,7 +49,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o -lgnat
$(CC) -shared -fPIC -o libog.so b~og.o og.o adaasn1rtl.o taste_dataview.o
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit();"
......
......@@ -30,7 +30,7 @@ test-ada: dataview-uniq.o test_ada.o
mono $(ASN1SCC) -Ada -typePrefix asn1Scc -equal dataview-uniq.asn
$(GNATMAKE) -O$(O) -c *.adb
$(GNATBIND) -n og.ali
$(GNATLINK) -o test_ada test_ada.o dataview-uniq.o og.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o dataview-uniq.o og.ali
./test_ada
test-c:
......
......@@ -43,7 +43,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o taste_dataview.o adaasn1rtl.o -lgnat
$(CC) -shared -fPIC -o libog.so b~og.o og.o taste_dataview.o adaasn1rtl.o
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit()"
simu:
......
......@@ -26,7 +26,7 @@ test-python:
$(GNATMAKE) -O$(O) -gnat2012 -fPIC -c *.adb
$(GNATBIND) -n -Llibog og
$(GNATMAKE) -c -fPIC -gnat2012 b~og.adb
$(CC) -shared -fPIC -o libog.so b~og.o og.o taste_dataview.o adaasn1rtl.o -lgnat
$(CC) -shared -fPIC -o libog.so b~og.o og.o taste_dataview.o adaasn1rtl.o
python -c "from ctypes import *; test=CDLL('./libog.so'); test.liboginit()"
simu:
......
......@@ -33,7 +33,7 @@ test-ada:
$(CC) -c external_proc.c
$(GNATMAKE) -O$(O) -gnat2012 -c *.adb
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o external_proc.o orchestrator.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o external_proc.o orchestrator.ali
./test_ada
simu:
......@@ -60,7 +60,7 @@ test-python:
$(GNATBIND) -n -Lliborchestrator orchestrator
$(GNATMAKE) -c -fPIC -gnat2012 b~orchestrator.adb
$(CC) -c -fPIC external_proc.c
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o external_proc.o -lgnat
$(CC) -shared -fPIC -o liborchestrator.so b~orchestrator.o orchestrator.o taste_basictypes.o adaasn1rtl.o external_proc.o
python -c "from ctypes import *; test=CDLL('./liborchestrator.so'); test.liborchestratorinit()"
coverage:
......
......@@ -30,7 +30,7 @@ test-ada: dataview-uniq.o | test_ada.o
mono $(ASN1SCC) -Ada -typePrefix asn1Scc -equal dataview-uniq.asn
$(GNATMAKE) -O$(O) -c *.adb
$(GNATBIND) -n og.ali
$(GNATLINK) -o test_ada test_ada.o og.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o og.ali
./test_ada | diff - expected
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: myfunction.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n myfunction.ali
$(GNATLINK) -o test_ada test_ada.o myfunction.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o myfunction.ali
./test_ada | diff expected -
test-c: myfunction.c | test_ada.o
......@@ -41,4 +41,4 @@ test-llvm: myfunction.o dataview-uniq.o | test_llvm.o
coverage:
coverage run -p $(OPENGEODE) myfunction.pr system_structure.pr --toAda
.PHONY: all edit test-parse test-ada test-llvm coverage
\ No newline at end of file
.PHONY: all edit test-parse test-ada test-llvm coverage
......@@ -25,7 +25,7 @@ test-qgen-gt-c:
test-ada: og.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n og.ali
$(GNATLINK) -o test_ada test_ada.o dataview-uniq.o og.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o dataview-uniq.o og.ali
./test_ada
#gcov og.adb
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: challenge.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n challenge.ali
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lgnat -lm
$(GNATLINK) -o test_ada test_ada.o challenge.ali -lm
./test_ada | diff expected -
test-c: challenge.c test_c.o dataview-uniq.o
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: og.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n og.ali
$(GNATLINK) -o test_ada test_ada.o og.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o og.ali
./test_ada | diff expected -
test-c: og.c test_c.o dataview-uniq.o
......
......@@ -25,7 +25,7 @@ test-qgen-gt-c:
test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali
./test_ada
#gcov orchestrator.adb
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: myfunction.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n myfunction.ali
$(GNATLINK) -o test_ada test_ada.o myfunction.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o myfunction.ali
./test_ada | diff expected -
test-c: myfunction.c test_c.o dataview-uniq.o
......
......@@ -27,7 +27,7 @@ test-qgen-gt-c:
test-ada: orchestrator.ali dataview-uniq.o | test_ada.o
$(GNATBIND) -n orchestrator.ali
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali -lgnat
$(GNATLINK) -o test_ada test_ada.o orchestrator.ali
./test_ada | diff expected -
test-c: orchestrator.c test_c.o dataview-uniq.o
......
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