/[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 93168 - (hide annotations)
Thu Oct 24 19:43:13 2013 UTC (6 years, 3 months ago) by zurfluhs
File size: 3026 byte(s)
Code Analysis: initial commit for code analysis project. Library 'code_analysis' added.
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     export
13     {NONE}
14     process_none_id_as,
15     process_typed_char_as,
16     process_agent_routine_creation_as,
17     process_inline_agent_creation_as,
18     process_create_creation_as,
19     process_bang_creation_as,
20     process_create_creation_expr_as,
21     process_bang_creation_expr_as,
22     process_keyword_as,
23     process_symbol_as,
24     process_break_as,
25     process_leaf_stub_as,
26     process_symbol_stub_as,
27     process_keyword_stub_as,
28     process_there_exists_as,
29     process_for_all_as
30     redefine
31     process_access_id_as,
32     process_assign_as,
33     process_body_as,
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     create rule_checkers.make
46     last_run_successful := False
47     create last_result.make
48     end
49    
50     feature -- Options For Execution
51    
52     add_rule_checker (a_rule_checker: CA_RULE_CHECKER)
53     do
54     rule_checkers.extend (a_rule_checker)
55     end
56    
57     remove_all_rule_checkers
58     do
59     rule_checkers.wipe_out
60     ensure
61     rule_checkers.is_empty
62     end
63    
64     clear_results
65     do
66     last_result.wipe_out
67     end
68    
69     feature -- Execution Commands
70    
71     run_on_class (a_class_to_check: CLASS_AS)
72     -- Check all rules that have been added
73     require
74     rule_checkers_added: not rule_checkers.is_empty
75     do
76     across rule_checkers as l_checkers loop
77     l_checkers.item.clear_results
78     l_checkers.item.process_class (a_class_to_check)
79     end
80    
81     process_class_as (a_class_to_check)
82    
83     across rule_checkers as l_checkers loop
84     across l_checkers.item.results as l_rule_results loop
85     last_result.extend (l_rule_results.item)
86     end
87     end
88     last_run_successful := True
89     ensure
90     last_run_successful implies last_result /= Void
91     end
92    
93     feature {NONE} -- Processing
94    
95     process_access_id_as (l_as: ACCESS_ID_AS)
96     do
97     across rule_checkers as l_checkers loop
98     l_checkers.item.process_access_id (l_as)
99     end
100    
101     Precursor (l_as)
102     end
103    
104     process_assign_as (l_as: ASSIGN_AS)
105     do
106     across rule_checkers as l_checkers loop
107     l_checkers.item.process_assignment (l_as)
108     end
109    
110     Precursor (l_as)
111     end
112    
113     process_body_as (l_as: BODY_AS)
114     do
115     across rule_checkers as l_checkers loop
116     l_checkers.item.process_body (l_as)
117     end
118    
119     Precursor (l_as)
120    
121     across rule_checkers as l_checkers loop
122     l_checkers.item.process_body_end
123     end
124     end
125    
126     process_feature_as (l_as: FEATURE_AS)
127     do
128     across rule_checkers as l_checkers loop
129     l_checkers.item.process_feature (l_as)
130     end
131    
132     Precursor (l_as)
133     end
134    
135     process_id_as (l_as: ID_AS)
136     do
137     across rule_checkers as l_checkers loop
138     l_checkers.item.process_id (l_as)
139     end
140    
141     Precursor (l_as)
142     end
143    
144     feature -- Results
145    
146     last_run_successful: BOOLEAN
147    
148     last_result: detachable LINKED_LIST[CA_RULE_VIOLATION]
149    
150     feature -- Rule Checkers
151    
152     rule_checkers: LINKED_LIST[CA_RULE_CHECKER]
153    
154     invariant
155     rule_checkers_list_exists: rule_checkers /= Void
156     end

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23