sel2.erl 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. % Autogenerated with DRAKON Editor 1.26
  2. -module(sel2).
  3. -export([case1/1, case2/1, case3/0, case4/0, case5/0, short/1]).
  4. case1(Arg1) ->
  5. % item 52
  6. case Arg1 =:= 0 of true ->
  7. % item 55
  8. io:format("0~n", [])
  9. ; false ->
  10. case Arg1 of
  11. ok ->
  12. % item 16
  13. io:format("ok~n", [])
  14. ;
  15. error ->
  16. % item 16
  17. io:format("ok~n", [])
  18. ;
  19. {foo, Message} ->
  20. % item 14
  21. io:format("ok ~p~n", [Message])
  22. ;
  23. {bar, Message} ->
  24. % item 51
  25. io:format("bar ~p~n", [Message])
  26. ;
  27. _ ->
  28. throw("Unexpected switch value")
  29. end
  30. end
  31. .
  32. case2(Arg1) ->
  33. case Arg1 of
  34. ok ->
  35. % item 44
  36. io:format("ok~n", []),
  37. % item 56
  38. io:format("ok2~n", []),
  39. % item 57
  40. io:format("ok3~n", [])
  41. ;
  42. {foo, Message} ->
  43. % item 42
  44. io:format("~p~n", [Message]),
  45. % item 57
  46. io:format("ok3~n", [])
  47. ;
  48. _ ->
  49. % item 47
  50. io:format("else~n", []),
  51. % item 57
  52. io:format("ok3~n", [])
  53. end
  54. .
  55. case3() ->
  56. receive
  57. ok ->
  58. % item 70
  59. io:format("ok~n", []),
  60. % item 74
  61. io:format("ok2~n", []),
  62. % item 75
  63. io:format("ok3~n", [])
  64. ;
  65. {foo, Message} ->
  66. % item 68
  67. io:format("~p~n", [Message]),
  68. % item 75
  69. io:format("ok3~n", [])
  70. ;
  71. _ ->
  72. % item 73
  73. io:format("else~n", []),
  74. % item 75
  75. io:format("ok3~n", [])
  76. end
  77. .
  78. case4() ->
  79. receive
  80. ok ->
  81. % item 90
  82. ok
  83. ;
  84. {error, _Message} ->
  85. % item 91
  86. error
  87. ;
  88. _ ->
  89. % item 92
  90. other
  91. after 6000 ->
  92. % item 93
  93. timeout
  94. end
  95. .
  96. case5() ->
  97. receive
  98. ok ->
  99. % item 109
  100. ok
  101. ;
  102. {error, _Message} ->
  103. % item 110
  104. error
  105. after 6000 ->
  106. % item 112
  107. timeout
  108. end
  109. .
  110. short(Arg) ->
  111. % item 22
  112. case ((Arg =:= 0) orelse (Arg =:= 1)) orelse (Arg =:= 2) of true ->
  113. % item 27
  114. true
  115. ; false ->
  116. % item 28
  117. false
  118. end
  119. .