Skip to content

Commit

Permalink
add readme and docs for documentation and ebnf
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasgruenewald committed Sep 21, 2020
1 parent 9c576f1 commit 8b57d47
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions documentation/markdown/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# README
Created with https://github.com/adobe/jsonschema2md

## Top-level Schemas

Expand Down
81 changes: 81 additions & 0 deletions ebnf/util/EBNF2railroad example.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
EBNF2railroad example






(*

Welcome to EBNF 2 Railroad
==========================

In this editor you can try out the command line tool.

Comments will be rendered throught markdown,
so you can do **markup** in them.

`Ctrl-Shift-C`/`Cmd-Shift-C` will expand the selected
string in `terminal` elements for each character,
as a choice element.

```
digit = 1234567890;
```

selecting the numbers and pressing `Ctrl-Shift-C` /
`Cmd-Shift-C`

will expand this into:

```
digit = "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "0";
```

The EBNF syntax is as follows:

*)



grammar = { rule } ;
rule = lhs , "=" , rhs , ";" ;

lhs = identifier ;
rhs = identifier
| terminal
| "[" , rhs , "]"
| "{" , rhs , "}"
| "(" , rhs , ")"
| rhs , "|" , rhs
| rhs , "," , rhs ;

identifier = letter , { letter | digit | "_" } ;
terminal = "'" , character , { character } , "'"
| '"' , character , { character } , '"' ;

character = letter | digit | symbol | "_" ;

(*
Basic components
----------------
These are low level components, the small building blocks.
*)


letter = "A" | "B" | "C" | "D" | "E" | "F" | "G"
| "H" | "I" | "J" | "K" | "L" | "M" | "N"
| "O" | "P" | "Q" | "R" | "S" | "T" | "U"
| "V" | "W" | "X" | "Y" | "Z" | "a" | "b"
| "c" | "d" | "e" | "f" | "g" | "h" | "i"
| "j" | "k" | "l" | "m" | "n" | "o" | "p"
| "q" | "r" | "s" | "t" | "u" | "v" | "w"
| "x" | "y" | "z" ;

digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" ;

symbol = "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">"
| "'" | '"' | "=" | "|" | "." | "," | ";" ;



0 comments on commit 8b57d47

Please sign in to comment.