-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add readme and docs for documentation and ebnf
- Loading branch information
1 parent
9c576f1
commit 8b57d47
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "[" | "]" | "{" | "}" | "(" | ")" | "<" | ">" | ||
| "'" | '"' | "=" | "|" | "." | "," | ";" ; | ||
|
||
|
||
|