PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 1ms

/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--
15deferred class LIBERTY_INTERPRETER_EXTERNAL_TYPED_BUILTINS[E_]
16
17inherit
18   LIBERTY_FEATURE_ACCELERATOR
19
20insert
21   LIBERTY_INTERPRETER_EXTERNAL_BUILTINS_CALLER
22
23feature {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
24   call (a_builtin_call: like builtin_call): LIBERTY_INTERPRETER_OBJECT is
25      do
26         last_call_failed := False
27         builtin_call := a_builtin_call
28         a_builtin_call.accelerate_call(Current)
29         Result := returned
30      end
31
32feature {}
33   builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL
34   returned: LIBERTY_INTERPRETER_OBJECT
35
36   left, target: E_ is
37      local
38         obj: LIBERTY_INTERPRETER_OBJECT_NATIVE[E_]
39      do
40         obj ::= builtin_call.target
41         Result := obj.item
42      end
43
44   right: E_ is
45      local
46         obj: LIBERTY_INTERPRETER_OBJECT_NATIVE[E_]
47      do
48         builtin_call.evaluate_parameters
49         obj ::= builtin_call.parameters.first
50         Result := obj.item
51      end
52
53end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPED_BUILTINS