OSDN Git Service

2006-10-31 Javier Miranda <miranda@adacore.com>
[pf3gnuchains/gcc-fork.git] / gcc / ada / gnat-style.texi
1 \input texinfo   @c -*-texinfo-*-
2 @c %**start of header
3
4 @c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
5 @c                                                                            o
6 @c                           GNAT DOCUMENTATION                               o
7 @c                                                                            o
8 @c                     G N A T   C O D I N G   S T Y L E                      o
9 @c                                                                            o
10 @c                     Copyright (C) 1992-2005, AdaCore                       o
11 @c                                                                            o
12 @c  GNAT is free software;  you can  redistribute it  and/or modify it under  o
13 @c  terms of the  GNU General Public License as published  by the Free Soft-  o
14 @c  ware  Foundation;  either version 2,  or (at your option) any later ver-  o
15 @c  sion.  GNAT is distributed in the hope that it will be useful, but WITH-  o
16 @c  OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY  o
17 @c  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License  o
18 @c  for  more details.  You should have  received  a copy of the GNU General  o
19 @c  Public License  distributed with GNAT;  see file COPYING.  If not, write  o
20 @c  to  the  Free Software Foundation,  51  Franklin  Street,  Fifth  Floor,  o
21 @c  Boston, MA 02110-1301, USA.                                               o
22 @c                                                                            o
23 @c oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
24
25 @setfilename gnat-style.info
26
27 @settitle GNAT Coding Style
28 @setchapternewpage odd
29
30
31 @dircategory Software development
32 @direntry
33 * gnat-style: (gnat-style).      GNAT Coding Style
34 @end direntry
35
36 @macro syntax{element}
37 @t{\element\}
38 @end macro
39 @c %**end of header
40
41 @titlepage
42 @sp 10
43 @title GNAT Coding Style
44 @flushright
45 @titlefont{A Guide for GNAT Developers}
46 @end flushright
47 @sp 2
48 @subtitle GNAT, The GNU Ada 95 Compiler
49
50 @author Ada Core Technologies, Inc.
51
52 @page
53 @vskip 0pt plus 1filll
54
55 Copyright @copyright{} 1995-2005, Free Software Foundation
56
57 Permission is granted to copy, distribute and/or modify this document
58 under the terms of the GNU Free Documentation License, Version 1.1
59 or any later version published by the Free Software Foundation;
60 with the Invariant Sections being ``GNU Free Documentation License'', with the
61 Front-Cover Texts being
62 ``GNAT Coding Style'' and ``A Guide for GNAT Developers'',
63 and with no Back-Cover Texts.
64 A copy of the license is included in the section entitled
65 ``GNU Free Documentation License''.
66 @end titlepage
67
68 @raisesections
69
70 @node    Top,       General,         , (dir)
71 @comment node-name, next,    previous, up
72
73 @ifnottex
74 @noindent
75 GNAT Coding Style@*
76 A Guide for GNAT Developers
77 @sp 2
78 @noindent
79 GNAT, The GNU Ada 95 Compiler@*
80
81 @noindent
82 Permission is granted to copy, distribute and/or modify this document
83 under the terms of the GNU Free Documentation License, Version 1.1
84 or any later version published by the Free Software Foundation;
85 with the Invariant Sections being ``GNU Free Documentation License'', with the
86 Front-Cover Texts being
87 ``GNAT Coding Style'' and ``A Guide for GNAT Developers''
88 and with no Back-Cover Texts.
89 A copy of the license is included in the section entitled
90 ``GNU Free Documentation License''.
91 @end ifnottex
92
93
94 @menu
95 * General::
96 * Lexical Elements::
97 * Declarations and Types::
98 * Expressions and Names::
99 * Statements::
100 * Subprograms::
101 * Packages::
102 * Program Structure::
103 * GNU Free Documentation License::
104 * Index::
105 @end menu
106
107 @c  -------------------------------------------------------------------------
108 @node    General, Lexical Elements, Top, Top
109 @section General
110 @c  -------------------------------------------------------------------------
111
112 @noindent
113 Most of GNAT is written in Ada using a consistent style to ensure
114 readability of the code.  This document has been written to help
115 maintain this consistent style, while having a large group of developers
116 work on the compiler.
117
118 For the coding style in the C parts of the compiler and run time,
119 see the GNU Coding Guidelines.
120
121 This document is structured after the @cite{Ada Reference Manual}.
122 Those familiar with that document should be able to quickly
123 lookup style rules for particular constructs.
124
125
126 @c  -------------------------------------------------------------------------
127 @node    Lexical Elements, Declarations and Types, General, Top
128 @section Lexical Elements
129 @c  -------------------------------------------------------------------------
130 @cindex Lexical elements
131
132 @subsection Character Set and Separators
133 @c  -------------------------------------------------------------------------
134 @cindex Character set
135 @cindex ASCII
136 @cindex Separators
137 @cindex End-of-line
138 @cindex Line length
139 @cindex Indentation
140
141 @itemize @bullet
142 @item
143 The character set used should be plain 7-bit ASCII@.
144 The only separators allowed are space and the end-of-line sequence.
145 No other control character or format effector (such as @code{HT},
146 @code{VT}, @code{FF})
147 should be used.
148 The normal end-of-line sequence is used, which may be
149 @code{LF}, @code{CR/LF} or @code{CR},
150 depending on the host system.  An optional @code{SUB}
151 (@code{16#1A#}) may be present as the
152 last character in the file on hosts using that character as file terminator.
153
154 @item
155 Files that are checked in or distributed should be in host format.
156
157 @item
158 A line should never be longer than 79 characters, not counting the line
159 separator.
160
161 @item
162 Lines must not have trailing blanks.
163
164 @item
165 Indentation is 3 characters per level for @code{if} statements, loops, and
166 @code{case} statements.
167 For exact information on required spacing between lexical
168 elements, see file @file{style.adb}.
169 @cindex @file{style.adb} file
170 @end itemize
171
172
173 @subsection Identifiers
174 @c  -------------------------------------------------------------------------
175 @itemize @bullet
176 @cindex Identifiers
177
178 @item
179 Identifiers will start with an upper case letter, and each letter following
180 an underscore will be upper case.
181 @cindex Casing (for identifiers)
182 Short acronyms may be all upper case.
183 All other letters are lower case.
184 An exception is for identifiers matching a foreign language.  In particular,
185 we use all lower case where appropriate for C@.
186
187 @item
188 Use underscores to separate words in an identifier.
189 @cindex Underscores
190
191 @item Try to limit your use of abbreviations in identifiers.
192 It is ok to make a few abbreviations, explain what they mean, and then
193 use them frequently, but don't use lots of obscure abbreviations.  An
194 example is the @code{ALI} word which stands for Ada Library
195 Information and is by convention always written in upper-case when
196 used in entity names.
197
198 @smallexample @c adanocomment
199        procedure Find_ALI_Files;
200 @end smallexample
201
202 @item
203 Don't use the variable name @code{I}, use @code{J} instead; @code{I} is too
204 easily confused with @code{1} in some fonts.  Similarly don't use the
205 variable @code{O}, which is too easily mistaken for the number @code{0}.
206 @end itemize
207
208 @subsection Numeric Literals
209 @c  -------------------------------------------------------------------------
210 @cindex Numeric literals
211
212 @itemize @bullet
213 @item
214 Numeric literals should include underscores where helpful for
215 readability.
216 @cindex Underscores
217
218 @smallexample
219       1_000_000
220       16#8000_000#
221       3.14159_26535_89793_23846
222 @end smallexample
223 @end itemize
224
225 @subsection Reserved Words
226 @c  -------------------------------------------------------------------------
227 @cindex Reserved words
228
229 @itemize @bullet
230 @item
231 Reserved words use all lower case.
232 @cindex Casing (for reserved words)
233
234 @smallexample @c adanocomment
235        return else
236 @end smallexample
237
238 @item
239 The words @code{Access}, @code{Delta} and @code{Digits} are
240 capitalized when used as @syntax{attribute_designator}.
241 @end itemize
242
243 @subsection Comments
244 @c  -------------------------------------------------------------------------
245 @cindex Comments
246
247 @itemize @bullet
248 @item
249 A comment starts with @code{--} followed by two spaces).
250 The only exception to this rule (i.e.@: one space is tolerated) is when the
251 comment ends with a single space followed by @code{--}.
252 It is also acceptable to have only one space between @code{--} and the start
253 of the comment when the comment is at the end of a line,
254 after some Ada code.
255
256 @item
257 Every sentence in a comment should start with an upper-case letter (including
258 the first letter of the comment).
259 @cindex Casing (in comments)
260
261 @item
262 When declarations are commented with ``hanging'' comments, i.e.@:
263 comments after the declaration, there is no blank line before the
264 comment, and if it is absolutely necessary to have blank lines within
265 the comments, e.g. to make paragraph separations within a single comment,
266 these blank lines @emph{do} have a @code{--} (unlike the
267 normal rule, which is to use entirely blank lines for separating
268 comment paragraphs).  The comment starts at same level of indentation
269 as code it is commenting.
270 @cindex Blank lines (in comments)
271 @cindex Indentation
272
273 @smallexample @c adanocomment
274        z : Integer;
275        --  Integer value for storing value of z
276        --
277        --  The previous line was a blank line.
278 @end smallexample
279
280 @item
281 Comments that are dubious or incomplete, or that comment on possibly
282 wrong or incomplete code, should be preceded or followed by @code{???}@.
283
284 @item
285 Comments in a subprogram body must generally be surrounded by blank lines.
286 An exception is a comment that follows a line containing a single keyword
287 (@code{begin}, @code{else}, @code{loop}):
288
289 @smallexample @c adanocomment
290 @group
291        begin
292           --  Comment for the next statement
293
294           A := 5;
295
296           --  Comment for the B statement
297
298           B := 6;
299        end;
300 @end group
301 @end smallexample
302
303 @item
304 In sequences of statements, comments at the end of the lines should be
305 aligned.
306 @cindex Alignment (in comments)
307
308 @smallexample @c adanocomment
309         My_Identifier := 5;      --  First comment
310         Other_Id := 6;           --  Second comment
311 @end smallexample
312
313 @item
314 Short comments that fit on a single line are @emph{not} ended with a
315 period.  Comments taking more than a line are punctuated in the normal
316 manner.
317
318 @item
319 Comments should focus on @emph{why} instead of @emph{what}.
320 Descriptions of what subprograms do go with the specification.
321
322 @item
323 Comments describing a subprogram spec should specifically mention the
324 formal argument names.  General rule: write a comment that does not
325 depend on the names of things.  The names are supplementary, not
326 sufficient, as comments.
327
328 @item
329 @emph{Do not} put two spaces after periods in comments.
330 @end itemize
331
332 @c  -------------------------------------------------------------------------
333 @node    Declarations and Types, Expressions and Names, Lexical Elements,Top
334 @section Declarations and Types
335 @c  -------------------------------------------------------------------------
336 @cindex Declarations and Types
337
338 @itemize @bullet
339 @item
340 In entity declarations, colons must be surrounded by spaces.  Colons
341 should be aligned.
342 @cindex Alignment (in declarations)
343
344 @smallexample @c adanocomment
345         Entity1   : Integer;
346         My_Entity : Integer;
347 @end smallexample
348
349 @item
350 Declarations should be grouped in a logical order.
351 Related groups of declarations may be preceded by a header comment.
352
353 @item
354 All local subprograms in a subprogram or package body should be declared
355 before the first local subprogram body.
356
357 @item
358 Do not declare local entities that hide global entities.
359 @cindex Hiding of outer entities
360
361 @item
362 Do not declare multiple variables in one declaration that spans lines.
363 Start a new declaration on each line, instead.
364
365 @item
366 The @syntax{defining_identifier}s of global declarations serve as
367 comments of a sort.  So don't choose terse names, but look for names
368 that give useful information instead.
369
370 @item
371 Local names can be shorter, because they are used only within
372 one context, where comments explain their purpose.
373
374 @end itemize
375
376
377 @c  -------------------------------------------------------------------------
378 @node    Expressions and Names, Statements, Declarations and Types, Top
379 @section Expressions and Names
380 @c  -------------------------------------------------------------------------
381 @cindex Expressions and names
382
383 @itemize @bullet
384
385 @item
386 Every operator must be surrounded by spaces. An exception is that
387 this rule does not apply to the exponentiation operator, for which
388 there are no specific layout rules. The reason for this exception
389 is that sometimes it makes clearer reading to leave out the spaces
390 around exponentiation.
391 @cindex Operators
392
393 @smallexample @c adanocomment
394        E := A * B**2 + 3 * (C - D);
395 @end smallexample
396
397 @item
398 Use parentheses where they clarify the intended association of operands
399 with operators:
400 @cindex Parenthesization of expressions
401 @smallexample @c adanocomment
402        (A / B) * C
403 @end smallexample
404 @end itemize
405
406 @c  -------------------------------------------------------------------------
407 @node    Statements, Subprograms, Expressions and Names, Top
408 @section Statements
409 @c  -------------------------------------------------------------------------
410 @cindex Statements
411
412 @subsection Simple and Compound Statements
413 @c  -------------------------------------------------------------------------
414 @cindex Simple and compound statements
415
416 @itemize @bullet
417 @item
418 Use only one statement or label per line.
419 @item
420 A longer @syntax{sequence_of_statements} may be divided in logical
421 groups or separated from surrounding code using a blank line.
422 @end itemize
423
424 @subsection If Statements
425 @c  -------------------------------------------------------------------------
426 @cindex @code{if} statement
427
428 @itemize @bullet
429 @item
430 When the @code{if}, @code{elsif} or @code{else} keywords fit on the
431 same line with the condition and the @code{then} keyword, then the
432 statement is formatted as follows:
433 @cindex Alignment (in an @code{if} statement)
434
435 @smallexample @c adanocomment
436 @group
437         if @var{condition} then
438            ...
439         elsif @var{condition} then
440            ...
441         else
442            ...
443         end if;
444 @end group
445 @end smallexample
446
447 @noindent
448 When the above layout is not possible, @code{then} should be aligned
449 with @code{if}, and conditions should preferably be split before an
450 @code{and} or @code{or} keyword a follows:
451
452 @smallexample @c adanocomment
453 @group
454         if @var{long_condition_that_has_to_be_split}
455           and then @var{continued_on_the_next_line}
456         then
457            ...
458         end if;
459 @end group
460 @end smallexample
461
462 @noindent
463 The @code{elsif}, @code{else} and @code{end if} always line up with
464 the @code{if} keyword.  The preferred location for splitting the line
465 is before @code{and} or @code{or}.  The continuation of a condition is
466 indented with two spaces or as many as needed to make nesting clear.
467 As an exception, if conditions are closely related either of the
468 following is allowed:
469
470 @smallexample
471 @group
472      if x = lakdsjfhlkashfdlkflkdsalkhfsalkdhflkjdsahf
473           or else
474         x = asldkjhalkdsjfhhfd
475           or else
476         x = asdfadsfadsf
477      then
478        ...
479      end if;
480 @end group
481
482 @group
483      if x = lakdsjfhlkashfdlkflkdsalkhfsalkdhflkjdsahf or else
484         x = asldkjhalkdsjfhhfd                         or else
485         x = asdfadsfadsf
486      then
487        ...
488      end if;
489 @end group
490 @end smallexample
491
492 @item
493 Conditions should use short-circuit forms (@code{and then},
494 @code{or else}), except when the operands are boolean variables
495 or boolean constants.
496 @cindex Short-circuit forms
497
498 @item
499 Complex conditions in @code{if} statements are indented two characters:
500 @cindex Indentation (in @code{if} statements)
501
502 @smallexample @c adanocomment
503 @group
504       if @var{this_complex_condition}
505         and then @var{that_other_one}
506         and then @var{one_last_one}
507       then
508          ...
509       end if;
510 @end group
511 @end smallexample
512
513 @noindent
514 There are some cases where complex conditionals can be laid out
515 in manners that do not follow these rules to preserve better
516 parallelism between branches, e.g.
517
518 @smallexample @c adanocomment
519 @group
520       if xyz.abc (gef) = 'c'
521            or else
522          xyz.abc (gef) = 'x'
523       then
524          ...
525       end if;
526 @end group
527 @end smallexample
528
529
530 @item
531 Every @code{if} block is preceded and followed by a blank line, except
532 where it begins or ends a @syntax{sequence_of_statements}.
533 @cindex Blank lines (in an @code{if} statement)
534
535 @smallexample @c adanocomment
536 @group
537         A := 5;
538
539         if A = 5 then
540            null;
541         end if;
542
543         A := 6;
544 @end group
545 @end smallexample
546 @end itemize
547
548 @subsection Case Statements
549 @cindex @code{case} statements
550
551 @itemize @bullet
552 @item
553 Layout is as below.  For long @code{case} statements, the extra indentation
554 can be saved by aligning the @code{when} clauses with the opening @code{case}.
555
556 @smallexample @c adanocomment
557 @group
558        case @var{expression} is
559           when @var{condition} =>
560              ...
561           when @var{condition} =>
562              ...
563        end case;
564 @end group
565 @end smallexample
566 @end itemize
567
568 @subsection Loop Statements
569 @cindex Loop statements
570
571 @itemize @bullet
572 @noindent
573 When possible, have @code{for} or @code{while} on one line with the
574 condition and the @code{loop} keyword.
575
576 @smallexample @c adanocomment
577 @group
578        for J in S'Range loop
579           ...
580        end loop;
581 @end group
582 @end smallexample
583
584 @noindent
585 If the condition is too long, split the condition (see ``If
586 statements'' above) and align @code{loop} with the @code{for} or
587 @code{while} keyword.
588 @cindex Alignment (in a loop statement)
589
590 @smallexample @c adanocomment
591 @group
592       while @var{long_condition_that_has_to_be_split}
593         and then @var{continued_on_the_next_line}
594       loop
595          ...
596       end loop;
597 @end group
598 @end smallexample
599
600 @noindent
601 If the @syntax{loop_statement} has an identifier, it is laid out as follows:
602
603 @smallexample @c adanocomment
604 @group
605       Outer : while not @var{condition} loop
606          ...
607       end Outer;
608 @end group
609 @end smallexample
610 @end itemize
611
612 @subsection Block Statements
613 @cindex Block statement
614
615 @itemize @bullet
616 @item
617 The @code{declare} (optional), @code{begin} and @code{end} words
618 are aligned, except when the @syntax{block_statement} is named.  There
619 is a blank line before the @code{begin} keyword:
620 @cindex Alignment (in a block statement)
621
622 @smallexample @c adanocomment
623 @group
624       Some_Block : declare
625          ...
626
627       begin
628          ...
629       end Some_Block;
630 @end group
631 @end smallexample
632
633 @end itemize
634
635 @c  -------------------------------------------------------------------------
636 @node    Subprograms, Packages, Statements, Top
637 @section Subprograms
638 @c  -------------------------------------------------------------------------
639 @cindex Subprograms
640
641 @subsection Subprogram Declarations
642 @c  -------------------------------------------------------------------------
643 @itemize @bullet
644
645 @item
646 Do not write the @code{in} for parameters, especially in functions:
647
648 @smallexample @c adanocomment
649       function Length (S : String) return Integer;
650 @end smallexample
651
652 @item
653 When the declaration line for a procedure or a function is too long to fit
654 the entire declaration (including the keyword procedure or function) on a
655 single line, then fold it, putting a single parameter on a line, aligning
656 the colons, as in:
657
658 @smallexample @c adanocomment
659 @group
660      procedure Set_Heading
661         (Source : String;
662          Count  : Natural;
663          Pad    : Character := Space;
664          Fill   : Boolean   := True);
665 @end group
666 @end smallexample
667
668 @noindent
669 In the case of a function, if the entire spec does not fit on one line, then
670 the return may appear after the last parameter, as in:
671
672 @smallexample @c adanocomment
673 @group
674       function Head
675         (Source : String;
676          Count  : Natural;
677          Pad    : Character := Space) return String;
678 @end group
679 @end smallexample
680
681 @noindent
682 Or it may appear on its own as a separate line. This form is preferred when
683 putting the return on the same line as the last parameter would result in
684 an overlong line. The return type may optionally be aligned with the types
685 of the parameters (usually we do this aligning if it results only in a small
686 number of extra spaces, and otherwise we don't attempt to align). So two
687 alternative forms for the above spec are:
688
689 @smallexample @c adanocomment
690 @group
691       function Head
692         (Source : String;
693          Count  : Natural;
694          Pad    : Character := Space)
695          return   String;
696
697       function Head
698         (Source : String;
699          Count  : Natural;
700          Pad    : Character := Space)
701          return String;
702 @end group
703 @end smallexample
704
705 @end itemize
706
707 @subsection Subprogram Bodies
708 @c  -------------------------------------------------------------------------
709 @cindex Subprogram bodies
710
711 @itemize @bullet
712 @item
713 Function and procedure bodies should usually be sorted alphabetically. Do
714 not attempt to sort them in some logical order by functionality. For a
715 sequence of subrpgroams specs, a general alphabetical sorting is also
716 usually appropriate, but occasionally it makes sense to group by major
717 function, with appropriate headers.
718
719 @item
720 All subprograms have a header giving the function name, with the following
721 format:
722
723 @smallexample @c adanocomment
724 @group
725       -----------------
726       -- My_Function --
727       -----------------
728
729       procedure My_Function is
730       begin
731         ...
732       end My_Function;
733 @end group
734 @end smallexample
735
736 @noindent
737 Note that the name in the header is preceded by a single space,
738 not two spaces as for other comments. These headers are used on
739 nested subprograms as well as outer level subprograms. They may
740 also be used as headers for sections of comments, or collections
741 of declarations that are related.
742
743 @item
744 Every subprogram body must have a preceding @syntax{subprogram_declaration}.
745
746 @item
747 @cindex Blank lines (in subprogram bodies)
748 A sequence of declarations may optionally be separated from the following
749 begin by a blank line.  Just as we optionally allow blank lines in general
750 between declarations, this blank line should be present only if it improves
751 readability. Generally we avoid this blank line if the declarative part is
752 small (one or two lines) and we include it if the declarative part is long.
753
754 @item
755 If the declarations in a subprogram contain at least one nested
756 subprogram body, then just before the @code{begin} of the enclosing
757 subprogram, there is a comment line and a blank line:
758
759 @smallexample @c adanocomment
760 @group
761     --  Start of processing for @var{Enclosing_Subprogram}
762
763     begin
764       ...
765     end @var{Enclosing_Subprogram};
766 @end group
767 @end smallexample
768
769 @end itemize
770
771 @c  -------------------------------------------------------------------------
772 @node    Packages, Program Structure, Subprograms, Top
773 @section Packages and Visibility Rules
774 @c  -------------------------------------------------------------------------
775 @cindex Packages
776
777 @itemize @bullet
778 @item
779 All program units and subprograms have their name at the end:
780
781 @smallexample @c adanocomment
782 @group
783       package P is
784          ...
785       end P;
786 @end group
787 @end smallexample
788
789 @item
790 We will use the style of @code{use}-ing @code{with}-ed packages, with
791 the context clauses looking like:
792 @cindex @code{use} clauses
793
794 @smallexample @c adanocomment
795 @group
796       with A; use A;
797       with B; use B;
798 @end group
799 @end smallexample
800
801 @item
802 Names declared in the visible part of packages should be
803 unique, to prevent name clashes when the packages are @code{use}d.
804 @cindex Name clash avoidance
805
806 @smallexample @c adanocomment
807 @group
808       package Entity is
809          type Entity_Kind is ...;
810          ...
811       end Entity;
812 @end group
813 @end smallexample
814
815 @item
816 After the file header comment, the context clause and unit specification
817 should be the first thing in a @syntax{program_unit}.
818
819 @item
820 Preelaborate, Pure and Elaborate_Body pragmas should be added right after the
821 package name, indented an extra level and using the parameterless form:
822
823 @smallexample @c adanocomment
824 @group
825       package Preelaborate_Package is
826          pragma Preelaborate;
827          ...
828       end Preelaborate_Package;
829 @end group
830 @end smallexample
831
832 @end itemize
833
834 @c  -------------------------------------------------------------------------
835 @node    Program Structure, GNU Free Documentation License, Packages, Top
836 @section Program Structure and Compilation Issues
837 @c  -------------------------------------------------------------------------
838 @cindex Program structure
839
840 @itemize @bullet
841 @item
842 Every GNAT source file must be compiled with the @option{-gnatg}
843 switch to check the coding style.
844 (Note that you should look at
845 @file{style.adb} to see the lexical rules enforced by
846 @option{-gnatg}).
847 @cindex @option{-gnatg} option (to gcc)
848 @cindex @file{style.adb} file
849
850 @item
851 Each source file should contain only one compilation unit.
852
853 @item
854 Filenames should be 8 or fewer characters, followed by the @code{.adb}
855 extension for a body or @code{.ads} for a spec.
856 @cindex File name length
857
858 @item
859 Unit names should be distinct when ``krunch''ed to 8 characters
860 (see @file{krunch.ads}) and the filenames should match the unit name,
861 except that they are all lower case.
862 @cindex @file{krunch.ads} file
863 @end itemize
864
865
866 @c **********************************
867 @c * GNU Free Documentation License *
868 @c **********************************
869 @include fdl.texi
870 @c GNU Free Documentation License
871 @cindex GNU Free Documentation License
872
873 @node Index,,GNU Free Documentation License, Top
874 @unnumberedsec Index
875
876 @printindex cp
877
878 @contents
879
880 @bye