encyclopegia.org

Syntax diagram

Syntax diagrams (or railroad diagrams) are a way to represent a context-free grammar.[src] They represent a graphical alternative to Backus–Naur form, EBNF, Augmented Backus–Naur form, and other text-based grammars as metalanguages.[src] Early books using syntax diagrams include the "Pascal User Manual" written by Niklaus Wirth (diagrams start at page 47) and the Burroughs CANDE Manual.[src] In the compilation field, textual representations like BNF or its variants are usually preferred.[src] BNF is text-based, and used by compiler writers and parser generators.[src] Railroad diagrams are visual, and may be more readily understood by laypeople, sometimes incorporated into graphic design.[src] The canonical source defining the JSON data interchange format provides yet another example of a popular modern usage of these diagrams.[src]

Syntax diagrams (or railroad diagrams) are a way to represent a context-free grammar.[src] They represent a graphical alternative to Backus–Naur form, EBNF, Augmented Backus–Naur form, and other text-based grammars as metalanguages.[src] Early books using syntax diagrams include the "Pascal User Manual" written by Niklaus Wirth (diagrams start at page 47) and the Burroughs CANDE Manual.[src] In the compilation field, textual representations like BNF or its variants are usually preferred.[src] BNF is text-based, and used by compiler writers and parser generators.[src] Railroad diagrams are visual, and may be more readily understood by laypeople, sometimes incorporated into graphic design.[src] The canonical source defining the JSON data interchange format provides yet another example of a popular modern usage of these diagrams.[src] ::= | "+" ::= | "*" ::= | | "(" ")" ::= "x" | "y" | "z" ::= | ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" EBNF: expression = term , [ "+" , expression ]; term = factor , [ "*" , term ]; factor = constant | variable | "(" , expression , ")"; variable = "x" | "y" | "z"; constant = digit , { constant }; digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"; ABNF: expression = term ["+" expression] term = factor ["*" term] factor = constant / variable / "(" expression ")" variable = "x" / "y" / "z" constant = 1*digit DIGIT = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" ABNF also supports ranges, e.g.[src] , but it is not used here for consistency with the other examples.[src] Red (programming language) Parse Dialect: Red [Title: "Parse Dialect"] expression: [term opt ["+" expression]] term: [factor opt ["*" term]] factor: [constant | variable | "(" expression ")"] variable: ["x" | "y" | "z"] constant: [some digit] digit: ["0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"] This format also supports ranges, e.g.[src] , but it is not used here for consistency with the other examples.[src] One possible syntax diagram for the example grammars is below.[src] While the syntax for the text-based grammars differs, the syntax diagram for all of them can be the same because it is a metalanguage.[src] ==See also== Recursive transition network Extended Backus–Naur form (EBNF) ==References== Note: the first link is sometimes blocked by the server outside of its domain, but it is available on archive.org.[src] The file was also mirrored at standardpascal.org.[src] ==External links== JSON website including syntax diagrams Generator from EBNF From EBNF to a postscript file with the diagrams EBNF Parser & Renderer SQLite syntax diagram generator for SQL Online Railroad Diagram Generator Augmented Syntax Diagram (ASD) grammars (ASD) Augmented Syntax Diagram Application Demo Site SRFB Syntax Diagram representation by Function Basis + svg generation[src]

23 sentences · 23 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Syntax diagram." encyclopegia.org, 2025, https://encyclopegia.org/wiki/syntax-diagram. Accessed 02 December 2026.

Chicago

"Syntax diagram." encyclopegia.org. Accessed December 2, 2026. https://encyclopegia.org/wiki/syntax-diagram.

APA

encyclopegia.org. (2025). Syntax diagram. Retrieved December 2, 2026, from https://encyclopegia.org/wiki/syntax-diagram

Accessed December 2, 2026 · CC BY-SA 4.0 · citation page · JSON

Related articles

wiring diagram

stub · references available

abstract syntax

stub · references available

Mollier-h-x-diagram

stub · references available

Feynman diagram

stub · references available

system context diagram

stub · references available

commutative diagram

stub · references available

Tanabe–Sugano diagram

stub · references available

data-flow diagram

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1316532313 · 0.5 · snapshot enwiki-001316532313

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools
  • Careers — open roles: frontier engineers and sales partners
  • Index — every corpus, paper and record
  • Estate guide — what a public data estate is
  • Founder — Lois-Kleinner Alpasan
  • Records — DOIs and external deposits
  • Documents — one-pagers, PDFs and QR codes
  • Brand kit — logos and share images
  • Papers — plain-language briefs with citations
  • Browser — search engine, PWA and bookmarklet
  • Anticloud — the operator and its projects

As seen in Business Insider · 336 outlets · evidence DOIs · plain-language papers

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.