-
Notifications
You must be signed in to change notification settings - Fork 2
/
tree-sitter-eno.ebnf
113 lines (81 loc) · 2.32 KB
/
tree-sitter-eno.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
//
// From tree-sitter-eno/src/grammar.json
//
//
// EBNF to generate railroad diagram at
// (IPV6) https://www.bottlecaps.de/rr/ui
// (IPV4) https://rr.red-dove.com/ui
//
document ::=
_instruction*
_commentOrEmpty ::=
comment
| _emptyLine
_elementOrFieldsetOrList ::=
_escapedOrUnescapedKey ( elementOperator | copyOperator token ) _endOfLine
_emptyLine ::=
[ #x09\uFEFF\u2060\u200B]*'#x0A'
_escapedOrUnescapedKey ::=
key
| escapeOperator escapedKey escapeOperator
_escapedOrUnescapedSectionKey ::=
sectionKey
| escapeOperator escapedKey escapeOperator
_instruction ::=
_commentOrEmpty
| element
| empty
| field
| fieldset
| list
| multilineField
| section
comment ::=
( commentOperator token? _endOfLine )+
continuation ::=
( directContinuationOperator | spacedContinuationOperator ) token _endOfLine
element ::=
_elementOrFieldsetOrList
empty ::=
_escapedOrUnescapedKey _endOfLine
entry ::=
_escapedOrUnescapedKey entryOperator token? _endOfLine ( _commentOrEmpty* continuation )*
field ::=
_escapedOrUnescapedKey elementOperator token _endOfLine ( _commentOrEmpty* continuation )*
| _escapedOrUnescapedKey elementOperator _endOfLine ( _commentOrEmpty* continuation )+
fieldset ::=
_elementOrFieldsetOrList ( _commentOrEmpty* entry )+
item ::=
itemOperator token? _endOfLine ( _commentOrEmpty* continuation )*
key ::=
[^`>:=<#x2D-#x23|\ #x09#x0A#x0B#x0C#x0D]|[^`>:=<#x2D-#x23|\ #x09#x0A#x0B#x0C#x0D][^:=<#x0A]*[^:=< #x09#x0A#x0B#x0C#x0D]
list ::=
_elementOrFieldsetOrList ( _commentOrEmpty* item )+
multilineField ::=
multilineFieldOperator multilineFieldKey _endOfLine multilineFieldValue? _multilineFieldEnd multilineFieldOperator multilineFieldKey _endOfLine
multilineFieldValue ::=
( _multilineFieldLine _endOfLine )+
section ::=
_sectionDescend sectionOperator _escapedOrUnescapedSectionKey ( ( copyOperator | deepCopyOperator ) token )? _endOfLine _instruction* _sectionAscend
sectionKey ::=
[^`< #x09#x0A#x0B#x0C#x0D]|[^`< #x09#x0A#x0B#x0C#x0D][^<#x0A]*[^< #x09#x0A#x0B#x0C#x0D]
token ::=
'\S'|'\S'[^#x0A]*'\S'
directContinuationOperator ::=
'|'
spacedContinuationOperator ::=
'\\'
commentOperator ::=
'>'
copyOperator ::=
'<'
deepCopyOperator ::=
'<<'
entryOperator ::=
'='
itemOperator ::=
'-'
elementOperator ::=
':'
sectionOperator ::=
'#'+