Resources for Ada


FTP Warning: Some items listed here are accessed through FTP.
Happy hyper-referencing.

Ada Grammar and Parsing

Syntax Summary
Syntactic diagrams [@UniGe]

yacc Grammar

The Ada 9X design team has written, and used, a YACC-compatible grammar for Ada 9X [@AdaIC]. (It should be accurate as of May 4, 1994.) If you find any problems with this grammar, please send email to Tucker Taft,

Here are some remarks on the grammar:

"The grammar is a bit "permissive," to simplify making it LALR(1), and semantic actions would be required to enforce certain "syntax" rules. But the differences are quite minor, and could mostly be eliminated even while remaining LALR(1). It is certainly adequate for "quick" syntax checkers, compilation order determination, and most other similar tools.

"As an example of its permissiveness, the grammar allows "aliased constant" in an object renaming declaration, but in fact the Ada9X syntax rules do not (these properties are inherited and not overridable in a renaming). This could be fixed at the expense of adding another nonterminal or two to the grammar. However, it is often better to make a grammar a bit permissive anyway, and check things in the semantic actions, as more helpful error messages can usually be produced in that way."

lex Grammar and Driver

The Ada 9X design team has also written a very simple lexer and driver routine [@AdaIC] to go with this grammar.

"It is designed to be used with "lex" -- the included driver code is written in C (Gasp ;-). The lexer is a bit simple-minded, but it works correctly for all but the most obscure cases involving strings of apostrophes in weird combinations."

Syntax Summary

Included in our hypertext version of RM95, you can browse the online Ada 95 syntax summary (Annex P).

Syntactic Diagrams

Members of the Database Research Group at the University of Geneva have produced a very nice set of documents describing the syntax rules of Ada 95 illustrated by syntactic diagrams, with cross-references.

Page last modified: 1998-12-20