Jump to content

User:Code-Analysis/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Code-Analysis (talk | contribs) at 06:48, 23 October 2012. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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

C++ 2011 Grammar