GNAT Coding Style


Next: , Up: (dir)


Next: , Previous: Top, Up: Top

1 General

Most of GNAT is written in Ada using a consistent style to ensure readability of the code. This document has been written to help maintain this consistent style, while having a large group of developers work on the compiler.

For the coding style in the C parts of the compiler and run time, see the GNU Coding Guidelines.

This document is structured after the Ada Reference manual. Those familiar with that document should be able to quickly lookup style rules for particular constructs.


Next: , Previous: General, Up: Top

2 Lexical Elements

2.1 Character Set and Separators

2.2 Identifiers

2.3 Numeric Literals

2.4 Reserved Words

2.5 Comments


Next: , Previous: Lexical Elements, Up: Top

3 Declarations and Types


Next: , Previous: Declarations and Types, Up: Top

4 Expressions and Names


Next: , Previous: Expressions and Names, Up: Top

5 Statements

5.1 Simple and Compound Statements

5.2 If Statements

5.3 Case Statements

5.4 Loop Statements

5.5 Block Statements


Next: , Previous: Statements, Up: Top

6 Subprograms

6.1 Subprogram Declarations

6.2 Subprogram Bodies


Next: , Previous: Subprograms, Up: Top

7 Packages and Visibility Rules


Previous: Packages, Up: Top

8 Program Structure and Compilation Issues