/src/tools/interpreter/builtins/liberty_interpreter_external_type_pointer_builtins.e

http://github.com/tybor/Liberty · Specman e · 39 lines · 21 code · 4 blank · 14 comment · 0 complexity · 314ca7a7cf4c6a1bd5ba2ea803c82482 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_POINTER_BUILTINS
  16. insert
  17. LIBERTY_INTERPRETER_EXTERNAL_BUILTINS_CALLER
  18. creation {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
  19. make
  20. feature {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
  21. call (builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL): LIBERTY_INTERPRETER_OBJECT is
  22. local
  23. target: LIBERTY_INTERPRETER_OBJECT_NATIVE[POINTER]
  24. do
  25. last_call_failed := False
  26. inspect
  27. builtin_call.name
  28. when "is_not_null" then
  29. target ::= builtin_call.target
  30. Result := interpreter.new_boolean(target /= Void and then target.item.is_not_null, builtin_call.position)
  31. else
  32. last_call_failed := True
  33. end
  34. end
  35. end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPE_POINTER_BUILTINS