/src/tools/interpreter/builtins/liberty_interpreter_external_typed_builtins.e

http://github.com/tybor/Liberty · Specman e · 53 lines · 32 code · 7 blank · 14 comment · 0 complexity · 665484c340c3afee9df8741a8bc560e2 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. deferred class LIBERTY_INTERPRETER_EXTERNAL_TYPED_BUILTINS[E_]
  16. inherit
  17. LIBERTY_FEATURE_ACCELERATOR
  18. insert
  19. LIBERTY_INTERPRETER_EXTERNAL_BUILTINS_CALLER
  20. feature {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
  21. call (a_builtin_call: like builtin_call): LIBERTY_INTERPRETER_OBJECT is
  22. do
  23. last_call_failed := False
  24. builtin_call := a_builtin_call
  25. a_builtin_call.accelerate_call(Current)
  26. Result := returned
  27. end
  28. feature {}
  29. builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL
  30. returned: LIBERTY_INTERPRETER_OBJECT
  31. left, target: E_ is
  32. local
  33. obj: LIBERTY_INTERPRETER_OBJECT_NATIVE[E_]
  34. do
  35. obj ::= builtin_call.target
  36. Result := obj.item
  37. end
  38. right: E_ is
  39. local
  40. obj: LIBERTY_INTERPRETER_OBJECT_NATIVE[E_]
  41. do
  42. builtin_call.evaluate_parameters
  43. obj ::= builtin_call.parameters.first
  44. Result := obj.item
  45. end
  46. end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPED_BUILTINS