Skip to Main Content
C++ In a Nutshell
book

C++ In a Nutshell

by Ray Lischner
May 2003
Intermediate to advanced content levelIntermediate to advanced
808 pages
32h 24m
English
O'Reilly Media, Inc.
Content preview from C++ In a Nutshell

Chapter 12. Language Reference

Here begins the alphabetic reference. This chapter presents each language keyword with a syntax summary, description, and, in some cases, an example. The syntax summaries use a modified BNF (Backus Normal Form or Backus-Naur Form):

  • Terminal symbols (keywords and operator symbols) are in a constant-width typeface.

  • To avoid ambiguity, a terminal symbol that might be mistaken for a BNF metacharacter (e.g., a vertical bar or a square bracket) is enclosed in quotes (e.g., "|“).

  • Nonterminal symbols (syntax elements) are in an italic typeface.

  • Optional elements are in square brackets ([ like this ]).

  • Choices are separated by vertical bars (|).

  • A production (syntax description) is introduced with := or ::=. The traditional symbol (::=) is used for a complete definition. The abbreviated symbol (:=) is used when the righthand side is incomplete. For example, here is the complete definition of function-specifier as it is given under declaration:

    function-specifier ::= explicit | inline | virtual

    The following is a partial production of function-specifier:

    function-specifier := inline

    The abbreviated symbol (:=) lets you see that the syntax summary is incomplete. Whenever an incomplete rule is used, a cross reference (under “See Also”) leads you to the complete rule.

The starting point for parsing a C++ source file (the start symbol) is translation-unit, which you can find under declaration.

C++ syntax is complicated, and even simple statements require an understanding of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

C++ High Performance

C++ High Performance

Viktor Sehr, Björn Andrist
Optimized C++

Optimized C++

Kurt Guntheroth
Mastering C++ Programming

Mastering C++ Programming

Jeganathan Swaminathan

Publisher Resources

ISBN: 059600298XSupplemental ContentErrata Page