feat(grammar): add grammar file
This commit is contained in:
parent
8553ae7a5a
commit
c863d71409
2 changed files with 36 additions and 1 deletions
31
grammar.ebnf
Normal file
31
grammar.ebnf
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
token ::= insert
|
||||
| select
|
||||
| meta-command
|
||||
| int
|
||||
| string
|
||||
| end-of-file
|
||||
|
||||
insert ::= "insert"
|
||||
select ::= "select"
|
||||
|
||||
meta-command ::= "." "exit"
|
||||
|
||||
int ::= sign? digit+
|
||||
sign ::= "+"
|
||||
| "-"
|
||||
digit ::= "0"
|
||||
| "1"
|
||||
| "2"
|
||||
| "3"
|
||||
| "4"
|
||||
| "5"
|
||||
| "6"
|
||||
| "7"
|
||||
| "8"
|
||||
| "9"
|
||||
|
||||
string ::= '"' string-char* '"'
|
||||
string-char ::= '\' utf8-char
|
||||
| utf8-char-not-dbl-quote
|
||||
|
||||
|
||||
|
|
@ -224,7 +224,11 @@ i will use rustyline, since it seems like the most feature-complete
|
|||
|
||||
* DONE print errors to stderr
|
||||
|
||||
* TODO write a proper grammar
|
||||
* DONE write a proper grammar
|
||||
|
||||
* TODO .about meta-command
|
||||
* TODO .version meta-command
|
||||
* TODO .license meta-command
|
||||
|
||||
* TODO parse insert statements in the form
|
||||
insert <id:int> <username:string> <email:string>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue