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

http://github.com/tybor/Liberty · Specman e · 69 lines · 44 code · 8 blank · 17 comment · 1 complexity · 6f7f90dc382cbf5d1419dc84f9bc8746 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_CALL_NATIVE
  16. --
  17. -- Call a native (low-level) function
  18. --
  19. inherit
  20. LIBERTY_ASM_INSTRUCTION
  21. redefine
  22. is_equal
  23. end
  24. create {ANY}
  25. make
  26. feature {ANY}
  27. symbol: FIXED_STRING
  28. arguments: COLLECTION[LIBERTY_ASM_NATIVE_VALUE]
  29. return: LIBERTY_ASM_NATIVE_VALUE
  30. is_equal (other: like Current): BOOLEAN is
  31. do
  32. Result := symbol = other.symbol
  33. and then arguments.is_equal(other.arguments)
  34. and then ((return = Void) or else (return /= Void and then return.is_equal(other.return)))
  35. and then Precursor(other)
  36. end
  37. accept (visitor: LIBERTY_ASM_VISITOR) is
  38. local
  39. v: LIBERTY_ASM_INSTRUCTION_VISITOR
  40. do
  41. v ::= visitor
  42. v.visit_call_native(Current)
  43. end
  44. feature {}
  45. make (a_symbol: like symbol; a_arguments: like arguments; a_return: like return) is
  46. require
  47. a_symbol /= Void
  48. a_arguments /= Void
  49. do
  50. symbol := a_symbol
  51. arguments := a_arguments
  52. return := a_return
  53. ensure
  54. symbol = a_symbol
  55. arguments = a_arguments
  56. return = a_return
  57. end
  58. invariant
  59. symbol /= Void
  60. arguments /= Void
  61. end -- class LIBERTY_ASM_CALL_NATIVE