PageRenderTime 56ms CodeModel.GetById 47ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/src/tools/interpreter/builtins/liberty_interpreter_external_type_function_builtins.e

http://github.com/tybor/Liberty
Specman e | 44 lines | 26 code | 4 blank | 14 comment | 0 complexity | e5cdbeb47fd1a7045c9f66cc6f4ce9af 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_TYPE_FUNCTION_BUILTINS
16
17inherit
18   LIBERTY_INTERPRETER_EXTERNAL_TYPE_ROUTINE_BUILTINS
19      redefine call
20      end
21
22creation {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
23   make
24
25feature {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
26   call (builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL): LIBERTY_INTERPRETER_OBJECT is
27      local
28         target: LIBERTY_INTERPRETER_AGENT
29      do
30         builtin_call.evaluate_parameters
31         inspect
32            builtin_call.name
33         when "item" then
34            target ::= builtin_call.target
35            Result := target.item_agent(builtin_call.parameters, builtin_call.position)
36         when "call" then
37            target ::= builtin_call.target
38            target.call_agent(builtin_call.parameters, builtin_call.position)
39         else
40            last_call_failed := True
41         end
42      end
43
44end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPE_FUNCTION_BUILTINS