/src/tools/compiler/asm/liberty_asm_instruction_proxy.e

http://github.com/tybor/Liberty · Specman e · 68 lines · 43 code · 11 blank · 14 comment · 0 complexity · d3489cad6ea07d9331787ded1b70157b 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_INSTRUCTION_PROXY
  16. inherit
  17. LIBERTY_ASM_INSTRUCTION
  18. redefine
  19. is_equal
  20. end
  21. create {LIBERTY_ASM_READER}
  22. new, invoke, jump
  23. feature {ANY}
  24. is_equal (other: like Current): BOOLEAN is
  25. do
  26. equal_visitor.start(Current)
  27. equal_visitor.confirm(other)
  28. Result := equal_visitor.confirmed and then Precursor(other)
  29. end
  30. accept (visitor: LIBERTY_ASM_VISITOR) is
  31. local
  32. v: LIBERTY_ASM_PROXY_VISITOR
  33. do
  34. v ::= visitor
  35. accepter.call([v])
  36. end
  37. feature {}
  38. accepter: PROCEDURE[TUPLE[LIBERTY_ASM_PROXY_VISITOR]]
  39. new (type_id: INTEGER) is
  40. do
  41. accepter := agent {LIBERTY_ASM_PROXY_VISITOR}.visit_proxy_new(Current, type_id)
  42. end
  43. invoke (method_id, type_id: INTEGER) is
  44. do
  45. accepter := agent {LIBERTY_ASM_PROXY_VISITOR}.visit_proxy_invoke(Current, method_id, type_id)
  46. end
  47. jump (a_position: INTEGER) is
  48. do
  49. accepter := agent {LIBERTY_ASM_PROXY_VISITOR}.visit_proxy_jump(Current, a_position)
  50. end
  51. equal_visitor: LIBERTY_ASM_INSTRUCTION_PROXY_EQUAL_VISITOR is
  52. once
  53. create Result.make
  54. end
  55. invariant
  56. accepter /= Void
  57. end -- class LIBERTY_ASM_INSTRUCTION_PROXY