Skip to content

Commit c7e20db

Browse files
committed
* index.html: explain backwards priority.
1 parent 5e394cf commit c7e20db

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,11 @@ <h2><a name="actions">Adding Parse Actions</a></h2>
486486

487487
<p>Let's try it.</p>
488488

489-
<p class="note">(Note the way the priority is "backwards" due to the
490-
particular way in which the grammar is ambiguous...)</p>
489+
<p class="note">(Note the way the priority is "backwards": since all the
490+
rules are going to be part of the parse, the priority just chooses which
491+
ones are closer to the top of the tree. But operator precedence works
492+
the other way: higher precedence operators bind more tightly to the
493+
leaves.)</p>
491494

492495
<pre><code>expr = new Grammar('E',
493496
E ::= E + E &#8594; d[0] + d[2]

0 commit comments

Comments
 (0)