Style enforcementAda-ASSURED supports professional quality and style guidelines. Many of these are enforced automatically by the pretty printer. Style violations that can not be corrected by formatting are automatically detected and indicated. These require programmer intervention to correct.
Insert a <statement> placeholder after the
A:=100; statement by clicking to the right of the semicolon
and striking RETURN. Enter goto a; then strike
RETURN.
The use of the goto is detected and a violation message is printed inline. Notice that the violation message is formatted as a comment, so it will not interfere with compilation. Violation codes in square brackets, e.g., [V4], are hot links to Ada 95 Quality and Style: Guidelines for Professional Programmers.
Click on [V4]. Then return to this page by backing up in
the documentation browser.
Ada-ASSURED detects and reports many different types of style violation. For example, all blocks must be named.
Move the structural selection to a <statement>
placeholder (if none currently exists, then one can be created by
clicking to the right of an existing statement, and striking
RETURN).
|
Select the Transforms/block menu item. | |
|
Note that the block template comes supplied with a placeholder for the block name. This is an optional part of the syntax, so when the selection is moved away from the placeholder, it will disappear.
Click on the <statement>
placeholder within the block-body. Note that a violation is reported.
To bring the block into compliance, materialize an
<identifier> placeholder again by clicking on
VIOLATION, and then striking RETURN. Do not enter a name
just yet.
Click again on the <statement>
placeholder so that the violation message reappears.