PageRenderTime 13ms CodeModel.GetById 11ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 1ms

/src/tools/compiler/asm/instruction/liberty_asm_call_native.e

http://github.com/tybor/Liberty
Specman e | 69 lines | 44 code | 8 blank | 17 comment | 1 complexity | 6f7f90dc382cbf5d1419dc84f9bc8746 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_ASM_CALL_NATIVE
16   --
17   -- Call a native (low-level) function
18   --
19
20inherit
21   LIBERTY_ASM_INSTRUCTION
22      redefine
23         is_equal
24      end
25
26create {ANY}
27   make
28
29feature {ANY}
30   symbol: FIXED_STRING
31   arguments: COLLECTION[LIBERTY_ASM_NATIVE_VALUE]
32   return: LIBERTY_ASM_NATIVE_VALUE
33
34   is_equal (other: like Current): BOOLEAN is
35      do
36         Result := symbol = other.symbol
37            and then arguments.is_equal(other.arguments)
38            and then ((return = Void) or else (return /= Void and then return.is_equal(other.return)))
39            and then Precursor(other)
40      end
41
42   accept (visitor: LIBERTY_ASM_VISITOR) is
43      local
44         v: LIBERTY_ASM_INSTRUCTION_VISITOR
45      do
46         v ::= visitor
47         v.visit_call_native(Current)
48      end
49
50feature {}
51   make (a_symbol: like symbol; a_arguments: like arguments; a_return: like return) is
52      require
53         a_symbol /= Void
54         a_arguments /= Void
55      do
56         symbol := a_symbol
57         arguments := a_arguments
58         return := a_return
59      ensure
60         symbol = a_symbol
61         arguments = a_arguments
62         return = a_return
63      end
64
65invariant
66   symbol /= Void
67   arguments /= Void
68
69end -- class LIBERTY_ASM_CALL_NATIVE