summaryrefslogtreecommitdiff
path: root/chapter17a/docs/17-grammar.md
diff options
context:
space:
mode:
Diffstat (limited to 'chapter17a/docs/17-grammar.md')
-rw-r--r--chapter17a/docs/17-grammar.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/chapter17a/docs/17-grammar.md b/chapter17a/docs/17-grammar.md
new file mode 100644
index 00000000..98aef06c
--- /dev/null
+++ b/chapter17a/docs/17-grammar.md
@@ -0,0 +1,17 @@
+# Chapter 17a grammar additions
+
+The expression and statement forms are those of Chapter 16. Declarations add
+independent access and binding modifiers:
+
+```text
+declaration = type binding ("," binding)* ";"
+binding = ("!" | "~")? identifier ("=" expression)?
+type = ("!" | "~")? name suffix*
+suffix = "?" | "[]" | "[~]"
+```
+
+A prefix qualifier requires a struct reference. It qualifies the named base,
+not enclosing arrays. Each bracket pair qualifies its own array layer. A binding
+modifier applies only to the following name. See the README for defaults and
+constructor initialization rules. `var`, `val`, increments, compound assignments,
+conditional expressions, and `for` loops are introduced in Chapter 17b.