You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need Java code-generation of trap statements in the AGCO project. Below are some test scenarios.
class Entry
operations
-- Result is 2
public noExcRaised : () ==> nat
noExcRaised () ==
trap - with return 6 in
return 2;
-- Result is 18
public excCaught : () ==> nat
excCaught () ==
trap a with return a + a in
exit 9;
-- Result is mk_(9, true)
public excCaughtTupRes : () ==> nat * bool
excCaughtTupRes () ==
trap mk_(b,n) with return mk_(n,b) in
exit mk_(true, 9);
-- Produces error (exception not caught)
public excNotCaught : () ==> nat * bool
excNotCaught () ==
trap mk_('a', 9) with return mk_(5,false) in
exit mk_(true, 9);
-- Produces error (exception not caught because 9 does not match 2)
public excBindNotCaught : () ==> nat
excBindNotCaught () ==
trap s in set {2} with return s
in
exit 9;
-- Result is 9
public excBindCaught : () ==> nat
excBindCaught () ==
trap s in set {9} with return s
in
exit 9;
end Entry
The text was updated successfully, but these errors were encountered:
We need Java code-generation of
trap
statements in the AGCO project. Below are some test scenarios.The text was updated successfully, but these errors were encountered: