/src/tools/compiler/asm/instruction/liberty_asm_new.e

http://github.com/tybor/Liberty · Specman e · 59 lines · 34 code · 8 blank · 17 comment · 0 complexity · f5ebd5eeb72fbf81300ad45ffd736338 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_NEW
  16. --
  17. -- New object creation
  18. --
  19. inherit
  20. LIBERTY_ASM_INSTRUCTION
  21. redefine
  22. is_equal
  23. end
  24. create {ANY}
  25. make
  26. feature {ANY}
  27. type: LIBERTY_ASM_TYPE
  28. is_equal (other: like Current): BOOLEAN is
  29. do
  30. Result := type.is_equal(other.type)
  31. and then Precursor(other)
  32. end
  33. accept (visitor: LIBERTY_ASM_VISITOR) is
  34. local
  35. v: LIBERTY_ASM_INSTRUCTION_VISITOR
  36. do
  37. v ::= visitor
  38. v.visit_new(Current)
  39. end
  40. feature {}
  41. make (a_type: like type) is
  42. require
  43. a_type /= Void
  44. do
  45. type := a_type
  46. ensure
  47. type = a_type
  48. end
  49. invariant
  50. type /= Void
  51. end -- class LIBERTY_ASM_NEW