/[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 93194 - (hide annotations)
Mon Nov 4 21:28:18 2013 UTC (6 years, 2 months ago) by zurfluhs
File size: 5605 byte(s)
Code Analysis:

- fixed 'Unused Argument' rule
- added Control Flow Graph rule type + some class skeletons
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     AST_ITERATOR
12 zurfluhs 93176 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 zurfluhs 93168 redefine
30     process_access_id_as,
31     process_assign_as,
32     process_body_as,
33 zurfluhs 93194 process_eiffel_list,
34 zurfluhs 93168 process_feature_as,
35     process_id_as
36     -- ...
37     end
38    
39     create
40     make
41    
42     feature {NONE} -- Initialization
43     make
44     do
45     last_run_successful := False
46 zurfluhs 93173
47     create_action_lists
48 zurfluhs 93168 end
49    
50 zurfluhs 93173 create_action_lists
51     do
52     create access_id_pre_actions.make
53     create access_id_post_actions.make
54     create assign_pre_actions.make
55     create assign_post_actions.make
56     create body_pre_actions.make
57     create body_post_actions.make
58     create class_pre_actions.make
59     create class_post_actions.make
60 zurfluhs 93194 create eiffel_list_pre_actions.make
61     create eiffel_list_post_actions.make
62 zurfluhs 93173 create feature_pre_actions.make
63     create feature_post_actions.make
64     create id_pre_actions.make
65     create id_post_actions.make
66     end
67    
68 zurfluhs 93181 feature {CA_STANDARD_RULE}
69 zurfluhs 93168
70 zurfluhs 93173 add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
71 zurfluhs 93168 do
72 zurfluhs 93173 access_id_pre_actions.extend (a_action)
73 zurfluhs 93168 end
74    
75 zurfluhs 93173 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
76 zurfluhs 93168 do
77 zurfluhs 93173 access_id_post_actions.extend (a_action)
78 zurfluhs 93168 end
79    
80 zurfluhs 93173 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
81 zurfluhs 93168 do
82 zurfluhs 93173 assign_pre_actions.extend (a_action)
83 zurfluhs 93168 end
84    
85 zurfluhs 93173 add_assign_post_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
86     do
87     assign_post_actions.extend (a_action)
88     end
89    
90     add_body_pre_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
91     do
92     body_pre_actions.extend (a_action)
93     end
94    
95     add_body_post_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
96     do
97     body_post_actions.extend (a_action)
98     end
99    
100     add_class_pre_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
101     do
102     class_pre_actions.extend (a_action)
103     end
104    
105     add_class_post_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
106     do
107     class_post_actions.extend (a_action)
108     end
109    
110 zurfluhs 93194 add_eiffel_list_pre_action (a_action: PROCEDURE[ANY, TUPLE[EIFFEL_LIST[AST_EIFFEL]]])
111     do
112     eiffel_list_pre_actions.extend (a_action)
113     end
114    
115     add_eiffel_list_post_action (a_action: PROCEDURE[ANY, TUPLE[EIFFEL_LIST[AST_EIFFEL]]])
116     do
117     eiffel_list_post_actions.extend (a_action)
118     end
119    
120 zurfluhs 93173 add_feature_pre_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
121     do
122     feature_pre_actions.extend (a_action)
123     end
124    
125     add_feature_post_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
126     do
127     feature_post_actions.extend (a_action)
128     end
129    
130     add_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
131     do
132     id_pre_actions.extend (a_action)
133     end
134    
135     add_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
136     do
137     id_post_actions.extend (a_action)
138     end
139    
140     feature {NONE} -- Agent lists
141    
142     access_id_pre_actions, access_id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]]]
143    
144     assign_pre_actions, assign_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ASSIGN_AS]]]
145    
146     body_pre_actions, body_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[BODY_AS]]]
147    
148     class_pre_actions, class_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[CLASS_AS]]]
149    
150 zurfluhs 93194 eiffel_list_pre_actions, eiffel_list_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[EIFFEL_LIST [AST_EIFFEL]]]]
151    
152 zurfluhs 93173 feature_pre_actions, feature_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[FEATURE_AS]]]
153    
154     id_pre_actions, id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ID_AS]]]
155    
156 zurfluhs 93168 feature -- Execution Commands
157    
158 zurfluhs 93173 run_on_class (a_class_to_check: CLASS_C)
159 zurfluhs 93168 -- Check all rules that have been added
160 zurfluhs 93173 local
161     l_ast: CLASS_AS
162 zurfluhs 93168 do
163 zurfluhs 93173 l_ast := a_class_to_check.ast
164     across class_pre_actions as l_a loop l_a.item.call ([l_ast]) end
165     process_class_as (l_ast)
166     across class_post_actions as l_a loop l_a.item.call ([l_ast]) end
167 zurfluhs 93168 last_run_successful := True
168     end
169    
170     feature {NONE} -- Processing
171    
172     process_access_id_as (l_as: ACCESS_ID_AS)
173     do
174 zurfluhs 93173 across access_id_pre_actions as l_a loop l_a.item.call ([l_as]) end
175 zurfluhs 93168
176     Precursor (l_as)
177 zurfluhs 93173
178     across access_id_post_actions as l_a loop l_a.item.call ([l_as]) end
179 zurfluhs 93168 end
180    
181     process_assign_as (l_as: ASSIGN_AS)
182     do
183 zurfluhs 93173 across assign_pre_actions as l_a loop l_a.item.call ([l_as]) end
184 zurfluhs 93168
185     Precursor (l_as)
186 zurfluhs 93173
187     across assign_post_actions as l_a loop l_a.item.call ([l_as]) end
188 zurfluhs 93168 end
189    
190     process_body_as (l_as: BODY_AS)
191     do
192 zurfluhs 93173 across body_pre_actions as l_a loop l_a.item.call ([l_as]) end
193 zurfluhs 93168
194     Precursor (l_as)
195    
196 zurfluhs 93173 across body_post_actions as l_a loop l_a.item.call ([l_as]) end
197 zurfluhs 93168 end
198    
199 zurfluhs 93194 process_eiffel_list (a_list: EIFFEL_LIST [AST_EIFFEL])
200     do
201     across eiffel_list_pre_actions as l_a loop l_a.item.call ([a_list]) end
202    
203     Precursor (a_list)
204    
205     across eiffel_list_post_actions as l_a loop l_a.item.call ([a_list]) end
206     end
207    
208 zurfluhs 93168 process_feature_as (l_as: FEATURE_AS)
209     do
210 zurfluhs 93173 across feature_pre_actions as l_a loop l_a.item.call ([l_as]) end
211 zurfluhs 93168
212     Precursor (l_as)
213 zurfluhs 93173
214     across feature_post_actions as l_a loop l_a.item.call ([l_as]) end
215 zurfluhs 93168 end
216    
217     process_id_as (l_as: ID_AS)
218     do
219 zurfluhs 93173 across id_pre_actions as l_a loop l_a.item.call ([l_as]) end
220 zurfluhs 93168
221     Precursor (l_as)
222 zurfluhs 93173
223     across id_post_actions as l_a loop l_a.item.call ([l_as]) end
224 zurfluhs 93168 end
225    
226     feature -- Results
227    
228     last_run_successful: BOOLEAN
229    
230     end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23