PageRenderTime 12ms CodeModel.GetById 10ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 1ms

/src/tools/interpreter/builtins/liberty_interpreter_external_type_platform_builtins.e

http://github.com/tybor/Liberty
Specman e | 68 lines | 49 code | 5 blank | 14 comment | 0 complexity | 062e125d9681b9edafec0f1e83a54b41 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_PLATFORM_BUILTINS
16
17insert
18   LIBERTY_INTERPRETER_EXTERNAL_BUILTINS_CALLER
19   PLATFORM
20
21creation {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
22   make
23
24feature {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
25   call (builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL): LIBERTY_INTERPRETER_OBJECT is
26      do
27         last_call_failed := False
28         inspect
29            builtin_call.name
30         when "Minimum_character_code" then
31            Result := interpreter.new_integer_16(Minimum_character_code, builtin_call.position)
32         when "Maximum_character_code" then
33            Result := interpreter.new_integer_16(Maximum_character_code, builtin_call.position)
34         when "Minimum_real" then
35            Result := interpreter.new_real_64(Minimum_real, builtin_call.position)
36         when "Maximum_real" then
37            Result := interpreter.new_real_64(Maximum_real, builtin_call.position)
38         when "Minimum_real_64" then
39            Result := interpreter.new_real_64(Minimum_real_64, builtin_call.position)
40         when "Maximum_real_64" then
41            Result := interpreter.new_real_64(Maximum_real_64, builtin_call.position)
42         when "Minimum_real_80" then
43            not_yet_implemented
44         when "Maximum_real_80" then
45            not_yet_implemented
46         when "Boolean_bits" then
47            Result := interpreter.new_integer(Boolean_bits, builtin_call.position)
48         when "Character_bits" then
49            Result := interpreter.new_integer(Character_bits, builtin_call.position)
50         when "Integer_bits" then
51            Result := interpreter.new_integer(Integer_bits, builtin_call.position)
52         when "Pointer_bits" then
53            Result := interpreter.new_integer(Pointer_bits, builtin_call.position)
54         else
55            last_call_failed := True
56         end
57      end
58
59feature {}
60   do_die_with_code (status: LIBERTY_INTERPRETER_OBJECT) is
61      local
62         sts: LIBERTY_INTERPRETER_OBJECT_NATIVE[INTEGER_64]
63      do
64         sts ::= status
65         die_with_code(sts.item.to_integer_32)
66      end
67
68end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPE_PLATFORM_BUILTINS