Skip to content
diagrams.mbt
DocsArticlesGalleryAPIGitHub

Gallery / EBNF

Arithmetic grammar railroad

Family: EBNF. Status: Implemented.

PlantUML EBNF with recursive rule references and a note.

Scope: Static grammar diagram and structural exploration; parse evidence requires an external provider.

Preview

Arithmetic grammar railroad preview
Arithmetic grammar railroad preview (dark)

Source

ebnf-arithmetic.puml

text/plain

@startebnf
title Arithmetic with recursion
(* Expressions refer to terms; parentheses refer back to expressions. *)
expression = term, { ("+" | "-"), term };
term = factor, { ("*" | "/"), factor };
factor = number | "(", expression, ")" | "-", factor;
number = digit, { digit };
digit = ? any decimal digit ? - "0" | "0";
@endebnf

Download source: ebnf-arithmetic.puml

Download SVG Download dark SVG Open offline player

diagrams.mbt · Diagramming for MoonBit.