PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/interpreter/liberty_interpreter_native_array.e

http://github.com/tybor/Liberty
Specman e | 121 lines | 86 code | 21 blank | 14 comment | 2 complexity | fca835eac975967a303c0df0d6eef34f 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_NATIVE_ARRAY
 16
 17inherit
 18   LIBERTY_INTERPRETER_OBJECT
 19      export {LIBERTY_INTERPRETER_NATIVE_ARRAY}
 20         interpreter
 21      undefine
 22         out_in_tagged_out_memory, copy
 23      end
 24
 25feature {ANY}
 26   type: LIBERTY_ACTUAL_TYPE
 27   item_type: LIBERTY_ACTUAL_TYPE
 28
 29   put (o: LIBERTY_INTERPRETER_OBJECT; index: INTEGER) is
 30      require
 31         valid_index(index)
 32      deferred
 33      end
 34
 35   valid_index (index: INTEGER): BOOLEAN is
 36      do
 37         Result := index.in_range(lower, upper)
 38      end
 39
 40   item (index: INTEGER): LIBERTY_INTERPRETER_OBJECT is
 41      require
 42         valid_index(index)
 43      deferred
 44      end
 45
 46   first: LIBERTY_INTERPRETER_OBJECT is
 47      deferred
 48      end
 49
 50   last: LIBERTY_INTERPRETER_OBJECT is
 51      deferred
 52      end
 53
 54   lower: INTEGER is
 55      deferred
 56      end
 57
 58   upper: INTEGER is
 59      deferred
 60      end
 61
 62   count: INTEGER is
 63      deferred
 64      end
 65
 66   is_empty: BOOLEAN is
 67      deferred
 68      end
 69
 70   converted_to (target_type: LIBERTY_ACTUAL_TYPE): LIBERTY_INTERPRETER_OBJECT is
 71      do
 72         not_yet_implemented
 73      end
 74
 75feature {LIBERTY_INTERPRETER_TO_EXTERNAL}
 76   to_external: POINTER is
 77      deferred
 78      end
 79
 80feature {LIBERTY_INTERPRETER_NATIVE_ARRAY_CREATOR}
 81   from_external (a_external: POINTER; a_capacity: INTEGER) is
 82      deferred
 83      end
 84
 85feature {LIBERTY_INTERPRETER_EXTERNAL_TYPE_NATIVE_ARRAY_BUILTINS}
 86   builtin_element_sizeof: INTEGER is
 87      deferred
 88      end
 89
 90   builtin_calloc (capacity: INTEGER; a_position: LIBERTY_POSITION): like Current is
 91      deferred
 92      end
 93
 94   builtin_item (index: INTEGER; a_position: LIBERTY_POSITION): LIBERTY_INTERPRETER_OBJECT is
 95      do
 96         if not valid_index(index) then
 97            interpreter.fatal_error("Invalid index: " + index.out, a_position)
 98         else
 99            Result := item(index)
100         end
101      end
102
103   builtin_put (element: LIBERTY_INTERPRETER_OBJECT; index: INTEGER; a_position: LIBERTY_POSITION) is
104      do
105         if not valid_index(index) then
106            interpreter.fatal_error("Invalid index: " + index.out, a_position)
107         else
108            put(element, index)
109         end
110      end
111
112   builtin_slice_copy (at: INTEGER; src: like Current; src_min, src_max: INTEGER) is
113      deferred
114      end
115
116feature {LIBERTY_INTERPRETER_OBJECT_PRINTER, LIBERTY_INTERPRETER_FEATURE_CALL}
117   show_stack (o: OUTPUT_STREAM; indent: INTEGER) is
118      deferred
119      end
120
121end -- class LIBERTY_INTERPRETER_NATIVE_ARRAY