You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We originally hadn't added rule identifiers to the notation chapter as
in some sense these aren't language rules. However, as it turns out,
it's still useful to have these so as to be able to refer by name to
particular sections. And anyway, since the language rules are defined
in terms of this notation, the notation rules are in a sense normative
at a meta level.
In doing this, we'll nest certain sections under the grammar section
that should be so nested.
Copy file name to clipboardExpand all lines: src/notation.md
+10-3Lines changed: 10 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,11 @@
1
+
r[notation]
1
2
# Notation
2
3
4
+
r[notation.grammar]
3
5
## Grammar
4
6
7
+
r[notation.grammar.syntax]
8
+
5
9
The following notations are used by the *Lexer* and *Syntax* grammar snippets:
6
10
7
11
| Notation | Examples | Meaning |
@@ -26,7 +30,8 @@ The following notations are used by the *Lexer* and *Syntax* grammar snippets:
26
30
27
31
Sequences have a higher precedence than `|` alternation.
28
32
29
-
## String table productions
33
+
r[notation.grammar.string-tables]
34
+
### String table productions
30
35
31
36
Some rules in the grammar — notably [unary operators], [binary
32
37
operators], and [keywords]— are given in a simplified form: as a listing
@@ -40,13 +45,15 @@ When such a string in `monospace` font occurs inside the grammar,
40
45
it is an implicit reference to a single member of such a string table
41
46
production. See [tokens] for more information.
42
47
43
-
## Grammar visualizations
48
+
r[notation.grammar.visualizations]
49
+
### Grammar visualizations
44
50
45
51
Below each grammar block is a button to toggle the display of a [syntax diagram]. A square element is a non-terminal rule, and a rounded rectangle is a terminal.
0 commit comments