Initial CustomizationBefore doing serious work with Ada-ASSURED, you should review the style enforcement parameters and establish settings appropriate for your site, project, or individual needs.
This chapter shows you how to create personal or project preferences. The material is presented in the following sections:
Most style enforcement parameters are aggregated into a preference file that is loaded when Ada-ASSURED is invoked. The file is not in ASCII format, but can be viewed and modified from within Ada-ASSURED.
The location of the style enforcement parameters file is given by Ada-ASSURED resource user0. Thus, different groups can adopt different preferences by setting the user0 resource to refer to their own copies of the file. (For a discussion of how to set Ada-ASSURED resources, see Establishing Preferences.)
In this section, you create your own copy of the file and change a few of the preferences. Section Enforcement Parameter Form contains complete documentation on the parameters that can be customized in this manner.
| X | aahome/files/.aa_enforcement_params |
| MS | aahome\files\.aa_enforcement_params |
where aahome is the location of the Ada-ASSURED directory. Say your copy is
| X | /tmp/style |
| MS | C:\temp\style |
Make sure it is writable. Under Microsoft® Windows®, make sure that it is not a hidden file.
| X | aa -xrm 'aa83*user0:/tmp/style' |
| MS | aa -command "(define sg:user0 \"C:\\\temp\\\style\")" |
| X | Double quotes may be used in place of the single quotes. |
| MS |
The upshot of the complicated notation above is to define the Scheme variable sg:user0 to be "C:\temp\style". In Scheme, `\' is an escape character, and must be doubled to represent itself. The Scheme interpreter must see this text: (define sg:user0 "C:\\temp\\style") The text that is passed to the Scheme interpreter appears on the command line within double quotes, which affects the representations of both the double quote and the backslash. The double quote must be escaped with a preceding backslash: ``\"'', and the backslash itself must be tripled: ``\\\''. |
with text_io; use text_io; procedure demo is begin put("Hello World"); end;
Then strike Enter. Save the program to disk by invoking
save-as from the File menu, typing the name of
the file, say
| X | /tmp/demo.a |
| MS | C:\temp\demo.a |
and striking Enter.
| X | aa -xrm 'aa83*user0:/tmp/style' /tmp/demo.a |
| MS | aa -command "(define sg:user0 \"C:\\\temp\\\style\")" C:\temp\demo.a |
and note that Ada-ASSURED has been initialized with the revised parameters. The file /tmp/demo.a [X] or C:\temp\demo.a [MS] on disk is still in the old format because it was saved before the enforcement parameters were changed. If you were to save it to disk now, the file would be written in the new format.
For information about the notation of the command to invoke Ada-ASSURED, see the Technical Notes above.
A small number of enforcement parameters are associated with individual Ada-ASSURED resources and not the enforcement parameter file. To customize these parameters, you must define individual Ada-ASSURED resources. Complete documentation on these resources appears in Section Enforcement Parameter Form. This section illustrates how to change one of these preferences:
| X | aa -xrm 'aa83*indentingSpaces:1' /tmp/demo.a |
| MS | aa -command "(define sg:indenting-spaces 1)" C:\temp\demo.a |
which changes indentation to use just one space.
In the scenarios above, it has been convenient to set individual Ada-ASSURED resources on the aa command line. Multiple -xrm flags can be used if you have several resources to set. However, when you are ready to establish personal or project preferences for real, you should create appropriate Ada-ASSURED resource initializations in the standard file for doing so, e.g., .Xdefaults.
For the example above, the following two lines would be placed into the resource file:
aa83*user0: /tmp/style
aa83*indentingSpaces: 1
In the scenarios above, it has been convenient to set individual Ada-ASSURED resources on the aa command line. Multiple define forms can be used if you have several resources to set. However, when you are ready to establish personal or project preferences for real, you should create appropriate Ada-ASSURED resource initializations in the standard file for doing so:
aahome\Users\username\aa_options.stk
For the example above, the following two lines would be placed into the resource file:
(define sg:user0 "C:\\temp\\style")
(define sg:indenting-spaces 1)
For information about the extra backslashes in the first line, see the Technical Notes above.
Chapter Standards Enforcement documents all aspects of style enforcement; Chapter Customizing an Editor documents all features that can be customized via individual Ada-ASSURED resources. You should peruse these chapters to get an idea of what is possible.
We draw your attention to one particular class of customizations that you should consider early: comments. Like many other tools, Ada-ASSURED uses the character after ``--'' for its own purposes. The system, as delivered, has the following defaults:
If any of these conventions conflicts with your coding practices, you will want to make the appropriate change. See Chapter Comments for documentation on comments.
-- normal comment --+ continuation comment --| untouchable comment --( begin freeform region --) end freeform region --C commented out code