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

http://github.com/tybor/Liberty · Specman e · 61 lines · 35 code · 8 blank · 18 comment · 0 complexity · ecf11b58c33363b83f641358f9292146 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_JUMP
  16. --
  17. -- Some conditional jump
  18. --
  19. inherit
  20. LIBERTY_ASM_INSTRUCTION
  21. redefine
  22. is_equal
  23. end
  24. create {ANY}
  25. make, set_target
  26. feature {ANY}
  27. target: LIBERTY_ASM_INSTRUCTION
  28. -- the jump target
  29. is_equal (other: like Current): BOOLEAN is
  30. local
  31. eq: SAFE_EQUAL[LIBERTY_ASM_INSTRUCTION]
  32. do
  33. Result := eq.test(target, other.target)
  34. and then Precursor(other)
  35. end
  36. set_target (a_target: like target) is
  37. do
  38. target := a_target
  39. ensure
  40. target = a_target
  41. end
  42. accept (visitor: LIBERTY_ASM_VISITOR) is
  43. local
  44. v: LIBERTY_ASM_INSTRUCTION_VISITOR
  45. do
  46. v ::= visitor
  47. v.visit_jump(Current)
  48. end
  49. feature {}
  50. make is
  51. do
  52. end
  53. end -- class LIBERTY_ASM_JUMP