/src/tools/semantics/code/entities/liberty_current.e

http://github.com/tybor/Liberty · Specman e · 74 lines · 48 code · 11 blank · 15 comment · 0 complexity · 161093ff8f0a22649102b6cdb4de8b87 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_CURRENT
  16. inherit
  17. LIBERTY_ENTITY
  18. redefine out_in_tagged_out_memory
  19. end
  20. create {LIBERTY_ACTUAL_TYPE}
  21. make
  22. feature {ANY}
  23. name: FIXED_STRING is
  24. once
  25. Result := "Current".intern
  26. end
  27. out_in_tagged_out_memory is
  28. do
  29. tagged_out_memory.append(name)
  30. end
  31. result_type: LIBERTY_ACTUAL_TYPE
  32. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  33. do
  34. Result := a_type.current_entity
  35. end
  36. feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
  37. mark_reachable_code (mark: INTEGER) is
  38. do
  39. -- nothing
  40. end
  41. feature {}
  42. make (type: like result_type; a_position: like position) is
  43. require
  44. type /= Void
  45. a_position /= Void
  46. do
  47. position := a_position
  48. result_type := type
  49. ensure
  50. position = a_position
  51. result_type = type
  52. end
  53. feature {ANY}
  54. accept (v: VISITOR) is
  55. local
  56. v0: LIBERTY_CURRENT_VISITOR
  57. do
  58. v0 ::= v
  59. v0.visit_liberty_current(Current)
  60. end
  61. invariant
  62. result_type /= Void
  63. end