/src/tools/compiler/asm/data/liberty_asm_system.e

http://github.com/tybor/Liberty · Specman e · 56 lines · 35 code · 7 blank · 14 comment · 0 complexity · 752c71c696edea1143328b7c03d1770d 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_ASM_SYSTEM
  16. insert
  17. ANY
  18. redefine
  19. is_equal
  20. end
  21. create {ANY}
  22. make
  23. feature {ANY}
  24. types: COLLECTION[LIBERTY_ASM_TYPE]
  25. main: LIBERTY_ASM_METHOD
  26. is_equal (other: like Current): BOOLEAN is
  27. do
  28. Result := types.count = other.types.count
  29. and then types.for_all(agent other.types.has)
  30. and then main.is_equal(other.main)
  31. end
  32. feature {}
  33. make (a_types: like types; a_main: like main) is
  34. require
  35. a_types /= Void
  36. a_main /= Void
  37. a_types.fast_has(a_main.type)
  38. do
  39. types := a_types
  40. main := a_main
  41. ensure
  42. types = a_types
  43. main = a_main
  44. end
  45. invariant
  46. types /= Void
  47. main /= Void
  48. types.fast_has(main.type)
  49. end -- class LIBERTY_ASM_SYSTEM