/[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 93181 - (hide annotations)
Tue Oct 29 10:59:59 2013 UTC (6 years, 2 months 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 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     last_run_successful := False
45 zurfluhs 93173
46     create_action_lists
47 zurfluhs 93168 end
48    
49 zurfluhs 93173 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 zurfluhs 93181 feature {CA_STANDARD_RULE}
66 zurfluhs 93168
67 zurfluhs 93173 add_access_id_pre_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
68 zurfluhs 93168 do
69 zurfluhs 93173 access_id_pre_actions.extend (a_action)
70 zurfluhs 93168 end
71    
72 zurfluhs 93173 add_access_id_post_action (a_action: PROCEDURE[ANY, TUPLE[ACCESS_ID_AS]])
73 zurfluhs 93168 do
74 zurfluhs 93173 access_id_post_actions.extend (a_action)
75 zurfluhs 93168 end
76    
77 zurfluhs 93173 add_assign_pre_action (a_action: PROCEDURE[ANY, TUPLE[ASSIGN_AS]])
78 zurfluhs 93168 do
79 zurfluhs 93173 assign_pre_actions.extend (a_action)
80 zurfluhs 93168 end
81    
82 zurfluhs 93173 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 zurfluhs 93168 feature -- Execution Commands
142    
143 zurfluhs 93173 run_on_class (a_class_to_check: CLASS_C)
144 zurfluhs 93168 -- Check all rules that have been added
145 zurfluhs 93173 local
146     l_ast: CLASS_AS
147 zurfluhs 93168 do
148 zurfluhs 93173 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 zurfluhs 93168 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 zurfluhs 93173 across access_id_pre_actions as l_a loop l_a.item.call ([l_as]) end
160 zurfluhs 93168
161     Precursor (l_as)
162 zurfluhs 93173
163     across access_id_post_actions as l_a loop l_a.item.call ([l_as]) end
164 zurfluhs 93168 end
165    
166     process_assign_as (l_as: ASSIGN_AS)
167     do
168 zurfluhs 93173 across assign_pre_actions as l_a loop l_a.item.call ([l_as]) end
169 zurfluhs 93168
170     Precursor (l_as)
171 zurfluhs 93173
172     across assign_post_actions as l_a loop l_a.item.call ([l_as]) end
173 zurfluhs 93168 end
174    
175     process_body_as (l_as: BODY_AS)
176     do
177 zurfluhs 93173 across body_pre_actions as l_a loop l_a.item.call ([l_as]) end
178 zurfluhs 93168
179     Precursor (l_as)
180    
181 zurfluhs 93173 across body_post_actions as l_a loop l_a.item.call ([l_as]) end
182 zurfluhs 93168 end
183    
184     process_feature_as (l_as: FEATURE_AS)
185     do
186 zurfluhs 93173 across feature_pre_actions as l_a loop l_a.item.call ([l_as]) end
187 zurfluhs 93168
188     Precursor (l_as)
189 zurfluhs 93173
190     across feature_post_actions as l_a loop l_a.item.call ([l_as]) end
191 zurfluhs 93168 end
192    
193     process_id_as (l_as: ID_AS)
194     do
195 zurfluhs 93173 across id_pre_actions as l_a loop l_a.item.call ([l_as]) end
196 zurfluhs 93168
197     Precursor (l_as)
198 zurfluhs 93173
199     across id_post_actions as l_a loop l_a.item.call ([l_as]) end
200 zurfluhs 93168 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