Syntaxdiagramm

Die erweiterte Backus-Naur-Form (EBNF) ist eine Art der formalen Syntax, die zur Beschreibung der Struktur einer Programmiersprache oder einer anderen formalen Sprache verwendet wird. Sie ist eine Erweiterung der Backus-Naur-Form (BNF), die ursprünglich von John Backus und Peter Naur entwickelt wurde, um die Syntax der Programmiersprache Algol zu beschreiben.

EBNF fügt den ursprünglichen BNF-Metasymbolen mehrere zusätzliche Metasymbole hinzu, was eine prägnantere und lesbarere Spezifikation der Syntax einer Sprache ermöglicht. Sie wird häufig bei der Spezifikation von Programmiersprachen verwendet und manchmal auch zur Beschreibung der Syntax anderer formaler Sprachen, wie z. B. Datenbankabfragesprachen oder Auszeichnungssprachen.

Eine grundlegende Unterstützung für EBNF wurde in PlantUML eingeführt.

*[Ref. [QA-16529](https://forum.plantuml.net/16529/could-we-add-syntax-diagrams)]*
WARNING
 This translation need to be updated. 
WARNING

Minimal binary diagram

All EBNF Elements

EBNF elements handled by PlantUML are described below.

Verwaltung spezieller Sequenzen mit special-sequence-symbol "?"

Sie können spezielle Sequenzen mit special-sequence-symbol "?" verwalten.

[Ref. QA-16781]

Full repetition management with repetition-symbol "*"

You can manage repetition with repetition-symbol "*".

[Ref. QA-16750]

Drawing mode

Before version V1.2025.1, you can choice the drawing mode, and having a compacted mode by using !pragma compact command.

Expanded mode (by default, and the only one from V1.2025.1)

Compacted mode (only available before V1.2025.1)

[Ref. QA-16692, QA-16529]

[End of the compacted mode: GH-1585]

Notes on Elements

Notes may be added to elements of your diagram by using EBNF comment tags.

Using (global) style

Without style (by default)

With style

You can use style to change rendering of elements.

[Ref. QA-16529]

Example of LISP Grammar

LISP Grammar with PlantUML.

[Ref. ]

EBNF of PlantUMLs EBNF Grammar

EBNF allows for self description, so here it is!

Java Language Specification

A real world example of a detailed programming language.

Packages and Modules

Lexical Structure

Types, Values, and Variables

Names

Classes

Interfaces

Arrays

Blocks, Statements, and Patterns

Remaining defects

Could you put 'arrow head' on all rerouted lines?

Fixed by EBNF more arrow head on V1.2024.8

Order issue

[Ref. QA-17090, fixed by EBNF concatenation order on V1.2024.8]

Allow accentuated or Unicode char on EBNF meta-identifier or rule name.

[Ref. QA-17145 , fixed by EBNF better unicode support on V1.2024.8]

Allow full restriction management with except-symbol "-"

[Ref. QA-16735]