-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspec.html
303 lines (295 loc) · 14.1 KB
/
spec.html
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="author" content="by Darius J Chuck" />
<title>The Jevko Syntax: Standard Grammar Specification</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
/* The extra [class] is a hack that increases specificity enough to
override a similar rule in reveal.js */
ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="/style.css?stamp=1703989588485" />
<link rel="stylesheet" href="/highlight/style.css?stamp=1703989588485" />
<link rel="icon" type="image/png" href="/jevko.png" />
<meta name="og-image" property="og:image" content="/jevko.png" />
<meta name="twitter:image" content="/jevko.png" />
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
<![endif]-->
</head>
<body>
<header id="top" class="top black-bg">
<div class="header">
<a href="/index.html">
<img class="logo" src="/jevko.png" alt="logo" />
</a>
<div class="right links" style="flex-grow: 1">
<div>
<a href="https://jevko-org.translate.goog/?_x_tr_sl=en&_x_tr_tl=zh-TW&_x_tr_hl=en" title="Click here to Google Translate jevko.org"><!--
--><img src="/translate_icon.svg" style="width: 2.5rem;" alt="[^translate]" /><!--
--></a>
<a href="https://xtao.org" title="Click here to go to xtao.org, the parent page of jevko.org"><!--
--><img src="/tao-logo.svg" style="width: 2.5rem;" alt="[^TAO]" /><!--
--></a>
</div>
<div>
<a href="https://archive.org/details/@jevko" title="Click here to go to the official Jevko archive.org profile"><!--
--><img src="/archive_icon.svg" style="width: 2.5rem;" alt="[^archive]" /><!--
--></a>
<a href="https://www.youtube.com/@jevko-org" title="Click here to go to the official Jevko YouTube channel"><!--
--><img src="/youtube_icon.svg" style="width: 2.5rem;" alt="[^youtube]" /><!--
--></a>
<a href="https://codeberg.org/jevko-org" title="Click here to go to the official Jevko Codeberg organization"><!--
--><img src="/codeberg_icon.svg" style="width: 2.5rem;" alt="[^codeberg]" /><!--
--></a>
<a href="https://github.com/jevko" title="Click here to go to the official Jevko GitHub organization"><!--
--><img src="/github_icon.svg" style="width: 2.5rem;" alt="[^github]" /><!--
--></a>
<a rel="me" href="https://layer8.space/@jevko" title="Click here to go to the official Jevko Mastodon channel"><!--
--><img src="/mastodon_icon.svg" style="width: 2.5rem;" alt="[^mastodon]" /><!--
--></a>
<a href="https://reddit.com/r/jevko" title="Click here to go to the official Jevko subreddit"><!--
--><img src="/reddit_icon.svg" style="width: 2.5rem;" alt="[^reddit]" /><!--
--></a>
<a href="https://layer8.space/@jevko.rss" title="Click here to download the official Jevko RSS channel"><!--
--><img src="/rss_icon.svg" style="width: 2.5rem;" alt="[rss]" /><!--
--></a>
</div>
<div>
<a href="/spec.html" title="Click here to go to see the official Jevko speficication">[specification]</a>
<a href="/diagram.xhtml" title="Click here to see the official Jevko syntax railroad diagrams">[diagrams]</a>
<a href="/extensions.html" title="Click here to go to see the official Jevko extensions specification">[extensions]</a>
<!-- <a href="/license.html" title="Click here to see the license Jevko is available under">[license]</a> -->
</div>
</div>
</div>
</header>
<header id="title-block-header">
<h1 class="title">The Jevko Syntax: Standard Grammar Specification</h1>
<p class="author">by Darius J Chuck</p>
<p class="date">First Edition: February 2022. Last revised: January
2024.</p>
</header>
<p>Also available <a
href="https://github.com/jevko/specifications/blob/master/spec-standard-grammar.md">on
GitHub</a>.</p>
<h1 id="revision-notes">Revision notes</h1>
<h2 id="january-2024">January 2024</h2>
<p>No breaking changes. On that note, let this be stated as an official
goal:</p>
<blockquote>
<p>No breaking changes shall be introduced to this specification.</p>
</blockquote>
<p><a href="#copyright-and-license">Copyright and license</a> section:
updated year.</p>
<p><a href="#see-also">See also</a> section: rearranged, added link to
<a href="extensions.html">extensions</a>.</p>
<hr />
<h1 id="introduction-and-scope">Introduction and scope</h1>
<p>Jevko is a versatile minimal syntax for encoding tree-structured
information.</p>
<p>It can be used to define simple and portable formats and languages in
a variety of domains, such as data interchange, configuration, or text
markup.</p>
<p>Jevko is completely programming-language independent and has no
inherent semantics. It is a pure syntactic building block which can be
joined together with other syntactic or semantic building blocks in a
modular way.</p>
<p>These additional building blocks are specified separately. The
purpose of this specification is only to describe the basic syntax in
terms of Unicode <a href="#ref-unicode">[Unicode]</a> code points,
providing a reference for implementations as well as other
specifications.</p>
<p>The formal grammar definitions in this document use the ABNF notation
<a href="#ref-rfc-5234">[RFC 5234]</a>.</p>
<h2 id="etymology-and-pronunciation">Etymology and pronunciation</h2>
<p>The name <a
href="http://ipa-reader.xyz/?text=%CB%88d%CD%A1%CA%92ef.k%C9%99%CA%8A&voice=Joey"><em>Jevko</em>
/ˈd͡ʒef.kəʊ/</a> is derived from Polish <a
href="https://en.wiktionary.org/wiki/drzewko"><em>drzewko</em>
/ˈdʐɛf.kɔ/</a>, meaning small tree.</p>
<h1 id="valid-jevko-sequence">Valid Jevko sequence</h1>
<p>A valid Jevko sequence is a sequence of Unicode code points which
conforms to the <a href="#jevko"><code>Jevko</code></a> rule defined in
this document.</p>
<h1 id="the-rules">The rules</h1>
<p>The syntax of Jevko is extremely minimal.</p>
<p>There are two main grammatical rules: the <a
href="#jevko"><code>Jevko</code></a> rule and the <a
href="#subjevko"><code>Subjevko</code></a> rule.</p>
<p>The <code>Jevko</code> rule is the <em>start symbol</em> of the
grammar.</p>
<p>It refers to the <code>Subjevko</code> rule which in turn refers back
to <code>Jevko</code>: the two rules are mutually-recursive.</p>
<p>This makes Jevko a <em>recursive grammar</em>.</p>
<p>This recursion is minimal: if a reference to either
<code>Jevko</code> or <code>Subjevko</code> was removed, the grammar
would cease to be recursive.</p>
<p>All remaining rules are non-recursive. Notably:</p>
<ul>
<li><p>The <a href="#character"><code>Character</code></a> rule covers
all possible code points except three.</p></li>
<li><p>The three remaining code points (<a
href="#delimiters"><code>Delimiters</code></a>) are the only special
characters in the grammar.</p></li>
<li><p>There are no special rules for whitespace. All whitespace
characters are captured by the <code>Character</code> rule.</p></li>
</ul>
<p>All rules are described and formally defined in the following
sections. The first section covers rules for delimiters. The remaining
sections describe the rest of the rules, top to bottom, starting with
<code>Jevko</code>.</p>
<div style="page-break-after: always;">
</div>
<h2 id="delimiters">Delimiters</h2>
<p>Jevko is based around three delimiters, named by the Delimiter
rule:</p>
<pre class="abnf"><code>Delimiter = Opener / Closer / Escaper</code></pre>
<p>The delimiters are defined as the following code points:</p>
<pre class="abnf"><code>Opener = %x5b ; left square bracket
Closer = %x5d ; right square bracket
Escaper = %x60 ; grave accent</code></pre>
<p>Equivalently:</p>
<pre class="abnf"><code>Opener = "["
Closer = "]"
Escaper = "`"</code></pre>
<h2 id="jevko">Jevko</h2>
<p>A <code>Jevko</code> is a sequence of zero or more
<code>Subjevko</code>s followed by a <code>Suffix</code>.</p>
<pre class="abnf"><code>Jevko = *Subjevko Suffix</code></pre>
<h2 id="subjevko">Subjevko</h2>
<p>A <code>Subjevko</code> is a <code>Prefix</code> followed by an
<code>Opener</code>, followed by a <code>Jevko</code>, followed by a
<code>Closer</code>.</p>
<pre class="abnf"><code>Subjevko = Prefix Opener Jevko Closer</code></pre>
<p>Equivalently:</p>
<pre class="abnf"><code>Subjevko = Prefix "[" Jevko "]"</code></pre>
<h2 id="prefix">Prefix</h2>
<p>A <code>Prefix</code> is an alias for <code>Text</code>:</p>
<pre class="abnf"><code>Prefix = Text</code></pre>
<p>This alias identifies that the <code>Text</code> is a part of a
<code>Subjevko</code>. A <code>Prefix</code> is <em>always</em> followed
by an <code>Opener</code>.</p>
<h2 id="suffix">Suffix</h2>
<p>A <code>Suffix</code> is an alias for <code>Text</code>:</p>
<pre class="abnf"><code>Suffix = Text</code></pre>
<p>This alias identifies that the <code>Text</code> is a part of
<code>Jevko</code>. A <code>Suffix</code> is <em>never</em> followed by
an <code>Opener</code>.</p>
<h2 id="text">Text</h2>
<p><code>Text</code> is a sequence of zero or more
<code>Symbol</code>s:</p>
<pre class="abnf"><code>Text = *Symbol</code></pre>
<h2 id="symbol">Symbol</h2>
<p>A <code>Symbol</code> is either a <code>Digraph</code> or a
<code>Character</code>:</p>
<pre class="abnf"><code>Symbol = Digraph / Character</code></pre>
<h2 id="digraph">Digraph</h2>
<p>A <code>Digraph</code> is an <code>Escaper</code> followed by a
<code>Delimiter</code>:</p>
<pre class="abnf"><code>Digraph = Escaper Delimiter</code></pre>
<p>Equivalently:</p>
<pre class="abnf"><code>Digraph = "`" ("`" / "[" / "]")
Digraph = "``" / "`[" / "`]"</code></pre>
<h2 id="character">Character</h2>
<p>A <code>Character</code> is any code point which is not a
<code>Delimiter</code>:</p>
<pre class="abnf"><code>Character = %x0-5a / %x5c / %x5e-5f / %x61-10ffff</code></pre>
<h1 id="normative-references">Normative references</h1>
<p><a id="ref-unicode"></a></p>
<div id="ref-unicode">
<p>[Unicode] The Unicode Consortium, “The Unicode Standard”, the latest
version, <a href="http://www.unicode.org/versions/latest/"
class="uri">http://www.unicode.org/versions/latest/</a>.</p>
</div>
<p><a id="ref-rfc-5234"></a></p>
<div id="ref-rfc-5234">
<p>[RFC 5234] Crocker, D., Ed. and P. Overell, “Augmented BNF for Syntax
Specifications: ABNF”, STD 68, RFC 5234, DOI 10.17487/RFC5234, January
2008, <a href="https://www.rfc-editor.org/info/rfc5234"
class="uri">https://www.rfc-editor.org/info/rfc5234</a>.</p>
</div>
<h1 id="see-also">See also</h1>
<ul>
<li><p>Jevko interactive railroad diagrams, <a
href="https://jevko.org/diagram.xhtml"
class="uri">https://jevko.org/diagram.xhtml</a></p></li>
<li><p>“The Jevko Syntax: Extensions Specification”, January 2024, <a
href="https://jevko.org/extensions.html"
class="uri">https://jevko.org/extensions.html</a></p></li>
<li><p>Jevko examples, <a href="https://github.com/jevko/examples"
class="uri">https://github.com/jevko/examples</a></p></li>
</ul>
<h1 id="copyright-and-license">Copyright and license</h1>
<p>© 2022-2024 <a href="https://jevko.org">Jevko.org</a></p>
<p>This document is licensed under the <a
href="https://choosealicense.com/licenses/mit/">MIT License</a>:</p>
<div style="font-size: 10pt">
<pre style="padding: 1rem;"><code>Copyright © 2022-2024 Jevko.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.</code></pre>
</div>
<h1 id="appendix-the-standard-grammar-abnf-in-one-page">Appendix: The
Standard Grammar ABNF in one page</h1>
<pre class="abnf"><code>; start symbol, main rule #1
Jevko = *Subjevko Suffix
; main rule #2, mutually recursive with #1
Subjevko = Prefix Opener Jevko Closer
; delimiters
Delimiter = Opener / Closer / Escaper
Opener = %x5b ; left square bracket
Closer = %x5d ; right square bracket
Escaper = %x60 ; grave accent
; aliases
Suffix = Text
Prefix = Text
; text
Text = *Symbol
Symbol = Digraph / Character
Digraph = Escaper Delimiter
; Character is any code point which is not a Delimiter
Character = %x0-5a / %x5c / %x5e-5f / %x61-10ffff</code></pre>
<footer id="bottom" class="black-bg">
<div class="footer">
<!-- <a href="/index.html" class="footer-link"> -->
<div class="left" style="margin-bottom: 1.25rem;">© 2024 Jevko.org</div>
<!-- </a> -->
<div class="right links">
<a href="/attribution.html" title="Click here to go to the [attribution] subpage"><!--
-->[attribution]<!--
--></a>
</div>
</div>
</footer>
</body>
</html>