/src/tools/interpreter/builtins/liberty_interpreter_external_type_integer_32_builtins.e

http://github.com/tybor/Liberty · Specman e · 43 lines · 23 code · 6 blank · 14 comment · 0 complexity · 7b3b6bc445a13e9e94f3ed6b9a9f784b 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_INTEGER_32_BUILTINS
  16. inherit
  17. LIBERTY_INTERPRETER_EXTERNAL_TYPE_INTEGERS_BUILTINS[INTEGER_32]
  18. creation {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
  19. make
  20. feature {}
  21. new_integer (value: INTEGER_32): LIBERTY_INTERPRETER_OBJECT_NATIVE[INTEGER_64] is
  22. do
  23. Result := interpreter.new_integer_32(value, builtin_call.position)
  24. end
  25. left, target: INTEGER_32 is
  26. do
  27. Result := int64_target.to_integer_32
  28. end
  29. right: INTEGER_32 is
  30. local
  31. obj: LIBERTY_INTERPRETER_OBJECT_NATIVE[INTEGER_64]
  32. do
  33. builtin_call.evaluate_parameters
  34. obj ::= builtin_call.parameters.first
  35. Result := obj.item.to_integer_32
  36. end
  37. end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPE_INTEGER_32_BUILTINS