/[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 93181 - (show annotations)
Tue Oct 29 10:59:59 2013 UTC (6 years, 1 month ago) by zurfluhs
File size: 4855 byte(s)
Code Analysis:

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23