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