PageRenderTime 15ms CodeModel.GetById 8ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/test/language/unclassified/uw/aux_uw01animal_node.e

http://github.com/tybor/Liberty
Specman e | 85 lines | 52 code | 9 blank | 24 comment | 0 complexity | d30d3de705dd0cb3f4bd309baad07964 MD5 | raw file
 1note
 2   description:
 3      "nodes representing animals"
 4   status:
 5      "See notice at end of class"
 6   author:
 7      "Ulrich Windl <Ulrich.Windl@rz.uni-regensburg.de>"
 8   version:
 9      "$Revision$"
10   last_modification:
11      "$Date$"
12class AUX_UW01ANIMAL_NODE
13
14inherit
15   AUX_UW01YES_NO_NODE
16      rename make_full as make_full_yes_no,
17         make_simple as make_simple_yes_no,
18         description as name
19      redefine yes_action, no_action
20      end
21
22create {ANY}
23   make_simple, make_full
24
25feature {ANY}
26   make_simple (nam: STRING)
27         -- set up node with name `nam'
28      require
29         good_name: nam /= Void and then nam.count > 0
30      do
31         make_simple_yes_no(nam)
32      end
33
34   make_full (y, n, p: AUX_UW01YES_NO_NODE; nam: STRING)
35         -- set up node with name `nam', yes link `y',
36         -- no link `n', and parent `p'
37      require
38         good_name: nam /= Void and then nam.count > 0
39      do
40         make_full_yes_no(y, n, p, nam)
41      end
42
43   execute
44         -- perform action
45      do
46         extra_io.print_multi({ARRAY[STRING] 1, << language.s4, name, language.s5 >> })
47      end
48
49   yes_action
50         -- the animal has been guessed correctly
51      do
52         io.put_string(language.s2)
53      end
54
55   no_action
56         -- the animal is unknown
57      do
58         io.put_string(language.s3)
59      end
60
61   read_answer
62         -- ask question about animal
63      do
64         extra_io.read_yes_no(language.s6)
65         last_answer := extra_io.last_boolean
66      end
67
68end -- class AUX_UW01ANIMAL_NODE
69-- Copyright (C) 1998-2017: by Ulrich Windl
70-- Copyright (C) 1998-2017: by Klinikum der Universit´┐Żt Regensburg,
71--      D-93042 Regensburg
72--
73--  This program is free software; you can redistribute it and/or modify
74--  it under the terms of the GNU General Public License as published by
75--  the Free Software Foundation; either version 2 of the License, or
76--  (at your option) any later version.
77--
78--  This program is distributed in the hope that it will be useful,
79--  but WITHOUT ANY WARRANTY; without even the implied warranty of
80--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
81--  GNU General Public License for more details.
82--
83--  You should have received a copy of the GNU General Public License
84--  along with this program; if not, write to the Free Software
85--  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA