aboutsummaryrefslogtreecommitdiff
path: root/docs/spec/grammar.html
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-10-03 16:38:35 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-10-03 16:38:35 -0400
commit673de1c627a2046123e1693e9e6508399a028508 (patch)
tree86303316523319eeebcf0e0c52a2be781089c286 /docs/spec/grammar.html
parent8846e63a6f1fe51ee9a68dc511cc6fcdbf54efa6 (diff)
Write files directly from md.bqn, not gendocs (removes trailing empty lines)
Diffstat (limited to 'docs/spec/grammar.html')
-rw-r--r--docs/spec/grammar.html1
1 files changed, 0 insertions, 1 deletions
diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html
index 66734fc4..b5443ce7 100644
--- a/docs/spec/grammar.html
+++ b/docs/spec/grammar.html
@@ -141,4 +141,3 @@
<span class='Function'>|</span> <span class='Paren'>(</span> <span class='Value'>subject_allow1</span> <span class='Function'>|</span> <span class='Value'>nothing_allow1</span> <span class='Paren'>)</span><span class='Value'>?</span> <span class='Function'>Derv_allow1</span> <span class='Value'>arg_req1</span>
</pre>
<p>Quite tedious. The explosion of rules is partly due to the fact that the brace-typing rule falls into a weaker class of grammars than the other rules. Most of BQN is <a href="https://en.wikipedia.org/wiki/Deterministic_context-free_grammar">deterministic context-free</a> but brace-typing is not, only context-free. Fortunately brace typing does not introduce the parsing difficulties that can be present in a general context-free grammar, and it can easily be performed in linear time: after <a href="token.html">scanning</a> but before parsing, move through the source code maintaining a stack of the current top-level set of braces. Whenever a colon or special name is encountered, annotate that set of braces to indicate that it is present. When a closing brace is encountered and the top brace is popped off the stack, the type is needed if there was no colon, and can be found based on which names were present. One way to present this information to the parser is to replace the brace tokens with new tokens that indicate the type.</p>
-