Skip to content

Instantly share code, notes, and snippets.

@sortie
Created May 2, 2016 15:36
Show Gist options
  • Select an option

  • Save sortie/6eccb27f3408e2c3f4877fed07100dd4 to your computer and use it in GitHub Desktop.

Select an option

Save sortie/6eccb27f3408e2c3f4877fed07100dd4 to your computer and use it in GitHub Desktop.
bnf.bnf
wspace ::= '\t' | '\n' | '\v' | '\f' | '\r' | ' '.
wspaces ::= <wspace>
| <wspace> <wspaces>.
ospaces ::=
| <wspaces>.
char-constant ::= '\'' [^'] '\''
| '\'' '\\' <char> '\''.
range-char ::= [^]].
ranges ::= | <range-char> <ranges>.
range-constant ::= '[' <ranges> ']
| '[' '^' <ranges> ']
| '[' ']' <ranges> ']
| '[' '^' ']' <ranges> '].
string-constant-char ::= [^"]
| '\\' <char>.
string-constant-chars ::= | <string-constant-char> <string-constant-chars>.
string-constant ::= '"' <string-constant-chars> '"'.
identifier-char ::= [^][ ^<>'":=\|].
identifier ::= <identifier-char>
| <identifier-char> <identifier>.
reference ::= '<' <identifier> '>'.
bnf-element ::= <char-constant>
| <string-constant>
| <range-constant>
| <reference>.
bnf-branch ::= <ospaces>
| <ospaces> <bnf-element> <bnf-branch>.
bnf-branches ::= <bnf-branch>
| <bnf-branch> '|' <bnf-branches>.
bnf-definition ::= <identifier> <ospaces> "::=" <bnf-branches> '.'.
bnf ::= <ospaces>
| <ospaces> <bnf-definition> <bnf>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment