Search code examples
jsonparsingecmatranslators

What type of charts is using in ECMA-404?


I found this figure in JSON spec

chart

http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf

  1. Whats name of type of this chart?
  2. Can I use this chart for specifying any programming language?

Solution

  • They are usually called railroad diagrams, and they are basically a way of presenting a finite state automaton's transition diagram in a readable fashion. It is straight-forward to convert any regular expression into this format, but some regular expressions are tidier than others.

    There are variations which work for context-free languages, so you will also find railroad diagrams for push-down automata. It is common that some high level of the grammar (for example, the non-terminal statement) can be expressed as a regular expression of lower-level components (such as expression).