/[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 93216 - (show annotations)
Wed Nov 6 16:55:32 2013 UTC (6 years, 2 months ago) by zurfluhs
File size: 8659 byte(s)
Code Analysis:

- updated testing facilities
- updated localized strings
- added 'empty if' rule
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_do_as,
34 process_eiffel_list,
35 process_feature_as,
36 process_id_as,
37 process_if_as,
38 process_inspect_as,
39 process_loop_as,
40 process_once_as
41 -- ...
42 end
43
44 create
45 make
46
47 feature {NONE} -- Initialization
48 make
49 do
50 last_run_successful := False
51
52 create_action_lists
53 end
54
55 create_action_lists
56 do
57 create access_id_pre_actions.make
58 create access_id_post_actions.make
59 create assign_pre_actions.make
60 create assign_post_actions.make
61 create body_pre_actions.make
62 create body_post_actions.make
63 create class_pre_actions.make
64 create class_post_actions.make
65 create do_pre_actions.make
66 create do_post_actions.make
67 create eiffel_list_pre_actions.make
68 create eiffel_list_post_actions.make
69 create feature_pre_actions.make
70 create feature_post_actions.make
71 create id_pre_actions.make
72 create id_post_actions.make
73 create inspect_pre_actions.make
74 create inspect_post_actions.make
75 create if_pre_actions.make
76 create if_post_actions.make
77 create loop_pre_actions.make
78 create loop_post_actions.make
79 create once_pre_actions.make
80 create once_post_actions.make
81 end
82
83 feature {CA_STANDARD_RULE}
84
85 add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
86 do
87 access_id_pre_actions.extend (a_action)
88 end
89
90 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
91 do
92 access_id_post_actions.extend (a_action)
93 end
94
95 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
96 do
97 assign_pre_actions.extend (a_action)
98 end
99
100 add_assign_post_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
101 do
102 assign_post_actions.extend (a_action)
103 end
104
105 add_body_pre_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
106 do
107 body_pre_actions.extend (a_action)
108 end
109
110 add_body_post_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
111 do
112 body_post_actions.extend (a_action)
113 end
114
115 add_class_pre_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
116 do
117 class_pre_actions.extend (a_action)
118 end
119
120 add_class_post_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
121 do
122 class_post_actions.extend (a_action)
123 end
124
125 add_do_pre_action (a_action: PROCEDURE[ANY, TUPLE[DO_AS]])
126 do
127 do_pre_actions.extend (a_action)
128 end
129
130 add_do_post_action (a_action: PROCEDURE[ANY, TUPLE[DO_AS]])
131 do
132 do_post_actions.extend (a_action)
133 end
134
135 add_eiffel_list_pre_action (a_action: PROCEDURE[ANY, TUPLE[EIFFEL_LIST[AST_EIFFEL]]])
136 do
137 eiffel_list_pre_actions.extend (a_action)
138 end
139
140 add_eiffel_list_post_action (a_action: PROCEDURE[ANY, TUPLE[EIFFEL_LIST[AST_EIFFEL]]])
141 do
142 eiffel_list_post_actions.extend (a_action)
143 end
144
145 add_feature_pre_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
146 do
147 feature_pre_actions.extend (a_action)
148 end
149
150 add_feature_post_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
151 do
152 feature_post_actions.extend (a_action)
153 end
154
155 add_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
156 do
157 id_pre_actions.extend (a_action)
158 end
159
160 add_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
161 do
162 id_post_actions.extend (a_action)
163 end
164
165 add_if_pre_action (a_action: PROCEDURE[ANY, TUPLE[IF_AS]])
166 do
167 if_pre_actions.extend (a_action)
168 end
169
170 add_if_post_action (a_action: PROCEDURE[ANY, TUPLE[IF_AS]])
171 do
172 if_post_actions.extend (a_action)
173 end
174
175 add_inspect_pre_action (a_action: PROCEDURE[ANY, TUPLE[INSPECT_AS]])
176 do
177 inspect_pre_actions.extend (a_action)
178 end
179
180 add_inspect_post_action (a_action: PROCEDURE[ANY, TUPLE[INSPECT_AS]])
181 do
182 inspect_post_actions.extend (a_action)
183 end
184
185 add_loop_pre_action (a_action: PROCEDURE[ANY, TUPLE[LOOP_AS]])
186 do
187 loop_pre_actions.extend (a_action)
188 end
189
190 add_loop_post_action (a_action: PROCEDURE[ANY, TUPLE[LOOP_AS]])
191 do
192 loop_post_actions.extend (a_action)
193 end
194
195 add_once_pre_action (a_action: PROCEDURE[ANY, TUPLE[ONCE_AS]])
196 do
197 once_pre_actions.extend (a_action)
198 end
199
200 add_once_post_action (a_action: PROCEDURE[ANY, TUPLE[ONCE_AS]])
201 do
202 once_post_actions.extend (a_action)
203 end
204
205 feature {NONE} -- Agent lists
206
207 access_id_pre_actions, access_id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]]]
208
209 assign_pre_actions, assign_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ASSIGN_AS]]]
210
211 body_pre_actions, body_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[BODY_AS]]]
212
213 class_pre_actions, class_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[CLASS_AS]]]
214
215 do_pre_actions, do_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[DO_AS]]]
216
217 eiffel_list_pre_actions, eiffel_list_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[EIFFEL_LIST [AST_EIFFEL]]]]
218
219 feature_pre_actions, feature_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[FEATURE_AS]]]
220
221 id_pre_actions, id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ID_AS]]]
222
223 if_pre_actions, if_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[IF_AS]]]
224
225 inspect_pre_actions, inspect_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[INSPECT_AS]]]
226
227 loop_pre_actions, loop_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[LOOP_AS]]]
228
229 once_pre_actions, once_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ONCE_AS]]]
230
231 feature -- Execution Commands
232
233 run_on_class (a_class_to_check: CLASS_C)
234 -- Check all rules that have been added
235 local
236 l_ast: CLASS_AS
237 do
238 l_ast := a_class_to_check.ast
239 across class_pre_actions as l_a loop l_a.item.call ([l_ast]) end
240 process_class_as (l_ast)
241 across class_post_actions as l_a loop l_a.item.call ([l_ast]) end
242 last_run_successful := True
243 end
244
245 feature {NONE} -- Processing
246
247 process_access_id_as (a_id: ACCESS_ID_AS)
248 do
249 across access_id_pre_actions as l_a loop l_a.item.call ([a_id]) end
250
251 Precursor (a_id)
252
253 across access_id_post_actions as l_a loop l_a.item.call ([a_id]) end
254 end
255
256 process_assign_as (a_assign: ASSIGN_AS)
257 do
258 across assign_pre_actions as l_a loop l_a.item.call ([a_assign]) end
259
260 Precursor (a_assign)
261
262 across assign_post_actions as l_a loop l_a.item.call ([a_assign]) end
263 end
264
265 process_body_as (a_body: BODY_AS)
266 do
267 across body_pre_actions as l_a loop l_a.item.call ([a_body]) end
268
269 Precursor (a_body)
270
271 across body_post_actions as l_a loop l_a.item.call ([a_body]) end
272 end
273
274 process_do_as (a_do: DO_AS)
275 do
276 across do_pre_actions as l_a loop l_a.item.call ([a_do]) end
277
278 Precursor (a_do)
279
280 across do_post_actions as l_a loop l_a.item.call ([a_do]) end
281 end
282
283 process_eiffel_list (a_list: EIFFEL_LIST [AST_EIFFEL])
284 do
285 across eiffel_list_pre_actions as l_a loop l_a.item.call ([a_list]) end
286
287 Precursor (a_list)
288
289 across eiffel_list_post_actions as l_a loop l_a.item.call ([a_list]) end
290 end
291
292 process_feature_as (a_feature: FEATURE_AS)
293 do
294 across feature_pre_actions as l_a loop l_a.item.call ([a_feature]) end
295
296 Precursor (a_feature)
297
298 across feature_post_actions as l_a loop l_a.item.call ([a_feature]) end
299 end
300
301 process_id_as (a_id: ID_AS)
302 do
303 across id_pre_actions as l_a loop l_a.item.call ([a_id]) end
304
305 Precursor (a_id)
306
307 across id_post_actions as l_a loop l_a.item.call ([a_id]) end
308 end
309
310 process_if_as (a_if: IF_AS)
311 do
312 across if_pre_actions as l_a loop l_a.item.call ([a_if]) end
313
314 Precursor (a_if)
315
316 across if_post_actions as l_a loop l_a.item.call ([a_if]) end
317 end
318
319 process_inspect_as (a_inspect: INSPECT_AS)
320 do
321 across inspect_pre_actions as l_a loop l_a.item.call ([a_inspect]) end
322
323 Precursor (a_inspect)
324
325 across inspect_post_actions as l_a loop l_a.item.call ([a_inspect]) end
326 end
327
328 process_loop_as (a_loop: LOOP_AS)
329 do
330 across loop_pre_actions as l_a loop l_a.item.call ([a_loop]) end
331
332 Precursor (a_loop)
333
334 across loop_post_actions as l_a loop l_a.item.call ([a_loop]) end
335 end
336
337 process_once_as (a_once: ONCE_AS)
338 do
339 across once_pre_actions as l_a loop l_a.item.call ([a_once]) end
340
341 Precursor (a_once)
342
343 across once_post_actions as l_a loop l_a.item.call ([a_once]) end
344 end
345
346 feature -- Results
347
348 last_run_successful: BOOLEAN
349
350 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23