fork download
  1. With Ada.Text_IO; Use Ada.Text_IO;
  2. With Ada.Integer_Text_IO; Use Ada.Integer_Text_IO;
  3.  
  4. procedure Program is
  5.  
  6. task Counter is
  7. entry Get (Result : out Integer);
  8. entry Increment;
  9. entry Decrement;
  10. end Counter;
  11. task body Counter is
  12. Value : Integer := 0;
  13. begin
  14. loop
  15. select
  16. accept Increment do
  17. Value := Value + 1;
  18. end Increment;
  19. or
  20. accept Decrement do
  21. Value := Value - 1;
  22. end Decrement;
  23. or
  24. accept Get (Result : out Integer) do
  25. Result := Value;
  26. end Get;
  27. or
  28. delay 1.0 * Minute;
  29. exit;
  30. end select;
  31. end loop;
  32. end Counter;
  33. begin
  34. end Program;
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
gcc -c -pipe -O2 test.adb
test.adb:34:01: statement expected
gnatmake: "test.adb" compilation error
stdout
Standard output is empty