/src/tools/semantics/types/impl/liberty_unknown_type.e

http://github.com/tybor/Liberty · Specman e · 80 lines · 47 code · 13 blank · 20 comment · 0 complexity · cf9a7d39ef17b66a8e0819beaae5302c 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_UNKNOWN_TYPE
  16. --
  17. -- An unknown type, i.e. we know nothing about it except its name (happens when the corresponding source
  18. -- cannot be found).
  19. --
  20. -- Should be used only for some unresolved export clients.
  21. --
  22. inherit
  23. LIBERTY_TYPE
  24. undefine is_equal
  25. end
  26. insert
  27. SINGLETON
  28. redefine out_in_tagged_out_memory
  29. end
  30. creation {LIBERTY_TYPE_RESOLVER}
  31. make
  32. feature {ANY}
  33. known_type: LIBERTY_KNOWN_TYPE is
  34. do
  35. check Result = Void end
  36. end
  37. is_known: BOOLEAN is False
  38. full_name: FIXED_STRING
  39. hash_code: INTEGER is 19741215
  40. out_in_tagged_out_memory is
  41. do
  42. tagged_out_memory.append(once "{unknown type ")
  43. tagged_out_memory.append(full_name)
  44. tagged_out_memory.extend('}')
  45. end
  46. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  47. do
  48. Result := Current
  49. end
  50. feature {LIBERTY_KNOWN_TYPE}
  51. full_name_in (buffer: STRING) is
  52. do
  53. buffer.append(full_name)
  54. end
  55. feature {}
  56. make (a_full_name: like full_name) is
  57. require
  58. a_full_name /= Void
  59. do
  60. full_name := a_full_name
  61. ensure
  62. full_name = a_full_name
  63. end
  64. invariant
  65. full_name /= Void
  66. not is_reachable
  67. end -- class LIBERTY_UNKNOWN_TYPE