/src/tools/semantics/code/instructions/liberty_check_instruction.e

http://github.com/tybor/Liberty · Specman e · 69 lines · 46 code · 9 blank · 14 comment · 1 complexity · 6af1d7e4ed83f7f7160dc78653a9578d MD5 · raw file

  1. -- This file is part of Liberty Eiffel.
  2. --
  3. -- Liberty Eiffel is free software: you can redistribute it and/or modify
  4. -- it under the terms of the GNU General Public License as published by
  5. -- the Free Software Foundation, version 3 of the License.
  6. --
  7. -- Liberty Eiffel is distributed in the hope that it will be useful,
  8. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. -- GNU General Public License for more details.
  11. --
  12. -- You should have received a copy of the GNU General Public License
  13. -- along with Liberty Eiffel. If not, see <http://www.gnu.org/licenses/>.
  14. --
  15. class LIBERTY_CHECK_INSTRUCTION
  16. inherit
  17. LIBERTY_INSTRUCTION
  18. create {LIBERTY_BUILDER_TOOLS, LIBERTY_CHECK_INSTRUCTION}
  19. make
  20. feature {ANY}
  21. checks: LIBERTY_CHECK
  22. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  23. local
  24. c: like checks
  25. do
  26. c := checks.specialized_in(a_type)
  27. if c = checks then
  28. Result := Current
  29. else
  30. create Result.make(c, position)
  31. end
  32. end
  33. feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
  34. mark_reachable_code (mark: INTEGER) is
  35. do
  36. checks.mark_reachable_code(mark)
  37. end
  38. feature {}
  39. make (a_checks: like checks; a_position: like position) is
  40. require
  41. a_checks /= Void
  42. a_position /= Void
  43. do
  44. checks := a_checks
  45. position := a_position
  46. ensure
  47. checks = a_checks
  48. position = a_position
  49. end
  50. feature {ANY}
  51. accept (v: VISITOR) is
  52. local
  53. v0: LIBERTY_CHECK_INSTRUCTION_VISITOR
  54. do
  55. v0 ::= v
  56. v0.visit_liberty_check_instruction(Current)
  57. end
  58. invariant
  59. checks /= Void
  60. end