/src/tools/semantics/types/delayed_resolver/liberty_delayed_open_argument.e

http://github.com/tybor/Liberty · Specman e · 93 lines · 63 code · 16 blank · 14 comment · 1 complexity · 19da7d98f13380b3c4503cc55708e0a2 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_DELAYED_OPEN_ARGUMENT
  16. inherit
  17. LIBERTY_DELAYED_RESOLVER
  18. creation {LIBERTY_AGENT}
  19. make
  20. feature {ANY}
  21. out_in_tagged_out_memory is
  22. do
  23. if can_resolve then
  24. resolved.out_in_tagged_out_memory
  25. else
  26. tagged_out_memory.extend('?')
  27. end
  28. end
  29. hash_code: INTEGER is
  30. do
  31. Result := full_name_memory.hash_code
  32. end
  33. is_equal (other: like Current): BOOLEAN is
  34. do
  35. Result := other = Current
  36. end
  37. feature {LIBERTY_DELAYED_TYPE}
  38. can_resolve: BOOLEAN is
  39. do
  40. Result := of_agent.can_compute_open_argument_type(Current, index)
  41. end
  42. resolved: LIBERTY_KNOWN_TYPE is
  43. do
  44. Result := of_agent.open_argument_type(Current, index)
  45. end
  46. full_name: FIXED_STRING is
  47. do
  48. Result := full_name_memory
  49. end
  50. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  51. do
  52. Result := Current
  53. end
  54. feature {}
  55. make (a_agent: like of_agent; a_index: like index) is
  56. require
  57. a_agent /= Void
  58. do
  59. of_agent := a_agent
  60. index := a_index
  61. lock_tagged_out
  62. tagged_out_memory.copy(once "open argument #")
  63. a_index.append_in(tagged_out_memory)
  64. tagged_out_memory.append(once " of ")
  65. a_agent.out_in_tagged_out_memory
  66. unlock_tagged_out
  67. full_name_memory := tagged_out_memory.intern
  68. ensure
  69. of_agent = a_agent
  70. index = a_index
  71. end
  72. of_agent: LIBERTY_AGENT
  73. index: INTEGER
  74. full_name_memory: FIXED_STRING
  75. invariant
  76. of_agent /= Void
  77. end -- class LIBERTY_DELAYED_OPEN_ARGUMENT