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

/src/tools/compiler/asm/marshall/liberty_asm_marshaller.e

http://github.com/tybor/Liberty
Specman e | 43 lines | 26 code | 3 blank | 14 comment | 1 complexity | e66eedb8482367955e888fa12b61e354 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--
15expanded class LIBERTY_ASM_MARSHALLER
16
17feature {ANY}
18   read (a_stream: INPUT_STREAM): TUPLE[LIBERTY_ASM_SYSTEM, FIXED_STRING] is
19      require
20         a_stream /= Void
21      local
22         reader: LIBERTY_ASM_READER
23         no_error: FIXED_STRING
24      do
25         create reader.read(a_stream)
26         if reader.error /= Void then
27            Result := [reader.system, reader.error.intern]
28         else
29            Result := [reader.system, no_error]
30         end
31      end
32
33   write (a_stream: OUTPUT_STREAM; a_system: LIBERTY_ASM_SYSTEM) is
34      require
35         a_stream /= Void
36         a_system /= Void
37      local
38         writer: LIBERTY_ASM_WRITER
39      do
40         create writer.write(a_stream, a_system)
41      end
42
43end -- class LIBERTY_ASM_MARSHALLER