/src/tools/interpreter/builtins/liberty_interpreter_external_type_platform_builtins.e

http://github.com/tybor/Liberty · Specman e · 68 lines · 49 code · 5 blank · 14 comment · 0 complexity · 062e125d9681b9edafec0f1e83a54b41 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_PLATFORM_BUILTINS
  16. insert
  17. LIBERTY_INTERPRETER_EXTERNAL_BUILTINS_CALLER
  18. PLATFORM
  19. creation {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
  20. make
  21. feature {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
  22. call (builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL): LIBERTY_INTERPRETER_OBJECT is
  23. do
  24. last_call_failed := False
  25. inspect
  26. builtin_call.name
  27. when "Minimum_character_code" then
  28. Result := interpreter.new_integer_16(Minimum_character_code, builtin_call.position)
  29. when "Maximum_character_code" then
  30. Result := interpreter.new_integer_16(Maximum_character_code, builtin_call.position)
  31. when "Minimum_real" then
  32. Result := interpreter.new_real_64(Minimum_real, builtin_call.position)
  33. when "Maximum_real" then
  34. Result := interpreter.new_real_64(Maximum_real, builtin_call.position)
  35. when "Minimum_real_64" then
  36. Result := interpreter.new_real_64(Minimum_real_64, builtin_call.position)
  37. when "Maximum_real_64" then
  38. Result := interpreter.new_real_64(Maximum_real_64, builtin_call.position)
  39. when "Minimum_real_80" then
  40. not_yet_implemented
  41. when "Maximum_real_80" then
  42. not_yet_implemented
  43. when "Boolean_bits" then
  44. Result := interpreter.new_integer(Boolean_bits, builtin_call.position)
  45. when "Character_bits" then
  46. Result := interpreter.new_integer(Character_bits, builtin_call.position)
  47. when "Integer_bits" then
  48. Result := interpreter.new_integer(Integer_bits, builtin_call.position)
  49. when "Pointer_bits" then
  50. Result := interpreter.new_integer(Pointer_bits, builtin_call.position)
  51. else
  52. last_call_failed := True
  53. end
  54. end
  55. feature {}
  56. do_die_with_code (status: LIBERTY_INTERPRETER_OBJECT) is
  57. local
  58. sts: LIBERTY_INTERPRETER_OBJECT_NATIVE[INTEGER_64]
  59. do
  60. sts ::= status
  61. die_with_code(sts.item.to_integer_32)
  62. end
  63. end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPE_PLATFORM_BUILTINS