diff options
| author | Harald Demel <tuempl@gmail.com> | 2011-06-29 01:11:44 +0200 |
|---|---|---|
| committer | Harald Demel <tuempl@gmail.com> | 2011-06-29 01:11:44 +0200 |
| commit | 0a061daf3cf101f408bb913d541bbda7ca0c52ca (patch) | |
| tree | 60892cc1f926784f7f26a88b874232fee9dd7475 /eiffel-fragen/nachbedingung | |
| parent | fa080cdb57f7fed327b0f967545c389f0d87d9ca (diff) | |
| download | foop-0a061daf3cf101f408bb913d541bbda7ca0c52ca.tar.gz foop-0a061daf3cf101f408bb913d541bbda7ca0c52ca.tar.bz2 foop-0a061daf3cf101f408bb913d541bbda7ca0c52ca.zip | |
frage 3
Diffstat (limited to 'eiffel-fragen/nachbedingung')
| -rw-r--r-- | eiffel-fragen/nachbedingung/application.e | 37 | ||||
| -rw-r--r-- | eiffel-fragen/nachbedingung/child.e | 25 | ||||
| -rw-r--r-- | eiffel-fragen/nachbedingung/counter.e | 30 | ||||
| -rw-r--r-- | eiffel-fragen/nachbedingung/nachbedingung.ecf | 21 |
4 files changed, 113 insertions, 0 deletions
diff --git a/eiffel-fragen/nachbedingung/application.e b/eiffel-fragen/nachbedingung/application.e new file mode 100644 index 0000000..6babd0c --- /dev/null +++ b/eiffel-fragen/nachbedingung/application.e | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | indexing | ||
| 2 | description : "nachbedingung application root class" | ||
| 3 | date : "$Date: 2008-12-29 15:41:59 -0800 (Mon, 29 Dec 2008) $" | ||
| 4 | revision : "$Revision: 76432 $" | ||
| 5 | |||
| 6 | class | ||
| 7 | APPLICATION | ||
| 8 | |||
| 9 | inherit | ||
| 10 | ARGUMENTS | ||
| 11 | |||
| 12 | create | ||
| 13 | make | ||
| 14 | |||
| 15 | feature {NONE} -- Implementation | ||
| 16 | ct: COUNTER | ||
| 17 | ch: CHILD | ||
| 18 | |||
| 19 | feature {NONE} -- Initialization | ||
| 20 | |||
| 21 | make | ||
| 22 | -- Run application. | ||
| 23 | do | ||
| 24 | print ("nachbedingung%N") | ||
| 25 | |||
| 26 | create ct | ||
| 27 | ct.set(3) | ||
| 28 | print ("ct " + ct.get().out + "%N") | ||
| 29 | |||
| 30 | create ch | ||
| 31 | ch.set(-2) | ||
| 32 | print ("ch " + ch.get().out + "%N") | ||
| 33 | |||
| 34 | print ("done%N") | ||
| 35 | end | ||
| 36 | |||
| 37 | end | ||
diff --git a/eiffel-fragen/nachbedingung/child.e b/eiffel-fragen/nachbedingung/child.e new file mode 100644 index 0000000..fcbe8c3 --- /dev/null +++ b/eiffel-fragen/nachbedingung/child.e | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | class | ||
| 2 | CHILD | ||
| 3 | inherit | ||
| 4 | COUNTER | ||
| 5 | redefine | ||
| 6 | set, | ||
| 7 | checkval | ||
| 8 | end | ||
| 9 | |||
| 10 | feature -- Element change | ||
| 11 | |||
| 12 | set (some_value: INTEGER) is | ||
| 13 | -- Set value of counter to some_value. | ||
| 14 | do | ||
| 15 | item := some_value - 10 | ||
| 16 | ensure then | ||
| 17 | checkval > 0 | ||
| 18 | end | ||
| 19 | |||
| 20 | checkval: INTEGER is | ||
| 21 | -- Get value of counter | ||
| 22 | do | ||
| 23 | Result := item + 20 | ||
| 24 | end | ||
| 25 | end | ||
diff --git a/eiffel-fragen/nachbedingung/counter.e b/eiffel-fragen/nachbedingung/counter.e new file mode 100644 index 0000000..db93ce7 --- /dev/null +++ b/eiffel-fragen/nachbedingung/counter.e | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | class | ||
| 2 | COUNTER | ||
| 3 | |||
| 4 | feature -- Access | ||
| 5 | |||
| 6 | item: INTEGER | ||
| 7 | -- Counter's value. | ||
| 8 | |||
| 9 | feature -- Element change | ||
| 10 | |||
| 11 | set (some_value: INTEGER) is | ||
| 12 | -- Set value of counter to some_value. | ||
| 13 | do | ||
| 14 | item := some_value | ||
| 15 | ensure | ||
| 16 | checkval > 0 | ||
| 17 | end | ||
| 18 | |||
| 19 | get: INTEGER is | ||
| 20 | -- Get value of counter | ||
| 21 | do | ||
| 22 | Result := item | ||
| 23 | end | ||
| 24 | |||
| 25 | checkval: INTEGER is | ||
| 26 | -- Get value of counter | ||
| 27 | do | ||
| 28 | Result := item | ||
| 29 | end | ||
| 30 | end | ||
diff --git a/eiffel-fragen/nachbedingung/nachbedingung.ecf b/eiffel-fragen/nachbedingung/nachbedingung.ecf new file mode 100644 index 0000000..d55b076 --- /dev/null +++ b/eiffel-fragen/nachbedingung/nachbedingung.ecf | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | <?xml version="1.0" encoding="ISO-8859-1"?> | ||
| 2 | <system xmlns="http://www.eiffel.com/developers/xml/configuration-1-5-0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eiffel.com/developers/xml/configuration-1-5-0 http://www.eiffel.com/developers/xml/configuration-1-5-0.xsd" name="nachbedingung" uuid="9ECF2BF2-5CA9-4126-B34E-978C47241CCD"> | ||
| 3 | <target name="nachbedingung"> | ||
| 4 | <root feature="make" class="APPLICATION"/> | ||
| 5 | <option warning="true"> | ||
| 6 | <assertions precondition="true" postcondition="true" check="true" invariant="true" loop="true" supplier_precondition="true"/> | ||
| 7 | </option> | ||
| 8 | <precompile name="base_pre" location="$ISE_PRECOMP/base.ecf"/> | ||
| 9 | <library name="base" location="$ISE_LIBRARY/library/base/base.ecf"/> | ||
| 10 | <cluster name="nachbedingung" location=".\" recursive="true"> | ||
| 11 | <file_rule> | ||
| 12 | <exclude>/EIFGENs$</exclude> | ||
| 13 | <exclude>/.svn$</exclude> | ||
| 14 | <exclude>/CVS$</exclude> | ||
| 15 | </file_rule> | ||
| 16 | </cluster> | ||
| 17 | </target> | ||
| 18 | <target name="nachbedingung_dotnet" extends="nachbedingung"> | ||
| 19 | <setting name="msil_generation" value="true"/> | ||
| 20 | </target> | ||
| 21 | </system> | ||
