Skip to content

Fix git push error for protected CLA branch #1793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .openpublishing.redirection.json
Original file line number Diff line number Diff line change
Expand Up @@ -8160,6 +8160,21 @@
"redirect_url": "/cpp/preprocessor/c-cpp-preprocessor-reference",
"redirect_document_id": false
},
{
"source_path": "docs/preprocessor/conventions.md",
"redirect_url": "/cpp/preprocessor/grammar-summary-c-cpp#conventions",
"redirect_document_id": false
},
{
"source_path": "docs/preprocessor/definitions-for-the-grammar-summary.md",
"redirect_url": "/cpp/preprocessor/grammar-summary-c-cpp#definitions",
"redirect_document_id": false
},
{
"source_path": "docs/preprocessor/preprocessor-grammar.md",
"redirect_url": "/cpp/preprocessor/grammar-summary-c-cpp#grammar",
"redirect_document_id": false
},
{
"source_path": "docs/security/index.md",
"redirect_url": "/cpp/security/security-best-practices-for-cpp",
Expand Down
1 change: 0 additions & 1 deletion docs/mfc/receiving-notification-from-common-controls.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: "Receiving Notification from Common Controls"
ms.date: "11/04/2016"
f1_keywords: ["ON_NOTIFY", "WM_NOTIFY"]
helpviewer_keywords: ["OnNotify method [MFC]", "common controls [MFC], notifications", "ON_NOTIFY macro [MFC]", "controls [MFC], notifications", "receiving notifications from common controls", "notifications [MFC], common controls", "Windows common controls [MFC], notifications", "WM_NOTIFY message"]
ms.assetid: 50194592-d60d-44d0-8ab3-338a2a2c63e7
---
Expand Down
1 change: 0 additions & 1 deletion docs/mfc/reference/handlers-for-wm-messages.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: "Handlers for WM_ Messages"
ms.date: "11/04/2016"
f1_keywords: ["WM_"]
helpviewer_keywords: ["WM_ messages [MFC]"]
ms.assetid: cad81690-90bf-4f77-943f-a435e7563bdd
---
Expand Down
1 change: 0 additions & 1 deletion docs/mfc/tn061-on-notify-and-wm-notify-messages.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: "TN061: ON_NOTIFY and WM_NOTIFY Messages"
ms.date: "06/28/2018"
f1_keywords: ["ON_NOTIFY", "WM_NOTIFY"]
helpviewer_keywords: ["ON_NOTIFY_EX message [MFC]", "TN061", "ON_NOTIFY message [MFC]", "ON_NOTIFY_EX_RANGE message [MFC]", "ON_NOTIFY_RANGE message [MFC]", "notification messages", "WM_NOTIFY message"]
ms.assetid: 04a96dde-7049-41df-9954-ad7bb5587caf
---
Expand Down
1 change: 0 additions & 1 deletion docs/mfc/using-a-dialog-bar-with-a-rebar-control.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: "Using a Dialog Bar with a Rebar Control"
ms.date: "11/04/2016"
f1_keywords: ["WM_EX_TRANSPARENT"]
helpviewer_keywords: ["WS_EX_TRANSPARENT style", "rebar controls [MFC], dialog bars", "dialog bars [MFC], using with rebar bands"]
ms.assetid: e528cea0-6b81-4bdf-9643-7c03b6176590
---
Expand Down
32 changes: 0 additions & 32 deletions docs/preprocessor/conventions.md

This file was deleted.

21 changes: 0 additions & 21 deletions docs/preprocessor/definitions-for-the-grammar-summary.md

This file was deleted.

116 changes: 109 additions & 7 deletions docs/preprocessor/grammar-summary-c-cpp.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,122 @@
---
title: "Grammar summary (C/C++)"
title: "Preprocessor grammar summary (C/C++)"
description: "Defines and describes the Microsoft C/C++ compiler (MSVC) preprocessor grammar syntax."
ms.date: "08/29/2019"
helpviewer_keywords: ["grammar", "preprocessor, grammar"]
ms.assetid: 0acb6e9b-364c-4ef8-ace4-7be980521121
---
# Grammar summary (C/C++)
# Preprocessor grammar summary (C/C++)

This section describes the formal grammar of the preprocessor. It covers the syntax of preprocessing directives and operators discussed in [The preprocessor](../preprocessor/preprocessor.md) and in [Pragma directives](../preprocessor/pragma-directives-and-the-pragma-keyword.md).
This article describes the formal grammar of the C and C++ preprocessor. It covers the syntax of preprocessing directives and operators. For more information, see [Preprocessor](../preprocessor/preprocessor.md) and [Pragma directives and the __pragma keyword](../preprocessor/pragma-directives-and-the-pragma-keyword.md).

The following articles are included:
## <a name="definitions"></a> Definitions for the grammar summary

- [Definitions](../preprocessor/definitions-for-the-grammar-summary.md)
Terminals are endpoints in a syntax definition. No other resolution is possible. Terminals include the set of reserved words and user-defined identifiers.

- [Conventions](../preprocessor/conventions.md)
Nonterminals are placeholders in the syntax. Most are defined elsewhere in this syntax summary. Definitions can be recursive. The following nonterminals are defined in the [Lexical Conventions](../cpp/lexical-conventions.md) section of the *C++ Language Reference*:

*constant*, *constant-expression*, *identifier*, *keyword*, *operator*, *punctuator*

An optional component is indicated by the subscripted <sub>opt</sub>. For example, the following syntax indicates an optional expression enclosed in curly braces:

**{** *expression*<sub>opt</sub> **}**

## <a name="conventions"></a> Document conventions

The conventions use different font attributes for different components of the syntax. The symbols and fonts are as follows:

| Attribute | Description |
|---------------|-----------------|
| *nonterminal* | Italic type indicates nonterminals. |
| **#include** | Terminals in bold type are literal reserved words and symbols that must be entered as shown. Characters in this context are always case sensitive. |
| <sub>opt</sub> | Nonterminals followed by <sub>opt</sub> are always optional.|
| default typeface | Characters in the set described or listed in this typeface can be used as terminals in statements. |

A colon (**:**) following a nonterminal introduces its definition. Alternative definitions are listed on separate lines.

In code syntax blocks, these symbols in the default typeface have a special meaning:

| Symbol | Description |
|---|---|
| \[ ] | Square brackets surround an optional element. |
| { \| } | Curly braces surround alternative elements, separated by vertical bars. |
| ... | Indicates the previous element pattern can be repeated. |

In code syntax blocks, commas (`,`), periods (`.`), semi-colons (`;`), colons (`:`), parentheses (`( )`), double-quotes (`"`), and single-quotes (`'`) are literals.

## <a name="grammar"></a> Preprocessor grammar

*control-line*:\
&nbsp;&nbsp;&nbsp;&nbsp;**#define** *identifier* *token-string*<sub>opt</sub>\
&nbsp;&nbsp;&nbsp;&nbsp;**#define** *identifier* **(** *identifier*<sub>opt</sub> **,** ... **,** *identifier*<sub>opt</sub> **)** *token-string*<sub>opt</sub>\
&nbsp;&nbsp;&nbsp;&nbsp;**#include** **"**_path-spec_**"**\
&nbsp;&nbsp;&nbsp;&nbsp;**#include** **\<**_path-spec_**>**\
&nbsp;&nbsp;&nbsp;&nbsp;**#line** *digit-sequence* **"**_filename_**"**<sub>opt</sub>\
&nbsp;&nbsp;&nbsp;&nbsp;**#undef** *identifier*\
&nbsp;&nbsp;&nbsp;&nbsp;**#error** *token-string*\
&nbsp;&nbsp;&nbsp;&nbsp;**#pragma** *token-string*

*constant-expression*:\
&nbsp;&nbsp;&nbsp;&nbsp;**defined(** *identifier* **)**\
&nbsp;&nbsp;&nbsp;&nbsp;**defined** *identifier*\
&nbsp;&nbsp;&nbsp;&nbsp;any other constant expression

*conditional*:\
&nbsp;&nbsp;&nbsp;&nbsp;*if-part* *elif-parts*<sub>opt</sub> *else-part*<sub>opt</sub> *endif-line*

*if-part*:\
&nbsp;&nbsp;&nbsp;&nbsp;*if-line* *text*

*if-line*:\
&nbsp;&nbsp;&nbsp;&nbsp;**#if** *constant-expression*\
&nbsp;&nbsp;&nbsp;&nbsp;**#ifdef** *identifier*\
&nbsp;&nbsp;&nbsp;&nbsp;**#ifndef** *identifier*

*elif-parts*:\
&nbsp;&nbsp;&nbsp;&nbsp;*elif-line* *text*\
&nbsp;&nbsp;&nbsp;&nbsp;*elif-parts* *elif-line* *text*

*elif-line*:\
&nbsp;&nbsp;&nbsp;&nbsp;**#elif** *constant-expression*

*else-part*:\
&nbsp;&nbsp;&nbsp;&nbsp;*else-line* *text*

*else-line*:\
&nbsp;&nbsp;&nbsp;&nbsp;**#else**

*endif-line*:\
&nbsp;&nbsp;&nbsp;&nbsp;**#endif**

*digit-sequence*:\
&nbsp;&nbsp;&nbsp;&nbsp;*digit*\
&nbsp;&nbsp;&nbsp;&nbsp;*digit-sequence* *digit*

*digit*: one of\
&nbsp;&nbsp;&nbsp;&nbsp;**0 1 2 3 4 5 6 7 8 9**

*token-string*:\
&nbsp;&nbsp;&nbsp;&nbsp;String of tokens

*token*:\
&nbsp;&nbsp;&nbsp;&nbsp;*keyword*\
&nbsp;&nbsp;&nbsp;&nbsp;*identifier*\
&nbsp;&nbsp;&nbsp;&nbsp;*constant*\
&nbsp;&nbsp;&nbsp;&nbsp;*operator*\
&nbsp;&nbsp;&nbsp;&nbsp;*punctuator*

*filename*:\
&nbsp;&nbsp;&nbsp;&nbsp;Legal operating system filename

*path-spec*:\
&nbsp;&nbsp;&nbsp;&nbsp;Legal file path

*text*:\
&nbsp;&nbsp;&nbsp;&nbsp;Any sequence of text

> [!NOTE]
> The following nonterminals are expanded in the [Lexical conventions](../cpp/lexical-conventions.md) section of the *C++ Language Reference*: *constant*, *constant-expression*, *identifier*, *keyword*, *operator*, and *punctuator*.

- [Preprocessor grammar](../preprocessor/preprocessor-grammar.md)

## See also

Expand Down
82 changes: 0 additions & 82 deletions docs/preprocessor/preprocessor-grammar.md

This file was deleted.

13 changes: 2 additions & 11 deletions docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4722,17 +4722,8 @@
href: preprocessor/variadic-macros.md
- name: Predefined preprocessor macros
href: preprocessor/predefined-macros.md
- name: Grammar summary (C/C++)
expanded: false
items:
- name: Grammar summary (C/C++)
href: preprocessor/grammar-summary-c-cpp.md
- name: Definitions for the grammar summary
href: preprocessor/definitions-for-the-grammar-summary.md
- name: Grammar conventions
href: preprocessor/conventions.md
- name: Preprocessor grammar
href: preprocessor/preprocessor-grammar.md
- name: Preprocessor grammar summary (C/C++)
href: preprocessor/grammar-summary-c-cpp.md
- name: Pragma directives and the __pragma keyword
expanded: false
items:
Expand Down