3
The initial version of the style checker should check the following
6
All subprograms should have separate declarations;
10
Add to the initial version of the style checker checks for the
13
All the generic instantiation should contain only named generic
16
Any declaration should define exactly one entity (that is,
17
multi-identifier declarations are not allowed);
19
The diagnosis generated when a style rule violation is detected
20
should contain the location of the syntax construct for which the
21
violation is detected.
23
The subdirectory 'task_1' contains three files:
25
- actuals_for_traversing-pre_op.adb - actual Pre-Operation to
26
instantiate Traverse_Element, this file should replace the file
27
with the same name in ASIS Application Templates to get the
30
- style_checker_utilities.ads and style_checker_utilities.adb - the
31
package Style_Checker_Utilities, contains the procedure for
32
printing out the style violation diagnosis.
34
The subdirectory 'task_2' contains one file:
36
- actuals_for_traversing-pre_op.adb - actual Pre-Operation to
37
instantiate Traverse_Element, this file should replace the file
38
with the same name in ASIS Application Templates to get the
39
solution for Task 2, it is the extended version of the same
40
file from subdirectory 'task_1', and it contains the code for
41
checks to be implemented for Task 2. This file uses the same
42
version of Style_Checker_Utilities as for Task 1.
47
The only thing to do to solve Task 1 is to provide the real code for
48
actual Pre-Operation for Traverse_Element. You do not need to do
49
anything in Post-Operation: Pre-Operation will give you the natural
50
left-to-right top-down sequence of style rule checking.
52
The rule to check is about declarations, and, more specific, about
53
only specific kinds of declarations - namely, about the subprogram
54
body declarations. So, the first thing to do is to define the kind of
55
the argument Element in Pre-Operation, and if it is a declaration
56
Element, you have to define its subordinate declaration kind.
58
Actually, you have to check, that each Element which represents a
59
subprogram body has the corresponding separate subprogram
60
declaration Element. To get the declaration for a body, you need the
61
Asis.Declarations.Corresponding_Declaration query. See also the
62
Element classification hierarchy defined in the Asis package and
63
classification queries in the package Asis.Elements.
65
Hints for Task 2 are given as comments in the solution for Task 1
66
(file task_1/actuals_for_traversing-pre_op.adb).
b'\\ No newline at end of file'