Udostępnij za pośrednictwem


EBNF Overview

Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012

Extended Backus Naur Form (EBNF) is a metalanguage and is used in this guide to describe the language syntax. An EBNF definition consists of production rules, nonterminals, and terminals. The key terms are shown in the following table.

Key terms

Example

Description

Terminals

Work_Team

A terminal is one character or a string of characters that never change.

Nonterminals

Employee

A nonterminal is a description of part of a valid sentence in the language that is defined either by a production rule or a textual description. A nonterminal symbol can always be expanded to one or more terminal symbols.

Production rules

Employee = Developer | Tester

A production rule is a description of a valid sentence. A production rule defines how a nonterminal symbol on the left side expands into a number of terminal and nonterminal symbols on the right side.

If you continue to expand all nonterminal symbols on the right side of the production rules in a particular grammar, you will eventually have a sequence of terminal symbols.

Example

Work_Team = Manager Employee {, Employee} 
 Employee = Developer | Tester

This example defines a Work_Team as consisting of a Manager and one or more Employees. An Employee is defined as being a Developer, or a Tester. The symbols used in the example are described in the following table.

Special Symbols in EBNF

Symbol

Description

(Expression)

Parentheses hold the symbols (terminals and nonterminals) together. They can be placed anywhere on the right side of a production rule.

Expression1 | Expression2

Or: Specifies that all the items on one side of the | apply, or else all the items on the other side of the | apply.

[Expression]

Optional: The items between [ and ] are optional. All or none of the items in the brackets are included.

{Expression}

Repeat: The items between { and } are optional, but can be repeated as many times as necessary.

For example, if the accessories you buy for your bicycle consist of a saddle, water-bottle holders, bells, and horns, and you could have either a bell or a horn, and zero, one, or more water bottle holders, and exactly one saddle, this could be expressed as:

Bicycle_Accessories = saddle [bell | horn] {water_bottle_holders}

This grammar defines the following possibilities:

saddle 
 saddle bell 
 saddle horn 
 saddle water_bottle_holder 
 saddle bell water_bottle_holder 
 saddle bell water_bottle_holder water_bottle_holder

And so on.

See also

X++ Syntax

Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.