PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

/tutorial/cecil/array_of_references/example.e

http://github.com/tybor/Liberty
Specman e | 33 lines | 20 code | 5 blank | 8 comment | 0 complexity | 5bb15a55244ce613e0a9dd0d2e1b8003 MD5 | raw file
 1class EXAMPLE
 2   --
 3   -- The Eiffel program is running first, then call the C program which is in charge to print the
 4   -- contents of `animals' using `lower'/`upper'/`item' of ARRAY[ANIMAL].
 5   --
 6   -- To compile this example, use command:
 7   --
 8   --  se c -cecil cecil.se example c_prog.c
 9   --
10
11create {ANY}
12   make
13
14feature {ANY}
15   make
16      local
17         cat: CAT; dog: DOG
18      do
19         create cat
20         create dog
21         animals := {ARRAY[ANIMAL] 1, << cat, dog, cat >> }
22         call_c_prog(animals)
23      end
24
25feature {}
26   animals: ARRAY[ANIMAL]
27
28   call_c_prog (a: like animals)
29      external "C"
30      alias "c_prog"
31      end
32
33end -- class EXAMPLE