/[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 93426 - (show annotations)
Tue Nov 19 08:45:14 2013 UTC (6 years ago) by zurfluhs
File size: 10530 byte(s)
Code Analysis: GUI:

- analysis options in class indexing clauses
  - rules that ignore class
  - library / nonlibrary classes
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
12 AST_ITERATOR
13 export {NONE}
14 process_none_id_as,
15 process_typed_char_as,
16 process_agent_routine_creation_as,
17 process_inline_agent_creation_as,
18 process_create_creation_as,
19 process_bang_creation_as,
20 process_create_creation_expr_as,
21 process_bang_creation_expr_as,
22 process_keyword_as,
23 process_symbol_as,
24 process_break_as,
25 process_leaf_stub_as,
26 process_symbol_stub_as,
27 process_keyword_stub_as,
28 process_there_exists_as,
29 process_for_all_as
30 redefine
31 process_access_id_as,
32 process_assign_as,
33 process_body_as,
34 process_creation_as,
35 process_do_as,
36 process_eiffel_list,
37 process_feature_as,
38 process_id_as,
39 process_if_as,
40 process_inspect_as,
41 process_instr_call_as,
42 process_loop_as,
43 process_once_as
44 -- ...
45 end
46
47 create
48 make
49
50 feature {NONE} -- Initialization
51 make
52 do
53 last_run_successful := False
54
55 create_action_lists
56 end
57
58 create_action_lists
59 do
60 create access_id_pre_actions.make
61 create access_id_post_actions.make
62 create assign_pre_actions.make
63 create assign_post_actions.make
64 create body_pre_actions.make
65 create body_post_actions.make
66 create class_pre_actions.make
67 create class_post_actions.make
68 create creation_pre_actions.make
69 create creation_post_actions.make
70 create do_pre_actions.make
71 create do_post_actions.make
72 create eiffel_list_pre_actions.make
73 create eiffel_list_post_actions.make
74 create feature_pre_actions.make
75 create feature_post_actions.make
76 create id_pre_actions.make
77 create id_post_actions.make
78 create if_pre_actions.make
79 create if_post_actions.make
80 create inspect_pre_actions.make
81 create inspect_post_actions.make
82 create instruction_call_pre_actions.make
83 create instruction_call_post_actions.make
84 create loop_pre_actions.make
85 create loop_post_actions.make
86 create once_pre_actions.make
87 create once_post_actions.make
88 end
89
90 feature {CA_STANDARD_RULE}
91
92 add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
93 do
94 access_id_pre_actions.extend (a_action)
95 end
96
97 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
98 do
99 access_id_post_actions.extend (a_action)
100 end
101
102 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
103 do
104 assign_pre_actions.extend (a_action)
105 end
106
107 add_assign_post_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
108 do
109 assign_post_actions.extend (a_action)
110 end
111
112 add_body_pre_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
113 do
114 body_pre_actions.extend (a_action)
115 end
116
117 add_body_post_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
118 do
119 body_post_actions.extend (a_action)
120 end
121
122 add_class_pre_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
123 do
124 class_pre_actions.extend (a_action)
125 end
126
127 add_class_post_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
128 do
129 class_post_actions.extend (a_action)
130 end
131
132 add_creation_pre_action (a_action: PROCEDURE [ANY, TUPLE [CREATION_AS] ])
133 do
134 creation_pre_actions.extend (a_action)
135 end
136
137 add_creation_post_action (a_action: PROCEDURE [ANY, TUPLE [CREATION_AS] ])
138 do
139 creation_post_actions.extend (a_action)
140 end
141
142 add_do_pre_action (a_action: PROCEDURE[ANY, TUPLE[DO_AS]])
143 do
144 do_pre_actions.extend (a_action)
145 end
146
147 add_do_post_action (a_action: PROCEDURE[ANY, TUPLE[DO_AS]])
148 do
149 do_post_actions.extend (a_action)
150 end
151
152 add_eiffel_list_pre_action (a_action: PROCEDURE[ANY, TUPLE[EIFFEL_LIST[AST_EIFFEL]]])
153 do
154 eiffel_list_pre_actions.extend (a_action)
155 end
156
157 add_eiffel_list_post_action (a_action: PROCEDURE[ANY, TUPLE[EIFFEL_LIST[AST_EIFFEL]]])
158 do
159 eiffel_list_post_actions.extend (a_action)
160 end
161
162 add_feature_pre_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
163 do
164 feature_pre_actions.extend (a_action)
165 end
166
167 add_feature_post_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
168 do
169 feature_post_actions.extend (a_action)
170 end
171
172 add_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
173 do
174 id_pre_actions.extend (a_action)
175 end
176
177 add_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
178 do
179 id_post_actions.extend (a_action)
180 end
181
182 add_if_pre_action (a_action: PROCEDURE[ANY, TUPLE[IF_AS]])
183 do
184 if_pre_actions.extend (a_action)
185 end
186
187 add_if_post_action (a_action: PROCEDURE[ANY, TUPLE[IF_AS]])
188 do
189 if_post_actions.extend (a_action)
190 end
191
192 add_inspect_pre_action (a_action: PROCEDURE[ANY, TUPLE[INSPECT_AS]])
193 do
194 inspect_pre_actions.extend (a_action)
195 end
196
197 add_inspect_post_action (a_action: PROCEDURE[ANY, TUPLE[INSPECT_AS]])
198 do
199 inspect_post_actions.extend (a_action)
200 end
201
202 add_instruction_call_pre_action (a_action: PROCEDURE [ANY, TUPLE [INSTR_CALL_AS] ])
203 do
204 instruction_call_pre_actions.extend (a_action)
205 end
206
207 add_instruction_call_post_action (a_action: PROCEDURE [ANY, TUPLE [INSTR_CALL_AS] ])
208 do
209 instruction_call_post_actions.extend (a_action)
210 end
211
212 add_loop_pre_action (a_action: PROCEDURE[ANY, TUPLE[LOOP_AS]])
213 do
214 loop_pre_actions.extend (a_action)
215 end
216
217 add_loop_post_action (a_action: PROCEDURE[ANY, TUPLE[LOOP_AS]])
218 do
219 loop_post_actions.extend (a_action)
220 end
221
222 add_once_pre_action (a_action: PROCEDURE[ANY, TUPLE[ONCE_AS]])
223 do
224 once_pre_actions.extend (a_action)
225 end
226
227 add_once_post_action (a_action: PROCEDURE[ANY, TUPLE[ONCE_AS]])
228 do
229 once_post_actions.extend (a_action)
230 end
231
232 feature {NONE} -- Agent lists
233
234 access_id_pre_actions, access_id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]]]
235
236 assign_pre_actions, assign_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ASSIGN_AS]]]
237
238 body_pre_actions, body_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[BODY_AS]]]
239
240 class_pre_actions, class_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[CLASS_AS]]]
241
242 creation_pre_actions, creation_post_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE[CREATION_AS] ] ]
243
244 do_pre_actions, do_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[DO_AS]]]
245
246 eiffel_list_pre_actions, eiffel_list_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[EIFFEL_LIST [AST_EIFFEL]]]]
247
248 feature_pre_actions, feature_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[FEATURE_AS]]]
249
250 id_pre_actions, id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ID_AS]]]
251
252 if_pre_actions, if_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[IF_AS]]]
253
254 inspect_pre_actions, inspect_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[INSPECT_AS]]]
255
256 instruction_call_pre_actions, instruction_call_post_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE [INSTR_CALL_AS] ] ]
257
258 loop_pre_actions, loop_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[LOOP_AS]]]
259
260 once_pre_actions, once_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ONCE_AS]]]
261
262 feature -- Execution Commands
263
264 run_on_class (a_class_to_check: CLASS_C)
265 -- Check all rules that have been added
266 local
267 l_ast: CLASS_AS
268 do
269 last_run_successful := False
270 l_ast := a_class_to_check.ast
271 across class_pre_actions as l_a loop l_a.item.call ([l_ast]) end
272 process_class_as (l_ast)
273 across class_post_actions as l_a loop l_a.item.call ([l_ast]) end
274 last_run_successful := True
275 end
276
277 feature {NONE} -- Processing
278
279 process_access_id_as (a_id: ACCESS_ID_AS)
280 do
281 across access_id_pre_actions as l_a loop l_a.item.call ([a_id]) end
282
283 Precursor (a_id)
284
285 across access_id_post_actions as l_a loop l_a.item.call ([a_id]) end
286 end
287
288 process_assign_as (a_assign: ASSIGN_AS)
289 do
290 across assign_pre_actions as l_a loop l_a.item.call ([a_assign]) end
291
292 Precursor (a_assign)
293
294 across assign_post_actions as l_a loop l_a.item.call ([a_assign]) end
295 end
296
297 process_body_as (a_body: BODY_AS)
298 do
299 across body_pre_actions as l_a loop l_a.item.call ([a_body]) end
300
301 Precursor (a_body)
302
303 across body_post_actions as l_a loop l_a.item.call ([a_body]) end
304 end
305
306 process_creation_as (a_creation: CREATION_AS)
307 do
308 across creation_pre_actions as l_a loop l_a.item.call ([a_creation]) end
309
310 Precursor (a_creation)
311
312 across creation_post_actions as l_a loop l_a.item.call ([a_creation]) end
313 end
314
315 process_do_as (a_do: DO_AS)
316 do
317 across do_pre_actions as l_a loop l_a.item.call ([a_do]) end
318
319 Precursor (a_do)
320
321 across do_post_actions as l_a loop l_a.item.call ([a_do]) end
322 end
323
324 process_eiffel_list (a_list: EIFFEL_LIST [AST_EIFFEL])
325 do
326 across eiffel_list_pre_actions as l_a loop l_a.item.call ([a_list]) end
327
328 Precursor (a_list)
329
330 across eiffel_list_post_actions as l_a loop l_a.item.call ([a_list]) end
331 end
332
333 process_feature_as (a_feature: FEATURE_AS)
334 local
335 l_b: BOOLEAN
336 do
337 across feature_pre_actions as l_a loop l_a.item.call ([a_feature]) end
338 Precursor (a_feature)
339 across feature_post_actions as l_a loop l_a.item.call ([a_feature]) end
340 end
341
342 process_id_as (a_id: ID_AS)
343 do
344 across id_pre_actions as l_a loop l_a.item.call ([a_id]) end
345
346 Precursor (a_id)
347
348 across id_post_actions as l_a loop l_a.item.call ([a_id]) end
349 end
350
351 process_if_as (a_if: IF_AS)
352 do
353 across if_pre_actions as l_a loop l_a.item.call ([a_if]) end
354
355 Precursor (a_if)
356
357 across if_post_actions as l_a loop l_a.item.call ([a_if]) end
358 end
359
360 process_inspect_as (a_inspect: INSPECT_AS)
361 do
362 across inspect_pre_actions as l_a loop l_a.item.call ([a_inspect]) end
363
364 Precursor (a_inspect)
365
366 across inspect_post_actions as l_a loop l_a.item.call ([a_inspect]) end
367 end
368
369 process_instr_call_as (a_call: INSTR_CALL_AS)
370 do
371 across instruction_call_pre_actions as l_a loop l_a.item.call ([a_call]) end
372
373 Precursor (a_call)
374
375 across instruction_call_post_actions as l_a loop l_a.item.call ([a_call]) end
376 end
377
378 process_loop_as (a_loop: LOOP_AS)
379 do
380 across loop_pre_actions as l_a loop l_a.item.call ([a_loop]) end
381
382 Precursor (a_loop)
383
384 across loop_post_actions as l_a loop l_a.item.call ([a_loop]) end
385 end
386
387 process_once_as (a_once: ONCE_AS)
388 do
389 across once_pre_actions as l_a loop l_a.item.call ([a_once]) end
390
391 Precursor (a_once)
392
393 across once_post_actions as l_a loop l_a.item.call ([a_once]) end
394 end
395
396 feature -- Results
397
398 last_run_successful: BOOLEAN
399
400 feature {NONE} -- Implementation
401
402 frozen rota: detachable ROTA_S
403 -- Access to rota service
404 local
405 l_service_consumer: SERVICE_CONSUMER [ROTA_S]
406 do
407 create l_service_consumer
408 if l_service_consumer.is_service_available and then l_service_consumer.service.is_interface_usable then
409 Result := l_service_consumer.service
410 end
411 end
412 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23