/[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 93194 - (show 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 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_eiffel_list,
34 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
47 create_action_lists
48 end
49
50 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 create eiffel_list_pre_actions.make
61 create eiffel_list_post_actions.make
62 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 feature {CA_STANDARD_RULE}
69
70 add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
71 do
72 access_id_pre_actions.extend (a_action)
73 end
74
75 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
76 do
77 access_id_post_actions.extend (a_action)
78 end
79
80 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
81 do
82 assign_pre_actions.extend (a_action)
83 end
84
85 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 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 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 eiffel_list_pre_actions, eiffel_list_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[EIFFEL_LIST [AST_EIFFEL]]]]
151
152 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 feature -- Execution Commands
157
158 run_on_class (a_class_to_check: CLASS_C)
159 -- Check all rules that have been added
160 local
161 l_ast: CLASS_AS
162 do
163 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 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 across access_id_pre_actions as l_a loop l_a.item.call ([l_as]) end
175
176 Precursor (l_as)
177
178 across access_id_post_actions as l_a loop l_a.item.call ([l_as]) end
179 end
180
181 process_assign_as (l_as: ASSIGN_AS)
182 do
183 across assign_pre_actions as l_a loop l_a.item.call ([l_as]) end
184
185 Precursor (l_as)
186
187 across assign_post_actions as l_a loop l_a.item.call ([l_as]) end
188 end
189
190 process_body_as (l_as: BODY_AS)
191 do
192 across body_pre_actions as l_a loop l_a.item.call ([l_as]) end
193
194 Precursor (l_as)
195
196 across body_post_actions as l_a loop l_a.item.call ([l_as]) end
197 end
198
199 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 process_feature_as (l_as: FEATURE_AS)
209 do
210 across feature_pre_actions as l_a loop l_a.item.call ([l_as]) end
211
212 Precursor (l_as)
213
214 across feature_post_actions as l_a loop l_a.item.call ([l_as]) end
215 end
216
217 process_id_as (l_as: ID_AS)
218 do
219 across id_pre_actions as l_a loop l_a.item.call ([l_as]) end
220
221 Precursor (l_as)
222
223 across id_post_actions as l_a loop l_a.item.call ([l_as]) end
224 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