/src/tools/semantics/code/expressions/liberty_string_manifest.e

http://github.com/tybor/Liberty · Specman e · 75 lines · 48 code · 9 blank · 18 comment · 0 complexity · 4763f57b0690e37e5612e047ebbe2146 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_STRING_MANIFEST
  16. inherit
  17. LIBERTY_TYPED_MANIFEST[STRING]
  18. rename
  19. make as typed_make
  20. redefine
  21. mark_reachable_code
  22. end
  23. create {LIBERTY_BUILDER_TOOLS}
  24. make
  25. feature {ANY}
  26. is_once: BOOLEAN
  27. feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
  28. mark_reachable_code (mark: INTEGER) is
  29. do
  30. Precursor(mark)
  31. storage_type.mark_reachable_code(mark)
  32. end
  33. feature {}
  34. make (a_type: like result_type; a_storage_type: like storage_type; a_manifest: like manifest; a_once: like is_once; a_position: like position) is
  35. require
  36. a_type /= Void
  37. -- a_type is STRING
  38. a_storage_type /= Void
  39. -- a_storage_type is NATIVE_ARRAY[CHARACTER]
  40. a_position /= Void
  41. do
  42. typed_make(a_type, a_manifest, a_position)
  43. storage_type := a_storage_type
  44. is_once := a_once
  45. ensure
  46. result_type = a_type
  47. storage_type = a_storage_type
  48. manifest = a_manifest
  49. is_once = a_once
  50. position = a_position
  51. end
  52. storage_type: LIBERTY_ACTUAL_TYPE
  53. feature {ANY}
  54. accept (v: VISITOR) is
  55. local
  56. v0: LIBERTY_STRING_MANIFEST_VISITOR
  57. do
  58. v0 ::= v
  59. v0.visit_liberty_string_manifest(Current)
  60. end
  61. invariant
  62. result_type /= Void
  63. -- result_type is STRING
  64. storage_type /= Void
  65. -- storage_type is NATIVE_ARRAY[CHARACTER]
  66. end