Skip to content

0x51-dev/railroad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Railroad Diagrams (or Syntax Diagrams)

Railroad diagrams are a way to visualize context-free grammars.

How to Read

You read the diagram from left to right and from top to bottom. The diagram is a visual representation of a context-free grammar. The diagram shows the rules of the grammar and how they are connected.

The following conventions are used:

  • The following diagram shows values A, B and C, which must be specified. The required values are defined on the main line of the diagram. (ABNF: and = A B C)

explain-and

  • The following diagram shows the optional value A. The value can be bypassed by following the empty path. (ABNF: opt = [A] B )

explain-optional

  • In the example below A, B and C are options. The value can be chosen from the options. (ABNF: or = A / B / C)

explain-or

Example

example1

References

About

Draw railroad diagrams from Go

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published