PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/interpreter/builtins/liberty_interpreter_external_type_character_builtins.e

http://github.com/tybor/Liberty
Specman e | 41 lines | 23 code | 4 blank | 14 comment | 0 complexity | d79fcdb9c454d8c81750dfdc068b5162 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_CHARACTER_BUILTINS
16
17insert
18   LIBERTY_INTERPRETER_EXTERNAL_BUILTINS_CALLER
19
20creation {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
21   make
22
23feature {LIBERTY_INTERPRETER_EXTERNAL_BUILTIN_CALL}
24   call (builtin_call: LIBERTY_INTERPRETER_FEATURE_CALL): LIBERTY_INTERPRETER_OBJECT is
25      local
26         target: LIBERTY_INTERPRETER_OBJECT_NATIVE[CHARACTER]
27      do
28         last_call_failed := False
29         target ::= builtin_call.target
30         inspect
31            builtin_call.name
32         when "code" then
33            Result := interpreter.new_integer_16(target.item.code, builtin_call.position)
34         when "to_integer_8" then
35            Result := interpreter.new_integer_8(target.item.to_integer_8, builtin_call.position)
36         else
37            last_call_failed := True
38         end
39      end
40
41end -- class LIBERTY_INTERPRETER_EXTERNAL_TYPE_CHARACTER_BUILTINS