# extended Backus–Naur form

> family of metasyntax notations, any of which can be used to express a context-free grammar

**Wikidata**: [Q1165219](https://www.wikidata.org/wiki/Q1165219)  
**Wikipedia**: [English](https://en.wikipedia.org/wiki/Extended_Backus–Naur_form)  
**Source**: https://4ort.xyz/entity/extended-backusnaur-form

## Summary
Extended Backus–Naur form (EBNF) is a family of metasyntax notations used to express context-free grammars in programming languages. It extends the original Backus–Naur form (BNF) by introducing more concise and readable syntax, such as optional elements, repetition, and grouping.

## Key Facts
- A family of metasyntax notations for expressing context-free grammars
- Based on the original Backus–Naur form (BNF)
- Invented by Niklaus Wirth
- Includes aliases such as EBNF, Forme de Backus-Naur étendue, and Расширенная форма Бэкуса-Наура
- Used in programming languages to define syntax rules
- Short names include EBNF and РБНФ
- First described in a formalized standard by Wirth in 1977
- Commonly used in compiler design and language specification

## FAQs
### Q: What is the difference between BNF and EBNF?
A: EBNF extends BNF by adding features like optional elements (denoted by square brackets), repetition (denoted by curly braces), and grouping (denoted by parentheses), making grammar definitions more concise and readable.

### Q: Who invented EBNF?
A: EBNF was invented by Niklaus Wirth, a pioneer in programming language design, in the late 1960s or early 1970s.

### Q: How is EBNF used in programming languages?
A: EBNF is used to formally define the syntax of programming languages, making it easier for developers and compilers to understand and process language rules.

### Q: What are some common notations in EBNF?
A: Common EBNF notations include square brackets for optional elements, curly braces for repetition, and parentheses for grouping, along with other symbols for defining grammar rules.

### Q: Is EBNF still used today?
A: Yes, EBNF remains widely used in computer science, particularly in compiler design, language specification, and documentation, due to its clarity and efficiency.

## Why It Matters
Extended Backus–Naur form (EBNF) is a foundational tool in computer science, particularly in the design and specification of programming languages. By extending the original Backus–Naur form (BNF), EBNF provides a more concise and readable way to express context-free grammars. This makes it easier for developers and compilers to understand and process language syntax rules. EBNF's introduction by Niklaus Wirth in the late 1960s or early 1970s significantly improved the clarity and efficiency of language definitions, influencing the development of numerous programming languages. Its use in compiler design and language documentation ensures that EBNF remains a critical component of modern software development.

## Notable For
- Introduced by Niklaus Wirth, a key figure in programming language design
- Provides a more concise and readable syntax compared to BNF
- Used in the formal specification of programming language syntax
- Influenced the design of many modern programming languages
- Remains a standard tool in compiler design and language documentation

## Body
### Origins and Development
EBNF was developed by Niklaus Wirth, a Swiss computer scientist and pioneer in programming language design. It was first formalized in the late 1960s or early 1970s as an extension of the original Backus–Naur form (BNF). Wirth's work aimed to improve the readability and conciseness of grammar definitions, making them more accessible to developers and compilers.

### Key Features
EBNF introduces several notational conventions to simplify grammar definitions:
- **Optional elements**: Denoted by square brackets (e.g., `[x]`), indicating that the element `x` may or may not be present.
- **Repetition**: Denoted by curly braces (e.g., `{x}`), indicating that the element `x` can appear zero or more times.
- **Grouping**: Denoted by parentheses (e.g., `(x)`), used to group elements together.

These features allow for more compact and intuitive grammar specifications compared to BNF.

### Applications
EBNF is widely used in:
- **Compiler design**: To define the syntax of programming languages, ensuring that compilers can accurately parse and process code.
- **Language specification**: As a standard tool for documenting the syntax rules of programming languages.
- **Education**: To teach students about formal grammar and language design.

### Influence
EBNF has had a significant impact on the field of computer science, influencing the design of numerous programming languages and compiler tools. Its use in language specification ensures that EBNF remains a critical component of modern software development.

### Standardization
EBNF has been adopted as a standard notation in various academic and industrial contexts, with its formalized description used in the specification of programming language syntax. This standardization has contributed to its widespread adoption and continued relevance in computer science.

## References

1. Freebase Data Dumps. 2013