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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 93389 - (hide annotations)
Fri Nov 15 17:19:03 2013 UTC (6 years, 2 months ago) by zurfluhs
File size: 10531 byte(s)
Code Analysis: GUI: various improvements

- also: unused argument rule fix
- also: asynchronous rule checking
1 zurfluhs 93168 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 zurfluhs 93389
12 zurfluhs 93168 AST_ITERATOR
13 zurfluhs 93176 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 zurfluhs 93168 redefine
31     process_access_id_as,
32     process_assign_as,
33     process_body_as,
34 zurfluhs 93304 process_creation_as,
35 zurfluhs 93216 process_do_as,
36 zurfluhs 93194 process_eiffel_list,
37 zurfluhs 93168 process_feature_as,
38 zurfluhs 93216 process_id_as,
39     process_if_as,
40     process_inspect_as,
41 zurfluhs 93304 process_instr_call_as,
42 zurfluhs 93216 process_loop_as,
43     process_once_as
44 zurfluhs 93168 -- ...
45     end
46    
47     create
48     make
49    
50     feature {NONE} -- Initialization
51     make
52     do
53     last_run_successful := False
54 zurfluhs 93173
55     create_action_lists
56 zurfluhs 93168 end
57    
58 zurfluhs 93173 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 zurfluhs 93304 create creation_pre_actions.make
69     create creation_post_actions.make
70 zurfluhs 93216 create do_pre_actions.make
71     create do_post_actions.make
72 zurfluhs 93194 create eiffel_list_pre_actions.make
73     create eiffel_list_post_actions.make
74 zurfluhs 93173 create feature_pre_actions.make
75     create feature_post_actions.make
76     create id_pre_actions.make
77     create id_post_actions.make
78 zurfluhs 93304 create if_pre_actions.make
79     create if_post_actions.make
80 zurfluhs 93216 create inspect_pre_actions.make
81     create inspect_post_actions.make
82 zurfluhs 93304 create instruction_call_pre_actions.make
83     create instruction_call_post_actions.make
84 zurfluhs 93216 create loop_pre_actions.make
85     create loop_post_actions.make
86     create once_pre_actions.make
87     create once_post_actions.make
88 zurfluhs 93173 end
89    
90 zurfluhs 93181 feature {CA_STANDARD_RULE}
91 zurfluhs 93168
92 zurfluhs 93173 add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
93 zurfluhs 93168 do
94 zurfluhs 93173 access_id_pre_actions.extend (a_action)
95 zurfluhs 93168 end
96    
97 zurfluhs 93173 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
98 zurfluhs 93168 do
99 zurfluhs 93173 access_id_post_actions.extend (a_action)
100 zurfluhs 93168 end
101    
102 zurfluhs 93173 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
103 zurfluhs 93168 do
104 zurfluhs 93173 assign_pre_actions.extend (a_action)
105 zurfluhs 93168 end
106    
107 zurfluhs 93173 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 zurfluhs 93304 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 zurfluhs 93216 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 zurfluhs 93194 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 zurfluhs 93173 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 zurfluhs 93216 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 zurfluhs 93304 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 zurfluhs 93216 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 zurfluhs 93173 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 zurfluhs 93304 creation_pre_actions, creation_post_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE[CREATION_AS] ] ]
243    
244 zurfluhs 93216 do_pre_actions, do_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[DO_AS]]]
245    
246 zurfluhs 93194 eiffel_list_pre_actions, eiffel_list_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[EIFFEL_LIST [AST_EIFFEL]]]]
247    
248 zurfluhs 93173 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 zurfluhs 93216 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 zurfluhs 93304 instruction_call_pre_actions, instruction_call_post_actions: LINKED_LIST [PROCEDURE [ANY, TUPLE [INSTR_CALL_AS] ] ]
257    
258 zurfluhs 93216 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 zurfluhs 93168 feature -- Execution Commands
263    
264 zurfluhs 93173 run_on_class (a_class_to_check: CLASS_C)
265 zurfluhs 93168 -- Check all rules that have been added
266 zurfluhs 93173 local
267     l_ast: CLASS_AS
268 zurfluhs 93168 do
269 zurfluhs 93304 last_run_successful := False
270 zurfluhs 93173 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 zurfluhs 93168 last_run_successful := True
275     end
276    
277     feature {NONE} -- Processing
278    
279 zurfluhs 93216 process_access_id_as (a_id: ACCESS_ID_AS)
280 zurfluhs 93168 do
281 zurfluhs 93216 across access_id_pre_actions as l_a loop l_a.item.call ([a_id]) end
282 zurfluhs 93168
283 zurfluhs 93216 Precursor (a_id)
284 zurfluhs 93173
285 zurfluhs 93216 across access_id_post_actions as l_a loop l_a.item.call ([a_id]) end
286 zurfluhs 93168 end
287    
288 zurfluhs 93216 process_assign_as (a_assign: ASSIGN_AS)
289 zurfluhs 93168 do
290 zurfluhs 93216 across assign_pre_actions as l_a loop l_a.item.call ([a_assign]) end
291 zurfluhs 93168
292 zurfluhs 93216 Precursor (a_assign)
293 zurfluhs 93173
294 zurfluhs 93216 across assign_post_actions as l_a loop l_a.item.call ([a_assign]) end
295 zurfluhs 93168 end
296    
297 zurfluhs 93216 process_body_as (a_body: BODY_AS)
298 zurfluhs 93168 do
299 zurfluhs 93216 across body_pre_actions as l_a loop l_a.item.call ([a_body]) end
300 zurfluhs 93168
301 zurfluhs 93216 Precursor (a_body)
302 zurfluhs 93168
303 zurfluhs 93216 across body_post_actions as l_a loop l_a.item.call ([a_body]) end
304 zurfluhs 93168 end
305    
306 zurfluhs 93304 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 zurfluhs 93216 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 zurfluhs 93194 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 zurfluhs 93216 process_feature_as (a_feature: FEATURE_AS)
334 zurfluhs 93305 local
335     l_b: BOOLEAN
336 zurfluhs 93168 do
337 zurfluhs 93373 across feature_pre_actions as l_a loop l_a.item.call ([a_feature]) end
338 zurfluhs 93216 Precursor (a_feature)
339 zurfluhs 93373 across feature_post_actions as l_a loop l_a.item.call ([a_feature]) end
340 zurfluhs 93168 end
341    
342 zurfluhs 93216 process_id_as (a_id: ID_AS)
343 zurfluhs 93168 do
344 zurfluhs 93216 across id_pre_actions as l_a loop l_a.item.call ([a_id]) end
345 zurfluhs 93168
346 zurfluhs 93216 Precursor (a_id)
347 zurfluhs 93173
348 zurfluhs 93216 across id_post_actions as l_a loop l_a.item.call ([a_id]) end
349 zurfluhs 93168 end
350    
351 zurfluhs 93216 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 zurfluhs 93304 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 zurfluhs 93216 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 zurfluhs 93168 feature -- Results
397    
398     last_run_successful: BOOLEAN
399    
400 zurfluhs 93298 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    
413 zurfluhs 93168 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23