/tutorial/cecil/eiffel_root/example.e

http://github.com/tybor/Liberty · Specman e · 34 lines · 19 code · 5 blank · 10 comment · 0 complexity · be8dce20385e72a17d0135c8963a1b21 MD5 · raw file

  1. class EXAMPLE
  2. --
  3. -- The Eiffel program is running first, then calls the C program which is in charge of calling the
  4. -- Eiffel feature `show_values'.
  5. -- Note that the Eiffel root object is not passed to the C world. Thus, the C code uses
  6. -- predefined `eiffel_root_object' to access the very first created Eiffel object.
  7. --
  8. -- To compile this example, use command:
  9. --
  10. -- se c -cecil cecil.se example c_prog.c
  11. --
  12. create {ANY}
  13. make
  14. feature {ANY}
  15. make
  16. do
  17. do_it
  18. call_c_prog
  19. end
  20. do_it
  21. do
  22. io.put_string("Hi from Eiffel world.%N")
  23. end
  24. feature {}
  25. call_c_prog
  26. external "C"
  27. alias "c_prog"
  28. end
  29. end -- class EXAMPLE