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

http://github.com/tybor/Liberty · Specman e · 74 lines · 51 code · 9 blank · 14 comment · 1 complexity · 1a8931e5086dfad106a711ecca73dcc5 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_DEBUG
  16. inherit
  17. LIBERTY_INSTRUCTION
  18. create {LIBERTY_BUILDER_TOOLS, LIBERTY_DEBUG}
  19. make
  20. feature {ANY}
  21. keys: TRAVERSABLE[FIXED_STRING]
  22. instruction: LIBERTY_INSTRUCTION
  23. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  24. local
  25. i: like instruction
  26. do
  27. i := instruction.specialized_in(a_type)
  28. if i = instruction then
  29. Result := Current
  30. else
  31. create Result.make(keys, i, position)
  32. end
  33. end
  34. feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
  35. mark_reachable_code (mark: INTEGER) is
  36. do
  37. instruction.mark_reachable_code(mark)
  38. end
  39. feature {}
  40. make (a_keys: like keys; a_instruction: like instruction; a_position: like position) is
  41. require
  42. a_keys /= Void
  43. a_instruction /= Void
  44. a_position /= Void
  45. do
  46. keys := a_keys
  47. instruction := a_instruction
  48. position := a_position
  49. ensure
  50. keys = a_keys
  51. instruction = a_instruction
  52. position = a_position
  53. end
  54. feature {ANY}
  55. accept (v: VISITOR) is
  56. local
  57. v0: LIBERTY_DEBUG_VISITOR
  58. do
  59. v0 ::= v
  60. v0.visit_liberty_debug(Current)
  61. end
  62. invariant
  63. keys /= Void
  64. instruction /= Void
  65. end