User:Code-Analysis/sandbox
Appearance
The grammar of the programming language can be considered either in wide terms that include exact specification of what is allowed and what is not allowed or in narrow terms that describe the formal grammar that is sutable for automatic creation of LR parsers. This article describes the formal grammar. For fine details please look at the main article on C++.
C++ 2003 Grammar
Formal gramar is presented in the Annex A of the standard. It consists of 3 major parts.
Lexical conventions
Preprocessor Directives
Core Grammar
This part of the grammar describes the language itself; features like classes, functions, statements, expressions, etc. In particular it contans:
Non terminals | 142 |
Grammar rules | 576 |
Parsing states (LR) | 14235 |
Grammar conflicts | 9337 |