-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsyntax.ebnf
54 lines (30 loc) · 1.5 KB
/
syntax.ebnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
(*
This document defines the syntax of the FQL query
language. The meta language used is extended Backus-Naur
form as defined in ISO/IEC 14977 with two modifications:
concatenation is implicit and rules terminate at newline.
*)
query = keyval | key | directory
keyval = key '=' ws value
key = directory tuple
value = 'clear' | data
directory = '/' ( '<>' | name | string ) [ directory ]
tuple = '(' [ nl elements [ ',' ] nl ] ')'
elements = '...' | ( data [ ',' nl elements ] )
data = 'nil' | variable | tuple | bool | int | float | scientific | string | uuid | bytes
variable = '<' [ type ] '>'
type = ( 'tuple' | 'bool' | 'int' | 'float' | 'string' | 'uuid' | 'bytes' ) [ '|' type ]
bool = 'true' | 'false'
int = [ '-' ] number
float = int '.' number
scientific = ( int | float ) 'e' int
string = '"' { text | '\"' } '"'
uuid = ( 8 * hexDigit ) '-' ( 4 * hexDigit ) '-' ( 4 * hexDigit ) '-' ( 4 * hexDigit ) '-' ( 12 * hexDigit )
bytes = '0x' { 2 * hexDigit }
number = { digit }
digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'
hexDigit = digit | 'A' | 'B' | 'C' | 'D' | 'E' | 'F'
text = ? Any number of ASCII characters 32-126 (Printable Group) other than 34 (Double Quote). ?
name = ? Any number of ASCII characters 48-57, 65-90, 97-122 (Alpha-numeric), 46 (Dot), 45 (Dash), or 95 (Underscore). ?
ws = ? Any number of ASCII characters 9 (Horizontal Tab) or 32 (Space). ?
nl = ? Any number of ASCII characters 9 (Horizontal Tab), 10 (Line Feed), 13 (Carriage Return), or 32 (Space). ?