3
<title>AdaControl Programmer Manual V1.9r4</title>
3
<title>AdaControl Programmer Manual V1.12b1</title>
4
4
<meta http-equiv="Content-Type" content="text/html">
5
<meta name="description" content="AdaControl Programmer Manual V1.9r4">
6
<meta name="generator" content="makeinfo 4.8">
5
<meta name="description" content="AdaControl Programmer Manual V1.12b1">
6
<meta name="generator" content="makeinfo 4.13">
7
7
<link title="Top" rel="top" href="#Top">
8
8
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
9
9
<meta http-equiv="Content-Style-Type" content="text/css">
23
<h1 class="settitle">AdaControl Programmer Manual V1.9r4</h1>
23
<h1 class="settitle">AdaControl Programmer Manual V1.12b1</h1>
27
27
Next: <a rel="next" accesskey="n" href="#General">General</a>,
28
28
Previous: <a rel="previous" accesskey="p" href="#dir">(dir)</a>,
29
29
Up: <a rel="up" accesskey="u" href="#dir">(dir)</a>
33
33
<h2 class="unnumbered">AdaControl Programmer Manual</h2>
35
<p>Last edited: 28 April 2008
35
<p>Last edited: 2 March 2010
37
37
<p>This is the AdaControl Programmer Manual. It is intended for those who
38
want to add new rules to AdaControl. Reading this manual is not
39
necessary to use AdaControl. On the other hand, it is assumed that the
40
reader knows how to use AdaControl before thinking of adding new rules.
38
want to add new rules to AdaControl, or more generally modify (and
39
presumably improve!) AdaControl. Reading this manual is not necessary
40
to use AdaControl. On the other hand, it is assumed that the reader
41
is familiar with how to use AdaControl.
43
44
<li><a accesskey="1" href="#General">General</a>
81
82
copyright notice is included unmodified in any copy.
85
85
<a name="General"></a>
86
87
Next: <a rel="next" accesskey="n" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>,
87
88
Previous: <a rel="previous" accesskey="p" href="#Top">Top</a>,
88
89
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
95
96
AdaControl. Since AdaControl is based on ASIS, this manual assumes
96
97
that the reader has some familiarity with ASIS programming.
98
<p>The AdaControl tool includes several main components. Those that are
99
<h3 class="section">1.1 vocabulary</h3>
101
<p>Some terms have a precise definition in AdaControl, and will be used
102
with that signification in the rest of this manual.
104
<p>A <i>rule</i> is an AdaControl package whose purpose is to recognize
105
occurrences of certain constructs in Ada programs. All rules are
106
children of the “Rules” package. By extension, the term rule is
107
also used to designate the check that is performed by the package. A
108
rule has a name, and may have parameters.
110
<p>A <i>control</i> defines a check to be performed on some Ada text. A
111
control is defined by a rule, and the value of the parameters given to
114
<p>A <i>command</i> is a statement in the command language interpreted by
117
<p>A <i>control command</i> is a kind of command that describes a check to
118
be performed. A control commmand includes a <i>kind</i> (“check”, “search”
119
or “count”, see user's guide), and a control (rule name and parameters).
121
<p>A <i>context</i> is a set of values used by a rule to keep the
122
characteristics associated with a control. Those values can, but need
123
not necessarily, be the parameters of the control.
125
<h3 class="section">1.2 General organization</h3>
127
<p>The AdaControl tool includes several main components. Those that are
99
128
relevant for writing new rules are:
101
130
<li>A general <i>framework</i> that provides services that are necessary to
115
144
<div class="node">
117
145
<a name="The-framework-and-utilities-packages"></a>
118
147
Next: <a rel="next" accesskey="n" href="#Writing-a-new-rule">Writing a new rule</a>,
119
148
Previous: <a rel="previous" accesskey="p" href="#General">General</a>,
120
149
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
161
190
<div class="node">
163
191
<a name="The-package-Adactl_Constants"></a>
164
192
<a name="The-package-Adactl_005fConstants"></a>
165
194
Next: <a rel="next" accesskey="n" href="#The-package-Framework">The package Framework</a>,
166
195
Previous: <a rel="previous" accesskey="p" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>,
167
196
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
180
209
any reasonable program, but should you hit one of these limits, you
181
210
can safely change them here. No other change is required.
212
<p>If a rule needs to set a fixed dimension to some tables for example,
213
it should use the constants defined in this package. If no existing
214
constant is appropriate, add a new one to the package, don't define
215
dimensioning constants in the rule itself.
183
217
<div class="node">
185
218
<a name="The-package-Framework"></a>
186
220
Next: <a rel="next" accesskey="n" href="#The-package-Framework_002eRules_005fManager">The package Framework.Rules_Manager</a>,
187
221
Previous: <a rel="previous" accesskey="p" href="#The-package-Adactl_005fConstants">The package Adactl_Constants</a>,
188
222
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
206
240
<pre class="example"> search Entities (Blah);
207
241
Strictly_Forbidden: check entities (Ada.Unchecked_Conversion)
209
243
<p>the rule Entities must associate that <code>Blah</code> is the target of a
210
244
search, and that <code>Ada.Unchecked_Deallocation</code> is the target of a
211
245
check with label <code>Strictly_Forbidden</code>.
214
248
<div class="node">
216
249
<a name="The-package-Framework.Rules_Manager"></a>
217
250
<a name="The-package-Framework_002eRules_005fManager"></a>
218
252
Next: <a rel="next" accesskey="n" href="#The-package-Framework_002eReports">The package Framework.Reports</a>,
219
253
Previous: <a rel="previous" accesskey="p" href="#The-package-Framework">The package Framework</a>,
220
254
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
238
272
currently active.
240
274
<div class="node">
242
275
<a name="The-package-Framework.Reports"></a>
243
276
<a name="The-package-Framework_002eReports"></a>
244
278
Next: <a rel="next" accesskey="n" href="#The-package-Framework_002eLanguage">The package Framework.Language</a>,
245
279
Previous: <a rel="previous" accesskey="p" href="#The-package-Framework_002eRules_005fManager">The package Framework.Rules_Manager</a>,
246
280
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
301
335
“Uncheckable” to work.
303
337
<div class="node">
305
338
<a name="The-package-Framework.Language"></a>
306
339
<a name="The-package-Framework_002eLanguage"></a>
307
341
Next: <a rel="next" accesskey="n" href="#The-package-Framework_002eScope_005fManager">The package Framework.Scope_Manager</a>,
308
342
Previous: <a rel="previous" accesskey="p" href="#The-package-Framework_002eReports">The package Framework.Reports</a>,
309
343
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
348
382
as implicitely provided by GNAT, does <i>not</i> work).
350
384
<div class="node">
352
385
<a name="The-package-Framework.Scope_Manager"></a>
353
386
<a name="The-package-Framework_002eScope_005fManager"></a>
354
388
Next: <a rel="next" accesskey="n" href="#The-package-Framework_002ePlugs">The package Framework.Plugs</a>,
355
389
Previous: <a rel="previous" accesskey="p" href="#The-package-Framework_002eLanguage">The package Framework.Language</a>,
356
390
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
378
412
<p>See the package specification for more details.
380
414
<div class="node">
382
415
<a name="The-package-Framework.Plugs"></a>
383
416
<a name="The-package-Framework_002ePlugs"></a>
384
418
Next: <a rel="next" accesskey="n" href="#The-package-Rules">The package Rules</a>,
385
419
Previous: <a rel="previous" accesskey="p" href="#The-package-Framework_002eScope_005fManager">The package Framework.Scope_Manager</a>,
386
420
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
397
431
described in details in <a href="#Plugging_002din-a-new-rule-into-the-framework">Plugging-in a new rule into the framework</a>.
399
433
<div class="node">
401
434
<a name="The-package-Rules"></a>
402
436
Next: <a rel="next" accesskey="n" href="#The-package-Utilities">The package Utilities</a>,
403
437
Previous: <a rel="previous" accesskey="p" href="#The-package-Framework_002ePlugs">The package Framework.Plugs</a>,
404
438
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
414
448
be used for instantiating <code>Traverse_Element</code>in simple cases.
416
450
<div class="node">
418
451
<a name="The-package-Utilities"></a>
419
453
Next: <a rel="next" accesskey="n" href="#The-package-Thick_005fQueries">The package Thick_Queries</a>,
420
454
Previous: <a rel="previous" accesskey="p" href="#The-package-Rules">The package Rules</a>,
421
455
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
471
505
<div class="node">
473
506
<a name="The-package-Thick_Queries"></a>
474
507
<a name="The-package-Thick_005fQueries"></a>
475
509
Next: <a rel="next" accesskey="n" href="#The-packages-Linear_005fQueue-and-Binary_005fMap">The packages Linear_Queue and Binary_Map</a>,
476
510
Previous: <a rel="previous" accesskey="p" href="#The-package-Utilities">The package Utilities</a>,
477
511
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
488
522
<div class="node">
490
523
<a name="The-packages-Linear_Queue-and-Binary_Map"></a>
491
524
<a name="The-packages-Linear_005fQueue-and-Binary_005fMap"></a>
492
526
Next: <a rel="next" accesskey="n" href="#The-package-A4G_005fBugs">The package A4G_Bugs</a>,
493
527
Previous: <a rel="previous" accesskey="p" href="#The-package-Thick_005fQueries">The package Thick_Queries</a>,
494
528
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
517
551
<p>See existing rules for examples of using this package.
519
553
<div class="node">
521
554
<a name="The-package-A4G_Bugs"></a>
522
555
<a name="The-package-A4G_005fBugs"></a>
523
557
Previous: <a rel="previous" accesskey="p" href="#The-packages-Linear_005fQueue-and-Binary_005fMap">The packages Linear_Queue and Binary_Map</a>,
524
558
Up: <a rel="up" accesskey="u" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>
546
580
replacement in <code>A4G_Bugs</code>.
548
582
<div class="node">
550
583
<a name="Writing-a-new-rule"></a>
551
585
Next: <a rel="next" accesskey="n" href="#Plugging_002din-a-new-rule-into-the-framework">Plugging-in a new rule into the framework</a>,
552
586
Previous: <a rel="previous" accesskey="p" href="#The-framework-and-utilities-packages">The framework and utilities packages</a>,
553
587
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
909
943
<div class="node">
911
944
<a name="Plugging-in-a-new-rule-into-the-framework"></a>
912
945
<a name="Plugging_002din-a-new-rule-into-the-framework"></a>
913
947
Next: <a rel="next" accesskey="n" href="#Testing-and-debugging-a-rule">Testing and debugging a rule</a>,
914
948
Previous: <a rel="previous" accesskey="p" href="#Writing-a-new-rule">Writing a new rule</a>,
915
949
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
927
961
<div class="node">
929
962
<a name="Normal-case"></a>
930
964
Next: <a rel="next" accesskey="n" href="#Specific-rules">Specific rules</a>,
931
965
Previous: <a rel="previous" accesskey="p" href="#Plugging_002din-a-new-rule-into-the-framework">Plugging-in a new rule into the framework</a>,
932
966
Up: <a rel="up" accesskey="u" href="#Plugging_002din-a-new-rule-into-the-framework">Plugging-in a new rule into the framework</a>
976
1010
<pre class="example"> <b>with</b> Rules.Pragmas;
978
1012
<li>Add calls to the rule's <code>Process</code> procedure(s) at the appropriate
979
1013
place(s) in the body of the provided procedures. For textual rules,
980
1014
<code>Text_Analysis</code> is the only appropriate place.
1011
1045
alternatives of the big case statement.
1013
1047
<div class="node">
1015
1048
<a name="Specific-rules"></a>
1016
1050
Next: <a rel="next" accesskey="n" href="#User-documentation">User documentation</a>,
1017
1051
Previous: <a rel="previous" accesskey="p" href="#Normal-case">Normal case</a>,
1018
1052
Up: <a rel="up" accesskey="u" href="#Plugging_002din-a-new-rule-into-the-framework">Plugging-in a new rule into the framework</a>
1047
1081
show that it is a specific version.
1049
1083
<div class="node">
1051
1084
<a name="User-documentation"></a>
1052
1086
Previous: <a rel="previous" accesskey="p" href="#Specific-rules">Specific rules</a>,
1053
1087
Up: <a rel="up" accesskey="u" href="#Plugging_002din-a-new-rule-into-the-framework">Plugging-in a new rule into the framework</a>
1064
1098
you need will be quite straightforward to understand.
1066
1100
<div class="node">
1068
1101
<a name="Testing-and-debugging-a-rule"></a>
1069
1103
Previous: <a rel="previous" accesskey="p" href="#Plugging_002din-a-new-rule-into-the-framework">Plugging-in a new rule into the framework</a>,
1070
1104
Up: <a rel="up" accesskey="u" href="#Top">Top</a>
1082
1116
<div class="node">
1084
1117
<a name="Testing"></a>
1085
1119
Next: <a rel="next" accesskey="n" href="#Debugging-aids">Debugging aids</a>,
1086
1120
Previous: <a rel="previous" accesskey="p" href="#Testing-and-debugging-a-rule">Testing and debugging a rule</a>,
1087
1121
Up: <a rel="up" accesskey="u" href="#Testing-and-debugging-a-rule">Testing and debugging a rule</a>
1108
1142
is done currently, and do the same.
1110
1144
<div class="node">
1112
1145
<a name="Debugging-aids"></a>
1113
1147
Next: <a rel="next" accesskey="n" href="#Integrating-the-test-in-the-test-suite">Integrating the test in the test suite</a>,
1114
1148
Previous: <a rel="previous" accesskey="p" href="#Testing">Testing</a>,
1115
1149
Up: <a rel="up" accesskey="u" href="#Testing-and-debugging-a-rule">Testing and debugging a rule</a>
1166
1200
instead. See <a href="#The-package-A4G_005fBugs">The package A4G_Bugs</a>.
1168
1202
<div class="node">
1170
1203
<a name="Integrating-the-test-in-the-test-suite"></a>
1171
1205
Previous: <a rel="previous" accesskey="p" href="#Debugging-aids">Debugging aids</a>,
1172
1206
Up: <a rel="up" accesskey="u" href="#Testing-and-debugging-a-rule">Testing and debugging a rule</a>