diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-06 14:08:49 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-08-06 14:08:49 -0400 |
| commit | 06b5904e470b5295a6f09b6f85f21cb8172e13be (patch) | |
| tree | 557ba8e908937e52d36e78b8b458b228469e5fbf /docs/spec/grammar.html | |
| parent | a2a5c7e9b242a8d5f3727e8c8e1b0e8f76de82e0 (diff) | |
class -> role in a few places
Diffstat (limited to 'docs/spec/grammar.html')
| -rw-r--r-- | docs/spec/grammar.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html index ca000bc6..419eb406 100644 --- a/docs/spec/grammar.html +++ b/docs/spec/grammar.html @@ -6,7 +6,7 @@ <div class="nav"><a href="https://github.com/mlochbaum/BQN">BQN</a> / <a href="../index.html">main</a> / <a href="index.html">spec</a></div> <h1 id="specification-bqn-grammar">Specification: BQN grammar</h1> <p>BQN's grammar is given below. Terms are defined in a <a href="https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form">BNF</a> variant. However, handling special names properly is possible but difficult in BNF, so they are explained in text along with the braced block grammar.</p> -<p>The symbols <code><span class='Value'>s</span></code>, <code><span class='Function'>F</span></code>, <code><span class='Modifier'>_m</span></code>, and <code><span class='Modifier2'>_c_</span></code> are identifier tokens with subject, function, 1-modifier, and 2-modifier classes respectively. Similarly, <code><span class='Value'>sl</span></code>, <code><span class='Function'>Fl</span></code>, <code><span class='Modifier'>_ml</span></code>, and <code><span class='Modifier2'>_cl_</span></code> refer to literals and primitives of those classes. While names in the BNF here follow the identifier naming scheme, this is informative only: syntactic classes are no longer used after parsing and cannot be inspected in a running program.</p> +<p>The symbols <code><span class='Value'>s</span></code>, <code><span class='Function'>F</span></code>, <code><span class='Modifier'>_m</span></code>, and <code><span class='Modifier2'>_c_</span></code> are identifier tokens with subject, function, 1-modifier, and 2-modifier classes respectively. Similarly, <code><span class='Value'>sl</span></code>, <code><span class='Function'>Fl</span></code>, <code><span class='Modifier'>_ml</span></code>, and <code><span class='Modifier2'>_cl_</span></code> refer to literals and primitives of those classes. While names in the BNF here follow the identifier naming scheme, this is informative only: syntactic roles are no longer used after parsing and cannot be inspected in a running program.</p> <p>A program is a list of statements. Almost all statements are expressions. Namespace export statements, and valueless results stemming from <code><span class='Nothing'>ยท</span></code>, or <code><span class='Value'>๐จ</span></code> in a monadic brace function, can be used as statements but not expressions.</p> <pre><span class='Function'>PROGRAM</span> <span class='Function'>=</span> <span class='Separator'>โ</span><span class='Value'>?</span> <span class='Paren'>(</span> <span class='Function'>STMT</span> <span class='Separator'>โ</span> <span class='Paren'>)</span><span class='Value'>*</span> <span class='Function'>STMT</span> <span class='Separator'>โ</span><span class='Value'>?</span> <span class='Function'>STMT</span> <span class='Function'>=</span> <span class='Function'>EXPR</span> <span class='Function'>|</span> <span class='Value'>nothing</span> <span class='Function'>|</span> <span class='Function'>EXPORT</span> |
