/[eiffelstudio]/branches/eth/eve/Src/framework/code_analysis/rule_checkers/ca_all_rules_checker.e
ViewVC logotype

Contents of /branches/eth/eve/Src/framework/code_analysis/rule_checkers/ca_all_rules_checker.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93176 - (show annotations)
Mon Oct 28 21:10:22 2013 UTC (6 years, 2 months ago) by zurfluhs
File size: 6311 byte(s)
Code Analysis: few minor changes
1 note
2 description: "Summary description for {CA_ALL_RULES_CHECKER}."
3 author: ""
4 date: "$Date$"
5 revision: "$Revision$"
6
7 class
8 CA_ALL_RULES_CHECKER
9
10 inherit
11 AST_ITERATOR
12 export {NONE}
13 process_none_id_as,
14 process_typed_char_as,
15 process_agent_routine_creation_as,
16 process_inline_agent_creation_as,
17 process_create_creation_as,
18 process_bang_creation_as,
19 process_create_creation_expr_as,
20 process_bang_creation_expr_as,
21 process_keyword_as,
22 process_symbol_as,
23 process_break_as,
24 process_leaf_stub_as,
25 process_symbol_stub_as,
26 process_keyword_stub_as,
27 process_there_exists_as,
28 process_for_all_as
29 redefine
30 process_access_id_as,
31 process_assign_as,
32 process_body_as,
33 process_feature_as,
34 process_id_as
35 -- ...
36 end
37
38 create
39 make
40
41 feature {NONE} -- Initialization
42 make
43 do
44 -- create rule_checkers.make
45 last_run_successful := False
46 -- create last_result.make (100) -- TODO: check initial capacity
47
48 create_action_lists
49 end
50
51 create_action_lists
52 do
53 create access_id_pre_actions.make
54 create access_id_post_actions.make
55 create assign_pre_actions.make
56 create assign_post_actions.make
57 create body_pre_actions.make
58 create body_post_actions.make
59 create class_pre_actions.make
60 create class_post_actions.make
61 create feature_pre_actions.make
62 create feature_post_actions.make
63 create id_pre_actions.make
64 create id_post_actions.make
65 end
66
67 feature -- Options For Execution
68
69 -- add_rule_checker (a_rule_checker: CA_RULE_CHECKER)
70 -- do
71 -- rule_checkers.extend (a_rule_checker)
72 -- end
73
74 -- remove_all_rule_checkers
75 -- do
76 -- rule_checkers.wipe_out
77 -- ensure
78 -- rule_checkers.is_empty
79 -- end
80
81 feature {CA_RULE}
82
83 add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
84 do
85 access_id_pre_actions.extend (a_action)
86 end
87
88 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
89 do
90 access_id_post_actions.extend (a_action)
91 end
92
93 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
94 do
95 assign_pre_actions.extend (a_action)
96 end
97
98 add_assign_post_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
99 do
100 assign_post_actions.extend (a_action)
101 end
102
103 add_body_pre_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
104 do
105 body_pre_actions.extend (a_action)
106 end
107
108 add_body_post_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
109 do
110 body_post_actions.extend (a_action)
111 end
112
113 add_class_pre_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
114 do
115 class_pre_actions.extend (a_action)
116 end
117
118 add_class_post_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
119 do
120 class_post_actions.extend (a_action)
121 end
122
123 add_feature_pre_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
124 do
125 feature_pre_actions.extend (a_action)
126 end
127
128 add_feature_post_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
129 do
130 feature_post_actions.extend (a_action)
131 end
132
133 add_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
134 do
135 id_pre_actions.extend (a_action)
136 end
137
138 add_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
139 do
140 id_post_actions.extend (a_action)
141 end
142
143 feature {NONE} -- Agent lists
144
145 access_id_pre_actions, access_id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]]]
146
147 assign_pre_actions, assign_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ASSIGN_AS]]]
148
149 body_pre_actions, body_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[BODY_AS]]]
150
151 class_pre_actions, class_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[CLASS_AS]]]
152
153 feature_pre_actions, feature_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[FEATURE_AS]]]
154
155 id_pre_actions, id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ID_AS]]]
156
157 feature -- Execution Commands
158
159 run_on_class (a_class_to_check: CLASS_C)
160 -- Check all rules that have been added
161 local
162 l_ast: CLASS_AS
163 do
164 -- across rule_checkers as l_checkers loop
165 -- l_checkers.item.clear_results
166 -- l_checkers.item.process_class (a_class_to_check)
167 -- end
168 l_ast := a_class_to_check.ast
169 across class_pre_actions as l_a loop l_a.item.call ([l_ast]) end
170 process_class_as (l_ast)
171 across class_post_actions as l_a loop l_a.item.call ([l_ast]) end
172 -- across rule_checkers as l_checkers loop
173 -- across l_checkers.item.results as l_rule_results loop
174 -- last_result.extend (l_rule_results.item)
175 -- end
176 -- end
177 last_run_successful := True
178 end
179
180 feature {NONE} -- Processing
181
182 process_access_id_as (l_as: ACCESS_ID_AS)
183 do
184 -- across rule_checkers as l_checkers loop
185 -- l_checkers.item.process_access_id (l_as)
186 -- end
187 across access_id_pre_actions as l_a loop l_a.item.call ([l_as]) end
188
189 Precursor (l_as)
190
191 across access_id_post_actions as l_a loop l_a.item.call ([l_as]) end
192 end
193
194 process_assign_as (l_as: ASSIGN_AS)
195 do
196 -- across rule_checkers as l_checkers loop
197 -- l_checkers.item.process_assignment (l_as)
198 -- end
199 across assign_pre_actions as l_a loop l_a.item.call ([l_as]) end
200
201 Precursor (l_as)
202
203 across assign_post_actions as l_a loop l_a.item.call ([l_as]) end
204 end
205
206 process_body_as (l_as: BODY_AS)
207 do
208 -- across rule_checkers as l_checkers loop
209 -- l_checkers.item.process_body (l_as)
210 -- end
211 across body_pre_actions as l_a loop l_a.item.call ([l_as]) end
212
213 Precursor (l_as)
214
215 across body_post_actions as l_a loop l_a.item.call ([l_as]) end
216 -- across rule_checkers as l_checkers loop
217 -- l_checkers.item.process_body_end
218 -- end
219 end
220
221 process_feature_as (l_as: FEATURE_AS)
222 do
223 -- across rule_checkers as l_checkers loop
224 -- l_checkers.item.process_feature (l_as)
225 -- end
226 across feature_pre_actions as l_a loop l_a.item.call ([l_as]) end
227
228 Precursor (l_as)
229
230 across feature_post_actions as l_a loop l_a.item.call ([l_as]) end
231 end
232
233 process_id_as (l_as: ID_AS)
234 do
235 -- across rule_checkers as l_checkers loop
236 -- l_checkers.item.process_id (l_as)
237 -- end
238 across id_pre_actions as l_a loop l_a.item.call ([l_as]) end
239
240 Precursor (l_as)
241
242 across id_post_actions as l_a loop l_a.item.call ([l_as]) end
243 end
244
245 feature -- Results
246
247 last_run_successful: BOOLEAN
248
249 -- last_result: HASH_TABLE[LINKED_LIST[CA_RULE_VIOLATION], CLASS_C]
250
251 feature -- Rule Checkers
252
253 -- rule_checkers: LINKED_LIST[CA_RULE_CHECKER]
254
255 --invariant
256 -- rule_checkers_list_exists: rule_checkers /= Void
257 end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date ID Revision

  ViewVC Help
Powered by ViewVC 1.1.23