/src/tools/semantics/types/type_resolver/liberty_type_resolver_in_universe.e

http://github.com/tybor/Liberty · Specman e · 72 lines · 46 code · 12 blank · 14 comment · 1 complexity · 79923158462bd5cf903b761bee631986 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_TYPE_RESOLVER_IN_UNIVERSE
  16. inherit
  17. LIBERTY_TYPE_RESOLVER
  18. insert
  19. LIBERTY_ERROR_LEVELS
  20. undefine out_in_tagged_out_memory
  21. end
  22. creation {LIBERTY_UNIVERSE}
  23. make
  24. feature {ANY}
  25. out_in_tagged_out_memory is
  26. do
  27. tagged_out_memory.append(once "resolver in universe")
  28. end
  29. specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
  30. do
  31. Result := Current
  32. end
  33. feature {}
  34. universe: LIBERTY_UNIVERSE
  35. lookup_type (type_definition: LIBERTY_AST_TYPE_DEFINITION): LIBERTY_TYPE is
  36. do
  37. if not type_definition.is_anchor then
  38. Result := universe.get_type_from_type_definition(type_definition, Void)
  39. end
  40. end
  41. lookup_export_type (type_definition: LIBERTY_AST_TYPE_DEFINITION): LIBERTY_TYPE is
  42. do
  43. check Result = Void end
  44. end
  45. lookup_position (type_definition: LIBERTY_AST_TYPE_DEFINITION): LIBERTY_POSITION is
  46. do
  47. check Result = Void end
  48. end
  49. make (a_universe: like universe) is
  50. require
  51. a_universe /= Void
  52. do
  53. universe := a_universe
  54. ensure
  55. universe = a_universe
  56. end
  57. invariant
  58. parent = Void
  59. universe /= Void
  60. end -- class LIBERTY_TYPE_RESOLVER_IN_UNIVERSE