2025-05-31 16:08:42 +02:00
|
|
|
/* token is first stage of parsing */
|
2025-06-03 22:00:52 +02:00
|
|
|
token ::= insert
|
|
|
|
|
| select
|
|
|
|
|
| meta-command
|
|
|
|
|
| int
|
|
|
|
|
| string
|
|
|
|
|
| semicolon
|
|
|
|
|
| end-of-file
|
2025-05-30 13:52:26 +02:00
|
|
|
|
2025-05-31 16:08:42 +02:00
|
|
|
/* command is second stage of parsing */
|
2025-06-03 22:00:52 +02:00
|
|
|
command ::= cmd-insert semicolon
|
|
|
|
|
| cmd-select semicolon
|
|
|
|
|
cmd-insert ::= insert int string string
|
|
|
|
|
cmd-select ::= select
|
2025-05-31 16:08:42 +02:00
|
|
|
|
2025-06-03 22:00:52 +02:00
|
|
|
insert ::= "insert"
|
|
|
|
|
select ::= "select"
|
|
|
|
|
semicolon ::= ";"
|
2025-05-30 13:52:26 +02:00
|
|
|
|
2025-06-03 22:00:52 +02:00
|
|
|
meta-command ::= meta-command-verb end-of-file
|
|
|
|
|
meta-command-verb ::= ".exit"
|
|
|
|
|
| ".about"
|
|
|
|
|
| ".version"
|
2025-05-30 13:52:26 +02:00
|
|
|
|
2025-06-03 22:00:52 +02:00
|
|
|
int ::= sign? digit+
|
|
|
|
|
sign ::= "+"
|
|
|
|
|
| "-"
|
|
|
|
|
digit ::= "0"
|
|
|
|
|
| "1"
|
|
|
|
|
| "2"
|
|
|
|
|
| "3"
|
|
|
|
|
| "4"
|
|
|
|
|
| "5"
|
|
|
|
|
| "6"
|
|
|
|
|
| "7"
|
|
|
|
|
| "8"
|
|
|
|
|
| "9"
|
2025-05-30 13:52:26 +02:00
|
|
|
|
2025-06-03 22:00:52 +02:00
|
|
|
string ::= '"' string-char* '"'
|
|
|
|
|
string-char ::= '\' utf8-char
|
|
|
|
|
| utf8-char-not-dbl-quote
|
2025-05-30 13:52:26 +02:00
|
|
|
|
|
|
|
|
|