PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/semantics/code/expressions/liberty_old.e

http://github.com/tybor/Liberty
Specman e | 74 lines | 50 code | 10 blank | 14 comment | 1 complexity | 5962af0eab6ca20d3ce15974cabb270e 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--
15class LIBERTY_OLD
16
17inherit
18   LIBERTY_EXPRESSION
19
20create {LIBERTY_BUILDER_TOOLS, LIBERTY_OLD}
21   make
22
23feature {ANY}
24   expression: LIBERTY_EXPRESSION
25
26   result_type: LIBERTY_TYPE is
27      do
28         Result := expression.result_type
29      end
30
31   specialized_in (a_type: LIBERTY_ACTUAL_TYPE): like Current is
32      local
33         e: like expression
34      do
35         e := expression.specialized_in(a_type)
36         if e = expression then
37            Result := Current
38         else
39            create Result.make(e, position)
40         end
41      end
42
43feature {LIBERTY_REACHABLE, LIBERTY_REACHABLE_COLLECTION_MARKER}
44   mark_reachable_code (mark: INTEGER) is
45      do
46         expression.mark_reachable_code(mark)
47      end
48
49feature {}
50   make (a_expression: like expression; a_position: like position) is
51      require
52         a_expression /= Void
53         a_position /= Void
54      do
55         expression := a_expression
56         position := a_position
57      ensure
58         expression = a_expression
59         position = a_position
60      end
61
62feature {ANY}
63   accept (v: VISITOR) is
64      local
65         v0: LIBERTY_OLD_VISITOR
66      do
67         v0 ::= v
68         v0.visit_liberty_old(Current)
69      end
70
71invariant
72   expression /= Void
73
74end