PageRenderTime 17ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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--
15class LIBERTY_INTERPRETER_EXTERNAL_BUILTINS
16
17create {LIBERTY_INTERPRETER}
18   make
19
20feature {LIBERTY_INTERPRETER_FEATURE_CALL}
21   call (a_builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL) is
22      require
23         a_builtin_call /= Void
24      local
25         builtin: LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL
26      do
27         create builtin.make(interpreter, a_builtin_call)
28         builtin.call
29         if builtin.last_call_failed then
30            interpreter.fatal_error("Unknown built-in feature " + a_builtin_call.name + " in class " + a_builtin_call.target.type.full_name, a_builtin_call.position)
31         end
32      end
33
34feature {}
35   make (a_interpreter: like interpreter) is
36      require
37         a_interpreter /= Void
38      do
39         interpreter := a_interpreter
40      ensure
41         interpreter = a_interpreter
42      end
43
44   interpreter: LIBERTY_INTERPRETER
45
46end -- class LIBERTY_INTERPRETER_EXTERNAL_BUILTINS