/src/tools/interpreter/liberty_interpreter_external_builtins.e

http://github.com/tybor/Liberty · Specman e · 46 lines · 27 code · 5 blank · 14 comment · 1 complexity · 377c3ec7a9307b6f2eeface5ece0e610 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_BUILTINS
  16. create {LIBERTY_INTERPRETER}
  17. make
  18. feature {LIBERTY_INTERPRETER_FEATURE_CALL}
  19. call (a_builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL) is
  20. require
  21. a_builtin_call /= Void
  22. local
  23. builtin: LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL
  24. do
  25. create builtin.make(interpreter, a_builtin_call)
  26. builtin.call
  27. if builtin.last_call_failed then
  28. interpreter.fatal_error("Unknown built-in feature " + a_builtin_call.name + " in class " + a_builtin_call.target.type.full_name, a_builtin_call.position)
  29. end
  30. end
  31. feature {}
  32. make (a_interpreter: like interpreter) is
  33. require
  34. a_interpreter /= Void
  35. do
  36. interpreter := a_interpreter
  37. ensure
  38. interpreter = a_interpreter
  39. end
  40. interpreter: LIBERTY_INTERPRETER
  41. end -- class LIBERTY_INTERPRETER_EXTERNAL_BUILTINS