PageRenderTime 22ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/src/tools/semantics/code/features/liberty_feature_attribute.e

http://github.com/tybor/Liberty
Specman e | 91 lines | 63 code | 14 blank | 14 comment | 1 complexity | a1a71e03c88f92c0a975afe172b7ca31 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_FEATURE_ATTRIBUTE
16
17inherit
18   LIBERTY_FEATURE
19      rename
20         make as make_late_binding
21      end
22
23create {LIBERTY_BUILDER_TOOLS}
24   make
25
26feature {ANY}
27   accept (v: VISITOR) is
28      local
29         v0: LIBERTY_FEATURE_ATTRIBUTE_VISITOR
30      do
31         v0 ::= v
32         v0.visit_liberty_feature_attribute(Current)
33      end
34
35feature {}
36   do_join (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
37      do
38         Result := a_feature.joined_attribute(a_type, Current, other_fd, current_fd)
39      end
40
41feature {LIBERTY_FEATURE}
42   joined_attribute (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_ATTRIBUTE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
43      do
44         current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
45      end
46
47   joined_constant (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_CONSTANT; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
48      do
49         current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
50      end
51
52   joined_deferred (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_DEFERRED; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
53      do
54         Result := Current
55      end
56
57   joined_do (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_DO; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
58      do
59         current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
60      end
61
62   joined_external (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_EXTERNAL; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
63      do
64         current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
65      end
66
67   joined_once (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_ONCE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
68      do
69         current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
70      end
71
72   joined_redefined (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_REDEFINED; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
73      do
74         if a_feature.definition_type = definition_type then
75            current_fd.fatal_join_error_concrete_redefined(a_type, other_fd)
76         end
77         Result := Current
78      end
79
80   joined_unique (a_type: LIBERTY_ACTUAL_TYPE; a_feature: LIBERTY_FEATURE_UNIQUE; current_fd, other_fd: LIBERTY_FEATURE_DEFINITION): LIBERTY_FEATURE is
81      do
82         current_fd.fatal_join_error_concrete_concrete(a_type, other_fd)
83      end
84
85feature {}
86   make (a_definition_type: like definition_type) is
87      do
88         make_late_binding(a_definition_type, Void)
89      end
90
91end