/src/tools/interpreter/builtins/liberty_interpreter_external_type_real_64_builtins.e

http://github.com/tybor/Liberty · Specman e · 57 lines · 36 code · 7 blank · 14 comment · 0 complexity · beca12b6cd818e931ca168fbc2a49f55 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_INTERPRETER_EXTERNAL_TYPE_REAL_64_BUILTINS
  16. inherit
  17. LIBERTY_INTERPRETER_EXTERNAL_TYPE_REALS_BUILTINS[REAL_64]
  18. creation {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
  19. make
  20. feature {}
  21. new_real (value: REAL_64): LIBERTY_INTERPRETER_OBJECT_NATIVE[REAL_128] is
  22. do
  23. Result := interpreter.new_real_64(value, builtin_call.position)
  24. end
  25. left, target: REAL_64 is
  26. local
  27. obj: LIBERTY_INTERPRETER_OBJECT_NATIVE[REAL_128]
  28. do
  29. obj ::= builtin_call.target
  30. Result := obj.item.force_to_real_64
  31. end
  32. right: REAL_64 is
  33. local
  34. obj: LIBERTY_INTERPRETER_OBJECT_NATIVE[REAL_128]
  35. do
  36. builtin_call.evaluate_parameters
  37. obj ::= builtin_call.parameters.first
  38. Result := obj.item.force_to_real_64
  39. end
  40. call_specific (f: LIBERTY_FEATURE) is
  41. do
  42. inspect
  43. builtin_call.name.out
  44. when "force_to_real_32" then
  45. returned := interpreter.new_real_32(target.force_to_real_32, builtin_call.position)
  46. else
  47. last_call_failed := True
  48. end
  49. end
  50. end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPE_REAL_64_BUILTINS