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

http://github.com/tybor/Liberty · Specman e · 74 lines · 49 code · 10 blank · 15 comment · 0 complexity · c439fe0d4daf70cf60cb616da7654eea 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_VOID
  16. inherit
  17. LIBERTY_EXPRESSION
  18. create {LIBERTY_BUILDER_TOOLS}
  19. make
  20. feature {ANY}
  21. result_type: LIBERTY_TYPE
  22. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  23. do
  24. Result := Current
  25. end
  26. feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
  27. mark_reachable_code (mark: INTEGER) is
  28. do
  29. -- nothing
  30. end
  31. feature {LIBERTY_BUILDER_TOOLS}
  32. set_result_type (a_result_type: like result_type) is
  33. require
  34. a_result_type /= Void
  35. result_type = void_type
  36. do
  37. result_type := a_result_type
  38. ensure
  39. result_type = a_result_type
  40. end
  41. void_type: LIBERTY_VOID_TYPE is
  42. once
  43. create Result.make
  44. end
  45. feature {}
  46. make (a_position: like position) is
  47. require
  48. a_position /= Void
  49. do
  50. position := a_position
  51. result_type := void_type
  52. ensure
  53. position = a_position
  54. result_type = void_type
  55. end
  56. feature {ANY}
  57. accept (v: VISITOR) is
  58. local
  59. v0: LIBERTY_VOID_VISITOR
  60. do
  61. v0 ::= v
  62. v0.visit_liberty_void(Current)
  63. end
  64. end