/[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 93176 - (hide annotations)
Mon Oct 28 21:10:22 2013 UTC (6 years, 2 months ago) by zurfluhs
File size: 6311 byte(s)
Code Analysis: few minor changes
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     process_feature_as,
34     process_id_as
35     -- ...
36     end
37    
38     create
39     make
40    
41     feature {NONE} -- Initialization
42     make
43     do
44 zurfluhs 93173 -- create rule_checkers.make
45 zurfluhs 93168 last_run_successful := False
46 zurfluhs 93173 -- create last_result.make (100) -- TODO: check initial capacity
47    
48     create_action_lists
49 zurfluhs 93168 end
50    
51 zurfluhs 93173 create_action_lists
52     do
53     create access_id_pre_actions.make
54     create access_id_post_actions.make
55     create assign_pre_actions.make
56     create assign_post_actions.make
57     create body_pre_actions.make
58     create body_post_actions.make
59     create class_pre_actions.make
60     create class_post_actions.make
61     create feature_pre_actions.make
62     create feature_post_actions.make
63     create id_pre_actions.make
64     create id_post_actions.make
65     end
66    
67 zurfluhs 93168 feature -- Options For Execution
68    
69 zurfluhs 93173 -- add_rule_checker (a_rule_checker: CA_RULE_CHECKER)
70     -- do
71     -- rule_checkers.extend (a_rule_checker)
72     -- end
73    
74     -- remove_all_rule_checkers
75     -- do
76     -- rule_checkers.wipe_out
77     -- ensure
78     -- rule_checkers.is_empty
79     -- end
80    
81     feature {CA_RULE}
82    
83     add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
84 zurfluhs 93168 do
85 zurfluhs 93173 access_id_pre_actions.extend (a_action)
86 zurfluhs 93168 end
87    
88 zurfluhs 93173 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
89 zurfluhs 93168 do
90 zurfluhs 93173 access_id_post_actions.extend (a_action)
91 zurfluhs 93168 end
92    
93 zurfluhs 93173 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
94 zurfluhs 93168 do
95 zurfluhs 93173 assign_pre_actions.extend (a_action)
96 zurfluhs 93168 end
97    
98 zurfluhs 93173 add_assign_post_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
99     do
100     assign_post_actions.extend (a_action)
101     end
102    
103     add_body_pre_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
104     do
105     body_pre_actions.extend (a_action)
106     end
107    
108     add_body_post_action (a_action: PROCEDURE[ANY, TUPLE[BODY_AS]])
109     do
110     body_post_actions.extend (a_action)
111     end
112    
113     add_class_pre_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
114     do
115     class_pre_actions.extend (a_action)
116     end
117    
118     add_class_post_action (a_action: PROCEDURE[ANY, TUPLE[CLASS_AS]])
119     do
120     class_post_actions.extend (a_action)
121     end
122    
123     add_feature_pre_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
124     do
125     feature_pre_actions.extend (a_action)
126     end
127    
128     add_feature_post_action (a_action: PROCEDURE[ANY, TUPLE[FEATURE_AS]])
129     do
130     feature_post_actions.extend (a_action)
131     end
132    
133     add_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
134     do
135     id_pre_actions.extend (a_action)
136     end
137    
138     add_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ID_AS]])
139     do
140     id_post_actions.extend (a_action)
141     end
142    
143     feature {NONE} -- Agent lists
144    
145     access_id_pre_actions, access_id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]]]
146    
147     assign_pre_actions, assign_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ASSIGN_AS]]]
148    
149     body_pre_actions, body_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[BODY_AS]]]
150    
151     class_pre_actions, class_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[CLASS_AS]]]
152    
153     feature_pre_actions, feature_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[FEATURE_AS]]]
154    
155     id_pre_actions, id_post_actions: LINKED_LIST[PROCEDURE[ANY, TUPLE[ID_AS]]]
156    
157 zurfluhs 93168 feature -- Execution Commands
158    
159 zurfluhs 93173 run_on_class (a_class_to_check: CLASS_C)
160 zurfluhs 93168 -- Check all rules that have been added
161 zurfluhs 93173 local
162     l_ast: CLASS_AS
163 zurfluhs 93168 do
164 zurfluhs 93173 -- across rule_checkers as l_checkers loop
165     -- l_checkers.item.clear_results
166     -- l_checkers.item.process_class (a_class_to_check)
167     -- end
168     l_ast := a_class_to_check.ast
169     across class_pre_actions as l_a loop l_a.item.call ([l_ast]) end
170     process_class_as (l_ast)
171     across class_post_actions as l_a loop l_a.item.call ([l_ast]) end
172     -- across rule_checkers as l_checkers loop
173     -- across l_checkers.item.results as l_rule_results loop
174     -- last_result.extend (l_rule_results.item)
175     -- end
176     -- end
177 zurfluhs 93168 last_run_successful := True
178     end
179    
180     feature {NONE} -- Processing
181    
182     process_access_id_as (l_as: ACCESS_ID_AS)
183     do
184 zurfluhs 93173 -- across rule_checkers as l_checkers loop
185     -- l_checkers.item.process_access_id (l_as)
186     -- end
187     across access_id_pre_actions as l_a loop l_a.item.call ([l_as]) end
188 zurfluhs 93168
189     Precursor (l_as)
190 zurfluhs 93173
191     across access_id_post_actions as l_a loop l_a.item.call ([l_as]) end
192 zurfluhs 93168 end
193    
194     process_assign_as (l_as: ASSIGN_AS)
195     do
196 zurfluhs 93173 -- across rule_checkers as l_checkers loop
197     -- l_checkers.item.process_assignment (l_as)
198     -- end
199     across assign_pre_actions as l_a loop l_a.item.call ([l_as]) end
200 zurfluhs 93168
201     Precursor (l_as)
202 zurfluhs 93173
203     across assign_post_actions as l_a loop l_a.item.call ([l_as]) end
204 zurfluhs 93168 end
205    
206     process_body_as (l_as: BODY_AS)
207     do
208 zurfluhs 93173 -- across rule_checkers as l_checkers loop
209     -- l_checkers.item.process_body (l_as)
210     -- end
211     across body_pre_actions as l_a loop l_a.item.call ([l_as]) end
212 zurfluhs 93168
213     Precursor (l_as)
214    
215 zurfluhs 93173 across body_post_actions as l_a loop l_a.item.call ([l_as]) end
216     -- across rule_checkers as l_checkers loop
217     -- l_checkers.item.process_body_end
218     -- end
219 zurfluhs 93168 end
220    
221     process_feature_as (l_as: FEATURE_AS)
222     do
223 zurfluhs 93173 -- across rule_checkers as l_checkers loop
224     -- l_checkers.item.process_feature (l_as)
225     -- end
226     across feature_pre_actions as l_a loop l_a.item.call ([l_as]) end
227 zurfluhs 93168
228     Precursor (l_as)
229 zurfluhs 93173
230     across feature_post_actions as l_a loop l_a.item.call ([l_as]) end
231 zurfluhs 93168 end
232    
233     process_id_as (l_as: ID_AS)
234     do
235 zurfluhs 93173 -- across rule_checkers as l_checkers loop
236     -- l_checkers.item.process_id (l_as)
237     -- end
238     across id_pre_actions as l_a loop l_a.item.call ([l_as]) end
239 zurfluhs 93168
240     Precursor (l_as)
241 zurfluhs 93173
242     across id_post_actions as l_a loop l_a.item.call ([l_as]) end
243 zurfluhs 93168 end
244    
245     feature -- Results
246    
247     last_run_successful: BOOLEAN
248    
249 zurfluhs 93173 -- last_result: HASH_TABLE[LINKED_LIST[CA_RULE_VIOLATION], CLASS_C]
250 zurfluhs 93168
251     feature -- Rule Checkers
252    
253 zurfluhs 93173 -- rule_checkers: LINKED_LIST[CA_RULE_CHECKER]
254 zurfluhs 93168
255 zurfluhs 93173 --invariant
256     -- rule_checkers_list_exists: rule_checkers /= Void
257 zurfluhs 93168 end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23